4 Replies Latest reply on Apr 18, 2016 12:51 PM by jagaddish reddy

    if its not a business day then add sales to next or previous day

    jagaddish reddy

      Hi All,


      Actually the requirement is 'if its Sunday then sales of sunday should add to monday and if its Saturday then its sales should added to Friday sales'. For this I have created weekdays sales calculations as " if DATEPART('weekday', [Order Date])=1 then [Sales] END " for weekday 1 similarly for remaining all weekdays i have created calculated fields.

      Then I've created a calulation as "

      if DATEPART('weekday', [Order Date])=1 then null

      ELSEIF DATEPART('weekday', [Order Date])=2 then [weekday2_sales]+[weekday1_sales]

      ELSEIF DATEPART('weekday', [Order Date])=3 then [weekday3_sales]

      ELSEIF DATEPART('weekday', [Order Date])=4 then [weekday4_sales]

      ELSEIF DATEPART('weekday', [Order Date])=5 then [weekday5_sales]

      ELSEIF DATEPART('weekday', [Order Date])=6 then [weekday6_sales]+[weekday7_sales]

      ELSEIF  DATEPART('weekday', [Order Date])=7 then null

      END "


      but I'm not getting why its showing null instead of addition.

      Please find the workbook in attachments and help me in this context