Concatenating strings with Aggregation Builder issue/question [message #1173842] |
Wed, 06 November 2013 14:55  |
Eclipse User |
|
|
|
I am using an older version of BIRT (SDK is 2.3.1.v20080701) due to my software requirements...I can not upgrade at this time.
Basically I'm trying to create a "breadcrum" from a possibly infinite parent/child relationship.
Example:
CHILD | PARENT
---------------
46 |
47 | 46
48 |
49 | 48
50 | 46
51 | 49
To handle this, I wrote a recursive SQL statement that will flatten based on what you select.
Example 1 - if you select 50...you would get
CHILD | PARENT
---------------
46 |
50 | 46
Example 2 - if you select 51...you would get
CHILD | PARENT
---------------
48 |
49 | 48
51 | 49
This all works great for me until I actually concatenate this using the Aggregation Builder.
I have:
1) bound a table to the DataSet mentioned above
2) I then GROUPed the DataSet
3) I then added a CONCATENATE Aggregation
This actually works really well...EXEPT I have an option for a "Separator" (Which has apparently gone away in newer versions, as all the screen shots I've seen don't have it) where I provide it " / "
The end result is...
Example 1
46 / 50 /
Example 2
48 / 49 / 51 /
These seem so easy, but I can NOT figure out how to get rid of the last "/"
NOTE: If you attempt to reference the row["Aggregation"] you will get back as many rows as you have levels...
i.e. for Example 2 you would get:
48 / 49 / 51 /
48 / 49 / 51 /
48 / 49 / 51 /
because there are 3 levels
My next attempt feels close...
row["Aggregation"].substr(0,row["Aggregation"].lastIndexOf("/"))
this unfortunately returns multiple rows..but I got rid of the "/"
48 / 49 / 51
48 / 49 / 51
48 / 49 / 51
Any help is much appeciated.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.08768 seconds