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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
ashis
Creator III
Creator III

How to pass multiple values in a variable

Hi,

Can you please help how to pass string values in a variable so that it can be used in an expressions.

I am trying to do this but it is not working;

vVar= {'Energy Syst*','Machine Learning'}

then I just need to pass this in an expression

sum({<usedby-={'Energy Syst*','Machine Learning'}>} sales)) ----> instead of 

sum({<usedby-= $(vVar)>} sales))

Labels (3)
2 Solutions

Accepted Solutions
vinieme12
Champion III
Champion III

Like Below

 

vVar

'Energy Syst*','Machine Learning'         <<----Do not add in variable definition

sum({<usedby-= {$(vVar)}>} sales)  <<{ } are  needed 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

Vegar
MVP
MVP

You can create the variable as you suggest, but your syntax is wrong.

Create your variable like this (notice the double "quotes":

SET vVar= {"Energy Syst*",'Machine Learning'}

When using wildchars in a set modifier you need to user double qoutes.

 

Then the expression can look like this :

=sum({<usedby-= $(vVar)>} sales)

View solution in original post

2 Replies
vinieme12
Champion III
Champion III

Like Below

 

vVar

'Energy Syst*','Machine Learning'         <<----Do not add in variable definition

sum({<usedby-= {$(vVar)}>} sales)  <<{ } are  needed 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Vegar
MVP
MVP

You can create the variable as you suggest, but your syntax is wrong.

Create your variable like this (notice the double "quotes":

SET vVar= {"Energy Syst*",'Machine Learning'}

When using wildchars in a set modifier you need to user double qoutes.

 

Then the expression can look like this :

=sum({<usedby-= $(vVar)>} sales)