Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have 2 tables.I want to merge it into one via join.
Case1:-
table a:
ref,
amount,
----
from table a;
table b:
ref,
Tax,
----
from table b;
Qlikview by default creating the join via ref and showing right data.
--------------------------------------------------------------------------------------------------------
Now i want to merge both table into 1 via join ref.
Case2:-
table a:
ref,
amount,
----
from table a;
join
table b:
ref,
Tax,
----
from table b;
But it is showing wrong data.What should i do to show right result during merging into 1 table.
table b having multiple entries of ref.But table 1 having single entry of ref.
Please suggest me to sort out this.
Thanks,
The join will not work if the join key has duplicate values, as this will result in the creation of extra row and either the tax or the amount (or both) will be duplicated.
Why do you need to make one table? The model calculations will work just as well if the tables are loaded as is.
say you are having two following tables like:
tablea:
mapping
load
ref,
amount
from tablea;
tableb:
load
ref,
applymap('tablea',ref,null()) as amount,
tax
from tableb;
This will give you one final table.
Note: Mapping load works only when you are fetching single field from other table.
I still suggest don't join but, if you want to join, group the tax table
tablea:
load * inline [
ref, amount
1, 1
2, 2
3, 3
];
tableb:
load * inline [
ref, tax
1,1
1,11
2,2
2,22
3,33
];
join (tablea)
load ref, sum(tax) as tax
Resident tableb
group by ref;
DROP Table tableb;
hiii,
you can use concatenate or resident load can also be used.
regards.