4 Replies Latest reply on Jul 25, 2016 6:47 AM by Luciano Vasconcelos

    Issue

    pren.su

      I require filters to change with refresh

        • 1. Re: Dynamic Default Filter
          Luciano Vasconcelos

          Maybe using an expression but i'm not sure:

           

          DATEPART('quarter',Today() ) will result in 1,2,3,or 4

           

          If DATEPART('quarter',Today() )  = DATEPART('quarter',your date field )  then 1

          Else 2

          End

           

          Use it to classify and it will be no possible to use the all values option.

          • 2. Re: Dynamic Default Filter
            Derrick Austin

            Hey Renn,

             

            You can't choose dynamically set the selected value in a filter, but you could do some magic with a parameter.

             

            Put "Current Quarter" in a parameter, and then Q1, Q2, Q3, and Q4.

            Select "Current Quarter" and then create a calculated field like this to use as a filter:

             

            IF [Selected Quarter] = 'Current Quarter'

                 IF DATEPART('quarter', [Order Date]) = DATEPART('quarter', TODAY())

                      THEN 1

                 ELSE 0

                 END

            ELSE

                 IF 'Q' + STR(DATEPART('quarter', [Order Date])) = [Selected Quarter]

                      THEN 1

                 ELSE 0

                 END

            END

            • 3. Re: Dynamic Default Filter
              pren.su

              Thanks, Luciano. I will try out this method. One thing I forgot to mention is that the filter is actually a combined year and quarter filter, so it is not just 1,2,3 or 4... Rather 2014 Q1, 2014 Q2,.. And so on. How can this be accommodated in the logic? Thanks!

              • 4. Re: Dynamic Default Filter
                Luciano Vasconcelos

                Did it work?