Qlik Community

Qlik Sense Enterprise Documents & Videos

Documents & videos about Qlik Sense.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT

Filter on set analysis

Partner
Partner

Filter on set analysis

Good day for you all!

As i am seeing a lot of questions about stuff you could do with a filter. I think i could help some people with this post.

Let talk about FILTERS !

On Qlik you have the global filter,

Screen Shot 2018-08-23 at 13.59.50.png

This filter will have effect in all of your app, but that is a workaround

if you want a filter in a KPI but not in everything else, you can!

It is like this, lets say you want the value from all apples in a KPI without using a global filter every time.

You could do something like this:

=count({<Fruit={'Apple'}>}Fruit)

what does it do? it is simple,

this is the filter:

{<Fruit={'Apple'}>}

the rest is the analysis that you want. Lets focus first on the filter.

{<NameOfField>}

this selects a field to filter, but without a comparison it does nothing. so:

this:

=count({<Fruit>}Fruit)

and this:

=count(Fruit)

will do the same thing.

but now a comparison:

{<Fruit={'Apple'}>}

after selected the field Fruit, it will compare if there is a match with the actual string 'Apple'.

But what if i wanted an expression? that what double quotes are for!

{<Sales={"max(sales)"}>}

this will filter all the itens that have the highest sale.

to finish:

=count({<Sales={"max(sales)"}>} Fruit)

//this will filter the fruits with the highest sales and then return you how many there is

BONUS:

what if there is more than one line with the same fruit?

use DISTINCT

so:

=count({<Sales={"max(sales)"}>} DISTINCT Fruit)

this will give you how many different fruits have had the maximum Sales value.

The database used is here:

Dummy database

Like, comment, rate, tell me what you think and I will improve and maybe help more people with these issues.

I am from Brazil, so if you think it will be good to post in Portuguese too, let me know.

Thanks!

Comments
lfholland
New Contributor III

Very easy to understand.

0 Likes
Partner
Partner

Thanks! I am doing my best

Partner
Partner

Muito bom o tutorial, espero que continue.

0 Likes
Version history
Revision #:
1 of 1
Last update:
‎2018-08-23 01:20 PM
Updated by: