Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys!
I'm new in this community and I hope to find a solution to my issue.
I have a pivot table like this
Month | A | B | X |
---|---|---|---|
1 | 10 | 0 | 0 |
2 | 5 | 2 | 8 |
3 | 20 | 1 | 4 |
where only Month is a dimension and A and X are expressions.
I want to evaluate X in this mode X(Month) = A(Month - 1) - B(Month).
Can someone explain me how to do that?
Ok,
I made a simple example too. Let me make a rewind and explain the case in more details.
The structure of my table is a little bit more complex as you can see in the attached qvw.
My goal is to evaluate the X column as the sum of A and B of the previous month only if the parameters P1 and P2 are 0.
In the qvw I'm evaluating X using set analysis but it (obviously) works only if a month is selected. I need to evaluate X with the explained rules disregarding selections on month.
In the subsequent table the final result that I must reach
Month | P1 | P2 | Key | In | Out | A | B | X |
---|---|---|---|---|---|---|---|---|
1 | 0 | 0 | A | 0 | 10 | 10 | 0 | - |
1 | 0 | 0 | B | 0 | 4 | 20 | 5 | - |
1 | 1 | 1 | A | 10 | 0 | 0 | 0 | 0 |
1 | 1 | 1 | B | 4 | 0 | 0 | 0 | 0 |
2 | 0 | 0 | A | 0 | 20 | 5 | 2 | 10 |
2 | 0 | 0 | B | 0 | 4 | 30 | 10 | 25 |
2 | 0 | 1 | A | 8 | 0 | 0 | 0 | 0 |
2 | 0 | 1 | B | 3 | 0 | 10 | 5 | 0 |
2 | 1 | 0 | A | 10 | 0 | 0 | 0 | 0 |
2 | 1 | 1 | A | 2 | 0 | 0 | 0 | 0 |
3 | 0 | 0 | B | 0 | 30 | 20 | 1 | 40 |
3 | 0 | 1 | B | 20 | 0 | 0 | 0 | 0 |
3 | 1 | 0 | B | 10 | 0 | 0 | 0 | 0 |
Thanks to all and sorry for imprecision.