Crystal Ver. 2008
Thank you in advance for any help you can lend. I’m trying to get a parameter-dependent formula to work to count the number of entries in a month. Then I need to list year to date information on the same report. The parameter is type Date and allows ranged values. What I have so far doesn’t give me correct results. I’m starting to wonder if I’m going about this the wrong way. The problem formulas are at Group 2 level.
Report setup:
Two Group levels. Group 1 is Compliments/Suggestions/Praise. Group 2 is different subjects such as work groups or locations. At the detail level I have this correctly working formula, one fore each month, named @Jan, etc:
If not isnull ({@Display 1 Topic}) then If {@Month of OpenDate}= 3 then 1 else 0
This formula is for totals for the current date range of the report (i.e. current month), it will only count 1 entry for the month there’s an entry in
If date({TASKS.OPENDATE}) in minimum({?Date Range}) to maximum({?Date Range})
Then Count ({TASKS.WOID}, {@Display 1 Topic}) Else 0
I also tried this. I get zero when there’s no entry that month, but get the cumulative total for all group 1 levels, up to the end date of the parameter:
If date({TASKS.OPENDATE}) in minimum({?Date Range}) to maximum({?Date Range}) then
If {@MonthofDateRange} = 1 then sum({@Jan}) else
If {@MonthofDateRange} = 2 then sum({@Feb}) else
If {@MonthofDateRange} = 3 then sum({@Mar})+sum({@feb})
My YTD formula works if I report for March, if I report for February, although my @feb formula lists 1 in the detail, it lists 0.
If {TASKS.OPENDATE} <= {?Date Range} Then Count ({TASKS.WOID}, {@Display 1 Topic}) Else 0
Example of basic data, Jan - Mar:
Compliments:
Boston 0 0 3
New York 0 1 1
Virginia 0 3 0
Complaints
Boston 0 2 3
New York 0 0 1
Virginia 0 1 0
If I run the report for February I should get:
Compliments – total 4 YTD total 4
Boston – total 0 YTD 0
New York - total 1 YTD 1
Virginia - total 3 YTD 3
Complaints – total 3 YTD total 3
Boston -total 2 YTD 0
New York - total 0 YTD 0
Virginia - total 1 YTD 1
Regards,
Kara
Thank you in advance for any help you can lend. I’m trying to get a parameter-dependent formula to work to count the number of entries in a month. Then I need to list year to date information on the same report. The parameter is type Date and allows ranged values. What I have so far doesn’t give me correct results. I’m starting to wonder if I’m going about this the wrong way. The problem formulas are at Group 2 level.
Report setup:
Two Group levels. Group 1 is Compliments/Suggestions/Praise. Group 2 is different subjects such as work groups or locations. At the detail level I have this correctly working formula, one fore each month, named @Jan, etc:
If not isnull ({@Display 1 Topic}) then If {@Month of OpenDate}= 3 then 1 else 0
This formula is for totals for the current date range of the report (i.e. current month), it will only count 1 entry for the month there’s an entry in
If date({TASKS.OPENDATE}) in minimum({?Date Range}) to maximum({?Date Range})
Then Count ({TASKS.WOID}, {@Display 1 Topic}) Else 0
I also tried this. I get zero when there’s no entry that month, but get the cumulative total for all group 1 levels, up to the end date of the parameter:
If date({TASKS.OPENDATE}) in minimum({?Date Range}) to maximum({?Date Range}) then
If {@MonthofDateRange} = 1 then sum({@Jan}) else
If {@MonthofDateRange} = 2 then sum({@Feb}) else
If {@MonthofDateRange} = 3 then sum({@Mar})+sum({@feb})
My YTD formula works if I report for March, if I report for February, although my @feb formula lists 1 in the detail, it lists 0.
If {TASKS.OPENDATE} <= {?Date Range} Then Count ({TASKS.WOID}, {@Display 1 Topic}) Else 0
Example of basic data, Jan - Mar:
Compliments:
Boston 0 0 3
New York 0 1 1
Virginia 0 3 0
Complaints
Boston 0 2 3
New York 0 0 1
Virginia 0 1 0
If I run the report for February I should get:
Compliments – total 4 YTD total 4
Boston – total 0 YTD 0
New York - total 1 YTD 1
Virginia - total 3 YTD 3
Complaints – total 3 YTD total 3
Boston -total 2 YTD 0
New York - total 0 YTD 0
Virginia - total 1 YTD 1
Regards,
Kara