Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

nayanpatel
New Contributor II

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
MVP
MVP

Re: Find difference between two dates

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.

Community Browser