Focal Point
[RESOLVED]Total of highest 5 values

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

September 21, 2012, 02:17 PM
Ted Michalski
[RESOLVED]Total of highest 5 values
I want to get the total of the highest 5 balances, so I used

TABLE FILE XXX
SUM
BALANCES
BY HIGHEST 5 BALANCES AS ' ' NOPRINT


But this prints all 5 of the balances. I just want to TOTAL of the 5 highest balances (one row totaling the highest 5 BALANCES on the DB). What am I doing wrong?

This message has been edited. Last edited by: Ted Michalski,


7.7.02
Windows
EXCEL, PDF, CSV, TEXT
September 21, 2012, 02:32 PM
Prarie
Need two steps.

  TABLE FILE CAR
PRINT SUM  SALES  
BY HIGHEST 2 SALES NOPRINT 
ON TABLE HOLD AS SALES  
-*
END
TABLE FILE SALES
SUM SALES AS TOTAL,SALES
END



In Focus since 1993. WebFOCUS 7.7.03 Win 2003
If you only want to see the value and not use it later on could do something like this (This will only get top 5 unique values though and any duplicates will not be counted):

TABLE FILE CAR
SUM SALES
BY HIGHEST 5 SALES NOPRINT
ON TABLE SUBFOOT RECOMPUTE
END



WF: 8201, OS: Windows, Output: HTML, PDF, Excel
If I may put in my 2 cents:
  
TABLE FILE CAR
BY HIGHEST 5 SALES 
ON TABLE HOLD AS SALES  
END
TABLE FILE SALES
SUM SALES
END



Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF