Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
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)