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

Date compare

Hi.

 

I currently use the following to value a date field in a set analysis expression:

[Planned To Date]= {">$(=Date(Today()))"}

 

I would like to add a further day to the  {">$(=Date(Today()))"} bit ie to check if the planned to date is >= todays date +1 day.

 

Also how would I determine the number of working days from today date and the planned to date. ie if the planned to date was the 7/3/2019 and todays date was 11/3/2019 it would be two working days (Thursday and Friday)

 

 

 

Thanks

Del

5 Replies
daanciorea
Partner - Contributor III
Partner - Contributor III

Hi Del,
You can use this expresion {">$(=Date(Today()+1))"} .
And for your seond question, you can use the following expresion:
https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Scripting/DateAndTimeFun...


Dan.
delbooth
Contributor II
Contributor II
Author

Thanks.

 

i have tried 

 

count( distinct(if(NetWorkDays([Planned To Date],today(),ListOfHolydays)>1)[Collection Number]) )

 

To determine the number of distinct collection numbers that have more than 1 working day between the planned to date and today date, but it does not seem to work.

 

Any thoughts

 

daanciorea
Partner - Contributor III
Partner - Contributor III

Try this
if(NetWorkDays([Planned To Date],today(),ListOfHolydays)>1, count(distinct [Collection Number])
delbooth
Contributor II
Contributor II
Author

Thanks, it seems to be giving me an error, does the >1 need to be in quotes 

daanciorea
Partner - Contributor III
Partner - Contributor III

what is 'ListOfHolydays'?
The argument that the funciton takes is a list of dates, for example:
NetWorkDays('1/1/2019', '1/2/2019', '1/1/2019', '7/1/2019') where '1/1/2019', '7/1/2019' are holidays.
Please, explain me what do you have to do? What tipe of chart?
If you can give me an example of your data I try to help you.