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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Rania
Contributor
Contributor

How to merge rows with the same ID on non-null Fields?

Hi Qlik Community,

Need your help in merging rows using the same ID which  is in my case the "Key" field.

This is what I'm getting now :

What I got.png

This is what I'm expecting:

What I expected.PNG

 

PS: I did use the join and it's behaving as the Concatenate function, the rows did not get joined

Labels (4)
1 Solution

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You will need to merge using Group By and then join. Like this:

Final:  // Load the dimension fields
Load Distinct Key ClosingDate, EventDate, OpeningStock, Location, OTIN, ClosingStock
Resident mydata
;

Join (Final)
Load Key, 
  Max(Shipped) as Shipped
  Max(Blocked) as Blocked,
  Max(Received) as Received
Resident mydata
Group By Key
;

Drop Table mydata;

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com

View solution in original post

1 Reply
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

You will need to merge using Group By and then join. Like this:

Final:  // Load the dimension fields
Load Distinct Key ClosingDate, EventDate, OpeningStock, Location, OTIN, ClosingStock
Resident mydata
;

Join (Final)
Load Key, 
  Max(Shipped) as Shipped
  Max(Blocked) as Blocked,
  Max(Received) as Received
Resident mydata
Group By Key
;

Drop Table mydata;

-Rob
http://www.easyqlik.com
http://masterssummit.com
http://qlikviewcookbook.com