Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

displaying values not in a list box

Hi all,

I have 2 list boxes. which should contain the same set of values.

fielda
1
2
3


fieldb
1
2


These list boxes arent linked in anyway.

How can I then create a list box which only contains values in [fielda] and not in [fieldb]?

thanks

1 Solution

Accepted Solutions
mark_casselman
Creator
Creator

Hi,

Based on the idea of Fabrice, this works:

= if( not match( FieldA ,  $(=concat({1} chr(39) & FieldB & chr(39) , ',' ) )  ) , FieldA)

the second argument of the match generates the correct string of comma seperated values of B

The result gives a selectable (on field A) listbox with values B and C.

Mark

View solution in original post

12 Replies
tresesco
MVP
MVP

Expression like:

=If(FieldA<>FieldB, FieldA)

Not applicable
Author

Hi ealmeida,

Are you using same field in both listboxes? If not and fielda and fieldb are different fields in the tabel then you can just use 'fileda' filed in the list box for your requirement.

Please provide some more details about the problem as above discription is not giving very clear idea on issue.

Thanks,

Amey

Not applicable
Author

Thanks for the response guys.

fielda and fieldb are both loaded in as inline tables. The important thing to note is that these fields are not connect in anyway.

I have a data reduction process which which removes  values from fieldb and when this happens I want to somehow show the values that were removed.

I therefore created a replica of fieldb and called it fielda in the script.

my last obstacle is, when the values in the 2 list boxes defer (post reload and data reduction), I want to show the defering values.

how can i do this?

Not applicable
Author

Just create the another field to any table showing common fields

Not applicable
Author

Hi,

I would do:

if(match( '|' & FieldA  & '|',  '|' & concat({1} FieldB, '|' ) & '|'  ) , FieldA)

Fabrice

saumyashah90
Specialist
Specialist

Expression like

=if(fielda<>fieldb,fielda)

and aslo try doing it in script

table1:

load * from fielda

table2:

load * from fieldb where not exists(fielda)

Not applicable
Author

Saumya - I need a way of doing it after reloading and the if function does not work unfortunately.

Fabrice - your script looks like it should work, but it isn't not giving me the right result at the moment.

thanks for the help guys

Not applicable
Author

This looks like is should work, but at the moment it is not.