Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Michael_Chappell
Contributor III
Contributor III

YESTERDAY to exclude weekends

Hi!

We have Yesterday set up as a Measure but it is currently looking at all days of the week. As a business we are closed on weekends so on a Monday we would like Yesterday to ignore Saturday and Sunday and look at Friday. Our Yesterday is currently built like this;

Script: IF( Day([Date]) = Day(Today()-1) AND
Month([Date]) = Month(Today()-1) AND
[Date] <= Today()-1, 'Y', Null() ) AS IsYESTERDAY,

Master Item: Sum( {<IsYESTERDAY = {'Y'}, InvoiceYear = {$(=Max(InvoiceYear))}>} GrossSales)

Any input would be much appreciated! 

Labels (3)
12 Replies
Michael_Chappell
Contributor III
Contributor III
Author

The data in the link looks incredibly complex and uses a lot of terminology that I'm unfamiliar with, so we'll avoid that one for the time being! 😅

How would you add a list of holidays to the FirstWorkDate function?

Or
MVP
MVP

Just type them into the formula as parameters, comma-separated, as per the documentation (note the comment about matching the format, too)

https://help.qlik.com/en-US/qlikview/May2021/Subsystems/Client/Content/QV_QlikView/Scripting/DateAnd...

 

 

Michael_Chappell
Contributor III
Contributor III
Author

Brilliant, I'll give that a go later today to exclude bank holidays for the UK - once I've built up a little more confidence I'll look into using the NetWorkDays() example you sent over earlier. As we operate in many countries  it would be beneficial to be able to exclude the bank holidays for each country, however we'll start small on this occasion. 🙂

Again, thank you so much for all your help Or, you've been fantastic! I hope you have a great day!