Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
danielnevitt
Creator
Creator

Date Variables (business days)

Hi,

Is it possible to to set variables showing:

1) Today() minus one business day

2) Today() minus two business days

3) Today() minus three business days

Thanks,

Daniel

1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

Try

=Firstworkdate(DATE#('12/03/2016','MM/DD/YYYY'),1)


This will minus one day to your date and move to the next business day , adding 1 day to Saturdays date and moving to Friday 2 Dec that is previous business day


=LastWorkDate(DATE#('12/03/2016','MM/DD/YYYY'),1)


This will add one day to your date and move to the next business day , adding 1 day to Saturdays date and moving to Monday 5th Dec that is next business day

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

6 Replies
vinieme12
Champion III
Champion III

Try

=Firstworkdate(DATE#('12/03/2016','MM/DD/YYYY'),1)


This will minus one day to your date and move to the next business day , adding 1 day to Saturdays date and moving to Friday 2 Dec that is previous business day


=LastWorkDate(DATE#('12/03/2016','MM/DD/YYYY'),1)


This will add one day to your date and move to the next business day , adding 1 day to Saturdays date and moving to Monday 5th Dec that is next business day

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
danielnevitt
Creator
Creator
Author

Thanks for your help

danielnevitt
Creator
Creator
Author

Hi Vineeth,

Is it possible to use the above in an expression?

I tried the following, however I received an error:

=Sum({<DTLS_PAYMENT_RECEIPT_IND={'R'},ReportDate={FirstWorkDate(DATE#(today(),'DD/MM/YYYY'),1)}>}DTLS_AMOUNT)

Regards,

Daniel

vinieme12
Champion III
Champion III

Try as below

=Sum({<DTLS_PAYMENT_RECEIPT_IND={'R'}

,ReportDate={"$(=DATE#(FirstWorkDate(today(),1),'DD/MM/YYYY')"}>}DTLS_AMOUNT)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
danielnevitt
Creator
Creator
Author

Thanks for the response Vineeth.

Unfortunately that expression does not work.  It would be much appreciated if you could investigate what the issue might be.

Thanks,

Daniel

vinieme12
Champion III
Champion III

Try evaluating

=Sum({<DTLS_PAYMENT_RECEIPT_IND={'R'}

,ReportDate={"$(=DATE(FirstWorkDate(today(),1),'DD/MM/YYYY'))"}>}DTLS_AMOUNT)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.