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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

can we store more than one value in a variable in qlikview

Hi guys

Sorry for posting the question on weekend

I want to store more than one Tagnames in a variable so that i can add or remove the tagnames at one place.

I mean i want to create a variable something like below

Let vTagsForEfficiency= ('MaEfficiency','CaEfficiency','daEfficiency');

Thank you

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Have you tried

SET vTagsForEfficiency= ('MaEfficiency','CaEfficiency','daEfficiency');

...

select * from tablename

where TagName IN $(vTagsforEfficiency)

;

View solution in original post

9 Replies
agni_gold
Specialist III
Specialist III

Use Concat function

Kushal_Chawda

Data:
LOAD * Inline [
Tag
A
B
C
D ]
;

=Concat(if(match(Tag,'A','B','C'),chr(39)&Tag&chr(39)),',')

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Can you explain what you're trying to achieve as an end result? Why do think you need a variable with a list of values?


talk is cheap, supply exceeds demand
Not applicable
Author

Hi Thank you  for the response

I am using a select statement to pull the data from database as below

select * from tablename where TagName IN('MaEfficiency','caEfficiency','daEfficiency')

so, in sql statement i want to use a variable like

select * from tablename where TagName IN '$(vTagsforEfficiency)'

so that i can use change the tagnames at the variable

Pls tell me, if I am not clear in explaining you

Thank you

swuehl
MVP
MVP

Have you tried

SET vTagsForEfficiency= ('MaEfficiency','CaEfficiency','daEfficiency');

...

select * from tablename

where TagName IN $(vTagsforEfficiency)

;

Not applicable
Author

yes i tried..

But, I am unable to create the variable like that, with three tagnames

Thank you

swuehl
MVP
MVP

I just tried and it worked for me.

Have you noticed that I used SET instead of LET statement?

Not applicable
Author

Thanks bhayya super.. Really thank you for the help

Not applicable
Author

Thanks for the reply bhayya.

I cant use this in my scenario

Thank you