Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

siepe1990
New 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

Re: Date Variable in Set Analysis

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

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

5 Replies

Re: Date Variable in Set Analysis

Hi Stefan, can you try?:

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

amit_saini
Honored Contributor III

Re: Date Variable in Set Analysis

Stefan,

Try this:

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

Thanks,

AS

Highlighted
siepe1990
New Contributor III

Re: Date Variable in Set Analysis

Ruben,

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

Re: Date Variable in Set Analysis

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

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

siepe1990
New Contributor III

Re: Date Variable in Set Analysis

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