2 Replies Latest reply on Aug 25, 2016 3:47 PM by Yuriy Fal

    Filter chart labels based on one or more selected years

    kevin knorpp

      Hey guys

       

      Here is a code snippet where I am setting a value of the field I am using for the label of a chart...

       

      if      (

              attr([DisplayCategory]) = "2014 Final"

              and [showLabel] = 'All'

              )

              or

              (

              attr([DisplayCategory]) = "2015 Final"

              and     (

                      [showLabel] = 'All'

                      or

                      [showLabel] = '2016 and 2015'

                      )

              )

      then [THRESHOLD]

      .

      .

      .

       

      ... and [showLabel] is a parameter that the user can set according to what he or she wants to see.  So, since parameters can have only a single value, I included the most obvious choices of 'All', '2016 and 2015', and '2016 only'.  The data set includes data from 2014, 2015 and 2016 and currently there is no way to see 2014 or 2015 labels only unless I add more combinations which gets messy.

       

      One idea I had is to have a separate Boolean parameter for each year which would meet the mission but would not look as good as a single selection.  The reason I am posting here is because I remember seeing somewhere that people are using filters instead of parameters in some cases but I don't remember why so I wondered if there might be some way to use a filter in my case.  The problem is that I am not filtering data with the parameter I am using but am merely determining whether a label displays.  So that method may not apply in this case but thought it was worth asking just in case and also in case anyone can think of another workaround as an alternative to having a Boolean parameter switch for every year which is rather ugly and will grow in ugliness as years are added.

       

      Many thanks in advance