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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
lightsection
Contributor III
Contributor III

How to pass multiple string values in a single variable parameter ?

Is there a way to put multiple string in a single parameter ?

For eg:

Expression:

Let vE_Sales = sum({<Year = {$1}>} Sales);

When calling this expression we say

$(vE_Sales('2016'))

But if I wanted to do the same for multiple years. Let say 2016 & 2015. how do we do pass multiple string values in a single parameter ?

$(vE_Sales('2016', '2015'))

Labels (1)
5 Replies
Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

I think this will work from script or variable overview window

From Script:

LET vVarMultiple = CHR(39) & 2015 & CHR(39) & CHR(44) & CHR(39) & 2016 & CHR(39);

From Variable Overview Window:

CHR(39) & 2015 & CHR(39) & CHR(44) & CHR(39) & 2016 & CHR(39)

The result is '2015','2016'

Hope this helps

el_aprendiz111
Specialist
Specialist

Hi,

Look

parametro.png

Anonymous
Not applicable

Hi

In variable overview you can pass multiple values using Valuelist() .

Eg: =ValueList('2015,2016,207')

marcus_sommer
MVP
MVP

I think this will be helpful: Re: variable with comma parameter

- Marcus

MarcoWedel
MVP
MVP

Hi,

I guess it could be easier to use another separator than comma between your year values, as it will be interpreted as separator of multiple variable parameters ($1, $2, $3 ...).

So one solution might be to use the The Search String:

QlikCommunity_Thread_234891_Pic1.JPG

QlikCommunity_Thread_234891_Pic2.JPG

QlikCommunity_Thread_234891_Pic3.JPG

SET vE_Sales = Sum({$<Year={"($1)"}>} Sales);

table1:

LOAD 2000+RecNo() as Year,

    Money(Ceil(Rand()*1000),'$#,##0;($#,##0)') as Sales

AutoGenerate 16;

hope this helps

regards

Marco