Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Max and Min on work date

 

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.

 

3 Replies
zebhashmi
Specialist
Specialist

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


zebhashmi
Specialist
Specialist

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;

isingh30
Specialist
Specialist

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.