Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

janwuqlik
New Contributor

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
Valued Contributor

Re: Max and Min on work date

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


zebhashmi
Valued Contributor

Re: Max and Min on work date

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
Contributor III

Re: Max and Min on work date

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.