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

How to calculate number of weekends/holidays between two successive dates in a column

Hi Guys,

I'm kinda stuck with this problem which is like the last step to wrap up the business logic for my app.

I have to calculate time difference for a Datetime column for successive dates. For example

RequestIDStatusCreationDateDifference
1Originator

9/5/2018  12:18

-
1Processor9/10/2018 12:20Diff
1Validation9/10/2018 17:20Diff
1Closed9/12/2018  9:20Diff


Now when I take the difference for first and second date, I'll get a weekend(sat and sun) i.e. 48 hours i need to deduct from the total difference. Now this is just one example, there can be n number of weekends or holidays in between . Can anyone help me write the logic where I can get the exact number of weekends/holidays in between each two successive dates then i can just multiply it with 24 to get total hours to deduct.


Any help or suggestions will be hugely appreciated. I need to get this done to get over the line as this is quite obviously a blocker for me.


Thanks in advance.


P.S. I'm working in Qlik Sense but i guess there won't be any difference in logic in QlikView.


Pranav 

2 Replies
dplr-rn
Partner - Master III
Partner - Master III

Use above function

Date-above(Date)

The Above Function