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: 
risabhroy_03
Partner - Creator II
Partner - Creator II

Sum of 2 rows

Hey, I have my table and below there is a row as follows - 

risabhroy_03_0-1657803662374.png

Actually, there are two records of the last line but only 1 line is coming as my table is automatically combining duplicate rows.

I want a single row only but if I want my "Net Quantity without QC" to be added up.

For ex - 

1) 315     ICB0000015     AA49209     3     BOA64817/19     Purchased     R     PC       1

2) 315     ICB0000015     AA49209     3     BOA64817/19     Purchased     R     PC       1

 

It should come like - 

315     ICB0000015     AA49209     3     BOA64817/19     Purchased     R     PC       2

 

Please help

1 Solution

Accepted Solutions
risabhroy_03
Partner - Creator II
Partner - Creator II
Author

I tried everything, but then i used group by after resident and it worked.

View solution in original post

6 Replies
Or
MVP
MVP

Switch the field you want summed from being a dimension to being a measure with the formula Sum([Net Quantity without QC]).

 

risabhroy_03
Partner - Creator II
Partner - Creator II
Author

I am getting an error as Invalid expression.

sidhiq91
Specialist II
Specialist II

@risabhroy_03  Are you getting the error even after trying something like below:

NoConcatenate
Temp:
Load * inline [
ID,Code,SKUCODe,Value,ID1,Status,Return,Product,Net Quantity without QC
315,ICB0000015,AA49209, 3, BOA64817/19, Purchased, R, PC , 1

315,ICB0000015,AA49209, 3 , BOA64817/19, Purchased, R, PC , 1
];

 

Temp1:
Load ID,Code,SKUCODe,Value,ID1,Status,Return,Product,
Sum([Net Quantity without QC]) as Total_Sum
Resident Temp
Group by ID,Code,SKUCODe,Value,ID1,Status,Return,Product;


Drop table Temp;

Exit Script;

Please see the screen shot, i have got the desired output.

Or
MVP
MVP

It's nothing more than a basic sum. If you're getting an error, I'd guess that you gave us the wrong field name.

Mark_Little
Luminary
Luminary

As Or said it should be a simple SUM. 

Check the field name, after that it would be worth checking the field is definitely seen as NUM.

Try Count([Net Quantity without QC]). If you get a result it looks like it is treating the field as a string.

 

risabhroy_03
Partner - Creator II
Partner - Creator II
Author

I tried everything, but then i used group by after resident and it worked.