Qlik Community

Ask a Question

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
QlikWorld starts MONDAY! last chance to register is now ! REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Edvin
Creator
Creator

Counting days between two dates, but wrong answer, when the dates are the same day

Hello all,

Got a problem. I'm counting days between two dates, I need to count how many network days are between the lowest date and the second to the lowest, grouped by ID.

The example:

IDCompany nameProcessSend date
2415976JMASENT2020.06.11
2415976LDNOT2020.06.11
2415976JMASENT2020.07.09
2415976LDNOT2020.07.09
2415976JMASENT2020.07.10
2415976LDDONE2020.07.10

 

My measure expression looks like this:

avg(networkdays(aggr(min([Send date]),[ID]),aggr(min([Send date],2),[ID])))

Now, somehow it skips the second date, which is equal to the 1st one '2020.06.11', and brings the result 21, which is between '2020.07.09' and '2020.06.11'

The outcome should look like this:

IDNetWorkDaysBetween
24159760

 

Thanks for the help!

20 Replies
Edvin
Creator
Creator
Author

Never knew you can accept several answers as solution 🙂