cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports 13: Need help Writing a Conditional Formula

0 Kudos

Hello,

I'm attempting to write a conditional formula. I'm trying to compare two numbers. A top number and a bottom number.

If the bottom number is 0 and the top number is less than or equal to 0 then display the result 'N' for NO else Y.

Top Number = Sum of @total std (Number)

Bottom Number = Sum of @total actual (Number)

So for example have a top number of 2,400,00000 and a bottom number of 0.00000 then I want to display 'N' for No. If the conditions are not met in the formula then I want it to display 'Y' for Yes.

If both numbers are equal to Zero then I want it to display 'N' as well. So anytime the top number is less than or equal to zero then I want to display the result at 'N" else 'Y'

Thanks!

Accepted Solutions (0)

Answers (1)

Answers (1)

abhilash_kumar
Active Contributor

Hi Todd,

Create a formula with this code:

If (Sum({@total std}) < 0 AND Sum({@total actual}) = 0) OR (Sum({@total std}) = 0 AND Sum({@total actual}) = 0) 
then 'N' Else 'Y'

-Abhilash

0 Kudos

thank you Abhilash. Although what you gave me is indeed correct I left out a few details that seems to be affecting the outcome. So, I will attempt to re-explain.

I attached a small snippet of a shift report. What I need to concentrate is on the data in 'yellow'.

5.RPMB604 is {MATPROD.ITEMNO}

2.00340 is Sum of @total std (Number)

0.00000 is Sum of @total actual (Number)

this = the current formula which I called Non_Dispo in Crystal reports in which my co-worker wrote a formula for that is incorrect:

IF Sum ({@total actual}, {MATPROD.ITEMNO}) = 0 THEN "this" else ""

Ignore the 'Y' as it's another value unrelated to what I'm seeking.

Shift reports populate in our ERP system once a shift has been reported as completed. However, not all shift reports are dispositioned although most are we have to weed out the ones that are not dispositioned for inventory accuracy purposes. So, I need to show all shift reports that are not dispositioned but Crystal reports with our ERP system makes this seem extremely difficult.

undispo.jpg

Thanks!