Focal Point
Concatinating data to create one record per account

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

May 22, 2006, 09:54 AM
Mchll
Concatinating data to create one record per account
Morning all. I am a novice @ webfocus, so any help would be appreciated! I have some data that has equipment for accounts, about 12,000 records. Most of the accounts have more than one piece of equipment and I need to sum the data so that there's one account with each different type of equipment concatinated into one column. My thought is to index and run the data through a loop to concatinate the equipment types. I was hoping for a less complex way. Thank you in advance.
May 22, 2006, 10:23 AM
ET
Try building a counter with your account (assuming that the file/data is in account order) and then use a table using an across on your counter and a by on the account. Here is an example with the using the car file. The first request shows the models for each car. The second request shows them on one line for each car. good luck!!

TABLE FILE CAR
PRINT MODEL BY CAR UNDER-LINE
END
CAR MODEL
--- -----
ALFA ROMEO 2000 GT VELOCE
2000 SPIDER VELOCE
2000 4 DOOR BERLINA
------------------------------------------
AUDI 100 LS 2 DOOR AUTO
------------------------------------------
BMW 2002 2 DOOR
2002 2 DOOR AUTO
3.0 SI 4 DOOR
3.0 SI 4 DOOR AUTO
530I 4 DOOR
530I 4 DOOR AUTO
------------------------------------------
DATSUN B210 2 DOOR AUTO
------------------------------------------
JAGUAR V12XKE AUTO
XJ12L AUTO
------------------------------------------
JENSEN INTERCEPTOR III
------------------------------------------
MASERATI DORA 2 DOOR
------------------------------------------
PEUGEOT 504 4 DOOR
------------------------------------------
TOYOTA COROLLA 4 DOOR DIX AUTO
------------------------------------------
TRIUMPH TR7
------------------------------------------

DEFINE FILE CAR
CNTR/I1=IF CAR EQ LAST CAR AND MODEL NE LAST MODEL THEN LAST CNTR + 1
ELSE 1;
END
TABLE FILE CAR
WRITE MODEL
ACROSS CNTR NOPRINT BY CAR
END



PAGE 1


CAR
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
ALFA ROMEO 2000 GT VELOCE 2000 SPIDER VELOCE 2000 4 DOOR BERLINA . . .
AUDI 100 LS 2 DOOR AUTO . . . . .
BMW 2002 2 DOOR 2002 2 DOOR AUTO 3.0 SI 4 DOOR 3.0 SI 4 DOOR AUTO 530I 4 DOOR 530I 4 DOOR AUTO
DATSUN B210 2 DOOR AUTO . . . . .
JAGUAR V12XKE AUTO XJ12L AUTO . . . .
JENSEN INTERCEPTOR III . . . . .
MASERATI DORA 2 DOOR . . . . .
PEUGEOT 504 4 DOOR . . . . .
TOYOTA COROLLA 4 DOOR DIX AUTO . . . . .
TRIUMPH TR7


FOCUS 7.6 MVS PDF,HTML,EXCEL
May 22, 2006, 10:32 AM
Mchll
Thanks, I'll give it a go.