Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

statement syntax

hi i have the following statement

If(isNull(%DatXX_Ölev_KO)),%Dat1 - %Dat2,%Dat1 - %Dat3) as DayAmount;

what i would like to do with this statement is add the function networkingdays for the two condtions,

ie %Dat1 - %Dat2 and

%Dat1 - %Dat3

i tried the following

If(networkingdays(isNull(%DatXX_Ölev_KO))),%Dat1 - %Dat2,%Dat1 - %Dat3) as DayAmount;

this however without success.

any help is greatly appreciated

best

Brad

1 Solution

Accepted Solutions
swuehl
MVP
MVP

First, both expressions seem to have unbalanced number of opening and closing round brackets, please recheck.

The syntax of networkdays() function is

networkdays (start:date, end_date {, holiday})

Returns the number of working days (Monday-Friday) between and including start_date and end_date taking into account any optionally listed holidays. All parameters should be valid dates or timestamps.

So you need to state at least two arguments (start date, end date). I think your end date is %dat1 and your start date either %Dat2 or %Dat3 (maybe the other way round, I assume your difference calculation should end up in a positive number so it should be later date - earlier date.

So try

networkdays( if(isnull(%DatXX_Ölev_KO), %Dat2, %Dat3), %Dat1 ) as NetworkDays

View solution in original post

1 Reply
swuehl
MVP
MVP

First, both expressions seem to have unbalanced number of opening and closing round brackets, please recheck.

The syntax of networkdays() function is

networkdays (start:date, end_date {, holiday})

Returns the number of working days (Monday-Friday) between and including start_date and end_date taking into account any optionally listed holidays. All parameters should be valid dates or timestamps.

So you need to state at least two arguments (start date, end date). I think your end date is %dat1 and your start date either %Dat2 or %Dat3 (maybe the other way round, I assume your difference calculation should end up in a positive number so it should be later date - earlier date.

So try

networkdays( if(isnull(%DatXX_Ölev_KO), %Dat2, %Dat3), %Dat1 ) as NetworkDays