Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
siepe1990
Contributor III
Contributor III

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

siepe1990
Contributor III
Contributor III
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)

siepe1990
Contributor III
Contributor III
Author

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