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

how to have Top N into parameter

Status
Not open for further replies.

dreman

Programmer
Jan 16, 2002
272
0
0
US
Using CR 8.5
What I would like to have top N based on user entry (Parameter) ? how do I do that ?
This is what I have:
Customer are grouped, detail section is suppressed, group footer are shown. I need to show top 25 or 50 or 60 or 10 based on user entry. Please help.
Thanks,
 
I don't know how you can set the top N dynamically from a parameter, but you could cheat this by creating a container report which has 4 subreports in it and just suppress the 3 incorrect subreports based on the parameter.

I know, it's an ugly solution...

-k kai@informeddatadecisions.com
 
K-
Way ugly reporting via subreport.
dré
 
I've found the solution to this one. It's going to be in the next issue of our newsletter.

Use topN to sort your groups (All) by the total - almost a TopN for all groups. The use conditional formatting to supress the group header/footer and detail if
GroupNumber > {?ShowGroups}

With a clever running total you can also calculate the missing others. Editor and Publisher of Crystal Clear
 
Hi

Actually, I asked this question on the site awhile back and Ken Hamady pointed me in the right direction with the use of the 3 formula technique for a manual running total. Then you suppress the group footer of the report so groupnumber > {?TopNParameter}. The report works excellently because I can also show the totals of the Top N but also the grand totals of the database.

If anyone is interested in further details, just ask.

MoJoP

 
MoJoP:
Can you please give me the technical on sorting by group and showing TOP N parameter. Thank you.
dré
 
Create a top N for all items, descending, then set up a parameter for N, then conditionally suppress the groups that do not fall in the top N.

You must use the 3 formula approach with variables to calculate report totals as the suppressed groups will still be in the totals otherwise. Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
Hi Dreman

I can send you a template report in Crystal 8.5 if you provide me with an e-mail address. It's easier to show you that way.

SynapseVampire - a copy is on the way.

MoJoP
 
Rhinok:
The method you pointed out worked Excellent. That's what Ken, MoJop, K and chelsea pointed out.
However I wasn't able to get GroupNumber instead I created a counter. I would still like to know how to get groupnumber, is it a fomula or...
Thank you.
dré
 
Groupnumber is function available within Crystal Reports. When you create a formula simply refer to GroupNumber.
 
Dre

I told you about this in the report I sent you - you format the suppression of the section using the phrase GroupNumber > {?TopNParameter} which will suppress all those other than what the user chose as TopN. It is found under the heading of PrintState functions in the function list.

MoJoP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top