Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Highlighted
varunreddy
Contributor III

How to use concat in the variable

Hi All,

I have the field (A) and I have values B,C,D,E,F. I want to store all the values in the variable.  

I am trying to convert  

Sum({A = {'B','C','D','E','F'}Sales) 

to

Sum({<A = {'$(vtest)'}>}Sales)

Where vtest = {'B','C','D','E','F'}

If I select B, then I should get the data by B else I need to see all the values.

Is this possible?

Thanks,

Varun

 

Labels (1)
1 Solution

Accepted Solutions

Re: How to use concat in the variable

May be you need this?

Sum({<Z = p(A), A>}Sales)

10 Replies

Re: How to use concat in the variable

May be this

Sum({<A *= {'$(vtest)'}>}Sales)

varunreddy
Contributor III

Re: How to use concat in the variable

Hi Sunny,

Thanks for the quick reply.

How can I create the vtest?

vtest = concat('A',',')?

Re: How to use concat in the variable

Is there a reason you want to create it using Concat?

varunreddy
Contributor III

Re: How to use concat in the variable

If nothing is selected, I wanted to select all the values. If they select the value, I want that value to be selected.

Re: How to use concat in the variable

So, why can't you just use this?
Sum({<A *= {'B','C','D','E','F'}>} Sales) 

Why do you need Concat?

varunreddy
Contributor III

Re: How to use concat in the variable

If new value is added (i.e. If G is added), then it requires the manual effort. 

Re: How to use concat in the variable

Lol, so why can't you just use Sum(Sales)? When nothing is selected, it will show the sum of sales for all A, but when one A is selected, it will show Sum of sales for just that A. Why do you need set analysis?

varunreddy
Contributor III

Re: How to use concat in the variable

Sorry for the confusion. I have renamed the field A as Z and using it in different table. But in the dashboard I am using A as the filter. If I select A, then few values are not displaying. So I thought if we create the variable and use it in the set expression, it will work.

Sum({<Z = {'$(vtest)'}, A>}Sales)

 

Re: How to use concat in the variable

May be you need this?

Sum({<Z = p(A), A>}Sales)