Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
IAMDV
Master II
Master II

Filtering subset of rows

Dear All,

How can we filter specific rows by using function and without changing the load script? Let us assume I have a table with one column

EmpID

1025

1028

1029

1038

1054

Now I wanted to filter only 1028 and 1054 records by using a function. I am sure this is fairly simple...

If possible, please provide 2 functions - one regular function and another one with set analysis.

TIA!

Cheers - DV

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

Yeah, sorry, very unclear what you want.

But let's say you want sum(Sales), but only for those two specific EmpIDs, and always just those two. You can use set analysis:

sum({<EmpID={'1028','1054'}>} Sales)

You also mention a "regular function", by which you might mean this:

sum(if(match(EmpID,1028,1054),Sales))

Or maybe you only want those two values as a dimension on some table. You could use a calculated dimension:

if(match(EmpID,1028,1054),EmpID)

But as long as you're hardcoding IDs, you could put it in the script for even better chart performance when using it as a dimension:

,if(match(EmpID,1028,1054),EmpID) as SpecialEmpID

Dimension = SpecialEmpID

And so on with various other answers depending on your actual requirement, which I really don't know.

View solution in original post

5 Replies
IAMDV
Master II
Master II
Author

Any suggestions please...?

Anonymous
Not applicable

This sort of filtering is usually done by maikng selections.
Maybe you have something else in mind, but it is not clear from your question...

johnw
Champion III
Champion III

Yeah, sorry, very unclear what you want.

But let's say you want sum(Sales), but only for those two specific EmpIDs, and always just those two. You can use set analysis:

sum({<EmpID={'1028','1054'}>} Sales)

You also mention a "regular function", by which you might mean this:

sum(if(match(EmpID,1028,1054),Sales))

Or maybe you only want those two values as a dimension on some table. You could use a calculated dimension:

if(match(EmpID,1028,1054),EmpID)

But as long as you're hardcoding IDs, you could put it in the script for even better chart performance when using it as a dimension:

,if(match(EmpID,1028,1054),EmpID) as SpecialEmpID

Dimension = SpecialEmpID

And so on with various other answers depending on your actual requirement, which I really don't know.

IAMDV
Master II
Master II
Author

This is perfect! Thanks so much for your help....

Not applicable

I have a similar issue...I have a table box with all the info in it.  From that i created a second chart (a straight table) using the info from the Table Box.  All i want in my straight table are the rows associated with Order Status 66.

I tryed the calculated dimension you showed here and thats not working for me, it creates a new column...

Can you help me?

Thansk

Karen