Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Christian_Lauritzen
Partner - Creator II
Partner - Creator II

Join problem; Sum in the where clause

Ideas why the join below does not work?

I suspect that I cannot use sum in the where clause, but hopefully I am wrong and there is another explanation. Would appreciate any hints!

Left join(Relations) LOAD Distinct

  relKey,

  FirstValue(tmp_rKey) as LeftKey2,

  FirstValue(tmp_sKey) as RightKey2

Resident Relations

where sum(docs) = 0

group by relKey;

Email: christian.lauritzen@b3.se
1 Solution

Accepted Solutions
Christian_Lauritzen
Partner - Creator II
Partner - Creator II
Author

Solved it by moving the sum condition to an if-clause on the line;

     if(sum(docs)>0,tmp_rKey) as LeftKey2    ... etc

Email: christian.lauritzen@b3.se

View solution in original post

2 Replies
Not applicable

left join (relations)

load leftkey2,rightkey2,sumdocs

k:

load distinct

   relkey, fistvalue(tmp_rkey) as leftkey2,

   firstvalue(tmp_skey)as Rightkey2, sum(docs) as sumdocs

resident relations

group by relkey;

left join(relatins)

load leftkey2,rightkey2,sumdocs resident k where sumdocs >0;

drop table k;

Christian_Lauritzen
Partner - Creator II
Partner - Creator II
Author

Solved it by moving the sum condition to an if-clause on the line;

     if(sum(docs)>0,tmp_rKey) as LeftKey2    ... etc

Email: christian.lauritzen@b3.se