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)
Calculate percentage change between 2 values in crosstab
abhipillai
Dear friends,
I have a crosstab report designed in birt 2.5.1 which has the count for applications over a particular quarter and year for a client.I have calculated average in this report. I would also like to include an additional coulmn called "% change" which calculates the change in percentage from one year over another year.
say in 2009, count is 2000 and in 2010, count is 2500. So percentage change is (2500 - 2000)/2500 * 100 which i need to show besides avg column. So percentage change for 2010 is 20%. For year 2009 it should compare with 2008 and show accordingly.
I have attached the image of the report. Any help would be greatly appreciated.
Find more posts tagged with
Comments
mwilliams
Hi abhipillai,
I don't see an image attached. Something must've messed up there. I think I know what you're looking for though. You could include a derived column by clicking on the icon next to the crosstab measure and choose to add a derived column. You can store the previous value in a persistentGlobalVariable that is named by the row dimension value so that you are sure to recall the correct "last year" value.
Hope this helps.
abhipillai
Hello Michael,
Thanks for the response.I think i missed the screenshot. I have attached it again here
mwilliams
Abhilash,
If you will only have 2 quarters that you want to find the %change between, you can just do what I said above saving the first value in the PGV named after the row dimensions, then recall that value in your second quarter, do your computation, store it in the PGV, then use a grid in the grand total column, put the grand total in the first grid cell and the %change in the second. That should do it. Let me know if you have questions or need a simple example to get started.
abhipillai
Hello Michael,
Sorry for the late reply. I solved this problem a few weeks back. Didnt log in to the forum since then. I just had to add a few scripts to the report to calculate the percentage change. Thanks for the timely responses.
Regards
Abhilash
mwilliams
Not a problem. Glad you found a solution. Let us know whenever you have questions!
John F
<p>Hey Michael,</p><p> </p><p>I have a related question - instead of doing a side by side percentage, I am comparing year-over-year row values as a percentage in the bottom YOY column. Easy way to do this?</p><p> </p><p>Many thanks!</p><p>John</p><p> </p><p> JAN FEB</p><p>2013 100, 200</p><p>2014 120, 202</p><p>YOY 20%, 1%</p>
mwilliams
Yeah. That shouldn't be too difficult. What is your BIRT version? I'll throw something together.
John F
<p>Hi Michael - I am using iHub3 and the RDP 4.2.3 tool.</p><p> </p><p>Thanks for your help..</p><p>John</p>
Sai krishna
<blockquote class="ipsBlockquote" data-author="mwilliams" data-cid="127201" data-time="1396971548">
<div>
<p>Yeah. That shouldn't be too difficult. What is your BIRT version? I'll throw something together.</p>
</div>
</blockquote>
<p>Hi <span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">Michael ,</span></p>
<p> </p>
<p><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">I too have that similar doubt. Could you please attach any sample report or any other way as you like. </span></p>
<p> </p>
<p><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">Thanks,</span></p>
<p><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">Sai</span></p>
Sai krishna
<blockquote class="ipsBlockquote" data-author="John F" data-cid="127142" data-time="1396563604">
<div>
<p>Hey Michael,</p>
<p> </p>
<p>I have a related question - instead of doing a side by side percentage, I am comparing year-over-year row values as a percentage in the bottom YOY column. Easy way to do this?</p>
<p> </p>
<p>Many thanks!</p>
<p>John</p>
<p> </p>
<p> JAN FEB</p>
<p>2013 100, 200</p>
<p>2014 120, 202</p>
<p>YOY 20%, 1%</p>
</div>
</blockquote>
<p><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">Hi John, </span></p>
<p> </p>
<p><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">Did you found any solution for your above question!!. If so could you please explain the logic there. I am new to BIRT.</span></p>
<p> </p>
<p><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">Thanks a lot in advance,</span></p>
<p><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">Sai</span></p>
sbijrlee
<p>Hi<span style="font-size:14px;">,</span></p>
<p> </p>
<p><span style="font-size:14px;">Good day, I am new to Birt report. I have problem with crosstab in Birt report. I need to calculate the % of change between years. I need to compare the sales in 2014, 2013 and calculate the % of change in crosstab and same goes to 2015, 2014. Could anyone guide me on how to do this? </span></p>
<p><span style="font-size:14px;">I have attached a screenshot on the sample report as below.</span></p>
<p> </p>
<p><span style="font-size:14px;">