3 Replies Latest reply on Dec 10, 2013 4:12 AM by lijin dev

    How to create calculated field that excludes multiple labels at the same time

    keren.abina-sotomayor

      Hello,

       

      I have a dimension with multiple labels. I want to either create a new dimension (parameter?) or filter using the following criteria:

       

      1. keep if the dimension [TypeDescription] starts with "class"

      2. exclude if the dimension [TypeDescription] contains any of the following words: YAIP, Lifeskills, WorkReadiness, Roster, Arrival, Arches, etc.

       

      What would that logic statement look like?

       

      Thank you for your help!!

        • 1. Re: How to create calculated field that excludes multiple labels at the same time
          Ashley Howard

          As I understand your request I think the best and most simple option would be to create a new calculation, drop on your filter shelf, and filter accordingly.

           

          If Startswith([typeDescription], "class")=TRUE then "Keep"

          Elseif Contains([TypeDescription], "YAIP")=TRUE then "Exclude"

          Elseif Contains([TypeDescription], "Lifeskills")=TRUE then "Exclude"

          Elseif Contains([TypeDescription], "WorkReadiness")=TRUE then "Exclude"

          Elseif Contains([TypeDescription], "Roster")=TRUE then "Exclude"

          Elseif Contains([TypeDescription], "Arrival")=TRUE then "Exclude"

          Elseif Contains([TypeDescription], "Arches")=TRUE then "Exclude"

          Elseif Contains([TypeDescription], "etc...")=TRUE then "Exclude"

          Else "Keep"

          End

           

          Note, depending on where you place the starts with "Class" statement, it will control the order in which it filters. In this case, starting with "Class" superceeds excluding it for any of the other variables.  If you want to exclude an entry for one of the words regardless of if it starts with "Class", you'd move the statement before startswith().

           

          Ashley

          • 2. Re: How to create calculated field that excludes multiple labels at the same time
            keren.abina-sotomayor

            This is exactly what I needed!  And your note on ordering was needed too.

             

            THANKS!!

            • 3. Re: How to create calculated field that excludes multiple labels at the same time
              lijin dev

              Hi  Ashley,

               

              Just need to know  what can be done if the same need comes in the case of a metric.

               

              I have one chart which  shows the Quarter to date (QTD) alone with the target for the quarter as a reference line.


              As a filter is enabled to select the end date ,  my target is also restricted to that particular date from the QTD starting. My need is to actually exclude the Target metric from the filter .  Is it possible ?

               

              please help

               

               

              Thanks

              lijin