Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Abhi999
Contributor III
Contributor III

Combining two row and show row seperatly

If i gave below expression i am getting

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

Measure: =Sum(Amount)

Name                     Amount

Suresh+Sai           600

Mohan                   200

Prathap                300

But i want output as like mentioned below.

 

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

Suresh                    100

Sai                            500

Mohan                   200

Prathap                300

 

1 Solution

Accepted Solutions
Saravanan_Desingh

tab1:
LOAD * INLINE [
    Name, Amount
    Suresh, 100
    Mohan, 200
    Prathap, 300
    Sai, 500
];

Dim:
LOAD * INLINE [
    Dim
    1
    2
];

commQV92.PNG

View solution in original post

6 Replies
Saravanan_Desingh

Can you try this?

Dimensions:

Dim
=If(Dim=1,'Suresh+Sai',Name)

Expression:

If(Dim=1,Sum({<Name={'Suresh'}>+<Name={'Sai'}>}Amount), Sum(Amount))

 

Saravanan_Desingh

tab1:
LOAD * INLINE [
    Name, Amount
    Suresh, 100
    Mohan, 200
    Prathap, 300
    Sai, 500
];

Dim:
LOAD * INLINE [
    Dim
    1
    2
];

commQV92.PNG

Saravanan_Desingh

We can do it Script as below.

tab1:
LOAD * INLINE [
    Name, Amount
    Suresh, 100
    Mohan, 200
    Prathap, 300
    Sai, 500
];

Concatenate(tab1)
LOAD 'Suresh+Sai' As Name, Sum(Amount) As Amount
Resident tab1
Where Match(Name,'Suresh','Sai')
;
Saravanan_Desingh

commQV93.PNG

Abhi999
Contributor III
Contributor III
Author

Thanks saran working fine.

 

Saravanan_Desingh

you welcome