2 Replies Latest reply: Jan 12, 2012 1:47 AM by Heri Zhang RSS

    Sum Weekend and Weekday?

      Hi all,

       

      anyone know how to set summary values for weekend (saturday & sunday) and weekday (monday till friday) for every week. so i want to know summary value (for example: sales) in this this week, which I separate the summary into weekend and weekday.

       

      thanks before

        • Sum Weekend and Weekday?
          Miguel Angel Baeyens de Arce

          Hi,

           

          You can use the WeekDay() function in your script, in the same place where you have the date field, and create a new flag field

           

          If(WeekDay(DateField) > 0 AND WeekDay(DateField)<6, 1, 0) AS WorkDay

           

          To get the sales on weekends

           

          Sum({< WorkDay = {0} >} Sales)

           

          And to get the sales on normal days, same expression but 1 instead of 0

           

          Sum({< WorkDay = {1} >} Sales)

           

          Hope that helps.

           

          Miguel