Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Separating values by semicolon - java?
Chaplin69
<p>Hi,
i have created report, which is returning multiple columns. Something like this:
Column are: RPI|ID|SBJC
Values are for example:
660319920054609|39259920054609|301562412816721,0000000,ou=XYC,dc=COM;301563749877468,0000000,ou=XYC,dc=COM;
In column SBJC i can have multiple values separated by semicolon, one value is there everytime. How could i separate the values from column SBJC to have result for example like this:
RPI|ID|SBJC|SBJC1 .....</p><p> </p><p>or like that</p><p> </p><p>RPI|ID|SBJC1
What is the best way to obtain the desired result? Newer used Java /scripts/ before in my reports.
How fast will be the report generation? Thank you for your help.
Chaplin</p>
Find more posts tagged with
Comments
ahsiang
Why don't you create a new field in your dataset. Use trim, left etc to scan for the ; sign and break out a new field.
Chaplin69
<p>Hi,
thanks for your quick answer. Can you show me some sample, how to do that? Shall i use computed columns in data source or can i use script for example onFetch? The column SBJC can have maximally 25 items, so how can i do the "separation" automatically?
Thx</p>
ahsiang
<p>Here's a sample that you can create a field within the data set. I am using Open Source BIRT3.7.2. For scripting sample, you can refer here, <a data-ipb='nomediaparse' href='
http://digiassn.blogspot.sg/2007/11/birt-dynamic-adding-tables-and-columns.html'>http://digiassn.blogspot.sg/2007/11/birt-dynamic-adding-tables-and-columns.html</a>
; where it will create the fields on the table rather than on the data set. You will have to create a while/for statement to loop through your SBJC and then add in additional cell and labels.</p>