Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Make your voice heard! Participate in the 2020 Wisdom of Crowds® Survey. BEGIN SURVEY
Highlighted
Not applicable

script for work days without year

Hi guys,

i have 2 fields : DAY MONTH

i need to calculate working days without YEAR

i.e. 09/02 i need to know number of working days from 01/01

I tried to use function nextworkingdays() but it doesn't work without a complete date filed(mm/dd/yyyy)

Can u help me pls?

6 Replies
Highlighted
Partner
Partner

Re: script for work days without year

Hi, the function working day needs the year because he works with this parameter.

it calculated the laboral day from each month depends of the year.

if you dont put the year, the function doesnt know what have to calculated, and the result will be incorrect

Fernando

Highlighted
MVP
MVP

Re: script for work days without year

You don't know the year for your DAY MONTH values? Then I think you can't calculate the working days between two DAY MONTH combinations.

If you know the year, but it's just not available in your source data, you can create complete dates in networkdays() function, like

=networkdays(makedate(2014), makedate(2014,MONTH,DAY) )

Highlighted
Not applicable

Re: script for work days without year

ty for answer

is it possibile know the number of day in a year without the year information?

i.e. 01/02 is day number 2

tyvm

Highlighted
MVP
MVP

Re: script for work days without year

What about leap years?

If you don't care, you can try

=makedate(2014, MONTH, DAY) - makedate(2014) +1

to get the date number,

or a little shorter:

DayNumberOfYear(makedate(2014, MONTH, DAY) )

Highlighted
Not applicable

Re: script for work days without year

it's not a problem, cause i need jurst a average value of woking days

So if i can calculate the day number of year without year i can  resolve my problem

tyvm

Highlighted
mov
Esteemed Contributor III

Re: script for work days without year

If you want an approximate number, you can use an assumption that five of each seven days are working days.  In this case, using Stefan's expression:

=DayNumberOfYear(makedate(2014, MONTH, DAY) ) *5/7