2 Replies Latest reply on Nov 30, 2016 12:04 PM by Kate Brown

    values for specific dates - is this the best way?

    Kate Brown

      Hello – looking for some advice/feedback on how to display a value for specific dates with my data set.

       

      I’m trying to get a value return for specific dates that my end users will select from a parameter.

      If they select day they would see all the days and the individual values.

      If they select week they would see the value for the first day of the week (Sunday).

      If they select month they would see the value for the fiscal month end date (21st of each month)

      Current date is my field that contains the dates I want to display

       

      For the fiscal month end date I created this:

      IF DATEPART('day',[Current Date] ) = 21 THEN [Current Date]

      END

       

      For the Sunday of the week I created this:

      IF DATETRUNC('week',[Current Date]) = [Current Date] THEN [Current Date]

      END

       

      Because I want all the individual days to show when the day is selected I didn’t create anything.

       

      The calculated field for the parameter is:

      IF [Date Type] = 1 THEN [Current Date]

      ELSEIF [Date Type] = 2 THEN [Sunday Value]

      ELSEIF [Date Type] = 3 THEN [21st of Month]

      END

       

      The results included a null value so I right clicked on the null and excluded it.

       

      Is there a better/easier way to do this?

       

      Thanks in advance!

      Kate