Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal Reports 8 formulas

Status
Not open for further replies.

cgilmore

Instructor
Mar 8, 2001
41
US
I need a report which will have several summaries for 2001 hospital payments, physician payments, rehab payments, etc.
This is my code from the select expert.

{payments.ccomptype} in ["05", "44"] and
{claimheader.cclmtype} = "WC" and
{claimstubwc.ccltype} in ["I", "M"] and
{claimheader.cjurstate} = "GA" and
{payments.dissued} in Date (2001, 01, 01) to Date (2001, 12, 31)

I have a grandtotal which sums payments.namount based on the above criteria. I then type the total for ccomptype of 05 & 44 on another document. Then I run the same report again changing the ccomptype to "02", "06". Then I run the same report again. I have 17 totals which I need to obtain.
I want to put all these summaries on one report. I removed the payments.ccomptype from the select expert and tried creating a formula such as sum ({payments.namount}) where payments.ccomptype = "04" or "55". This didn't work. I tried if {payments.ccomptype} = "04" or {payments.ccomptype} = "55" then sum ({payments.namount}). This didn't work. What is the correct syntax? I tried this with grouping the report on payments.ccomptype and then with no group. Do I put my 17 formulas in the report footer?
 
You solution is:
1) Do your record selection without selecting CompType
2) Write a formula for each column....
if {payments.ccomptype} in ["05", "44"] then {payments.amount} else 0

3) Then summarise this formula
Editor and Publisher of Crystal Clear
 
Thanks for your help. We have to complete one of these reports for each state we do business in. I had the report completed and everything worked and then I reviewed the state requirements. As per my select statement above I had {claimstubwc.ccltype} in ["I", "M"]. Well now the statement needs to be inside my formulas instead of the select expert as the ccltype needs to change for some of the formulas. I re-did my formula to be
if {payments.ccomptype} in ["05", "44"]
and {claimheader.cclmtype} in ["I", "M"] then {payments.namount} else 0
But now I'm only getting 0's.
 
I solved my own problem. Thanks for your help in the first issue, though.
 
I have a question. On this same report I have inserted a subreport. Is there anyway to use a total from the subreport and subtract from it a total which is in my main report?
 
I have a question. On this same report I have inserted a subreport. Is there anyway to use a total from the subreport and subtract from it a total which is in my main report? The reports are not linked.
 
Thanks for your input. I need a little more help, please. I have seventeen summary fields in the report footer of the Main Report. I have seventeen summary fields in the report footer of the subreport. From the main report I need to take each summary field from the subreport and subtract a summary field from the main report. How would I do this using shared variables?
 
I have a subreport named reserves total. I have a main report named payments total. I have 17 summary fields in the report footer in both reports. I inserted the subreport into the main report's report footer because I need the data to show to the right hand side of my main report data. It's a state requirement that the data is shown in a certain manner. I then went to link options from the subreport and I picked a common field from a common table but I removed the checkmark from select data in subreport based on field. If I don't remove the checkmark it changes all of my 17 summary fields in the subreport to zeros. I now need to grab each one of the 17 summary fields from the subreport and subtract a summary field from the main report.

In the subreport I created the following formula
Shared NumberVar DeathIncurred := sum ({@death incurred});

I also tried this formula as
Shared NumberVar DeathIncurred := {@sum death incurred};

Then in the main report I created the following formula

Shared NumberVar DeathIncurred;
DeathIncurred - {@sum death}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top