Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grouping by a variable driven by parameter

Status
Not open for further replies.

dninus

Programmer
Feb 8, 2012
13
US
Hi All,

I am modifying this report to run as a parameter driven report.
I need to group by @Qtr. @Qtr is calculated from input parameter ?FiscalPeriod.I can't set my group to Quarter. It yield error message: Group speciying on a non-recurring field. Detail @Qtr
Here is my calculation
if {?Fiscal Period} = 1 then 1 else
if {?Fiscal Period} = 2 then 1 else
if {?Fiscal Period} = 3 then 1 else
if {?Fiscal Period} = 4 then 2 else
if {?Fiscal Period} = 5 then 2 else
if {?Fiscal Period} = 6 then 2 else
if {?Fiscal Period} = 7 then 3 else
if {?Fiscal Period} = 8 then 3 else
if {?Fiscal Period} = 9 then 3 else
if {?Fiscal Period} = 10 then 4 else
if {?Fiscal Period} = 11 then 4 else
if {?Fiscal Period} = 12 then 4 else 0
I need to do sum of sales by quarter base on the Fiscal Period input.
Please help!!

Thanks,
 
You need to group based on a database field. So let's say you have a field called {table.period} with values 1 to 12. You would then create a formula like this:

//}@Qtr}:
if {table.period} in 1 to 3 then 1 else
if {table.period} in 4 to 6 then 2 else
if {table.period} in 7 to 9 then 3 else
if {table.period} in 10 to 12 then 4

Insert a group on this. To limit the records to certain quarters, use a record selection formula like this:

{@Qtr} = {?Quarter}

-LB
 
Hi lbass,

The problem I have is that I need to run my report for last year data. Therefore, I have to calculate my Qtr base on the FiscalPeriod parameter input.
Do you have any susgestion for this?

Thanks!
 
I'm not following what the problem is -- I don't see why calculating the Qtr based on a fiscal period parameter has anything to do with last year's data. Please try to explain in more depth and include the fields you are working with. Show some sample values, too.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top