Qlik Community

Ask a Question

New to Qlik Sense

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

Announcements
Qlik Highlights 2020 Giveaway! Watch, reply and have a chance to win a $200 Amazon Gift Card! Watch Video
cancel
Showing results for 
Search instead for 
Did you mean: 
Partner
Partner

GetFieldSelections not working with AND condition though working with OR in If condition

=IF(GetFieldSelections(SalesOffice)='NA38' AND GetFieldSelections(SalesOffice)='NA40' ,100,60)

Labels (1)
1 Solution

Accepted Solutions
Creator II
Creator II

GetFieldSelections will return multiple value separated by commas in a single string if multiple values are selected, so the comparison to a single value in a string will not work.

Try this:

if(GetSelectedCount(SalesOffice)>0 and
Match('NA38',$(=concat(distinct chr(39)&SalesOffice&chr(39),',')))>0 and
Match('NA40',$(=concat(distinct chr(39)&SalesOffice&chr(39),',')))>0,
100,60)

View solution in original post

6 Replies
Creator II
Creator II

GetFieldSelections will return multiple value separated by commas in a single string if multiple values are selected, so the comparison to a single value in a string will not work.

Try this:

if(GetSelectedCount(SalesOffice)>0 and
Match('NA38',$(=concat(distinct chr(39)&SalesOffice&chr(39),',')))>0 and
Match('NA40',$(=concat(distinct chr(39)&SalesOffice&chr(39),',')))>0,
100,60)

View solution in original post

Partner
Partner

Thankyou its working 🙂

 

Partner
Partner

GetFieldselections not working with AND Condition with different dimensions

=If(GetFieldSelections(Crop)='Tomato' and GetFieldSelections(Species)='Tomato',1,0)

Please help for this Expression @GaryGiles 

I have tried this  below expression but it is not working.

=if(GetSelectedCount(Crop)>0 and GetSelectedCount(Species)>0 and
Match('Tomato',$(=concat(distinct chr(39)&Crop&chr(39),',')))>0 and
Match('Tomato',$(=concat(distinct chr(39)&Species&chr(39),',')))>0,
1,0)

please help

Creator II
Creator II

That looks like it should work.  Are you sure that Tomato is selected in both Crop and Species and that a fact row exists for that combination?

 

Partner
Partner

yes  I have selected both and fact row exists for both combinations. But not working.

Is there any other expression which helps me when user select Crop = Tomato and Species = Tomato then only chart should be visible?

Creator II
Creator II

Can you post the results of these 2 expressions with and without the selections made?

concat(distinct chr(39)&Crop&chr(39),',')

concat(distinct chr(39)&Species&chr(39),',')