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: 
Anonymous
Not applicable

Set Analysis With Date Ranges

Good Day All,

Having some difficulty here.  I am looking for a calculation within two dates.

vToday = date(Today())

vWeekAhead = date(Today()+8)

My set analysis formula is the below :

=Sum({<ReqShipDate = {">= $(vToday) <= $(vWeekAhead)"}>}MStockUnitMass*MOrderQty

When I use this formula in a chart i can see that the result is what I want :

=Sum({<ReqShipDate = {">= 2018/03/12 <= 2018/03/20"}>}MStockUnitMass*MOrderQty

But for some reason the calculation isn't correct, it doesn't show any data, although there really is data available.  I've tried some of the below solutions.  none worked.

=Sum({<ReqShipDate = {'>= $(vToday) <= $(vWeekAhead)'}>}MStockUnitMass*MOrderQty

=Sum({<ReqShipDate = {'>= $(=vToday) <= $(=vWeekAhead)'}>}MStockUnitMass*MOrderQty

Please assist.

Regards,

5 Replies
tresesco
MVP
MVP

Make sure that your ReqShipDate is a proper date(dual) field  and format and the comparison date format are same, i.e. - YYYY/MM/DD

Anonymous
Not applicable
Author

I did, the Reqshipdate is in the format YYYY/MM/DD

I have adapted the variables to also be the same format.  Still didn't work, I did however notice now that if I changed the formula to =Sum({<ReqShipDate = {"= $(vToday)"}>}MStockUnitMass*MOrderQtyJust as a test, it works, as soon as I add the greater than ">" things don't work.

tresesco
MVP
MVP

Could you post a sample app to investigate?

Anonymous
Not applicable
Author

Just reloaded the data and it worked.

Not sure what the issue was but the formula posted originally was correct.

Thanks for the help.

shiveshsingh
Master
Master

Please close the thread