Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi team,
Can we handle following case in Qlikview data model ?
SELECT COUNT(T1.FIELD1)
FROM TABLE T1,TABLE T2
WHERE
T1.KEY = T2.KEY AND
T1.KEY2 <> T2.KEY2
Your reply will definitely appreciate to me.
Thank you.
Sanket
Hi,
I think you have to create more steps, at least two: in the first you have only the first join (KEY), then a second step to apply the second join (KEY2).
But how ?? Can you explain through script .. thats may be more helpful
Is this not a way,
Table1:
Load Key1 as #Key1,
Key2,
otherfields
from table;
Table 2:
Load Key as #Key1,
Key2 as #Key2,
otherfields
from table 2
where not exists(Key2)
;
when loaded,
this will map with #Key1 only. and
not exists will only load data of those values where Key2 is not avalilabe in table 1.
May be like :
JoinedTable:
Load
Field1,
KEY
From T1;
Left Join
Load
KEY,
KEY2
From T2;
Final:
Load
Count(Field1) as Count
Resident JoinedTable Where KEY<>KEY2;
Drop Table JoinedTable;
I think it is helpful.
You can do theta joins, but only in SQL script as far as i know. Solutions above are logical equivalents of "Not in", which can be regarded as type of a equi join.
If you want to do joins like A.No > B.No and A.No => C.No you better look how to move this to SQL script or other pluggable languages.