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: 
djaykumar
Contributor
Contributor

How to merge multiple rows into single row in qlikview

Hi,

I am struggling to merge multiple rows into single.

Please find below data

Material     Description                     Quantity

24                 Bolt                                    25

24                 Bolt                                      6

25                 Bush                                   10

26                Copper Cover                  2

26                Copper Cover                  6

Required output

Material     Description                     Quantity

24                 Bolt                                     31

25                 Bush                                   10

26                Copper Cover                   8

When I am using Straight table or pivot table I am getting  Required output . But My requirement is The requirement output should come in Table Box.

Please help me in this.

Thanks

Jay

Labels (1)
1 Solution

Accepted Solutions
StarinieriG
Partner - Specialist
Partner - Specialist

Try to see file attached

View solution in original post

5 Replies
StarinieriG
Partner - Specialist
Partner - Specialist

Hi,

to do that you have to use group by in the script.

 

Load

Material

Description

Sum(Quantity) as Quantity

from ....

group by

Material,

Description

;

djaykumar
Contributor
Contributor
Author

Hi  StarinieriG,

Thanks for quick reply

But without giving quantity in group by  I am getting  'Invalid expression'  error.

Please help me

Thanks,

Jay

 

StarinieriG
Partner - Specialist
Partner - Specialist

It's because you can't keep Quantity as dimension.

If you want to keep each distinct rows, you could create a new table (using the script that I suggested before) and then call the sum(quantity) in another way

djaykumar
Contributor
Contributor
Author

Hi  StarinieriG,

According to you  I am getting doubled  the quantity as below

Material     Description                     Quantity

24                 Bolt                                     62

25                 Bush                                   10

26                Copper Cover                   16

Thanks

Jay

StarinieriG
Partner - Specialist
Partner - Specialist

Try to see file attached