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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quarter parameter

Status
Not open for further replies.

veles

Technical User
Sep 1, 2006
57
CA
Hi,

I am using crystal XI.
I created a fromula to diaplay quarters and used it as a group

if month ({DATE.field}) in [4,5,6] and year({DATE.field}) = 2011 then "Quarter 2/2011"
else
if ..... and so on.
This works fine.

My question is how to use this to create a parametar for quarters from which the user can choose.

I hope I explained this right.

Thanks
 

I think this is a case where the tendency is to get overly clever.

Can you have two parameters - year and quarter?

Then your select criteria would be

year({date.field}) = {?YearPrompt}

and

(if {?QuarterPrompt} = "First Quarter"
then month({date.field}) in [1,2,3]
else
if {?QuarterPrompt} = "Second Quarter"
then month({date.field}) in [4,5,6]
etc....)

If you want it all in one parameter then you can do that but it's a bit more work.

 
Thanks for the reply.

Yes I can split the quarter and year.

Do I do the quarter and year parameters as numbers like quarter 1,2,3,4 and for year 2011, 2012.

It looks promising but I need a bit more help with the explanation.

Thanks
 

I think it looks better if you set the values in the quarter parameter as "First Quarter", "Second Quarter", etc. - it doesn't matter what the text is because you'll address that in the if statement:

(if {?QuarterPrompt} = "First Quarter"
then month({date.field}) in [1,2,3]
else
if {?QuarterPrompt} = "Second Quarter"
then month({date.field}) in [4,5,6]
etc....)

Make sure you set the 'custom values allowed' to false for the quarter parameter. You could also include a value of "Entire Year", or "All Quarters", or whatever so the user could also run the report for the whole year.

For the year parameter, you could do the same thing and enter the years that the user might possibly pick - 2009, 2010, 2011, 2012 - but I think it's just as easy to not use a picklist and let the user type in the year they want. That way there is no maintenance needed on the report.





 
Thank you very much.

It worked as described. I created a year picklist for the next 4 years, so it should be fine for quit some time :).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top