Link to home
Start Free TrialLog in
Avatar of psokolo
psokolo

asked on

HOW TO COUNT TRUE VALUES IN CRYSTAL REPORT.

I have a formula set up to filter data in a column.
{tbOrders.OrderStatus}=220
It gives out me a boolean parameter true or false. What I need now is a count of positive  records(true).
In general i need to have a count of '220' record in a column grouped by another column(time).  
Can anyone help me with that ??
Pawel
Avatar of bdreed35
bdreed35
Flag of United States of America image

If you only want to count true values, create a formula to return a 1 or 0.

@Count_True

If {table.field} = True then
    1
else
    0

Place the field in your detail section and suppress it.
Right click the field and choose Insert, Summary.
In the box that opens up, the formula should be the field, make sure that summary type is SUM, and change the location to your Time Grouping.
ASKER CERTIFIED SOLUTION
Avatar of ebolek
ebolek

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Emre - This is true, there is mnore than one way to skin a cat.  The only difference is that your solution is only available at the end og a grouping or the report, whereas, is you need the total in the group or report headers, you will have to use the solution that I presented.
Avatar of ebolek
ebolek

That is true too. I only want to give him the other options like everybody else does. I think it is a good information to know that you can get the summary totals by using formulas too.

Regards
Emre
No problem.  For that matter, you could also create a Running Total.
Avatar of psokolo

ASKER

thank you very much
Glad i could help

Regards
Emre