I am using Crystal Reports XI R2.
My table has transaction data by date. I have a group set up by day and a summary to give a count of transactions for each day. I also have a running total set to give a year to date count for each day. Of course it resets on a change in year.
My goal is to be able to find the difference between the YTD count yesterday and the same for the same date last year.
Edit: I’ve misstated the goal. It isn’t to be able to find the difference for just yesterday, but for each day in a range of days.
I finally got this nailed down. There is likely a cleaner way of doing this, but….
I converted the dates (started as text yyyy-mm-dd) into text mm/dd/yyyy format:
Grouped by this field and inserted a count summary into the group header. Created a separate field for the mm/dd portion of each date:
Added a flag to see if the date in the current group header matched the previous:
Used a shared variable to store the YTD totals for each year (2 formulas):
|
Put both of these into the group footer (suppressed) and added a field to do the subtraction into the group header.