Skip to main content



      Home
Home » Archived » BIRT » Concatenate Values from Different Rows
Concatenate Values from Different Rows [message #1610483] Tue, 10 February 2015 15:45 Go to next message
Eclipse UserFriend
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 17:01 Go to previous messageGo to next message
Eclipse UserFriend
There is a CONCATENATE function in the aggregation element that will do exactly this. Have you tried that or am I misunderstanding?
Re: Concatenate Values from Different Rows [message #1611844 is a reply to message #1610571] Wed, 11 February 2015 11:52 Go to previous messageGo to next message
Eclipse UserFriend
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 12:02 Go to previous message
Eclipse UserFriend
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

[Updated on: Wed, 11 February 2015 12:04] by Moderator

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


Current Time: Mon Apr 14 18:50:00 EDT 2025

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

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

Back to the top