Reputation: 17
I'm fairly new to Crystal Reports, so maybe this is pretty basic but here goes..
I have a field where the value can be Y or N. At the bottom of my report I want to show the amount of Y of this field from the above records.
Example:
Name Field 1
===== ========
pers1 Y
pers2 N
pers3 Y
TOTAL 2
Anyone has a clue how to get this done? Many Thanks for your time!
Upvotes: 0
Views: 3880
Reputation: 26272
Create a formula field:
// {@Has_Y}
If {table.Field 1}="Y" Then 1 Else 0
Add a summarized field:
{@Has_Y} for
Last Year's Sales'Note: If it makes it easier, you can add {@Has_Y}
to the details
section, but it isn't required for the summarized field to work correctly.
Upvotes: 0
Reputation: 9101
My approach woule be:
Create a formula @Caclculate
and write below code.
if Field1='Y'
then 1
else 0
Place the formula adjacent to Field 1
and supress.
2 . Now take the sum of the @Calculate
and place it in footer.
Take sum by Right Click field calculate-->Insert --> summary
Edit----------------------------------------------------------------------------------
one more apporach.. try this:
you can use running total.
In field to summarize take Field1
and take count
as option to summarize.
In evaluate use option formula, In that write below condition.
if(Field1='Y')
then true
else false
Upvotes: 1
Reputation: 5808
Your "Y" and "Parse" is seprate column ? I think separate in your question, so simply use Running total as descrive link or you can use summarize field.
put a running total field and sum of this.
http://victoriayudin.com/2009/11/25/running-totals-in-crystal-reports/
http://crystalreportsblog.com/crystal-reports-running-totals/
Upvotes: 0