3 Replies Latest reply: Feb 3, 2018 1:29 PM by Ishtdeep Singh RSS

    Max and Min on work date

    Jane Wu

       

      Hi I like to use Max and Min to get the "start date" and "end date" in a networkdays function, trying to add new measure in the data.
      my date filed is [work date].
      add field:
      Field Name: Number of Workdays
      networkdays = (min([Work Date]), max([Work Date]))
      min and max are invalid function
      Please advise what is the correct syntax.

       

        • Re: Max and Min on work date
          Jahanzeb Hashmi

          networkdays (min([Work Date]), max([Work Date]))


          • Re: Max and Min on work date
            Jahanzeb Hashmi

            in script two steps to go there

            Temp:

            Load

            min([Work Date]) as MinDate,

            max([Work Date]) as MaxDate

            Resident Test;

             

             

            NowTest:

            Load *,

            NetWorkDays(peek(MinDate,0,'Temp'),Peek(MaxDate,0,'Temp')) as WD

            Resident Test;

            Drop Table Test;

            • Re: Max and Min on work date
              Ishtdeep Singh

              Please convert Work Date as Start & End Date.

              Then use - NetWorkDays([Start Date],[End Date])

               

              if you want you can specify holidays as well. Please check the below example.

               

                need to specify the holidays in networkday().

               

                 For example you want networkdays between 2006-12-18 and 2006-12-31.

               

                 If you just give this without the specific holidays you will get 10 as output.

               

                 But say you have holiday on 2006-12-25 and 2006-12-26

               

                 Then specify like this

               

                 networkdays ('2006-12-18', '2006-12-31', '2006-12-25', '2006-12-26')

               

                 and you will get answer as 8.

               

               


               

              Thanks.