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: 
azmeerrehan
Partner - Creator
Partner - Creator

Variable With Hard Coded Values

I have a set analysis Expression as

SUm({<Product={'A','B','C'}>} Sales)

I would like to place the A,B, C in a variable so in future if the requirements change then  we can change the variable value and won't have to edit every single expression .

I created a variable vProduct as "A"CHR(44)"B"CHR(44)"C"CHR(44). Its not working .

Can someone help

1 Solution

Accepted Solutions
captain89
Creator
Creator

try this:

vProduct=chr(39)&'A'&chr(39)&chr(44)&' '&chr(39)&'B'&chr(39)&chr(44)&' '&chr(39)&'C'&chr(39)

View solution in original post

2 Replies
vishsaggi
Champion III
Champion III

May be in your variable store like below

vProduct = 'A','B','C'

Then in your expr

= Sum({<Product = {$(vProduct)} >} sales)

captain89
Creator
Creator

try this:

vProduct=chr(39)&'A'&chr(39)&chr(44)&' '&chr(39)&'B'&chr(39)&chr(44)&' '&chr(39)&'C'&chr(39)