15 Replies Latest reply on Jan 6, 2016 4:49 PM by mark schukas

    calculating sales by day of week

    mark schukas

      (improvements, but still not a "home run"...)

       

      i'm using (and works well - in my testing to date)

      (Report Start/End are parameters and RevenueDate is a date dimension)

      if (([Report End] >= [RevenueDate] AND [Report Start] <= [RevenueDate]))

      then {include [Calcu_Weekday] : SUM([Revenue])}

      ELSE

      null

      END

       

      in addition I would like to do a calculated field that that sums Revenue by Day of Week (Calcu_Weekday = DATENAME('weekday',[RevenueDate])...?

       

      so I modified the above to:

      if ((([Baseline End] >= [RevenueDate] AND [Baseline Start] <= [RevenueDate])

      and [DayOfWeek] = 'Sunday')) THEN {fixed [DayOfWeek] : AVG([Revenue])}

      //etc.

       

      but I get a different answer for Sunday's revenue...???

       

      thank you.