Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
BernardBernoulli
Contributor III

Set up variable with field column values

Hi,

I'm new to Qlik Sense and currently trying to get our first dashboards up and running.


We have a field containing a column of several different values, which I want to pass to a variable to use in different scenarios.

e.g.

Field A contains:
1
2
3
4

And I want to pass all of these values to the variable "numbers" which is defined by the following expression:
=if(vDim = 1, [Field A], if(vDim = 2,[Field B]))

Now if vDim is true the variable still doesn't show the values of Field A.

Though when I add sum() to the expression, it adds all these numbers and the variable is working.

What is the best way to set up the variable with all of the single values of Field A?

Labels (2)
1 Solution

Accepted Solutions
steeefan
Luminary

If you want all the values of a field shown in one expression, try CONCAT().

View solution in original post

3 Replies
steeefan
Luminary

If you want all the values of a field shown in one expression, try CONCAT().

BernardBernoulli
Contributor III
Author

Thanks! I think this might help. Is there a way to avoid duplicates after concatenate?

steeefan
Luminary

Yes: CONCAT(DISTINCT [Field A], ', ')