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: 
ashis
Creator III
Creator III

Networkdays function does not returning syntax error in load script

Hi,

In my data set i have only one date column . I am creating one composite key (concatenating  few columns ) as

distintct xx &'-'&  yy &'-'&  zz as key

in the fact table.

then creating one  table to calculate day difference 

temp:

load

key,

min(date),

max(date),

NetWorkDays(DATE(MAX(DATE),'DD/MM/YYYY'),DATE(MIN(DATE),'DD/MM/YYYY')

resident table1;

when loading this script , i am getting syntax error . I have tried this  NetWorkDays(max(date),min(date)) but same error. 

In the front end i have created a chart and used the above formula as expression , however it does not gives any error but is giving wrong number e.g max(date) =12-02-2019 and min (date) = 12-02-2019 , return same and networkdays return =1 .

Could you please help me where i am doing wrong.

10 Replies
Vegar
MVP
MVP

Regarding your interval question regarding Interval(Date(LASTDATE,'DD/MM/YYYY')
- Date(STARTDATE,'DD/MM/YYYY'),'D')

Date(LASTDATE,'DD/MM/YYYY') and Date(LASTDATE,'DD/MM/YYYY') should be
thought on as a number.
If both LASTDATE and STARDATE are 24/04/2019 then each of your Date()
expression equals to 43579.

Giving you the intervalexpression below:

Interval(43579 - 43579 ,'D') = Interval(0 ,'D') = 0