Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have my data set like this
Vendor | Quarter | Current quarter |
Market | Q3 2013 | 100 |
Market | Q2 2013 | 200 |
Market | Q1 2013 | 300 |
Market | Q4 2013 | 100 |
Market | Q3 2013 | 200 |
Market | Q2 2013 | 300 |
Market | Q1 2013 | 100 |
Market | Q4 2013 | 200 |
I want new variable "Growth" so that , growth of Q4 will be calculated from Current quater. and like wise for other quaters as well..
for ex. growth= q4/q3-1
If you want this calculation to happen at back end then you have to add a group by to the table to group data at quarter level and sort it in ascending order then use previous function to calculate it as a Field.
If you want the same in variable you will have to do group by and capture the details to a varialbe with peek function.
But the simplest way should be to do it in the front end like sum({<Quarter={'current_quarter'}>}sales)/sum({<Quarter={'previous_quarter'}>}sales). -1
can you explain why you want it in a variable?
-Sundar
I need a separate variable ...doing it for the ease of use to see the growth rate.
I didn't get your 1st two lines....can you show what are you trying to say?
I am new to this.
PFA the sample. It shows the exaple where the requirement is handled in script.
But it is better to be calcualted in the front end like (in a text box)
=(sum({<Quarter={'2015 Q4'}>}sales)/sum({<Quarter={'2015 Q3'}>}sales))-1
-Sundar