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!

TOP N Parameters

Status
Not open for further replies.

lisa626

Programmer
Aug 9, 2006
92
0
0
US
Crystal XI - Business Objects XI R 2

I have a report that has multiple parameters, I want to add a parameter so that a person can tell it to pull the top # or all of a certain group, what would be the easiest way to do this???
 
Set up a number parameter {?topN} and in the prompt text, instruct the user to enter 0 to see all groups, or to enter the number of top groups he/she would like displayed. Then go to report->group sort->topN->where N is->x+2 and enter:

if {?topN} <> 0 then
{?topN} else
10000

-LB
 
Ok, have the parameter created...
Under report->group sort->topN->where N = 10000, where do I put the formula

if {?topN} <> 0 then
{?topN} else
10000

does that go at the group I want to sort on or where????

 
This goes right IN the group sort screen. After you select topN, a space appears below--leave that as is, and instead go into the x+2 button next to it and enter the formula there. The formula overrides whatever is in the box.

-LB
 
It won't let me leave it blank, it wants a number greater than 1.
 
What won't be left blank? If you mean the box next to the x+2 put a number in it--it doesn't matter, since the formula will override it.

You always must enter something at a parameter prompt--at least in XI.

-LB
 
ALSO, my fault, forgot to add that I have 2 subreports on this report that also need to show top n, would I do the same thing for the sub reports as I did for the main.

SORRY, I thought I was adding to the original.
 
Once you have created the parameters in the subs and set up the topNs in each, you can link the parameter from the main report to the parameter in each of the subs by using the dropdown in the lower left of the subreport linking screen to select {?topN}, not the default {?pm-?topN}.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top