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: 
nayanpatel
Partner - Creator
Partner - Creator

Find difference between two dates

Hi,

I want to find date difference in days between two dates say D1 and D1 i.e. (D1-D2)

But in that case Holydays and some week days should be removed and not considered.

Networkdays function not working in this case

For example

1) Find the date difference between two dates in days and remove all Mondays and holydays (Saturdays must be considered must not be removed)

2) Find the date difference between two dates in days and remove only 2nd and 4th Saturdays and holydays etc.

Thanks

1 Reply
jagan
Partner - Champion III
Partner - Champion III

Hi,

Arrive a field (flag) in your script for working days by implementing all your conditions, and then use this flag in expression like

=Sum({<DateField={'>=$(=vStartDate)<=$(=vEndDate)'} IsWorkingDay)

In the above expression where DateField is your dimension name, and IsWorkingDay is a flag which has value 0 or 1.

Hope this helps you.

Regards,

Jagan.