Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using variable in Set Analysis

Hi There,

I am trying to use a variable (declared in the settings not in the load script) in a set analysis but it just does not want to work. Probably I am doing something wrong but I tried already couple of things like single, double quotations. = within the evaluation. Nothing works.

I need to get back data which is less than the value of the variable, but seems within the set analysis the bigger (>), smaller (<) operators just ignored. It gives me back all the results.

Would be happy with any suggestion.

Set Analysis

=COUNT({<[Renewal Month Relative]= {'-1'}, [Current Free Month]={'0'}, [Current Discount]={"<$(vExpCentreEmbeddedDiscount)"}>}  [Parent Duration])

Variable (vExpCentreEmbeddedDiscount)

AVG({<[Renewal Month Relative] = {'-1'}>} [Parent Inventory Value])/AVG({<[Renewal Month Relative] = {'-1'}>} [Parent List Price]))

Thanks in advance for your help guys.

Tamas

4 Replies
sunny_talwar

Not sure but may be an equal sign next to the variable might helps:

=COUNT({<[Renewal Month Relative]= {'-1'}, [Current Free Month]={'0'}, [Current Discount]={"<$(=vExpCentreEmbeddedDiscount)"}>} [Parent Duration])

Not applicable
Author

Thanks, it is not working. That was what I already mentioned " = within the evaluation. Nothing works"

sunny_talwar

I apologize, I missed that part of the post

Not applicable
Author

Hi,

I think Set Analisys is correct.

Try put "=" before variable definition, that also need an initial parenthesis:

=(AVG({<[Renewal Month Relative] = {'-1'}>} [Parent Inventory Value])/AVG({<[Renewal Month Relative] = {'-1'}>} [Parent List Price]))

regards!