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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
renovero
Creator
Creator

Simple help with exclude expression

Hello, I have straight table in my front end page.

In data there is column "KodTowaruID", like numeric Code column, and I want to exclude few positions from my table.
example
If KodTowaruID = 1122 then exclude from table

How to write expression to do that and paste it in this place?

2019-05-14_09h38_52.png

I thought about simple

If((KodTowaruID)={1122} or {1123} or {1124} exclude from table

But could You write to me, how to make this expression to be correct?

Labels (2)
2 Solutions

Accepted Solutions
marcus_sommer

You could use the following expression as calculated dimension (not in your highlighted condition which is only for displaying the entire column or hiding them):

If( not match(KodTowaruID, 1122, 1123, 1124), KodTowaruID)

- Marcus

View solution in original post

tresesco
MVP
MVP

Try putting the values within single quotes like:


If(not Match(KodTowaruID, '_590', '_59027', ....

View solution in original post

5 Replies
marcus_sommer

You could use the following expression as calculated dimension (not in your highlighted condition which is only for displaying the entire column or hiding them):

If( not match(KodTowaruID, 1122, 1123, 1124), KodTowaruID)

- Marcus

renovero
Creator
Creator
Author

So I have made like U said and it is not working properly.

2019-05-14_14h16_01.png

 Do You know why?  I have write it exactly like You did.
In Dimentons tab i add calculated dimension.

tresesco
MVP
MVP

Try putting the values within single quotes like:


If(not Match(KodTowaruID, '_590', '_59027', ....

Jagsfan82
Partner - Contributor III
Partner - Contributor III

While calculated dimensions are useful, I tend to stay in the habit of using set expressions for whatever I am calculating in the expressions tab.  So for a Sum() expression:

Sum(  {$<KodTowaruID-={1111,1112,1113,1114}>} Field)

Notice the "-" in front of the "=" signifying to exclude the following set of values.  Simple as copying and pasting that in any aggregate function you are using.  You could also store it in a variable using the "Variable Overview" in settings menu, and then call that to use that set.  If you were to put{$<KodTowaruID-={1111,1112,1113,1114}>} as vSet1, you could write the above as.

Sum( $(vSet1) Field) or Count( $(vSet1) EmployeeID) or whatever aggregate expression you need to use.

That being said, the earlier suggestion in the calculated dimension should work as well with the single quotes (apparently Qlik doesn't like the "_" and thinks you are entering field names).  

renovero
Creator
Creator
Author

Thank You @Jagsfan82 for your suggestion, I will try to practise this 🙂
Also thank You @marcus_sommer for respond and ofc @tresesco  for really helpful correction 🙂