Forum Discussion

BlameXen's avatar
BlameXen
New Member
2 years ago

Variable Equals Selected Value in Slicer

I've been at this for a week now and it's driving me crazy ðŸ˜…

 

I have a report that shows various different charts relating to information about cases. Only "Regular Feed" cases should be shown on the report, so I have a calculated column that marks all cases reported via "Method 1" and some from "Method 2" that regard certain topics as appropriate, and a page filter to filter to just those cases.

I now need to create a slicer with three options, "Method 1", "Method 2", and "Regular Feed", that changes the way that the data is filtered. If "Method 1" or "Method 2" are chosen, it shows just cases that came from those methods (which is explicited stated in the data). If "Regular Feed" is chosen, then it'll do the calculation that I talked about earlier.

I've tried making a switch statement and use a SELECTEDVALUE to produce a Variable that returns the selected value in the slicer however it keeps returning blanks. Any clue how to achieve this differently?

5 Replies

  • BlameXen SELECTEDVALUE function will only return value if a single value is selected otherwise it will return blank.

     

    Now to answer your question, could you paste some sample data with the expected output? Make sure to paste your data in raw format as a table, not an image. 

    • BlameXen's avatar
      BlameXen
      New Member

      Ahh explains the difficulty. Below is an example of the raw data (anonymised):

      CaseIDCaseTypeCaseMethodCaseDetails
      1Type1Method1Anonymized
      2Type3Method1Anonymized
      3Type7Method1Anonymized
      4Type1Method1Anonymized
      5Type6Method1Anonymized
      6Type3Method1Anonymized
      7Type1Method1Anonymized
      8Type1Method2Anonymized
      9Type9Method1Anonymized
      10Type3Method1Anonymized
      11Type2Method1Anonymized
      12Type5Method1Anonymized
      13Type2Method1Anonymized
      14Type5Method2Anonymized
      15Type3Method2Anonymized
      16Type1Method1Anonymized
      17Type1Method1Anonymized
      18Type4Method1Anonymized
      19Type5Method1Anonymized
      20Type7Method1Anonymized


      When "Method1" is selected in the filter, I'd like it to look like:

      CaseIDCaseTypeCaseMethodCaseDetails
      1Type1Method1Anonymized
      2Type3Method1Anonymized
      3Type7Method1Anonymized
      4Type1Method1Anonymized
      5Type6Method1Anonymized
      6Type3Method1Anonymized
      7Type1Method1Anonymized
      9Type9Method1Anonymized
      10Type3Method1Anonymized
      11Type2Method1Anonymized
      12Type5Method1Anonymized
      13Type2Method1Anonymized
      16Type1Method1Anonymized
      17Type1Method1Anonymized
      18Type4Method1Anonymized
      19Type5Method1Anonymized
      20Type7Method1Anonymized


      When "Method2" is selected:

      CaseIDCaseTypeCaseMethodCaseDetails
      8Type1Method2Anonymized
      14Type5Method2Anonymized
      15Type3Method2Anonymized


      But then when "Regular Feed" is selected, only certain types with certain details are shown irregardless of Method (vague I know but it's a pretty sensitive sorting algrothim to our business):

      CaseIDCaseTypeCaseMethodCaseDetails
      3Type7Method1Anonymized
      4Type1Method1Anonymized
      5Type6Method1Anonymized
      6Type3Method1Anonymized
      7Type1Method1Anonymized
      9Type9Method1Anonymized
      10Type3Method1Anonymized
      11Type2Method1Anonymized
      12Type5Method1Anonymized
      15Type3Method2Anonymized
      16Type1Method1Anonymized
      17Type1Method1Anonymized
      18Type4Method1Anonymized
      20Type7Method1Anonymized
      15Type3Method2Anonymized
      16Type1Method1Anonymized
      17Type1Method1Anonymized
      18Type4Method1Anonymized
      19Type5Method1Anonymized
      20Type7Method1Anonymized

       

  • BlameXen create a new table for slicer (maybe you already have it) with two columns:

     

    Slicer Display Name Method Name
    Method 1 Method 1
    Method 2 Method 2
    Regular Feed Method 1
    Regular Feed Method 2

     

    Set the relationship on the "method name" with your data table, it will be many to many relationship, and change the relationship setting to "slicer table" will filter the "data table".

     

    And that's it, use the display name column in the slicer and everything should work.

    • BlameXen's avatar
      BlameXen
      New Member

      parry2k Sadly no dice, the SELECTEDVALUE still returns blanks - though I'm unsure how to change a relationship setting to "Slicer Table" so it may be that? It's currently many-to-many

  • BlameXen not sure why you need selectedvalue , it is not required anymore, on relationship windows you will change the relationship: