*UPDATE based on ksp's answer (thank you very much for that, it was almost what I was looking for.)
Can somebody help me with the following problem.
Given the data table:
Key Rec Period DOW Category Value
Key1 Rec1 Period1 dow1 KPIa x1
Key1 Rec2 Period1 dow1 KPIb z1
Key1 Rec3 Period2 dow1 KPIa y1
Key2 Rec4 Period1 dow1 KPIa x1
Key2 Rec5 Period1 dow1 KPIb z1
Key2 Rec6 Period2 dow1 KPIa y1
Key1 Rec7 Period1 dow2 KPIa x2
Key1 Rec8 Period1 dow2 KPIb z2
Key1 Rec9 Period2 dow2 KPIa y2
Key2 Rec10 Period1 dow2 KPIa x2
Key2 Rec11 Period1 dow2 KPIb z2
Key2 Rec12 Period2 dow2 KPIa y2
Key1 Rec13 Period1 dow1 Delta d1
Key1 Rec14 Period1 dow2 Delta d2
Key2 Rec15 Period1 dow1 Delta d3
Key2 Rec16 Period1 dow2 Delta d4
In Spotfire, it is possible to create the following cross table:
Avg(KPIa) Avg(KPIb) Delta
Period1 Period2 Period1 Period1
dow1 dow2 dow1 dow2 dow1 dow2 dow1 dow2
Key1 x1 x2 y1 y2 z1 z2 d1 d2
Key2 x1 y1 y2 z1 z2 d3 d4
Now there is something I would want to change in this cross table but I can’t manage to figure out how:
Delta is a column which is only valid for Period1. Is it possible to apply the extra Period and DOW level only to certain columns of the cross table?
So what I want is:
Avg(KPIa) Avg(KPIb) Delta
Period1 Period2 Period1
dow1 dow2 dow1 dow2 dow1 dow2
Key1 x1 x2 y1 y2 z1 z2 (d1 + d2) / 2
Key2 x1 y1 y2 z1 z2 (d3 + d4) / 2
And when the dow2 is filtered out:
Avg(KPIa) Avg(KPIb) Delta
Period1 Period2 Period1
dow1 dow1 dow1
Key1 x1 y1 z1 d1
Key2 x1 y1 z1 d3
Thanks in advance.
@ user6076025 - Please check this solution and let me know if this helps.
I have considered X as 1, Y as 2 and Z as 3 for computation purpose.
I have unpivoted your data which is there in the first screenshot of your post and then created a cross table from the unpivoted data.
Attached are the screenshots for your reference.