6 Replies Latest reply: May 17, 2011 11:12 AM by washington alex RSS

    Weekdays

    washington alex

      Hello everyone,

       

      I'm not able to bring the sum of days in a given period.

       

      Does anyone have a solution?

       

      Here the result is 81 working days.

       

      01/2011 = 21

      02/2011 = 20

      03/2011 = 21

      04/2011 = 19

       

      Is attached hereto.

        • Weekdays

          Hi washington,

           

          the right formula is the following one:

           

          aggr(DISTINCT avg(Weekdays),months)

           

          You can use the max or min function as well.

           

          s1.JPG

           

          ..you have to change the Total Mode modifications to the following ones:

          s2.JPG

          • Weekdays
            Erich Shiino

            Hi,

            Washington. Not sure about what your problem really is.

            Do you want to automatically calculate network days and sum it?

             

            The first problem is the date in your file. It was not recognized as a date, since it was not written in your own date format ( check the sets in the beginning of the script  :SET DateFormat='DD/MM/YYYY';)

            You can adjust it at the script (recommended) or at the interface. The syntax will be like this:

            date#(months,'MMM/YY') or you can write the date in your own format.

             

            After this, you can use network days to get the number you need:

            NetWorkDays(MonthStart(months), Monthend(months))

            I used monthstart and monthend to get the first and last date of months (if it is already a real date)

             

            To make it work on a chart with the date as string (as it is now) you can use:

            NetWorkDays(MonthStart(date#(months,'MMM/YY')), Monthend(date#(months,'MMM/YY'))) )

            or even:

            SUM( NetWorkDays(MonthStart(date#(months,'MMM/YY')), Monthend(date#(months,'MMM/YY'))) )

             

            Hope it helps,

             

            Erich