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

Combine two rows as one

Hi i need your help to get output like below.

I have two fields

Name       Amount

Suresh     100

Mohan   200

Prathap 300

Sai            500

 

I want to combine Suresh and Sai as one, required output like below

Name                     Amount

Suresh+Sai           600

Mohan                   200

Prathap                300

1 Solution

Accepted Solutions
Taoufiq_Zarra

attached qvw example

that's what I sent

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

9 Replies
Taoufiq_Zarra

@Abhi999  for example :

Data:

load if(Name='Suresh' or Name='Sai','Suresh+Sai',Name) as Name,Amount inline [
Name,Amount
Suresh,100
Mohan,200
Prathap,300
Sai,500
]
;

output:
noconcatenate

load Name,sum(Amount) as NewAmount resident Data group by Name;

drop table Data;

 

Taoufiq_ZARRA_0-1591196567867.png

 

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Abhi999
Contributor III
Contributor III
Author

thank you, is it possible in front end instead of script.

Taoufiq_Zarra

@Abhi999 

In front :

Add dimension : =if(Name='Suresh' or Name='Sai','Suresh+Sai',Name)

Measure: =Sum(Amount)

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Abhi999
Contributor III
Contributor III
Author

thanks your quick response, i want to show Prathap and mohan aswell not only Suresh and Sai .

I am expecting below:

Suresh and Sai as on row and remaining as usual.

Taoufiq_Zarra

attached qvw example

that's what I sent

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Abhi999
Contributor III
Contributor III
Author

Thank you Zarra, it works fine for me.

Abhi999
Contributor III
Contributor III
Author

Is it possible to show 

Suresh and said seperate and suresh+Sai seperate ?

 

Abhi999
Contributor III
Contributor III
Author

Using below we are able to combine Suresh and said show count. But I want to show Sai and Suresh seperatly and sures+Sai aswell.

 dimension : =if(Name='Suresh' or Name='Sai','Suresh+Sai',Name)

Abhi999
Contributor III
Contributor III
Author

 

Using below we are able to combine Suresh and said show count. But I want to show Sai and Suresh seperatly and suresh+Sai aswell.

 dimension : =if(Name='Suresh' or Name='Sai','Suresh+Sai',Name)