Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Dynamic expression based on filter - Qlik Sense

Hi Guys,

I have two dimensions

1. Product Category

2. Product Name

So the purpose is.. if user has only made selection on Product Category level instead of Product Names then the table should show count of total categories and as soon as user filters any product Name then that expression should change to count product names.

Something like this:

If Product Name Selection is > 0 then count(Distinct([Product Name])) else  Count(Distinct([Product Category]))

What is the best way to write that expression?

Thank you.

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: Dynamic expression based on filter - Qlik Sense

May be like this

If(GetSelectedCount([Product Name]) > 0, Count(DISTINCT [Product Name]), Count(DISTINCT [Product Category]))

2 Replies
MVP
MVP

Re: Dynamic expression based on filter - Qlik Sense

May be like this

If(GetSelectedCount([Product Name]) > 0, Count(DISTINCT [Product Name]), Count(DISTINCT [Product Category]))

Not applicable

Re: Dynamic expression based on filter - Qlik Sense

Thanks Sunny