Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
TKendrick20
Partner - Specialist
Partner - Specialist

Qlik Sense Field Selection as Variable

I have a field which has values that I would like to use as a Dimension in another chart. I was able to do this in QlikView, but I can't quite figure it out in Qlik Sense.

I am trying to create a variable where the value is equal to the selections in a field.vDemographic.PNG

Then, I want to be able to use this variable as a Dimension in another chart.

Dimension Demographic.PNG

What am I doing wrong? Or is the GetFieldSelections() not supported in the variable creator?

1 Solution

Accepted Solutions
undergrinder
Specialist II
Specialist II

Hi Tim,

Try enclose the variable '' characters.

='$(vDemographic)'

It shows to Qlik Sense, that it contains a characters.

By the way I think this document will help you:

Makes Sense to go round in circles

G.

View solution in original post

4 Replies
undergrinder
Specialist II
Specialist II

Hi Tim,

Try enclose the variable '' characters.

='$(vDemographic)'

It shows to Qlik Sense, that it contains a characters.

By the way I think this document will help you:

Makes Sense to go round in circles

G.

TKendrick20
Partner - Specialist
Partner - Specialist
Author

Got it! I've added the '' as you said and had to add an = to the GetFieldSelections formula. I installed the extension you linked to, but did not end up using it.

vDemographic.PNG

Dimension Demographic.PNG

The only problem now is if there are multiple selections in the Demographics field this will not work. Therefore, I am using the bi-listbox to limit the selections in the field to 1. Qlik Sense Listbox

undergrinder
Specialist II
Specialist II

Yes, the qsVariable extensions allows one selected button as I rembered, but why would you with one object to select multiple column?

I think you have dimensions like:

Age, Sex, School , and you would provide to users select which dimension is selected to show.

I missed/misunderstood something?

G.

lightsection
Contributor III
Contributor III

In case of multiple selections it is better to use a string array to store selections in a variable.

Try this:

Concat(distinct [Demographics], ',')

 

This will store all selected values in a comma-separated string array. Which you can later pass into a set analysis condition if required.