Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Join issue

Hello everyone,

I have to left join two tables lets say a and b.

a has fields bill, facility and some other fields.

a:

bill   facility

1233     12

1233     13

1234     11

1234      12

1235   12

1236    12

1237    12

and in second table I have bill, creditdebits, revenue and discounts.

temp:

load

bill,

sum(credit_debit) as cd,

sum(discounts) as discounts1,

sum(_ev) as profit

Resident b

Group by bill;

left join (a)

load

* resident temp;

problem is the table a has multiple occurrences of bill but  I want to join with only one of those

5 Replies
sunny_talwar

Which one of those would you like to join it with? Is there a logic behind this join?

rubenmarin

Hi anita, for the bills 1233, 1234.. wich row you want to keep and what are the conditions to choose one row over other?

Chanty4u
MVP
MVP

try

load 

Distinct bill,

sum(credit_debit) as cd,

sum(discounts) as discounts1,

sum(_ev) as profit

Resident b

Group by bill;

left join (a)

load

* resident temp;

Not applicable
Author

I found the solution. Thanks for your help though.

Chanty4u
MVP
MVP

cooool

Please close the thread by making correct and helpful answers above.

Qlik Community Tip: Marking Replies as Correct or Helpful

Best

Chanty