Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
tanmay_bhardwaj
Contributor III
Contributor III

How to perform LEFT JOIN on the first matching row only

I am performing LEFT JOIN on two tables and below are their representative layouts.

Inside my LEFT TABLE I have multiple rows for a given Key, and on my RIGHT TABLE I have only one row for the same Key.

tanmay_bhardwaj_5-1691666182532.png

 

 

tanmay_bhardwaj_4-1691666165215.png

 

Now I want my result such that in my resultant table, for a given Key match only the first row in my LEFT TABLE is populated with the Value (as per the image below).

tanmay_bhardwaj_3-1691665737586.png

 

Is this feasible is Qlik Sense, can someone please help guide me in this regard.

Thanks

Environment: Qlik Sense Enterprise Client Managed for Windows

Version: QlikSense May 2023

 

 

 

 

Labels (2)
1 Solution

Accepted Solutions
Ravi_Nagmal
Contributor III
Contributor III

@tanmay_bhardwaj 
Add addition column in LEFT table with condition 

AutoNumber(RecNo(),Col 3) as Col 4

then create string in left table like 

Col 3 & Col 4 as Connection_String

and create same string in Right Table 

Col 3 & '1' as Connection_String

Left Join based on Connection_String and you are done

 

 

View solution in original post

2 Replies
Ravi_Nagmal
Contributor III
Contributor III

@tanmay_bhardwaj 
Add addition column in LEFT table with condition 

AutoNumber(RecNo(),Col 3) as Col 4

then create string in left table like 

Col 3 & Col 4 as Connection_String

and create same string in Right Table 

Col 3 & '1' as Connection_String

Left Join based on Connection_String and you are done

 

 

tanmay_bhardwaj
Contributor III
Contributor III
Author

@Ravi_Nagmal , thanks for your help, the logic worked perfectly.