Focal Point
[SOLVED] sort group row numbering

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

May 02, 2012, 09:41 AM
Abu
[SOLVED] sort group row numbering
Hi,
I have a report that has several groups of rows. I want to number each row in a group starting from 1. For example, if group 1 has 10 rows, they will be numbered from 1 to 10, then if group 2 has 15 rows it will be numbered from 1 to 15. How do I do that in Webfocus?
Thanks
Abu

This message has been edited. Last edited by: Kerry,


WebFOCUS 7.6
Windows, All Outputs
May 02, 2012, 10:51 AM
Mary Watermann
Create a counter field.
COMPUTE RANK1/I9 = IF (sortfield1 NE LAST sortfield1) THEN 1 ELSE RANK1 + 1;



WF 7.6.10, Windows, PDF, Excel
May 02, 2012, 12:15 PM
Abu
Thanks Mary, it works perfectly as I wanted.


WebFOCUS 7.6
Windows, All Outputs
May 02, 2012, 12:34 PM
Doug
Well put Mary,

Try this (SEQUENCE):
TABLE FILE CAR
PRINT MODEL
COMPUTE RANK1/I9 = IF (COUNTRY NE LAST COUNTRY) THEN 1 ELSE RANK1 + 1;
BY COUNTRY
BY CAR
ON TABLE SET STYLE *
TYPE=REPORT, COLUMN=RANK1, SEQUENCE=1,$
ENDSTYLE
END
Smiler
May 02, 2012, 01:11 PM
Danny-SRL
If you want to renumber on the outer BY field only, use the original LIST:
  
TABLE FILE CAR
LIST MODEL
BY COUNTRY
BY CAR
ON TABLE SET STYLE *
TYPE=REPORT, COLUMN=LIST, SEQUENCE=1,$
ENDSTYLE
END



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