GetPivotData - floating reference - on PowerPivot

casper

New member
Joined
May 21, 2015
Messages
1
Reaction score
0
Points
0
Hello All,
I have recently started on PowerPivot and love it.

I am trying to do 'GETPIVOTDATA' function from it though and got confused by the following. (Note that I purposely did not want to use CUBEVALUE).
I am trying to GETPIVOTDATA from pivot table similar like below. I'm trying to make it floating reference, so I wanted to replace the year and month with cell reference; (highlighted in red) below.
I have found out that I'm supposed to do ["&...&"] but I'm not sure what the . between 2014 (2.014) refers to, and the . between month 12 (1.2) refers to. Also, not sure why it gives me the E3 and E1 reference eventhough it refers to nothing in my power pivot.

Any help would be greatly appreciated.
Note that this pivot table is obtained from data which is linked to sql connection instead of table; hence may be the reason it says [Query] instead of
.
Thanks!
GETPIVOTDATA("[Measures].[Sum of salesvalue]",$B$5,"[Query].[Year]","[Query].[Year].&[2.014E3]","[Query].[Month]","[Query].[Month].&[1.E1]")
GETPIVOTDATA("[Measures].[Sum of salesvalue]",$B$5,"[Query].[Year]","[Query].[Year].&[2.014E3]","[Query].[Month]","[Query].[Month].&[1.2E1]")

Example of pivot table:
Sum of salesvalueColumn Labels
2014
Row Labels112
Product A$100$908
Product B$67$605
 
Hi Casper,


The getpivotdata response to me request was as follows:


=getpivotdata(“[Measures].[Actual],TB_Pivots!$G$421,”[Subj Hierarchy].[TB Activity L1]” ,”[Subj Hierarchy].[TB Activity L1].&[Education and Training]”)


The data field
“[Measures].[Actual]” was changed to “[Measures].[“ & C$11 & “]” in which Actual was typed into cell C11.


Pivot table
TB_Pivots!$G$421 is the worksheet and first cell of the pivot table. Note it’s anchored.


Field 1
”[Subj Hierarchy].[TB Activity L1]” is the query and the field within that query to be searched.


Item 1
”[Subj Hierarchy].[TB Activity L1].&[Education and Training]” to ,”[Subj Hierarchy].[TB Activity L1].&[“ & $B13 & “]”


The anchoring allowed me to copy and paste to other cells to ensure the correct values were returned.


Regards
Mike
 
Back
Top