Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Date Variable in Set Analysis

I load my data from a MS Access Database. One of the fields is 'Shipmentdate'. I load this field in my script like this:

date(Shipmentdate) as Shipmentdate

I also create a variable, returning the date of yesterday:

LET vYesterday = date(Today()-1);

Now, I create a table, where I use this as expression:

=sum({$<Shipmentdate={'<=$(#=vYesterday)'} >} SHP)

This returns all zero's, whilst there is definitely date on yesterday.

Please find below 2 screenshots (to show you the outcome of my scripting):


Listbox of Shipmentdate:

Listbox Shipmentdate.png


Variable Overview:

Variable Overview.png


Anybody have any idea what I'm doing wrong?

Thanks in advance for the help once again!

1 Solution

Accepted Solutions
rubenmarin

You can change the compare from '<=' to '=', or remove it:

=sum({$<Shipmentdate={'$(=vYesterday)'}>} SHP)

View solution in original post

5 Replies
rubenmarin

Hi Stefan, can you try?:

=sum({$<Shipmentdate={'<=$(=vYesterday)'}>} SHP)

amit_saini
Master III
Master III

Stefan,

Try this:

sum({$<Shipmentdate={"<=$(=vYesterday)"} >}SHP)

Thanks,

AS

Anonymous
Not applicable
Author

Ruben,

thanks for the response. However, the formula suggested returns my SHP for the entire year, not only yesterday...

rubenmarin

You can change the compare from '<=' to '=', or remove it:

=sum({$<Shipmentdate={'$(=vYesterday)'}>} SHP)

Anonymous
Not applicable
Author

Removing it did the trick indeed, thanks for the quick help!