Sorry, the sheet is too complex and big to share, so I try to describe my problem.
I have this PivotTable with a field in it with two options, let's say 'yes' and 'no'.
Because of this field lot's of teams have two rows: the yes and no, because of a certain issue. And in the PivotTable I see their values as normal in those two rows. No problem (au contraire).
When I use the Get Pivotdata function, I can't get these same amounts in the report table.
I see that what comes in that table depends on how I filter the PivotTable!
When I filter the 'yes' (in the PivotTable), I see them with the GetPivotdata function and when I filter the 'no' (in the PivotTable) I see the values of the 'no'. But when I don't filter (option: all), I only get the 'yes' ones? Do I have to use some other options in the Get Pivotdata function? Or is it simply not possible to get both values in the same table?
thanks for helping and/or giving suggestion how to solve this (if it is solvable?)
Hi Frans,
I suspect your GETPIVOTDATA formula has a filter that remains for the "Yes" value, but difficult to tell without seeing the file, or at least a sample file so we can replicate your scenario.
Mynda
Yes of course I'd better make an example, but after trying again now for more than half an hour I quit.
Because of named tables, lot's of vlookups en referencing to headercells, I can't get it work in a simple sheet with only three tabs and four or five rows for an example. Sorry for now, because I really want to know if it's something that can work.
But I'm a bit in a hurry, things have to be ready in some days (first general impression already tomorrow). I think I have a work around for the moment and come back later here, when I've some time, for the real knowledge 😉
Thanks anyway for your reaction Mynda!
Maybe the error message tells you more: it gives the yellow triangle and the hoover over text is something as: "Due to move or delete there is an unvalid cel reference, or the function gives a referral error as result". When I filter the datatable, this message comes in cells depending on the filter.
Somehow I can understand that, but I don't understand that there is 1 group where this occurs also when not filtering the data.
But I can't show you in a file, only with screenshots, but don't think that'll help, does it?
One other thing I thought of (but didn't had the change to verify): can it be that I created my own trouble by first making the get pivotdata formula (which seemed to work) and after that making changes in the pivottable (i.e. addition of the yes/no field)?? (which already was part of the data of course, but maybe changes something for the get pivotdata function?).
Hi Frans,
Your last comment sounds like you're getting close to what the problem may be, which is what I suspected initially.
When you insert a GETPIVOTDATA formula Excel automatically inserts the arguments based on the fields in the PivotTable. Take this one as an example:
=GETPIVOTDATA("Order Amount",$A$4,"Order Date",1,"Years",2009)
I can tell that this formula is returning the Order Amount for the Order Date 1 and Year 2009. If I were to change the PivotTable to remove the Year field the formula would break.
If you're changing your PivotTable so that the Yes/No field is no longer present then your formula will break.
You can learn more about the GETPIVOTDATA function here.
If the above doesn't help then sharing some before and after screenshots may do.
Mynda
Think I solved the problem (at least for this case and this moment). I'll probably come back on it later (after this project ends, end of the month), because I also want to understand if this is the right way to do it.
What I changed in the pivot table: I moved the delta values to the Rowlabel part. After that I moved that 'yes/no' field to the column labels part.
That did it! The function is now working fine. Only thing now is that the Pivot Table is not 'viewable' (if that's an English word (it doesn't have the right presentation), but I can copy it for a workaround version.
Ok. When you come back to it I think you'll need to create a mock-up of the data so we can see your question in context.