Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Getting last row after concatenation of col. data

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Getting last row after concatenation of col. data
 Login/Join
 
Gold member
posted
Hi,

I have data like

Col1____Col2____Col3
A_______A1______A11
A_______A1______A22
A_______A2______A33
A_______A2______A44
B_______B1______B11
B_______B1______B22
B_______B2______B33
B_______B2______B44

I want data like

A_______A1______A11, A22
A_______A2______A33, A44
B_______B1______B11, B22
B_______B2______B33, B44

i.e. If for 2 or more records if Col1 and Col2 have same values then concatenate the data for Col 3. I am able to do concatenation by comparing using LAST phrase, but I am not able to get ONLY the last record. I get data like

A_______A1______A11
A_______A1______A11, A22

i.e. by comparing row by row the LAST values of Col1 and Col2.

But what filter should I put to get only the last row
A_______A1______A11, A22

Do we have something like NEXT in WF??

Thanks,
 
Posts: 78 | Registered: December 11, 2005Report This Post
Virtuoso
posted Hide Post
CD

Sounds like you are using PRINT when you need SUM,e.g:
DEFINE FILE CAR
NEW_MOD/A150V = IF COUNTRY EQ LAST COUNTRY AND CAR EQ LAST CAR 
                 THEN NEW_MOD || (', ' | MODEL) 
                 ELSE MODEL;
END
TABLE FILE CAR
SUM NEW_MOD
BY COUNTRY
BY CAR
END

With alpha fields SUM (WRITE) overlays values.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Expert
posted Hide Post
Hi Code Digger,

Has this issue been resolved? Many thanks to Alan's help on this one. Smiler

Here is suggestion from internal expert:

Focexec
FILEDEF MYSORT DISK C:\IBI\APPS\SORT\MYSORT.TXT
-RUN
TABLE FILE MYSORT
PRINT
COMPUTE
NEWCOL/A12=IF COL1 EQ LAST COL1 AND COL2 EQ LAST COL2 THEN LAST COL3 | ',' | COL3 
        ELSE COL3;
BY COL1
BY COL2
BY HIGHEST 1 TOTAL COL3
END


MYSORT.TXT data file
AA1A11
AA1A22
AA2A33
AA2A44
BB1B11
BB1B22
BB2B33
BB2B44

MYSORT.MAS master
FILENAME=mysort,SUFFIX=FIX
FIELD=COL1, ALIAS=COL1, FORMAT=A1,$
FIELD=COL2, ALIAS=COL2, FORMAT=A2,$
FIELD=COL3, ALIAS=COL3, FORMAT=A3,$


Hope this helps. Big Grin

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
 
Posts: 1948 | Location: New York | Registered: November 16, 2004Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     Getting last row after concatenation of col. data

Copyright © 1996-2020 Information Builders