Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi there,
I have a table with states / year / month dimensions, I need to calculate the following formula:
T = Value_Month_Year / Value_Month_PreviousYear
Example:
My first table looks like:
2014 | 2014 | 2014 | 2015 | 2015 | 2015 | |
Jan | Feb | Mar | Jan | Feb | Mar | |
State1 | 10 | 20 | 30 | 9 | 15 | 20 |
State2 | 15 | 30 | 40 | 15 | 15 | 20 |
State3 | 20 | 40 | 50 | 10 | 20 | 30 |
And I need a second table to show:
T = Value_Month_Year / Value_Month_PreviousYear
2015 | 2015 | 2015 | |
Jan | Feb | Mar | |
State1 | 0.9 | 0.75 | 0.66666667 |
State2 | 1 | 0.5 | 0.5 |
State3 | 0.5 | 0.5 | 0.6 |
For All the Years since 2010
How can I achieve this???
Thanks in advance
Berenice
what is the current expression that you are using ?
how does your date field looks ?
you could probably do something like this
sum(value)
/
sum({<month = {">=$(=(addyears(month,-1)))"}>}value)
Thanks,
I'm using this expression:
=
Avg(ActividadInd)
/
Avg({<Año = {$(=Year(AddYears(MakeDate(Año,Mes),-1)) )}, Año = >} ActividadInd)
But in my table obviously the value is divided by itself because I'm ignoring the year selected
I've attached the qv file