Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Concatenate Values from Different Rows
Concatenate Values from Different Rows [message #1610483] Tue, 10 February 2015 20:45 Go to next message
andy rush is currently offline andy rushFriend
Messages: 15
Registered: July 2014
Junior Member
I am working on a report wrapper where the .rptdesign files are created by a third party who is more of a designer than a coder. I am faced with a situation where a report displays the contents of variable that is set a field in the dataset (i.e. using dataSetRow['columnName'] as part of the expression in the binding editor. The problem is the column can display more than one value, but the binding only allows the display of the value in the first row of the result set, rather than the distinct values.

To illustrate

My report displays:

Names: Bill

My result set column looks like:

columnName
Bill
Bill
Steve
Bill

Given this result set, the generated report view will always display "Names: Bill" instead of the desired output of "Names: Bill, Steve".

Is it possible to get the desired output? If so, how would you go about doing it?
Re: Concatenate Values from Different Rows [message #1610571 is a reply to message #1610483] Tue, 10 February 2015 22:01 Go to previous messageGo to next message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

There is a CONCATENATE function in the aggregation element that will do exactly this. Have you tried that or am I misunderstanding?

Michael

Developer Evangelist, Silanis
Re: Concatenate Values from Different Rows [message #1611844 is a reply to message #1610571] Wed, 11 February 2015 16:52 Go to previous messageGo to next message
andy rush is currently offline andy rushFriend
Messages: 15
Registered: July 2014
Junior Member
Thanks for the quick reply, Michael. To be honest, i hadn't tried the aggregation builder (or even heard of it - my responsibilities in the project are primarily outside of BIRT) but, as a result of you pointing out the concatenate function therein, i was able to get the report working more or less as intended.

One final question - short of grabbing and parsing the output from the concatenation, is there a way to get the number of values that are being concatenated so i can make the label plural when necessary?

Thanks again!
Re: Concatenate Values from Different Rows [message #1611860 is a reply to message #1611844] Wed, 11 February 2015 17:02 Go to previous message
Michael Williams is currently offline Michael WilliamsFriend
Messages: 1925
Registered: July 2009
Senior Member

You're welcome.

For your question: There's another aggregation you could create on your table or in a computed column in the data set that is for distinct count. If you set the expression to the field you're wanting, you'll get a count of the unique values in that column. This would give you a value to check against to see if the count is greater than 1, though, it might be easier to just check your concatenation field for an instance of whatever your "separator" you used for your concatenation was. This would let you know there's more than one item as well, without creating another field. Hope this helps. Smile


Michael

Developer Evangelist, Silanis

[Updated on: Wed, 11 February 2015 17:04]

Report message to a moderator

Previous Topic:Sankey diagram
Next Topic:"Find" issue in XML source- page jumping back to top
Goto Forum:
  


Current Time: Sun Jul 14 20:29:12 GMT 2024

Powered by FUDForum. Page generated in 0.03503 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top