Gary Demos
asked on
Creating a formula for a conditional count on two unique values in Crystal Reports
I'm using the following formula successfully with a summary (count) on that formula to count unique values in a field:
if {table.field} = 1 then '1' else '0'
I'm now trying to count two unique values and cannot get the summary count to work:
if {table.field} = 1 OR {table.field} = 2 then '1' else '0'
It does not combine the two values in the count.
if {table.field} = 1 then '1' else '0'
I'm now trying to count two unique values and cannot get the summary count to work:
if {table.field} = 1 OR {table.field} = 2 then '1' else '0'
It does not combine the two values in the count.
Is your count coming incorrect?
ASKER
Oh it is working after I changed the ELSE {@NULL} and did a COUNT instead of DISTINCT COUNT in the summary. Sorry for the confusion!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
That's a clever idea!
No need to worry about distinct count or the '0' values being counted.
mlmcc
mlmcc
ASKER
Great help