Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have data like in below table for a selected country.
Yer_Qtr | data | Growth |
2011Q2 | 101 | |
2011Q3 | 102 | |
2011Q4 | 103 | |
2012Q1 | 104 | |
2012Q2 | 105 | |
2012Q3 | 106 | 1.039216 |
2012Q4 | 107 | 1.038835 |
2013Q1 | 108 | 1.038462 |
2013Q2 | 109 | 1.038095 |
I have to display the Year_Qtr and Growth in bar chart. I have to calculate Growth field in expression. The logic to calculate growth is:
For the Yer_Qtr 2013Q2= Growth is Data for 2013Q2 / Growth is Data for 2012Q2.
Like that I have to calculate growth for 2013Q2 to 2012Q3.
Is there any way to write one expression which will calculate growth for current year quarter till the last year quarter like we are doing in the above table from 2013Q2 to 2012Q3.
Thanks
I think the easiest way is to create an AsOf table in the script. That table contains records like this:
AsOfQuarter, Quarter, Type
2013Q2, 2013Q2, Current
2013Q2, 2012Q2, LastYear
2013Q1, 2013Q1, Current
2013Q1, 2012Q1, LastYear
...etc
You can then use AsOfQuarter as dimension in your chart and the expression sum({<Type={'LastYear'}>}data)/sum({<Type={'Current'}>}data).
Hi Gysbert,
I have created the table as u have suggested. But the expression you have given will give me always 1 as output because the dimension will be same for condition Type = Last year and Type = Current.
Do we need to write some condition in set modifier for Quarter field also?. I am trying to write the condition for Quarter field in set modifier but I am wrong some where.
What is yoour suggestion.
Thanks
Rajneesh