1 Reply Latest reply on Aug 25, 2017 11:14 AM by Aaron Freed

    Create quick YTD vs prior YTD with filter

    Alex Martino

      What's the best way to create a quick YTD vs. prior YTD view (or even if it's just same period yoy comparisons)

        • 1. Re: Create quick YTD vs prior YTD with filter
          Aaron Freed

          i suggest that you create a YOUR.PARAMETER parameter with the following values:

          value     display as

          0           All Dates   

          1           YTD   

          2           YTD (YOY)   

           

          and then create a YOUR.MEASURE calculated field:

          CASE YOUR.PARAMETER

          WHEN 0 THEN 1

          WHEN 1 THEN IF DATEPART('dayofyear',YOUR.DATE) <= DATEPART('dayofyear',TODAY()) AND YEAR(YOUR.DATE) = YEAR(TODAY()) THEN 1 ELSE 0 END

          WHEN 2 THEN IF DATEPART('dayofyear',YOUR.DATE) <= DATEPART('dayofyear',TODAY()) THEN 1 ELSE 0 END

          END

           

          and then add YOUR.PARAMETER to your visual and place YOUR.MEASURE on the filter shelf with '1' as the selected value.