Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
I'm brand new to Qlik and I've tried everything I can find, but I haven't gotten this to work. I'm trying to calculate the number of days between 'today' and a fixed date. It's basically a countdown. Any and all help is greatly appreciated.
Thanks!
Allison
Hi @afuhrman ,
I might have a solution to your query.
We have Date and Time Function NetWorkDays(start_date, end_date). It counts the number of days between the mentioned Start Date and End Date.
I tried the following expression with the Text object.
=NetWorkDays(today(), makedate(2020, 12, 31))
Here, Today() will give you the today's date and it will change daily, whenever you start the tool.
and fixed date, I considered 31st December 2020, so I made the Date with MakeDate() function. It will be a fixed date in this expression.
The result of this expression is 101. Considering Today = 13th August 2020.
Hope this solution helps you with your query. Let me know if you face any issues.
Regards,
Rushika
Hi Allison,
You can use either Interval(Today()- FixedDate,'D') or Floor(Today())-Floor(FixedDate), both will work.
Let me know if not working.
Manesh Khot
maneshkhot@gmail.com
Hi Rushika,
This expression worked perfectly for work days, but we want to include all days, weekends too. I’ve tried a few different functions in place of NetWorkDays, but nothing worked. Do you have an alternate function that would include all days?
Thanks so much for your help!
Allison
Hi Manesh,
I tried both of these expressions, but it keeps telling me "error in expression" for both. I've tried a few different variations, but I can't get either to work.
Thanks for your help!
Allison
Things are actually quite simple, you need to be sure both values are in dual or integer format and simply subtract them in that case to get the number of days between. About the best I can offer to try to help further is the following Design Blog post, which also contains two links to related posts at the bottom, hopefully those will get you on the right track with things.
https://community.qlik.com/t5/Qlik-Design-Blog/The-Date-Function/ba-p/1463157
Regards,
Brett