GetPivotData with "nested" rows

bradams

New Member
Joined
Oct 23, 2012
Messages
40
I realize there are a ton of existing posts about GetPivotData and apologies if this question has already been answered previously but I wasn't able to find it. I'm not sure what the best way to describe it is so that may be part of the problem. I can't get GetPivotData to work when I have more than one dimension (if that's the correct word). I'm working on a web analytics report and I need to show session information for thousands of different ids and I need to break down those sessions by multiple criteria. I'm trying to avoid having to create multiple copies of the pivot table. Here is a snapshot of the pivot table configuration:

(OK, the image upload didn't work but you can see the image at the link below)

https://goo.gl/photos/G79x6uRVfmcvybeG7

An ID can have sessions from multiple channels (e.g. paid search) and those channels can be on different devices (e.g. mobile phone) and those devices can be located in various regions (e.g. Europe). I can get GetPivotData to work just fine if I only have one of those dimensions displayed. However, as soon as I add a second dimension, I start getting #Ref errors. What I would like to be able to do is write a GetPivotData request like this:

=SUM(GETPIVOTDATA("sessions",'PivotTable'!$A$4,"Month of Year",C$1,"ID",$B13))

that would give me total sessions for the id in B13. Keep in mind that there are multiple rows in the pivot table for that id (Europe-Mobile-Paid, Europe-Desktop-Paid, Europe-Mobile-Direct,Asia-Tablet-Referral, etc) that need to be summed.

Then I would like to be able to write another query

=SUM(GETPIVOTDATA("sessions",'PivotTable'!$A$4,"Month of Year",C$1,"ID",$B13,"Geo","Europe"))

that only sums the sessions for that id that were in Europe but that could have been on different devices and different channels.

The pattern continues from there.

=SUM(GETPIVOTDATA("sessions",'PivotTable'!$A$4,"Month of Year",C$1,"ID",$B13,"Device","Mobile"))

=SUM(GETPIVOTDATA("sessions",'PivotTable'!$A$4,"Month of Year",C$1,"ID",$B13,"Geo","Europe","Device","Mobile"))

=SUM(GETPIVOTDATA("sessions",'PivotTable'!$A$4,"Month of Year",C$1,"ID",$B13,"Geo","Europe","Device","Mobile","Channel","Paid Search"))


Is this possible? Or do I need to create a bunch of different copies of my pivot table so there is only one dimension in the table (and use filters to limit it to specific geos, device types, channels, etc)?

Please note I've also tried putting the dimensions into columns instead of rows and had the same issues.

Thank you in advance.
 
Last edited:
I think I've figured out that it's better to forget pivot tables and do this with regular SUMIFS. A reply to another GetPivotData question on the forum gave me the idea. Thanks!
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top