Focal Point
concatenation [Solved]

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

June 17, 2011, 10:17 AM
Shubha Manjit
concatenation [Solved]
I have a requirement where, I need to concatenate all the values of a field under a group.

In the below example
TABLE FILE XXX
PRINT LASTTOKEN
BY GROUPID
END

I need to concatenate all the values of LASTTOKEN

I tried the following:
TABLE FILE XXX
PRINT LASTTOKEN
COMPUTE MOD2/A200 =
IF GROUPID NE LAST GROUPID THEN LASTTOKEN|','|SUBSTR(200, LAST MOD2, 1, 176, 176, 'A176')
ELSE 'LASTTOKEN' ;
BY GROUPID
END

This works fine until line 12 of the output.After line 12, the new 'LASTTOKEN' is added but the initial vale is not displayed. How do I increase the display size? all that I tried dint work for me.
The maximum lines of outpu is 32
GROUPID LASTTOKEN MOD2
CCT10010401 401 401 ,
CCT10010402 402 402 ,401 ,
CCT10010403 403 403 ,402 ,401 ,
CCT10010404 404 404 ,403 ,402 ,401 ,
CCT10010405 405 405 ,404 ,403 ,402 ,401 ,
CCT10010406 406 406 ,405 ,404 ,403 ,402 ,401 ,
CCT10010601 601 601 ,406 ,405 ,404 ,403 ,402 ,401 ,
CCT10010602 602 602 ,601 ,406 ,405 ,404 ,403 ,402 ,401 ,
CCT10010A23 A23 A23 ,602 ,601 ,406 ,405 ,404 ,403 ,402 ,401 ,
CCT10010A41 A41 A41 ,A23 ,602 ,601 ,406 ,405 ,404 ,403 ,402 ,401 ,
CCT10010A52 A52 A52 ,A41 ,A23 ,602 ,601 ,406 ,405 ,404 ,403 ,402 ,401 ,
CCT10010B23 B23 B23 ,A52 ,A41 ,A23 ,602 ,601 ,406 ,405 ,404 ,403 ,402 ,401 ,
CCT10010B52 B52 B52 ,B23 ,A52 ,A41 ,A23 ,602 ,601 ,406 ,405 ,404 ,403 ,402 ,
CCT10010C23 C23 C23 ,B52 ,B23 ,A52 ,A41 ,A23 ,602 ,601 ,406 ,405 ,404 ,403 ,

This message has been edited. Last edited by: Shubha Manjit,


WebFOCUS 7.6
Windows, All Outputs
June 17, 2011, 11:49 AM
Alan B
Use Variable fields, for example:
TABLE FILE CAR
PRINT SEATS
COMPUTE NEW/A200V = EDIT(SEATS) | ',' | NEW;
BY COUNTRY
END 


It makes life a lot easier.


Alan.
WF 7.705/8.007