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: 
manoj217
Creator III
Creator III

exclude function for dimension

Hi all

I have a fields in straight table and i want to exclude some values in dimension dynamically.

fields like

 

ABCcount(A)
applered31
ballgreen41
catyellow31
dogwhite21
elephantash51
foxorange11

now if i enter any value in input box it should not visible in the straight table

example :

if i enter apple,ball

it should not appear in the straight table

30 Replies
jensmunnichs
Creator III
Creator III

So like this? I'm sorry if I'm not getting this right.

If you want to exclude based on the selections made in a listbox instead of an input box you'd have to use franky_h79's original suggestion.

jensmunnichs
Creator III
Creator III

So if you do want to exclude based on listboxes instead of an input box, check the top table of the 2 in the attached file.

manoj217
Creator III
Creator III
Author

not able to create a list box user is not accepting.

he wants to give the input

manoj217
Creator III
Creator III
Author

your output is correct my requirement is also same

input values is also not in a single field he will give  A and B both fields

manoj217
Creator III
Creator III
Author

already list box is available but if u made any selections on this may impact on other objects so he dont want to disturb the other objects he want to exclude those values in straight table only

Frank_Hartmann
Master II
Master II

then use this as expression:

if(len(GetFieldSelections(A))<>0,count({1-$}A),count({$}A))

jensmunnichs
Creator III
Creator III

If you enter something in 'ExcludeB' or ExcludeC' it will exclude those values as well, see below. If you only want values from fields A and B to be excluded you can remove the 'ExcludeC' variable from the input box in its properties, you'll also have to remove ', C-={$(ExcludeC)' from the expression in the straight table properties.

manoj217
Creator III
Creator III
Author

if i doesn't enter any values then it is showing all values?

can you pls share the variable expression

manoj217
Creator III
Creator III
Author

in your expression have $ instead of that i want a variable that variable value is entered by input box not with the list box selections

jensmunnichs
Creator III
Creator III

Yes, if you leave the input box empty it will show all values.

The expression used in the straight table is as follows:

Count({<A-={$(ExcludeA)}, B-={$(ExcludeB)}, C-={$(ExcludeC)}>} A)

The variables don't have an expression, they're set by the input box. I've attached the file that has this solution in it, have a look.

Keep in mind that Listboxes elsewhere in the document will still affect this straight table. I'm pretty sure you can solve this by simply adding a 1 to the set analysis expression:

Count({1<A-={$(ExcludeA)}, B-={$(ExcludeB)}, C-={$(ExcludeC)}>} A)

Hope this helps