Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
sifatnabil
Specialist
Specialist

Showing all values from 2 unrelated listboxes

Hi,

I have 2 listboxes from 2 unassociated tables, and they contain the same 3 values, E, M, V. However, sometimes some of the 3 values will be missing from 1 listbox but not the other (because it doesn't exist in the listbox's table), like below:

Type1

E

M

V

Type2

E

M

How can I make a combined listbox that will have all the 3 values, and when a value is selected, it triggers select in field for both listboxes (irrespective of whether a value is missing from one of the listboxes)?

1 Solution

Accepted Solutions
Not applicable

In that case, you can actual create a field in script like

LOAD

Type1 as Type,

'type1' as flag

<datasource1>;

concatenate

LOAD

Type2 as Type

'type2' as flag

<datasource2>;

And then use Type as the listbox and in triggers set value for Both flags. Something like this might help.

Thanks,

Singh

View solution in original post

11 Replies
Not applicable

Go to Document Properties->> Triggers->> Field Event Triggers.

For Type1 and Type 2 field you can add any trigger based on each other.

Thanks,

Singh

sifatnabil
Specialist
Specialist
Author

Hi Angad, I've done this but on the front-end I would like to show only 1 listbox. Thus this listbox must contain all the values from both the listboxes, even if they don't exist in one table. So it would need to a listbox that, when selected, triggers the other 2 listboxes.

Kushal_Chawda

if both the table don't have any association I don't think so you can make single list box.

Not applicable

In that case, you can actual create a field in script like

LOAD

Type1 as Type,

'type1' as flag

<datasource1>;

concatenate

LOAD

Type2 as Type

'type2' as flag

<datasource2>;

And then use Type as the listbox and in triggers set value for Both flags. Something like this might help.

Thanks,

Singh

ashfaq_haseeb
Champion III
Champion III

May be like this.

have a look at attached document.

Regards

ASHFAQ

Anonymous
Not applicable

Hi,

use a apply map and use it in the table where profitability of missing values is more

Chinna.

Not applicable

Hi,

I think you could use JOIN or CONCATENATE..

eg:

load * Table1 ;

join/Concatenate

load * Table2 ;

also remember Join and concatenate work differently when you try to add any numeric fields...

Here is some more info if u need..

Concatenate just appends the records from the new source onto the end of the existing table.  There are many forms of join, but they all try to match up "key fields" between the two tables.  In QlikView's case, they match on all fields of the same name.  So let's take some examples.  First, here's our basic script.  The concatenate or join will go in the indicated spot:

Table:
LOAD * INLINE [
Customer, Sales
Andy, 123
Becky, 234
];
// either concatenate or a join here
LOAD * INLINE [
Customer, Country
Becky, Canada
Carla, Mexico
];

And here are the expected results for our various options.  Hopefully I got all these right.

CONCATENATE (Table)

Customer, Sales, Country
Andy, 123, null
Becky, 234, null
Becky, null, Canada
Carla, null, Mexico

------------------------------

LEFT JOIN (Table)

Customer, Sales, Country
Andy, 123, null
Becky, 234, Canada

------------------------------

RIGHT JOIN (Table)

Customer, Sales, Country
Becky, 234, Canada
Carla, null, Mexico

------------------------------

OUTER JOIN (Table)

Customer, Sales, Country
Andy, 123, null
Becky, 234, Canada
Carla, null, Mexico

------------------------------

INNER JOIN (Table)

Customer, Sales, Country
Becky, 234, Canada

Not applicable

There is no way if there is no association between the two tables.Only thing I think you can make same field name to both tables for the association.

Not applicable

Hi,

I had interpreted the question wrong...

If u have 2 tables with no common key , then you should create a link table taking the Primary keys of both the tables.