Solved

# what does this formula mean in crystal report

Posted on 2012-09-19
Medium Priority
613 Views
Hi, All:

Today when I was modifying a crystal report, i found a field is defined by the following code.

This field is used to get the sum of new leads based on each admission rep (staff name). I don't know if this formula is right or not, but the result is not correct. Could you guys help me with this?  Thank you.
0
Question by:Jason Yu
• 3
• 2
• 2
• +1

LVL 35

Assisted Solution

James0628 earned 400 total points
ID: 38417229
In your screenshot, the formula is being used to suppress GH1, so it's not really being "used to get the sum of new leads".  It's just being used to determine which GH1 sections are visible.  I'm assuming that group 1 is on StaffName.

The formula in your screenshot suppresses GH1 if StaffName is null, or if the total NewLead and FollowUp for the StaffName group is 0.

When you say that "the result is not correct", what result are you talking about, and what's wrong with it?

James
0

LVL 101

Assisted Solution

mlmcc earned 800 total points
ID: 38419730
The formula only returns TRUE or FALSE.

If you are trying to calculate based on that then it needs to part of a test

mlmcc
0

LVL 14

Assisted Solution

LinInDenver earned 800 total points
ID: 38419763
You might need it to do something more like this:

IF
(
) = TRUE
then 1 else 0

This would give you a 1 or 0 for each detail line that meets the criteria. You can then sum this to get total number of rows meeting the criteria.
0

Author Comment

ID: 38420275
Hi, thank you guys for advising.

I will try to use LinInDenver's suggestion and try to calcluate the total. My confusion is why the sum function has two parameters instead of one.

And it has = 0 behind it, I am quite confused.

thank you.
0

LVL 101

Assisted Solution

mlmcc earned 800 total points
ID: 38420303
The sum is for a group rather than the full report.

The second field identifies the group to sum over.

The = 0 is a comparison.  It is testing if the sum for the group is 0.

What is it you want to do?

mlmcc
0

LVL 14

Accepted Solution

LinInDenver earned 800 total points
ID: 38420305
Ah, good point. I think that means my actually won't work.  I was thinking the formula was sitting in the detail section of the report, and I have a feeling it isn't.

It is checking to see if the sum of Followup by Staffname is 0. You must have a group in the report by Staffname.

What that means is Sum (Field, Group).

If you have a group called State and wanted to sum an amount on all the detail lines within each state, you would end up with something like

Sum({table.field},{table.state})

This formula would only work in the group header or group footer of the State Group.

If possible (with confidential data removed, if any), could you attach the RPT file with data saved? It would be easier to see what is actually being returned.
0

LVL 35

Expert Comment

ID: 38420973
Lin,

If you look at the screenshot with the first post, the formula is actually used as the suppression formula for GH1.  At least that's what's in the screenshot.  Of course the formula could be used in other places too, but, based on the screenshot, it's not being used to calculate anything, so it's really unclear what they're really after.  Which is why I asked in my first post what kind of result they were actually trying to get.

James
0

LVL 14

Expert Comment

ID: 38422674
Thanks James - I was actually trying to address the part where the author has stated "This field is used to get the sum of new leads based on each admission rep (staff name)."

I will wait for the author to make another comment and/or attach the report file.
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customerâ€™s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. â€¦
I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirementsâ€¦