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  iWay Software Product Forum on Focal Point    [CLOSED] How to concatenate column values from multiple rows in iDM?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] How to concatenate column values from multiple rows in iDM?
 Login/Join
 
Member
posted
Hello, is there a way to concatenate column values from multiple rows using iDM GUI/DMC?

For example I have two columns with these rows.
MAKE MODEL
Nissan Xterra
Nissan Altima
Nissan Pathfinder
Honda Accord
Honda Pilot
Toyota Camry

I would like the output to be
MAKE MODEL
Nissan Xterra, Altima, Pathfinder
Honda Accord, Pilot
Toyota Camry

Thanks.

This message has been edited. Last edited by: <Kathryn Henning>,


iSM 616
iDM 7705
iDQC 802
WF 77
Windows 2008 Server
 
Posts: 29 | Registered: May 01, 2007Report This Post
Guru
posted Hide Post
Sure. Create a source transformation like this:

MODELS | A256V | IF MAKE NE LAST MAKE THEN MODEL  ELSE MODELS || ( ' ' |  MODEL ) 

Then in your SQL object

 
MAKE   | Group By
MODELS | Max   


Also if the source data is in a recent release of ORACLE or DB2 you can use DB_EXPR with the native SQL function LISTAGG.


N/A
 
Posts: 397 | Location: New York City | Registered: May 03, 2007Report This Post
Member
posted Hide Post
Thanks Clif.

I am using SQL Server 2012 for my data source. In regards to your comment about using DB_EXPR to invoke native SQL functions, is this expression available in source, SQL and target nodes in DMC?


iSM 616
iDM 7705
iDQC 802
WF 77
Windows 2008 Server
 
Posts: 29 | Registered: May 01, 2007Report This Post
Guru
posted Hide Post
Unfortunately there is no LISTAGG equivalent in MS SQL Server so DB_EXPR won't help in your case.

If you search for such a thing you'll find rather complex workarounds. They would be more suitable for use in a DBMS SQL Flow or a synonym created for an external SQL Script.

One more thing: for the technique I gave you works for your sample since all the rows with the same MAKE are grouped together.


N/A
 
Posts: 397 | Location: New York City | Registered: May 03, 2007Report This Post
Platinum Member
posted Hide Post
The row concatenation is better implemented in DBMS than WebFOCUS/DataMigrator. You'll find different ways like this:

http://stackoverflow.com/quest...a-single-text-string

One thing you need to keep in mind is that you have to set a size limit to the returned string. I've done something similar in DB2, and it caused a "buffer overflow" error when the string size was more than it could handled.


7.66 and 7.704
System: Windows / AIX / Linux
Output: Mostly HTML, with some PDF, Excel and Lotus(!)
 
Posts: 147 | Location: Toronto (GTA) | Registered: May 25, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    [CLOSED] How to concatenate column values from multiple rows in iDM?

Copyright © 1996-2020 Information Builders