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
QlikWorld Online 2021, May 10-12: Our Free, Virtual, Global Event REGISTER TODAY
cancel
Showing results for 
Search instead for 
Did you mean: 
lulululu
Contributor
Contributor

Mutual exclusion of filters

  hi,

    I just started to learn Qlik Sense,I'm sorry about the problem that I was sending out.

    What I want is that when I select a filter , I can't select another filter。

    For example,

     if I select "1年" in the "time" filter,I can't select any option in the "product" and "Infor" filter,Of course, I can continue to select “2年” or “3年” in the "time" filter.

     if I select same options in the "product" or "Infor"filter,I can't select any option in the "time"  filter.

    And all the data comes from a table.

    Can you solve this problem with an expression?

   Thank you in advance。

22.png

消息编辑者为:lisa lu

12 Replies
cazztfplease
Creator
Creator

Hello Lisa,

To clarify, you are not able to select any of these filters?

qlikcomm.PNG

Anil_Babu_Samineni

That means 2 approached are bad

1) Data model wrong, May be

2) In your source might they doesn't have associate one. Can you try with simple table and check how testing is under.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
lulululu
Contributor
Contributor
Author

I can select this filters,but I want to unable select this filters .

-Original-

woshua5550
Creator III
Creator III

Hi lisa

you may need to attach your .qvf file and data source if possible

by the way , 你是中国人吧? 哈哈,这里很少见的。

lulululu
Contributor
Contributor
Author

I'm sorry I didn't make it clear, I'll describe it in a simple way .

source:

load * Inline [

Country, City

A, a1

A, a2

A, a3

B, b1

B, b2

B, b3

C, c1

C, c2

C, c3

];

1210.png

if I select "A" or "B" in the "Country" filter,I can't select any option in the "City" filter.And vice versa.1212.png

My attempt on "City":

     if(GetSelectedCount(Country)=0,City). 

But that's wrong.I can't use this expression on "Country" and "City" at the same time.

Can you solve this.

lulululu
Contributor
Contributor
Author

对呀,我是中国人,我的表述不大清楚,其实我想知道多个筛选项能不能相互独立存在,当我在A字段里做了筛选后不能在B字段里做筛选,反之亦然。我试着用GetSelectedCount()函数,但是只能在一个字段里面写表达式,还只能单向选择,反选就不行。请问有没有解决的方法?

pradosh_thakur
Master II
Master II

Hi Anil

i guess here the requirement is disable two filters when one is selected. May be i am wrong.

regards

Pradosh

Learning never stops.
Anil_Babu_Samineni

Sometimes, If data model is wrong then it may not associate as expected because of data granularity issue it triggers the issue.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
pradosh_thakur
Master II
Master II

why don't you use set expression in your chart or table to select only the selected filters data

or else another workaround can be  please check your field name as it can be case sensitive

expression for time

if (getfieldselection(product)>0 or getfieldselection(infor)>0,null(),time)


expression for product

if (getfieldselection(time)>0 or getfieldselection(infor)>0,null(),product)


expression for infor

if (getfieldselection(time)>0 or getfieldselection(product)>0,null(),infor)


if this doesn't help please post your sample app.


regards

Pradosh

Learning never stops.