on 01-01-2015 7:38 PM
I have this model with year-month (attributes) in the rows and KPIs (measures) in the columns. A simple tabular display of the content thereby obviously shows the KPI-values / month (and other attributes).
What is missing - and which I cannot figure how to do - is how to create columns showing the KPI-values / previous month (i.e. month - 1). To clarify the result would thereby look like this:
Sales Prev Sales
January 2014 100 160
February 2014 105 100
March 2014 110 105
...
I figure it must actually be pretty easy using restricted and/or calculated columns, but just cannot figure out how to do it (maybe I ate too much for x-mas). I much appreciate hints.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why don't you use window functions (e.h. LEAD/LAG) to access the prior/following row?
For your scenario, you could also use a self-join.
Shouldn't be too difficult for you to find a fitting solution.
- Lars
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.