Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

wesbrowning
New 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!!!

Tags (2)
1 Solution

Accepted Solutions
MVP
MVP

Re: How to use Today()

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]))

8 Replies
MVP
MVP

Re: How to use Today()

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]))

MVP
MVP

Re: How to use Today()

try

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

wesbrowning
New Contributor III

Re: How to use Today()

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

wesbrowning
New Contributor III

Re: How to use Today()

Thanks Stefan... worked perfectly!

markusvtg
New Contributor

Re: How to use Today()

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
New Contributor III

Re: How to use Today()

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

markusvtg
New Contributor

Re: How to use Today()

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
New Contributor III

Re: How to use Today()

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!

Community Browser