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)
Filtering data in aggregation(concatenate)
birt_ag
<p>Hi,</p>
<p> </p>
<p>I'm trying to concatenate two elements using aggregation. But i want to add a condition to concatenate rows block wise. Kindly look into below xml snippet:</p>
<p> </p>
<div>
<pre class="_prettyXprint">
<rootTag>
<identifier>
<C.1.9.1.r.1>Link ID 1</C.1.9.1.r.1>
<C.1.9.1.r.2>001</C.1.9.1.r.2>
<identifier-count>0</identifier-count>
</identifier>
<identifier>
<C.1.9.1.r.1>Link ID 2</C.1.9.1.r.1>
<C.1.9.1.r.2>002</C.1.9.1.r.2>
<identifier-count>0</identifier-count>
</identifier>
<rootTag-count>0</rootTag-count>
<rootTag>
<rootTag>
<identifier>
<C.1.9.1.r.1>Link ID 3</C.1.9.1.r.1>
<C.1.9.1.r.2>003</C.1.9.1.r.2>
<identifier-count>1</identifier-count>
</identifier>
<identifier>
<C.1.9.1.r.1>Link ID 4</C.1.9.1.r.1>
<C.1.9.1.r.2>004</C.1.9.1.r.2>
<identifier-count>1</identifier-count>
</identifier>
<rootTag-count>1</rootTag-count>
<rootTag></pre>
</div>
<p>I need output in the following way - </p>
<p> </p>
<p><strong>In page 1 of the report : Link ID 1/001, Link ID 2/002</strong></p>
<div> </div>
<div><strong>In page 2 of the report: Link ID 3/003, Link ID 4/004</strong></div>
<div> </div>
<div>Using the aggregations concatenate i'm able to combine C.1.9.1.r.1 and C.1.9.1.r.2 tags with appropriate delimeters, but i want to filter out based on <rootTag-count> and <identifier-count> value so that in 1st page identifier items with rootTag-count as 0 is displayed and in 2nd page identifier items with rootTag-count as 1 is displayed.</div>
<div> </div>
<div>I'm not able to use the filter option in aggregation window in the above way.. <br>
can anybody kindly help me.. I'm using BIRT 4.4</div>
<div> </div>
<div>Thank you</div>
Find more posts tagged with
Comments
birt_ag
<p>can anyone help me.. i guess we cannot get the required result with aggregation.. is there any other way ?</p>
Clement Wong
<p>I'm having trouble understanding the requirements.</p>
<p> </p>
<p>You want all the <identifier>s of the first <rootTag> on page 1, and all the <identifier>s of the second <rootTag> on page 2?</p>
<p> </p>
<p>And then you want the values of <span><C.1.9.1.r.1> and <span><C.1.9.1.r.2> tags combined as a group, and then concatenated in a long string?</span></span></p>
<p> </p>
<p><span><span>In non-sample data, for the first <rootTag>, can <<span>identifier-count> or <rootTag-count> be a value other than 0? Can the second <rootTag> have <span><span><<span>identifier-count> or <rootTag-count> values other an 1?</span></span></span></span></span></span></p>
<p> </p>
<p><span><span><span><span><span><span>I may have a solution, but I want make sure we're on the same page.</span></span></span></span></span></span></p>
birt_ag
<p>Hi Clement,</p>
<p> </p>
<p>Yes <span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">i need all the <identifier>s of the first <rootTag> on page 1, and all the <identifier>s of the second <rootTag> on page 2.</span></p>
<p> </p>
<blockquote class="ipsBlockquote"><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">In non-sample data, for the first <rootTag>, can <</span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">identifier-count> or <rootTag-count> be a value other than 0? Can the second <rootTag> have <identifier-count> or <rootTag-count> values other an 1?</span>
<p> </p>
</blockquote>
<p> </p>
<p>No, first occurence of rootTag and <span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;font-size:12px;background-color:rgb(247,247,247);">identifier-count </span>will always be 0, it wont change. 2nd occurrence of root tag and <span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;font-size:12px;background-color:rgb(247,247,247);">identifier-count </span>will have value as 1, 3rd occurrence as 2 and so on... </p>
<p> </p>
<p>Thank you.</p>
Clement Wong
<p>Thanks for the clarification. Also, I had a question that you may have missed. "And then you want the values of <span><C.1.9.1.r.1> and <span><C.1.9.1.r.2> tags combined as a group, and then concatenated in a long string?"</span></span></p>
<p> </p>
<p> </p>
<p>Like this?</p>
<p style="margin-left:40px;"><u>Page 1</u></p>
<p style="margin-left:40px;"><span style="font-family:'courier new', courier, monospace;">Link ID 1/001, Link ID 2/002</span></p>
<p> </p>
<p>Or like this? </p>
<p style="margin-left:40px;"><u>Page 1</u></p>
<p style="margin-left:40px;"><span style="font-family:'courier new', courier, monospace;">Link ID 1/001</span></p>
<p style="margin-left:40px;"><span style="font-family:'courier new', courier, monospace;">Link ID 2/002</span></p>
birt_ag
Hi,<br><br>
I need <br><br>
page 1 of the report : Link ID 1/001, Link ID 2/002<br><br>
page 2 of the report: Link ID 3/003, Link ID 4/004
Clement Wong
<p>In the attached example, I use E4X (as illustrated here @ <a data-ipb='nomediaparse' href='
http://developer.actuate.com/community/forum/index.php?/files/file/1122-parsing-xml-in-birt-with-e4x/)'>http://developer.actuate.com/community/forum/index.php?/files/file/1122-parsing-xml-in-birt-with-e4x/)</a>to
parse the DOM and populate a scripted data source / data set.</p>
<p> </p>
<p>In the beforeOpen of the scripted data set, I have your XML streams. I added a root element so that I can use E4X. I use RegEx to remove the dots (.) and the dash (-) from the element names so we can use E4X to traverse the DOM.</p>
<p> </p>
<p>The total rows will the # of <rootTag> elements.</p>
<p> </p>
<p>In the fetch event, I use the # of <identifier> elements and concatenate the <C.1.9.1.r.1> and <C.1.9.1.r.2> elements, and add a comma as needed.</p>
<p> </p>
<p>On Page 1 of the example, I just display the entire result set.</p>
<p> </p>
<p>On Page 2 and Page 3, is where I have grouped the table based on the rootTagcount. Your "page 1" and "page 2".</p>