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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Greater than Less than formula not returning proper information 1

Status
Not open for further replies.

IneedHelp01

Programmer
Feb 17, 2010
8
US
Hi,
I am using crystal reports 2008 and I am using a Greater than Less than formula and it is only returning the data that is equal and is not counting the less than. The data is Turnaround times in days ranging from 0 days up so I created this formula:

if {'9PK_'.TAT}<=1
then "1 Day or Less"
else if {'9PK_'.TAT}<=2
then "2 Days or Less"
else if {'9PK_'.TAT}<=3
then "3 Days or Less"
else if {'9PK_'.TAT}<=4
then "4 Days or Less"
else if {'9PK_'.TAT}>=5
then "5 Days or More"
else "nothing"

And grouping and doing a summmary count this is what I get
1 Day or Less 26
2 Days or Less 43
3 Days or Less 44
4 Days or Less 23
5 Days or More 19

The logic is correct so 2 Days or Less (<=2) should give me everything that is 2 days and the 26 that are in the 1 Day or Less so 2 Days or Less should be 69...and so on

This is essentially what I need crystal to give me

1 day or less 26
2 days or less 69
3 days or less 113
4 days or less 136
5 days or more 19


Is there something wrong with my formula or is there another type of formula I need to be using?

Thank you!!!
 
A record only gets evaluated once by an if/then formula, so once it meets a criterion, it isn't counted again. You need to create separate running totals per condition, using the evaluation section for formulas like this:

{'9PK_'.TAT}<=1 //one day or less

I'd be careful about the <= 4 and >= 5. If the number can contain a decimal, anything > 4.0 and < 5.0 will be excluded. If you are working only with counts, this is fine as is.

-LB
 
I know that I can get those totals w/ the Running Totals function but I need the totals next to the Group Names. If I do the Running totals wouldnt they have to go in the RF section? And I also need a side by side bar chart and I dont think you can use the Running Total formulas on the chart. Is there any way I can accomplish this?
 
Again, you cannot group on your formula, because one record can only appear in one group. You can use running totals in group footers--but not in this case because of this. So add the running totals in the report footer, and add text boxes for to reflect the names of each group instance. The running total would have reset = never, with the group defined only in the formula in the evaluation section. You can add the inserted running totals into charts in the report footer.

-LB
 
Alright I finally accomplished the report I was going for. I was totally going a different route which ultimately kept leading me to dead ends. lbass thanks for pointing me in the right direction. I think I have a better understanding on CR2008 now.
 
I have figured out how to get the cumulative numbers by using running totals, variables, and formulas. Now after I get the totals and convert them to percentages (Sum or running total)/Count*100) I am unable to get them on a side by side chart. Can anyone point me in the right direction to get this chart going?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top