SOLVED

GETPIVOTDATA Relative Reference and Cascading (Linking) Slicers to Filter Students and Test Scores

Brass Contributor

Hi All,

 

I could really use some help before I go jump off a bridge. Jk.

 

The issue I am currently having it related to using relative references in the GETPIVOTDATA function and cascading slicers. I have a PivotTable set up that has a list of students and their test scores. What I would like to happen is for the user to select one student from the cascading slicer, whose parent is a slicer with which class they're in, and the student's name changes in one cell while the student's test score appears in another. I do not know if this is possible with slicers, but I was able to get it to work with data validation lists. Unfortunately, the data validation is not dependent on a parent. 

 

How it works with the data validation is I connect it to the list of students. After that, I get the scores from the PivotTable and change the absolute reference to relative by changing the name of the student to the cell in which I have the students listed. The function works well for what it's supposed to do. The issue is that it is not dependent on the parent slicer and it takes away from the interactivity of the dashboard I am working on. In addition, I am unable to search the list of students to make it more efficient for the user. Is there a way to search slicers? Can I connect another slicer that allow me to search by the first two letters of the student's name? How would I do this?

 

The other way I have done it is to use the GETPIVOTDATA function to obtain all the names in the PivotTable relative to which class they're in. After that, I set up the GETPIVOTDATA function to retrieve the test scores for each student. The absolute reference was changed to relative by connecting the formula to the cells with the names I had already retrieved. This works really well for it does. The student's name appears at the top along with the respective test score. The issue with this is that all of the other cells either turn into a 0 or a reference error since that data has been filter. Is there a workaround for this?

 

Please see the attached file. 

3 Replies
best response confirmed by Anthony Smith (Brass Contributor)
Solution

I'm not really sure what you are trying to do.

 

In your Example 2, you can use an IF to get rid of the 0s or #Refs

 

=IF(OR(A5="Grand Total",A5=""),"",A5)

=IF(OR(A5="Grand Total",A5=""),"",GETPIVOTDATA("Field1",$A$4,"Name",I4))

These will tidy up your results, it just gives you an empty cell if its not returning a score.

 

In example 1.. You can add another slicer, just add it and select class and you will have 2 slicers that work together to let you select a class and then a student. On the Name slicer right click and select Slicer Settings then tick the Hide items with no data to hide students not in whatever class wasn't selected. You could then use something like the above IFs to check if only 1 child has been selected, by seeing if A6 = Grand Total.. then show the name and score.

 

I'm not 100% sure that I understood what you were trying to do, but hopefully that helps a bit, I've attached a workbook with the above examples working.

Thank you so much! I am not entirely familiar with the OR function. I will have to look into it a bit more. 

 

Part of the reason I wanted to connect a shape or combo box is because I want the data to appear on a nicer graphic. I will probably just write the formula in a text box and format the text box so the information looks cleaner and easier to read on my dashboard. 

@Philip West I have a similar request yet I wasn't quite able to figure out how.

 

Each "ID" has 2 mark "X" at different identifier A-N. As the list (data tab) gets updated over time, I'd like to plot a matrix (matrix tab) where the filtered total count got updated as well.

 

The total identifier count is depending on three filters: Owned, Rarity and the specific identifier (only one identifier at a time, either A or B or C...). Are you able to advise what would be the tweaks I'm missing?

1 best response

Accepted Solutions
best response confirmed by Anthony Smith (Brass Contributor)
Solution

I'm not really sure what you are trying to do.

 

In your Example 2, you can use an IF to get rid of the 0s or #Refs

 

=IF(OR(A5="Grand Total",A5=""),"",A5)

=IF(OR(A5="Grand Total",A5=""),"",GETPIVOTDATA("Field1",$A$4,"Name",I4))

These will tidy up your results, it just gives you an empty cell if its not returning a score.

 

In example 1.. You can add another slicer, just add it and select class and you will have 2 slicers that work together to let you select a class and then a student. On the Name slicer right click and select Slicer Settings then tick the Hide items with no data to hide students not in whatever class wasn't selected. You could then use something like the above IFs to check if only 1 child has been selected, by seeing if A6 = Grand Total.. then show the name and score.

 

I'm not 100% sure that I understood what you were trying to do, but hopefully that helps a bit, I've attached a workbook with the above examples working.

View solution in original post