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

Mergin duplicate rows in QS

Hi,

i have the following issue. I hope you can guide me to the correct method for solving this issue.

I have the following table:

MergeRows.JPG

 

 As you can see, the first row is duplicated except the value in "Standard Price New".

My question is, is there a way to merge the duplicated rows ad keep the one with values, i.e 5000 in this case? There are 4 columns called "Standard Price ...." and the values can appear in any 4 of them, including all.

NOTE: The same could happen for any row so its not like the position is fixed for the duplicated row.

 

Please let me know if you require more information.

Resulting Table will only have the row with the value in the "standard Price ..." columns. So, is the picture above, the first row will disappear and the second row will take it's place.

Some background information as to how the second row is generated:

The second row is generated through a different script and then concatenated/joined to this table. which is why there are two rows with the same values.  The original table does not have any duplicates.

@sunny_talwar 

Thank you.

 

Labels (5)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

Try something like this.

Load 

Dim1,

Dim2, 

DimN

Max(Standardprice1) as Standardprice1,

Max(Standardprice2) as Standardprice2,

Max(Standardprice3) as Standardprice3

From TableSource

Group by Dim1, Dim2,DimN;

 

 

 

View solution in original post

1 Reply
Vegar
MVP
MVP

Try something like this.

Load 

Dim1,

Dim2, 

DimN

Max(Standardprice1) as Standardprice1,

Max(Standardprice2) as Standardprice2,

Max(Standardprice3) as Standardprice3

From TableSource

Group by Dim1, Dim2,DimN;