Forum Discussion

arashaga's avatar
arashaga
Icon for Helper I rankHelper I
7 years ago
Solved

Issue with Slicing data based on the columns

Hi I have a table as below. I would like to know how to use the slicer in such a way that when I pick Year 1, it would give me a barchart with ony Year1_Median, Year1_P25 and Year1_P75 and when I pick Year 5 from the slicer it would give me allthe measures for Year5 in the bar chart(lkie below). I know I may have to restructure the data but I need to know what would be the best appraoch.

Here is the table:

inst_nameYear1_MedianYear1_P25Year1_P75Year5_MedianYear5_P25Year5_P75
abc616915157869881624274839571718
abc678406027574638762836066289644
abc   755045176785939
abc5457750854116518   
abc431743894544991623075412274470
abc522724203054537597184839992076
cda      
cda   597934903568015
cda435823531047482518274274356783
wad   609485173075345
wad441744128946312   
wad511384870161766   
wad412713505345585615556008576922
  • Anonymous's avatar
    Anonymous
    7 years ago

    Try unpivoting your table through the "Query Editor". 

     

    1. Edit table

    2. Select column name "inst_name" and right click on the column header

    3. Select "Unpivot Other Columns"

     

    You'll get an "attribute" Column which will contain values such as your column headers (Year1_Median, Year1_P25, Year1_P75 etc.) and then a "Value" Column which will be the corresponding dollar amount.

     

    Hopefully that helps!

    Derek G

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Try unpivoting your table through the "Query Editor". 

     

    1. Edit table

    2. Select column name "inst_name" and right click on the column header

    3. Select "Unpivot Other Columns"

     

    You'll get an "attribute" Column which will contain values such as your column headers (Year1_Median, Year1_P25, Year1_P75 etc.) and then a "Value" Column which will be the corresponding dollar amount.

     

    Hopefully that helps!

    Derek G