Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Custom aggregation column in crosstab with last data
lemonch
<p>Hi,</p>
<p> </p>
<p>I have a crosstab, and want a custom total column with last values. I have createad the grand total column and there i put the data i want. I have createad an aggregation with last as the function to aggregate. The problem is that it works great when there is data, but when there is a null value, i dont want the prior last data. I would rather put a 0. How can i simulate that if the last value is null, put a 0 in the custom grand total column. </p>
<p> </p>
<p>Like this is what shows</p>
<p> </p>
<p> Jan Feb Mar Apr Last</p>
<p>Rice null null 54 null 54</p>
<p>Oil 44 null 14 66 66</p>
<p>Salt 5 null null null 5</p>
<p> </p>
<p>But i want THIS output and dont know how to get it</p>
<p> </p>
<p> Jan Feb Mar Apr Last</p>
<p>Rice null null 54 null 0</p>
<p>Oil 44 null 14 66 66</p>
<p>Salt 5 null null null 0</p>
Find more posts tagged with
Comments
mwilliams
<p>Without a value, it'll always pull the last cell value with an actual value in it. Outside of making sure each cell has a value by adding 0 values to your data, you could use persistent global variables to store the latest value of each row and just use the grand total column to report this PGV value. There may be other ways, but this is the first that comes to mind. What is your BIRT version, I can make an example for you, if needed.</p>
lemonch
<p>Yes, if you could provide an example would be great. I have the 3.7.1 version</p>
mwilliams
<p>Take a look at this sample. There is script in the onCreate of the measure element and then script to grab the appropriate value from the PGV in the dynamic textbox in the grand total column. Hope this helps.</p>
lemonch
<p>Worked like a charm! Thank you very very much!</p>
mwilliams
<p>Great! Let us know whenever you have questions.
</p>
blueboy410
<p>Hi mwilliams,</p>
<p> </p>
<p>How do you insert the cell in the Column Area after the Level - date? Same with the cell in the Aggregation.</p>
<p>Somehow I cannot do it.. Is it my BIRT version?</p>
deepak.jyothiprakash
<p>Hi Michael ,</p>
<p> </p>
<p>is there any way to do custom aggregation in the cross tab, </p>
<p> </p>
<p>I have three Columns like Col A = -100 , Col B = 100, Col C = 200, but my total should not include Col A(no matter if its positive or negative).</p>
<p> </p>
<p>Please do help me.</p>
<p> </p>
<p>Thanks in Advance.</p>