# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

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

## 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

## 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

## Re: How to use Today()

try

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

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.

New Contributor III

## Re: How to use Today()

Thanks Stefan... worked perfectly!

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

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

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.

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!