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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to merge similar rows

Hi Friends,

I have data like this

Inline

[

  A, B, C, Code, Amount

  1, 2, 3, PC, 900

  1,2,3,PC,900

  1, 3, 4, PM,  800

  1, 2, 4, TM, 800

  1, 2, 6, PC, 800

  ]

I have to merge first two rows and amount should be 1800.

Thanks

1 Solution

Accepted Solutions
MayilVahanan

Hi

Try like this

Load A,B,C, Sum(Amount) as Amount, Code Group by A,B,C, Code;
Load * inline
[
  A, B, C, Code, Amount
  1, 2, 3, PC, 900
  1,2,3,PC,900
  1, 3, 4, PM,  800
  1, 2, 4, TM, 800
  1, 2, 6, PC, 800
  ]
;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

4 Replies
martinpohl
Partner - Master
Partner - Master

Create a straight table chart.

Add fields A, B, C and Code as dimension

Create a formula sum(Amount)

This will show you the wanted value.

Regards

tresesco
MVP
MVP

In the front -end if you use aggregation function Sum() with other dimensions in a chart you get it as you want. If you are looking for script solution try like:

Input:    

Inline

[

  A, B, C, Code, Amount

  1, 2, 3, PC, 900

  1,2,3,PC,900

  1, 3, 4, PM,  800

  1, 2, 4, TM, 800

  1, 2, 6, PC, 800

  ];

NoConcatenate

Final:

Load

          A,

          B,

          C,

          Code

          Sum(Amount) as Amount

Resident Input Group By A, B, C, Code;

Drop Table Input;

ashfaq_haseeb
Champion III
Champion III

Hi,

Create New Chart --> Straight Table

Dimension

A

B

C

Code

Expression

=sum(Amount)

Regards

ASHFAQ

MayilVahanan

Hi

Try like this

Load A,B,C, Sum(Amount) as Amount, Code Group by A,B,C, Code;
Load * inline
[
  A, B, C, Code, Amount
  1, 2, 3, PC, 900
  1,2,3,PC,900
  1, 3, 4, PM,  800
  1, 2, 4, TM, 800
  1, 2, 6, PC, 800
  ]
;

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.