Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
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.