Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
anderseriksson
Partner - Specialist
Partner - Specialist

Button doing a NOT value selection in field?

Say I have a field 'Category' with possible values 'A', 'B', 'C'.

Now I want a button to make a selection in field 'Category' and i want the selection to be 'NOT B'.

'NOT B' is not the same thing as selecting 'A' & 'C' as there can also be rows in the datamodel without any value in field 'Category'.

Those rows are included with the selection 'NOT B' but excluded if you do selection 'A' & 'C'.

The only way of accomplishing 'NOT B' in a button trigger that I know of is by first doing a field selection 'B' and then select excluded values.

Problem is this will not do when user has made other selections.

Say I also have a field 'Year' and user made the selection '2013' in this field.

If there are no 'B's during 2013 what will happen with the button trigger?

First we select 'B' but since there are no 'B's during 2013 QlikView will loose the selection in field 'Year'!

Next we exclude the selection in field 'Category', fine we now have 'Category' = 'NOT B' but we no longer have the selection 'Year' = '2013'!

Example data that illustrates the problem could be;

YearCategoryValue
2012A1
2012B2
2012C3
2013A4
2013
6

If user did not make any selection prior to pressing the button we should get values 1, 3, 4 & 6.

If user select 2012 and press button we should get 1 & 3 (will work with button first selecting 'B' and then exclude selected value).

User selected 2013 and press the button I want values 4 & 6 (exclude those with 'B').

With button first selecting 'B' and then excluded values I will get 1, 3, 4 & 6 (since selection of Year is lost).

With button selecting all values but 'B' I will only get value 4 (since 6 does not have a Category).

In a listbox you can type 'NOT B' to do exactly this but what search pattern should I use in a trigger to accomplish this?

30 Replies
anderseriksson
Partner - Specialist
Partner - Specialist
Author

NullAsValue is essential for this to work as you suggest.
In the question Nulls are not values - "without any value in field 'Category'"
Because of this condition the suggested solution does not work.