Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
azmeerrehan
Partner - Creator
Partner - Creator

GetFieldSelection Isssue

I have the below statement

If(GetFieldSelections(MYField)='A' and GetFieldSelections(MYField)='B', 1,0).

So If I am making a selection A and B in MYField this statement is returning 0 means False.  It works fine with or but my requirement is and

What am I doing wrong here

1 Solution

Accepted Solutions
atoz1158
Creator II
Creator II

If(GetFieldSelctions(MyField)='A,%B',1,0)


Where the % is the space

View solution in original post

18 Replies
marcus_sommer

Maybe there is just some misunderstanding between the requirement und you ... For your descriped use-case OR will be correct. Otherwise you need to explain it a bit more.

- Marcus

vishsaggi
Champion III
Champion III

May be try like? I did not try let me know if it works?

IF(GetFieldSelections(Match(MyField, 'A', 'B')), 1, 0)

atoz1158
Creator II
Creator II

Hi Rehan

If you are select both A and B then GetFieldSelctions(MyField) will return A, B so your test should be

If(GetFieldSelctions(MyField)='A, B',1,0)


Adrain

krishnacbe
Partner - Specialist III
Partner - Specialist III

Try below expression

=if(Concat(MyField,'|')='A|B',1,0)

azmeerrehan
Partner - Creator
Partner - Creator
Author

Doesnt work

azmeerrehan
Partner - Creator
Partner - Creator
Author

Doesnt work

azmeerrehan
Partner - Creator
Partner - Creator
Author

I can see that ur sample app it works, but its working on mine .

If(Concat([My Field],'|')='Golden Harvest West|Golden Harvest East',1,0)

azmeerrehan
Partner - Creator
Partner - Creator
Author

Sorry its not working on mine

atoz1158
Creator II
Creator II

Hi Rehan

It works for me, please note that the values of A & B must be in Alphabetical order and there must be a space after the comma.

Try just putting the following in a text box and seeing what comes back

=GetFieldSelctions(MyField)


Adrian