# New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Join us for a live Q&A! September 21, 10 AM ET - Onboarding Fast in Qlik Sense SaaS! REGISTER
cancel
Showing results for
Did you mean:
Contributor III

## GetfieldSelection() On a Master Measure

Hi All,

I have the following Master Dimension that is calculated as per the below. This is to only make fields starting with XXXX filterable.

``IF(LEFT(FIELD,4) = 'xxxx', FIELD,NULL())``

I then would like to use the GetfieldSelections() Function to identify what one has been selected. Below is what I thought would work. However this returns '-' when I have one valued filtered.

``=GetFieldSelections(FIELD,';',1)``

I have tried putting the Master Dimension Calculation in but this returns nothing as well.

``=GetFieldSelections(IF(LEFT(FIELD,4) = 'xxxx',FIELD,NULL()),';',1)``

When I put the Master Dimension next to the field it shows that Master Dimension as selected, but not the field.

Any one know a solution to this one?

Labels (2)

• ### Qlik Sense

1 Solution

Accepted Solutions
MVP

You will need to add an Aggr() to your filter to select the actual FIELD.

Aggr(IF(LEFT(FIELD,4) = 'xxxx', FIELD,NULL()), Field)

If you want to continue to show all the values (unselected in gray) after selections, add Only() with a set like this:

Aggr(IF(LEFT(Only({1}FIELD),4) = 'xxxx', Only({1}FIELD),NULL()), Field)

3 Replies
Specialist II

Hi

by my opinion i should rather add a dimension in the script :

if(left(field,4)='xxxx',FIELD,NULL) as FIELD2,

then use GetfieldSelections(FIELD2,';',1) on back end

Contributor III
Author

I did think of this, but it seems silly that Qlik does this when its build of the field itself. The documentation does not help or explain, and often There are nifty ways to do something.

MVP

You will need to add an Aggr() to your filter to select the actual FIELD.

Aggr(IF(LEFT(FIELD,4) = 'xxxx', FIELD,NULL()), Field)

If you want to continue to show all the values (unselected in gray) after selections, add Only() with a set like this:

Aggr(IF(LEFT(Only({1}FIELD),4) = 'xxxx', Only({1}FIELD),NULL()), Field)