psgoldberg
New Member
- Joined
- Jul 11, 2013
- Messages
- 38
- Office Version
- 365
- Platform
- Windows
I am new to PowerPivot and was making great progress in rethinking a large Excel model to use the techniques. Here are the existing data structures:
Major data table (1M records)
[TABLE="width: 174"]
<tbody>[TR]
[TD]Game[/TD]
[TD]Brand[/TD]
[TD]Type[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]AAA12[/TD]
[TD]a[/TD]
[TD]x[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]AAA12[/TD]
[TD]a[/TD]
[TD]y[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]AAA12[/TD]
[TD]b[/TD]
[TD]x[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]BBB12[/TD]
[TD]a[/TD]
[TD]x[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD]BBB12[/TD]
[TD]a[/TD]
[TD]y[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD]CCC13[/TD]
[TD]b[/TD]
[TD]x[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]CCC13[/TD]
[TD]a[/TD]
[TD]y[/TD]
[TD="align: right"]9[/TD]
[/TR]
</tbody>[/TABLE]
For each game there are a set of rates, one each for a given demographic. This is external data provided in the form:
[TABLE="width: 167"]
<tbody>[TR]
[TD]Game[/TD]
[TD]male[/TD]
[TD]female[/TD]
[TD]dog[/TD]
[/TR]
[TR]
[TD]AAA12[/TD]
[TD="align: right"]88[/TD]
[TD="align: right"]99[/TD]
[TD="align: right"]33[/TD]
[/TR]
[TR]
[TD]BBB12[/TD]
[TD="align: right"]22[/TD]
[TD="align: right"]11[/TD]
[TD="align: right"]33[/TD]
[/TR]
[TR]
[TD]CCC13[/TD]
[TD="align: right"]88[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]15[/TD]
[/TR]
</tbody>[/TABLE]
For a given demographic (slice selection), say "dog", I need to multiply each value for a game in the first table by the rate for that demographic in the game. Without PP, I would use an index or similar function to find the right column to use. So I would use 33 for game AAA12 and 15 for game CCC13 to multiply against each of the values in the first table. Pivoting uses these mulitplied values.
From other posts, it seems I need to normalize the data of table 2 to be like this which is straightforward:
[TABLE="width: 147"]
<tbody>[TR]
[TD]Game[/TD]
[TD]Demo[/TD]
[TD]Rate[/TD]
[/TR]
[TR]
[TD]AAA12[/TD]
[TD]male[/TD]
[TD="align: right"]88[/TD]
[/TR]
[TR]
[TD]AAA12[/TD]
[TD]female[/TD]
[TD="align: right"]99[/TD]
[/TR]
[TR]
[TD]AAA12[/TD]
[TD]dog[/TD]
[TD="align: right"]33[/TD]
[/TR]
[TR]
[TD]BBB12[/TD]
[TD]male[/TD]
[TD="align: right"]22[/TD]
[/TR]
[TR]
[TD]BBB12[/TD]
[TD]female[/TD]
[TD="align: right"]11[/TD]
[/TR]
[TR]
[TD]BBB12[/TD]
[TD]dog[/TD]
[TD="align: right"]33[/TD]
[/TR]
[TR]
[TD]CCC13[/TD]
[TD]male[/TD]
[TD="align: right"]88[/TD]
[/TR]
[TR]
[TD]CCC13[/TD]
[TD]female[/TD]
[TD="align: right"]14[/TD]
[/TR]
[TR]
[TD]CCC13[/TD]
[TD]dog[/TD]
[TD="align: right"]15[/TD]
[/TR]
</tbody>[/TABLE]
Question: How do I relate the new tables to the Game table since both have multiple (non-unique) values for Game. I'd want to filter on the demographic (at which point the second table has unique values for Game) so a simple relationship will exist.
Major data table (1M records)
[TABLE="width: 174"]
<tbody>[TR]
[TD]Game[/TD]
[TD]Brand[/TD]
[TD]Type[/TD]
[TD]Value[/TD]
[/TR]
[TR]
[TD]AAA12[/TD]
[TD]a[/TD]
[TD]x[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]AAA12[/TD]
[TD]a[/TD]
[TD]y[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]AAA12[/TD]
[TD]b[/TD]
[TD]x[/TD]
[TD="align: right"]5[/TD]
[/TR]
[TR]
[TD]BBB12[/TD]
[TD]a[/TD]
[TD]x[/TD]
[TD="align: right"]6[/TD]
[/TR]
[TR]
[TD]BBB12[/TD]
[TD]a[/TD]
[TD]y[/TD]
[TD="align: right"]7[/TD]
[/TR]
[TR]
[TD]CCC13[/TD]
[TD]b[/TD]
[TD]x[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]CCC13[/TD]
[TD]a[/TD]
[TD]y[/TD]
[TD="align: right"]9[/TD]
[/TR]
</tbody>[/TABLE]
For each game there are a set of rates, one each for a given demographic. This is external data provided in the form:
[TABLE="width: 167"]
<tbody>[TR]
[TD]Game[/TD]
[TD]male[/TD]
[TD]female[/TD]
[TD]dog[/TD]
[/TR]
[TR]
[TD]AAA12[/TD]
[TD="align: right"]88[/TD]
[TD="align: right"]99[/TD]
[TD="align: right"]33[/TD]
[/TR]
[TR]
[TD]BBB12[/TD]
[TD="align: right"]22[/TD]
[TD="align: right"]11[/TD]
[TD="align: right"]33[/TD]
[/TR]
[TR]
[TD]CCC13[/TD]
[TD="align: right"]88[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]15[/TD]
[/TR]
</tbody>[/TABLE]
For a given demographic (slice selection), say "dog", I need to multiply each value for a game in the first table by the rate for that demographic in the game. Without PP, I would use an index or similar function to find the right column to use. So I would use 33 for game AAA12 and 15 for game CCC13 to multiply against each of the values in the first table. Pivoting uses these mulitplied values.
From other posts, it seems I need to normalize the data of table 2 to be like this which is straightforward:
[TABLE="width: 147"]
<tbody>[TR]
[TD]Game[/TD]
[TD]Demo[/TD]
[TD]Rate[/TD]
[/TR]
[TR]
[TD]AAA12[/TD]
[TD]male[/TD]
[TD="align: right"]88[/TD]
[/TR]
[TR]
[TD]AAA12[/TD]
[TD]female[/TD]
[TD="align: right"]99[/TD]
[/TR]
[TR]
[TD]AAA12[/TD]
[TD]dog[/TD]
[TD="align: right"]33[/TD]
[/TR]
[TR]
[TD]BBB12[/TD]
[TD]male[/TD]
[TD="align: right"]22[/TD]
[/TR]
[TR]
[TD]BBB12[/TD]
[TD]female[/TD]
[TD="align: right"]11[/TD]
[/TR]
[TR]
[TD]BBB12[/TD]
[TD]dog[/TD]
[TD="align: right"]33[/TD]
[/TR]
[TR]
[TD]CCC13[/TD]
[TD]male[/TD]
[TD="align: right"]88[/TD]
[/TR]
[TR]
[TD]CCC13[/TD]
[TD]female[/TD]
[TD="align: right"]14[/TD]
[/TR]
[TR]
[TD]CCC13[/TD]
[TD]dog[/TD]
[TD="align: right"]15[/TD]
[/TR]
</tbody>[/TABLE]
Question: How do I relate the new tables to the Game table since both have multiple (non-unique) values for Game. I'd want to filter on the demographic (at which point the second table has unique values for Game) so a simple relationship will exist.