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

Use a Parameter for Top N Charting? 1

Status
Not open for further replies.
Feb 4, 2004
60
EU
Good day to all who log in.

Has anyone ever managed to use a parameter input to drive the TOP N feature within charts. I have a report where a parameter drives the TOP N within each group which works perfectly, but cannot find a method to drive the TOP N within a chart.

Anyone?

Cheers

BurnsORegan
 
nagornyi

Thanks for the comment, but how does this help? Please explain further?

BurnsORegan
 
The subreport would contain data only for the top N. So the Top N restriction would be implemented not on the chart level, but on the report level, which is not a problem. The chart woul just disply what's in (sub)report.
 
What you say is true, however it does still not explain how it wouls be a variable. If I use the method currently employed to use the Top N as a variable it will still chart all the data.

(Currently using the Count Variable to determin the number of records required to print and resetting it on the header)

However the chart still includes all the records!

Am I missing the point?

BurnsORegan
 
It may depend on your DB, but I mean the subreport SQL would bring only the desired number of records defined by TopN parameter passed to it.
 
Here's how I accomplished what you're asking:[ol][li]Create a {?TopN} Parameter with multiple default values (5, 10, 20, etc...)[/li][li]Create as many sections as you have parameter selections (typically Group or Report Header sections)[/li][li]Create as many Top N Charts as you have parameter selections and place each chart into its respective Header section[/li][li]Conditionally suppress each section if the parameter selected <> the TopN Value of the chart in the section[/li][/ol]Please note, in order for this to work, you must have a finite list of Parameter Selections.

Hope this helps!


~Kurt
 
Another approach you might try is to use a topN sort (Choose "All" and "descending") on the summary field in the report itself, and then create a formula:

//{@topN}:
if groupnumber <= {?topN} then {table.groupfield}

Then use the formula {@topN} in the chart as your "on change of" field. Then highlight the formula and choose "Order"->Specified Order and add in all of the possible group results. Then choose the "Other" tab and select "Discard all others."

This should result in a chart (in the report header or footer) of only the topN groups. However, the chart does depend on your ability to use the topN in the report itself, since the formula is based on groupnumber, which is a simple running total--so the groups must be in topN order.

If you don't want to use a topN order in your main report, you could set this up in a subreport where you could suppress the report sections except the one containing the chart.

-LB
 
lbass has done it again......the idea of using the TOP N as the "Change On" feature, thats brilliant.

Thanks to all who have replied.

Regards

BurnsORegan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top