Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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)?
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
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
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.
if both the table don't have any association I don't think so you can make single list box.
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
May be like this.
have a look at attached document.
Regards
ASHFAQ
Hi,
use a apply map and use it in the table where profitability of missing values is more
Chinna.
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
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.
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.