Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
imtiaz_ullah
Creator
Creator

Create "simple" measure expression

Hi all,

I am trialling QlikSense and am trying to create a measure which is filtered based on date.

I have a date and quantity field being returned in my dataset.

All I want to do it calculate the sum of quantity where the date is greater than today.

I can easily do this at the DB level, but would prefer to calculate it in QS.


Thanks

Immy

1 Solution

Accepted Solutions
Anonymous
Not applicable

OK, let's change a little:
sum({<Date={"$(='>=' & date(today()))"}>} quantity)

View solution in original post

6 Replies
Anonymous
Not applicable

Hi Immy,

Try something like this:

sum({<Date={">=date(today())"}>} quantity)

Regards,

Michael

imtiaz_ullah
Creator
Creator
Author

Hi Michael – almost…

It doesn’t error on the syntax now but returns 0. I know have data which is greater than today ☺

Your help is appreciated.

imtiaz_ullah
Creator
Creator
Author

Here is a snippet - any idea why QS would red underline? I am using that field happily in other areas... Thanks

Anonymous
Not applicable

OK, let's change a little:
sum({<Date={"$(='>=' & date(today()))"}>} quantity)

Anonymous
Not applicable

Well, it says that the field doesn't exist...  Check the spelling.  On the other hand, the "syntax checker" sometimes is wrong and the expressions with red lines sometimes work.  Check my latest expression, see if it helps.

imtiaz_ullah
Creator
Creator
Author

Yes, the edited version worked perfectly. Thank you.