Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
azmeerrehan
Partner - Creator
Partner - Creator

Selecting 2 Values

I have a Field called "Field A" with values as "Status A", "Status B" and "Complete C".

I have a text object with a expression If(Mid(Field_A,1,6)='Status',1,0). This works If I select one of the "Status" Values , but when I select both Status Values it goes to 0, I want that weather a user selects "Status A" or "Status B" or Both it should always give me value 1.

Attached please find the sample

6 Replies
sibin_jacob
Creator III
Creator III

Use this formula

=if(Substringcount(concat(Field_A,'|'),'Status')>0,1,0)

azmeerrehan
Partner - Creator
Partner - Creator
Author

It works Partially, means, It still gives me one If I have nothing selected. I expect 0 if nothing is selected

sibin_jacob
Creator III
Creator III

Please use this one

=if(GetSelectedCount(Field_A)>0,

if(Substringcount(concat(Field_A,'|'),'Status')>0,1,0),0)

azmeerrehan
Partner - Creator
Partner - Creator
Author

Now ir works fine, but I am trying to use this as a Conditional Filed show  in Dimension of Straight table , but it doesnt work there . What am I missing there

sibin_jacob
Creator III
Creator III

The above formula will work in 'Enable conditional' option also.

Can you please share little more details on your requirement?

What is your dimension? how you need to enable the dimension?

arvind1494
Specialist
Specialist

=if(getselectedcount(Field_A)>0 and GetFieldSelections (Field_A)<>'Complete C',1,0)