Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis with today()

Hello all,

I am trying to return the widgets_purchsed for yesterday, but am getting errors. Can someone point me in the right direction?

=Count( {1<SESSION_START_TIME = {$(=Date(Today()-1, 'MM/DD/YYYY'))}>} widgets_purchsed )

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Does SESSION_START_TIME contain a time portion? If so, it will (almost) never be equal to Today(). The best solution is to split the time portion out from the date to create a proper date field during the load:

     LOAD

          ...

          Date(Floor(SESSION_START_TIME)), 'MM/DD/YYYY') As SESSION_START_DATE,

          Time(Frac(SESSION_START_TIME)) As SESSION_START_TIME,   // if you need the time portion

          ...

Now use  SESSION_START_DATE in your set expression.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

3 Replies
PrashantSangle

Hi,

Try with ""

like

=Count({<SESSION_START_TIME = {"$(=Date(Today()-1, 'MM/DD/YYYY'))"}>} widgets_purchsed )

Check your Session_start_Time format.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Does SESSION_START_TIME contain a time portion? If so, it will (almost) never be equal to Today(). The best solution is to split the time portion out from the date to create a proper date field during the load:

     LOAD

          ...

          Date(Floor(SESSION_START_TIME)), 'MM/DD/YYYY') As SESSION_START_DATE,

          Time(Frac(SESSION_START_TIME)) As SESSION_START_TIME,   // if you need the time portion

          ...

Now use  SESSION_START_DATE in your set expression.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Thanks!