Focal Point
Numbered listing

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

September 04, 2007, 05:29 PM
gregson06
Numbered listing
Here's my scenario. I would like to do something like a list with groups, except that I don't want the numbers to restart after each group.

So it should look like this:

Group A
1 car
2 truck
3 van
Group B
4 motorcycle
5 moped
6 scooter

Is there a way to do this with LIST, or must I use a DEFINED field for this?

Thanks!
September 04, 2007, 05:48 PM
Leah
Far as I know list numbers based on a by field. I'd use a compute to get your 'list' as the first field in the list.

compute countlist/i5 = if countlist eq 0 then 1 else countlist + 1; as 'LIST'

Of course many ways to skin a cat. Define won't work unless the file is in the order you want to 'list it'.


Leah
September 04, 2007, 06:01 PM
gregson06
Thanks Leah,

It worked the following way (similar to what you mentioned):

TABLE FILE DATA
PRINT
CAR
YEAR
BY CAR
BY YEAR
ON TABLE HOLD AS DATA1
END

DEFINE FILE DATA1
CNTR/I6 = IF CNTR EQ 0 THEN 1 ELSE CNTR+1;
END

TABLE FILE DATA1
PRINT
CNTR
CAR
YEAR
ON TABLE HOLD AS DATA2
END

TABLE FILE DATA2
PRINT
CNTR
CAR
BY CAR
BY YEAR
END


This basically gets the data that I need sorted on the first pass, then adds the counter on the second pass, then displays the counter in the groups I need them in on the last pass.

Thanks a bunch!
September 05, 2007, 02:43 AM
Tony A
You should be able to do it in a single pass - depending upon the number of fields you have in the output and their layout etc.
TABLE FILE GGSALES
SUM COMPUTE LIST/I9 = LAST LIST + 1;
    ST
    DOLLARS
-* This is your group field
BY REGION NOPRINT
-* This is the field that you want ranked within your report
BY ST NOPRINT
ON REGION SUBHEAD
"Region <REGION"
END

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
September 05, 2007, 03:26 AM
Piipster
I might stay away from LIST as a fieldname. It was a valid verb in the past and as such would be a reserved word. I don't know if it works now though and I've just shut down my vmware image. I'll test it out tomorrow if I get a chance.


ttfn, kp


Access to most releases from R52x, on multiple platforms.
September 05, 2007, 03:37 AM
Tony A
Very true Karen, forgot about that! (early morning etc. Wink) However, it worked on 7.6.2 on Windows this am.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
September 05, 2007, 05:27 AM
Danny-SRL
This could help:
DEFINE FILE CAR
DUM/A1=' ';
END
TABLE FILE CAR
LIST CAR
BY DUM NOPRINT
BY COUNTRY NOPRINT SUBHEAD
"Group: <COUNTRY "
END



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

September 05, 2007, 01:11 PM
ET
This also works.

TABLE FILE CAR
PRINT COMPUTE CNTR/I9=CNTR + 1; AS LIST CAR
BY COUNTRY
END
COUNTRY LIST CAR
------- ---- ---
ENGLAND 1 JAGUAR
2 JENSEN
3 TRIUMPH
FRANCE 4 PEUGEOT
ITALY 5 ALFA ROMEO
6 MASERATI
JAPAN 7 DATSUN
8 TOYOTA
W GERMANY 9 AUDI
10 BMW


FOCUS 7.6 MVS PDF,HTML,EXCEL