Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
wesbrowning
Partner - Contributor III
Partner - Contributor III

How to use Today()

Hi everyone... 

I'm trying to understand how I can use the Today() function to specify day, month, year (or whatever else is available) in functions such as the one below:

=(Count({<[Date/Time Opened.autoCalendar.Year] = {'2017'}>} [Case Number]))

Instead of manually entering '2017' I want to leverage Today() (or other) to tag the current year dynamically.  Can also see uses for this in referencing # weeks or months into current year, month, day, etc...  Please let me know if this is enough info and I can add more as needed.

Thanks in advance for the great help I always receive here!!!

1 Solution

Accepted Solutions
swuehl
MVP
MVP

You can use a dollar sign expansion to replace the magic number with a dynamically created year based on today:

=(Count({<[Date/Time Opened.autoCalendar.Year] = {'$(=Year(Today()))'}>} [Case Number]))

View solution in original post

8 Replies
swuehl
MVP
MVP

You can use a dollar sign expansion to replace the magic number with a dynamically created year based on today:

=(Count({<[Date/Time Opened.autoCalendar.Year] = {'$(=Year(Today()))'}>} [Case Number]))

maxgro
MVP
MVP

try

=(Count({<[Date/Time Opened.autoCalendar.Year] = {'$(=year(today()))'}>} [Case Number]))

wesbrowning
Partner - Contributor III
Partner - Contributor III
Author

Thanks Massimo!  Your answer came in just a couple minutes behind Stefan's ... really appreciate your help.

wesbrowning
Partner - Contributor III
Partner - Contributor III
Author

Thanks Stefan... worked perfectly!

Anonymous
Not applicable

Hi everyone...

I am new using Qlik. I am trying to calculate how many days there are between today and a due date. But I don’t know how to use today (). My function is this:

=Interval({<[Date]={'$(=(Today()))'}>}, [Due Date])

Thanks in advance!!!

wesbrowning
Partner - Contributor III
Partner - Contributor III
Author

Try this:

= [Due Date] - Today()


I used similar in my app and got a list of days:

= [Service End Date] - Today()

Screenshot 2017-12-05 11.33.18.png

Anonymous
Not applicable

Thank you Wes, I've already tried it but doesn't work for me. It tells me that Today is not a valid function.

wesbrowning
Partner - Contributor III
Partner - Contributor III
Author

Hmmm...  can you create a test table (just a place to test out fields/variables) and enter Today() as a measure?  If so it should show the current date.

I'm uploading a test app created to verify this.  Feel free to import it and reference the syntax of functions.  At least it could give comparison reference to see what's different in yours.  Hope this helps!