Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
jorgelardi
Contributor II
Contributor II

Set Analysis with variables

I want to use a variable in my Set Analysis.

I created the variable Tomorrow by defining it as Today () + 1

Then I use the following expression:

= Sum ({$ <delivery_date = {'$ (= Tomorrow)'}>} QuantityProduction) but I can not get consistent values

Can someone help me?

Jorge

1 Solution

Accepted Solutions
jorgelardi
Contributor II
Contributor II
Author

Thank you all !! I discovered my error. I had badly defined the variable Tomorrow in the script

View solution in original post

16 Replies
Anil_Babu_Samineni

May be this?

= Sum ({$ <delivery_date = {'$ (Tomorrow)'}>} QuantityProduction)

Remove = symbol in variable or use two $ symbol around variable

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
passionate
Specialist
Specialist

Try Using

= Sum ({$ <delivery_date = {"=$ (= Tomorrow)"}>} QuantityProduction)

vishsaggi
Champion III
Champion III

What is your date format for your delivery_date?

= Sum({< delivery_date = {"$(=Date(Tomorrow, 'Yourdeliverydateformat here')"} >} QuantityProduction) like

= Sum({< delivery_date = {"$(=Date(Tomorrow, 'MM/DD/YYYY') " } >} QuantityProduction)

jcampbell474
Creator III
Creator III

You can try this:

In the load script or variable editor:

Let Tomorrow = Date(Today(1)+1)

Expression:

=Sum ({<delivery_date = {'$(Tomorrow)'}>} QuantityProduction)

jorgelardi
Contributor II
Contributor II
Author

Thanks for your help, but it throws me a zero value

jorgelardi
Contributor II
Contributor II
Author

Thanks for your help, but while it gives me correct results for the Tomorrow variable, it gives me the same results for the variable Past Tomorrow which is incorrect

jorgelardi
Contributor II
Contributor II
Author

I throw the following error: "Error in set modifier ad hoc element list; ',' or ')' expected

jorgelardi
Contributor II
Contributor II
Author

Thanks for your help, but it throws me a zero value

jcampbell474
Creator III
Creator III

How is your date displayed?  mm/dd/yyyy ???