I would like to be able to allow the user to select whether they would like to see the top or bottom x items and not select them while creating the report.
I was saying both but figured out how to determine the N number of groups dynamically. Now I need to find out how to dynamically change from top N to bottom N.
I figured out how to dynamically choose the top or bottom depending upon a field formula
if {?Top/Bottom} = "Bottom" then {datafield}
what I need is
if {?Top/Bottom} = "Bottom" then Sum ({datafield}, {datafield})
using the first formula I create a report/sort based upon the field formula and sort ascending. I need to do the same for the top to create a descending list but still cannot get it to work with the sum as in the second formula
Great question. I'll use it for an article in the February Crystal Clear.
A TopN of the -Summary gives you the same result as the Bottom N.
Conditional TopN/Bottom N
1) Create a parameter {?Top/Bottom}
2) Create a formula {@Sort}
If {?Top/Bottom} ="Top" then {table.value}
else -{table.value}
3) Create a subtotal of this in your group and suppress it.
4) use TopN to do a Sort on this subtotal (Ascending)
Conditional number of groups
1)create a parameter {?Group}
2) Do conditional section suppress GH, D and GF of
GroupNumber > {?Group}
Email me (bruce@chelseatech.co.nz) and I'll send the report I used to test this out. Editor and Publisher of Crystal Clear
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.