2 Replies Latest reply on Sep 14, 2018 6:00 AM by Stephen Groff

    Day, Week, Month - Filter for View

    Stephen Groff

      I've put in a date filter on my dashboard, one that we all recognize:

       

       

      However, my boss wants the view to change based on the selection on the date filter.

       

      For example, when filtering for "this year", the view automatically shows the below image, which he likes.

      However, when he chooses something like

       

      He wants to actually see the view in weeks... not in months (view below)

       

      This is because my view is dictated by my [DATE] on the columns shelf

       

      What kind of a calculation would I write to control this dimension:

      Parameter:

      View by Day

      View by Week

      View by Month

       

      Calc:

      IF [view by].[parameters]="View by Day" THEN....????

       

      Or could I write a calculation based on the DATE filter already added and add that calc to the columns shelf?

        • 1. Re: Day, Week, Month - Filter for View
          Alexander Dawson

          I think you're on the right track but I'm not sure if this can be done in a single step.

           

          At the least you'd need a filter on Master Date for the date period.  Standard out-of-the-box one works fine.  However don't display it.

           

           

          Create a parameter like "Date Granularity"  This will include a list of text values:  day, month, year etc.

           

          Create a date calculation which is dynamic based on "Date Granularity"

          A case statement would give you a bit more control, but you can get away with what's in comments if "Date Granularity" exactly matches the first Datetrunc parameter.

           

          On your Viz display "Display Master Date", not the "Master Date" from your query.

          • 2. Re: Day, Week, Month - Filter for View
            Stephen Groff

            If we were in the movie "Stand By Me" I'd give you some skin.  Rad.