Focal Point
Unique ranking issue? [resolved]

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

May 11, 2011, 06:58 AM
Ted Michalski
Unique ranking issue? [resolved]
I have a table with two numeric columns (A, B). Column B is a calculation on Column A (fixed amount - Col A). I want the report to display by highest A until B reaches zero, but, at minimum, I want to display 15 rows. In other words, if the value of Col B on the 5th row is zero, then I want to continue displaying rows until I have a total of 15 rows on the report.
If Col B doesn't get to zero until the 30th row, then I want to display all 30 rows. Can this be done?

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


7.7.02
Windows
EXCEL, PDF, CSV, TEXT
May 11, 2011, 07:15 AM
GamP
Sure.
You could compute an extra field in your table that keeps track of the record number (just increasing the value by one for every new record). And then have a second compute with which you define if the record should be printed or not using the newly created recordnumber and the value of the B column to decide. So something like this should do the trick:
TABLE FILE ...
COMPUTE RECNO/I5 = RECNO+1; NOPRINT
COMPUTE PRINT/A1 = IF RECNO LE 15 THEN 'Y' ELSE IF COLB GE 0 THEN 'Y' ELSE 'N'; NOPRINT
....
WHERE TOTAL PRINT EQ 'Y';



GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
May 11, 2011, 07:26 AM
Ted Michalski
Thanks GamP. This works.


7.7.02
Windows
EXCEL, PDF, CSV, TEXT
May 11, 2011, 11:10 AM
Ted Michalski
GamP, is there any way if the number of rows goes past 15 before I reach zero, to display all the rows that are not zero AND the first row that is zero?


7.7.02
Windows
EXCEL, PDF, CSV, TEXT
May 12, 2011, 05:11 PM
Waz
Ted, this is all to do with flagging records, then filtering.

If you have the logic to flag the record, the you can keep it.

For example:

IF LAST COLB GT 0 AND COLB EQ 0 THEN 'Y' ELSE ...  



Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!