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: 
iago1
Contributor
Contributor

Need Urgent Help: Filtering to Show Only Highest "CHAPA" Values in a Table

Hello everyone,

I need urgent assistance with a problem I'm facing in Qlik. I have a dashboard with a table, as shown in the image below.

iago1_1-1721332529621.png

I want to modify this table to include a filter with the following requirements:

  • If the [NOME FUNCIONARIO] field is repeated, I want to keep only the rows with the highest CHAPA values, even if there are duplicates.
  • I do not want to show the rows with the lowest CHAPA values for each [NOME FUNCIONARIO].

I’m not sure what the best approach is to achieve this. I would really appreciate it if someone could provide a step-by-step solution.

Thank you so much for your help!

Labels (2)
1 Solution

Accepted Solutions
levente81
Partner - Contributor III
Partner - Contributor III

I have created a sample data to generalize a bit your question allowing me to ask questions in order to ensure that we are on the same page regarding the nature of the issue:

NOME, CHAPAL, D1, D2, DN
nome1, 10, d11, d21, dn1
nome1, 100, d12, d22, dn2
nome2, 20, d13, d23, dn3
nome2, 200, d14, d24, dn4
nome3, 300, d15, d25, dn5

My understanding is that you need to show only 3 records from the above table, right:

NOME, CHAPAL, D1, D2, DN
nome1, 100, d12, d22, dn2
nome2, 200, d14, d24, dn4
nome3, 300, d15, d25, dn5

This can be done by creating a calculated dimension that either shows certain NOME value or null (this way you can add the rest of the dimensions freely):

levente81_1-1721382931423.png

So my solution for this scenario would be this calculated dimension:

=if(aggr(nodistinct Max(CHAPAL), NOME)=CHAPAL,NOME,NULL())

 

=if(aggr(nodistinct Max(CHAPAL), NOME)=CHAPAL,NOME,NULL())

 

This will result null for certain records that you can easily hide by ticking off the "include null values" checkbox in the table tools (in edit view).

View solution in original post

2 Replies
levente81
Partner - Contributor III
Partner - Contributor III

I have created a sample data to generalize a bit your question allowing me to ask questions in order to ensure that we are on the same page regarding the nature of the issue:

NOME, CHAPAL, D1, D2, DN
nome1, 10, d11, d21, dn1
nome1, 100, d12, d22, dn2
nome2, 20, d13, d23, dn3
nome2, 200, d14, d24, dn4
nome3, 300, d15, d25, dn5

My understanding is that you need to show only 3 records from the above table, right:

NOME, CHAPAL, D1, D2, DN
nome1, 100, d12, d22, dn2
nome2, 200, d14, d24, dn4
nome3, 300, d15, d25, dn5

This can be done by creating a calculated dimension that either shows certain NOME value or null (this way you can add the rest of the dimensions freely):

levente81_1-1721382931423.png

So my solution for this scenario would be this calculated dimension:

=if(aggr(nodistinct Max(CHAPAL), NOME)=CHAPAL,NOME,NULL())

 

=if(aggr(nodistinct Max(CHAPAL), NOME)=CHAPAL,NOME,NULL())

 

This will result null for certain records that you can easily hide by ticking off the "include null values" checkbox in the table tools (in edit view).

iago1
Contributor
Contributor
Author

It worked perfectly! I really appreciate your help—thank you so much!!