Focal Point
[SOLVED] Sort on Sub Total

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/931107671

July 10, 2009, 07:15 AM
Wasi
[SOLVED] Sort on Sub Total
I need to sort on a Sub total field. Eg We have a shortage column and after doing Sub total i am getting Total potential Shortage. Sorting needs to be done on the Total Potentail shortage Amount.

This message has been edited. Last edited by: Kerry,
July 10, 2009, 07:35 AM
GamP
It will all becomes so much clearer to us if you provide us with an example of what you're looking for, along with the code you already have developed to get there. The description you provided is not really clear enough.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
July 10, 2009, 07:45 PM
Doug
Thanks GamP... I couldn't have said it better myself...

Wasi: Can you examplify it with the CAR file?




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
July 16, 2009, 02:50 AM
Wasi
I want the sub total(total car) to be sorted by highest.

Eg: CAR BMW has the highest Total Sales by CAR and this needs to be first.

TABLE FILE CAR
PRINT
SALES
SEATS
BY CAR
ON CAR SUB-TOTAL SALES SEATS AS 'TOTAL CAR'
END
July 16, 2009, 07:44 AM
Prarie
Add
BY HIGHEST TOTAL SALES NOPRINT


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
Prarie: How simple was that!
Wasi: Anything else? Is this Closed?
Prarie, Doug;

Not so fast. Adding the BY TOTAL HIGHEST statement only will sort the report based on the individual values of SALES, not the SUBTOTAL value of SALES. You need to do a bit more work.

Try this example:

TABLE FILE CAR
SUM SALES NOPRINT
BY TOTAL HIGHEST SALES NOPRINT
BY CAR
PRINT SALES SEATS
BY TOTAL HIGHEST SALES NOPRINT
BY CAR
BY MODEL
BY BODYTYPE
ON CAR SUBTOTAL SALES SEATS AS 'TOTAL CAR'
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, SQUEEZE=ON,$
TYPE=SUBTOTAL, BACKCOLOR=ORANGE,$
ENDSTYLE
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
Here's another interesting approach to the issue:

TABLE FILE CAR
PRINT SUM.SALES WITHIN CAR NOPRINT SALES SEATS
COMPUTE SUMSALES/D12=C1; NOPRINT
BY TOTAL HIGHEST SUMSALES NOPRINT
BY CAR
BY MODEL
BY BODYTYPE
ON CAR SUBTOTAL SALES SEATS AS 'TOTAL CAR'
ON TABLE SET STYLE *
TYPE=REPORT, GRID=OFF, SQUEEZE=ON,$
TYPE=SUBTOTAL, BACKCOLOR=ORANGE,$
ENDSTYLE
END


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
Thanks Mickey!
Thanks it worked,
SOLVED
Wasi,

Here is a link to the post that explains how to change the thread description to have [SOLVED] in the description.

http://forums.informationbuild...1057331/m/8871069592

"To add this keyword to the subject title the member who began the thread should go to the very first post that they started the thread with and then edit it. The subject title may only be changed by editing the very first post in the thread."


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011