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

problem with 'Top N'

Status
Not open for further replies.

JeroenBoon

Technical User
Aug 15, 2002
106
NL
Hello,

In a report I print the top 20 based on Costumer turnover. CR groups the not-top-20 in 'Others' and in the footer I print the total turnover.
The problem is: I also want to print a sort of subtotal in the footer: the sum of the top-20 turnover. I've tried a lot of things, but can't find the solution. I am sure some of you can!

Greetings, Jeroen.
 
A topN repot IS a sort of a subtotal. OPlease clarify what you are trying to do. Software Sales, Training and Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
for example:
top N=3:

costumer C € 5.000
costumer A € 4.000
costumer F € 3.000
others € 10.000
total € 22.000

Now I also want a subtotal like: sum top 3 = € 12000

'How do I do that?

Jeroen.
 
Hi !

Maybe this isn´t the best way, but I think it will work.

Create a formula:

NumberVar Total_Top20;

if GroupName ({YourField}) <> 'Others' then
Total_Top20 := Total_Top20 + Sum ({YourTurnoverField}, { YourField })
else
Total_Top20;


Place the field in the section where you have your summary for the customer tornover.

Also place the field in the Report Footer (if it is there you want the subtotal to show up).

And for suppressing the field in the other footers you can conditionally suppress it with a formula like:

not isNull(GroupName ({YourField }))

I hope you can follow, and that it helps.

/Goran
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top