Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with date in Set analysis

Hello

I am new to QlikView and I have a problem with comparing dates in Set analysis.

I have a simple table from SQL CE with columns: [Date1],[Name],[Time] and I want to show in pivot table only names with today's  date.

How to do this using Today() function and Set Analysis?

TIA

15 Replies
sunny_talwar

If it is number, then try this

Sum({<[Date1]={"$(=Num(Today()))"}>} Time)

Not applicable
Author

Hi

Here is the sample. nl2.sdf is the datasource. The sample is in Polish, Czas means Time and Data1 is Date1.

Thanks for help

sunny_talwar

Try this:

Sum({<[Data1]={"$(=Date(Today(1), 'YYYY-MM-DD hh:mm:ss'))"}>} Czas)

For your attached sample you don't have Today's date in it, so I am posting the sample qvw with yesterday's date

Sum({<[Data1]={"$(=Date(Today(1)-1, 'YYYY-MM-DD hh:mm:ss'))"}>} Czas)


Capture.PNG

trdandamudi
Master II
Master II

As you do not have personal edition I am not attaching the file. As you do not have any records for today's date I did used yesterday date.Please use the below expression:

For yesterday's date:

Sum({<[date(Date#(Data1,'DD-MM-YYYY hh:mm:ss'),'DD/MM/YYY')]={"$(=Date(Today(1)-1"}>} Czas)

  OR

Sum({<[Data1]={"$(=Date(Today(1)-1, 'YYYY-MM-DD hh:mm:ss'))"}>} Czas)

For Today's date use the below expression:

Sum({<[date(Date#(Data1,'DD-MM-YYYY hh:mm:ss'),'DD/MM/YYY')]={"$(=Date(Today(1)"}>} Czas)

  OR

Sum({<[Data1]={"$(=Date(Today(1), 'YYYY-MM-DD hh:mm:ss'))"}>} Czas)

Also please note that Sunny also provided a working solution. So feel free which ever expression you want to use. Hope this helps.

Not applicable
Author

Thanks both solutions are great!

trdandamudi
Master II
Master II

Thanks for teaching us a little polish.... Happy Qliking.....