Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
could you please help me with a problem.
I have two data sets that need to be loaded.
in SQL it will look like this:
Select
t1.A,
t1.B+t1.C,
T2.E
from t1
left join t2
on t1.A=t2.A
In Qlik Sense when I do this:
T1:
load
A,
B+C,
T2:
Load
A,
E
I'm getting correct result, but extra syntactic keys. When I'm trying to add left join, I'm getting the wrong number for B+C.
What am I doing wrong?
Thanks a lot in advance!
I found a solution...My problem was I didn't add distinct when I was loading t2.
Temp:
Load A, B , C from Table1;
Left Join
Load A,E from Table2;
Noconcatenate
Final:
Load A,B+C,E Resident Temp;
Drop Table Temp;
Regards,
Prashant Sangle
@Ethel Please use the below script in you load Editor:
NoConcatenate
Table1:
Load * Inline [
A, B, C
1,4,7
2,5,8
3,6,9
];
Left join (Table1)
Load * Inline [
A,E
1,Si
2,Mu
4,Ne
];
NoConcatenate
Table:
Load A,
B+C as Total,
E
Resident Table1;
Drop table Table1;
Exit Script;
If this resolves your issue, please like and accept it as a solution.
Thank you so much! No unfortunately I'm still getting wrong number. But if I do one load after another, result is correct. What type of join qlik do automatically?
Thank you so much! Unfortunately, I'm still getting wrong number. But if I do one load after another, result is correct. What type of join qlik do automatically? I tried even outer join, still wrong number...but If i do one load after another, result is correct....
@Ethel What type of join qlik do automatically? - By default, Qlik performs an outer join.
I tried outer join, but I also got the wrong result.
Be default qlik never do any join
If your all fields are same between 2 tables then it will do concatenation
If you have few fields same between 2 tables the ln qlik create a synthetic key which is combination of all common fields between 2 tables.
Regards,
Prashant Sangle
I found a solution...My problem was I didn't add distinct when I was loading t2.