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

Question on today() syntax

Good morning.

I'm struggling getting my KPI chart to automatically show data for today only.  If I set up Filters and manually select today it works, or if I hard code in today's date in the expression it works.  I've tried various ways to get today() to work but all I get is either 0, or - as the result.  This is what I have currently and it works correctly: 

count({1<[omdDeliveryDate.autoCalendar.Date] = {'9/27/2018'}>} omdPartID)

I've tried replacing the date with: {today()}.... ${=today()}....and various others but am not getting the results I need.  I don't want the users to have to select the date from the filter panes but rather have the chart update automatically each day.  What am I missing?

Thanks!

Dan

1 Solution

Accepted Solutions
marcus_sommer

Try it with: count({1<[omdDeliveryDate.autoCalendar.Date] = {'$(=today())'}>} omdPartID) and should your calendar-date have a different formatting to your default date-variable you need to wrap today() with a date(today(), 'YourFormatPattern').

- Marcus

View solution in original post

3 Replies
marcus_sommer

Try it with: count({1<[omdDeliveryDate.autoCalendar.Date] = {'$(=today())'}>} omdPartID) and should your calendar-date have a different formatting to your default date-variable you need to wrap today() with a date(today(), 'YourFormatPattern').

- Marcus

justinphamvn
Creator II
Creator II

Hi,

Try this

count({1<[omdDeliveryDate.autoCalendar.Date] = {">=$(=Date(Max([omdDeliveryDate.autoCalendar.Date])))<=$Date(=Max([omdDeliveryDate.autoCalendar.Date]))"}>} omdPartID)

Hope this helps,

Justin.

dhowland
Contributor
Contributor
Author

Thanks Marcus.

I swear I tried it that way several times.  I stripped out all my other AND clauses and it worked.  I've added the extras back in one at a time and they are all producing numbers.  They don't match what I show in my ERP system but that will just take some more trial and error to figure out the differences.  Your syntax worked however.