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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikwiz123
Creator III
Creator III

Add only one value per row ID

I need to do a sum on a Value column per Row ID.

Row ID Value
0 0.5
0 0.5
0 0.5
1 1.7
1 1.7
1 1.7
1 1.7
2 2.3
2 2.3
3 1.1
3 1.1
3 1.1
3 1.1
3 1.1

 

My calculation should take only one value per Row ID

0.5+1.7+2.3+1.1 = 5.6

Labels (3)
5 Replies
Lisa_P
Employee
Employee

If you are doing this in the front end (sheets/charts), you would use Row ID as dimension and sum(Value) as measure.

To do this in the load script you use the group by function to aggregate per Row ID..

Load "Row ID",
   Sum(Value) as  NewValue
From ...
Group by "Row ID";

This creates a new table with the aggregated values.

qlikwiz123
Creator III
Creator III
Author

@Lisa_P Hi, I want to do this as a Text KPI on the front end. Built it using 

SUM(Aggr(Only(Value),Row ID))

Dataintellinalytics

@qlikwiz123  IF you are looking for KPI then I believe you have two options

1. Use Sum(Value) formula in KPI and then select any Row Id as per need in filter.

2. Or you can use set analysis and hardcode the Row Id using following Sum ( {<Row ID = {0}>} Value)

marcus_sommer

Maybe just:

sum(aggr(sum(distinct Value), [Row ID]))
or
sum(aggr(avg(Value), [Row ID]))

Qrishna
Master
Master

if you are trying to sum up the distinct values and show on the KPI, then = Sum(DISTINCT Value) should work. if try to group by Row ID you may get different results but if you wanna consider different values for the same id and do it for all other ids then prolly @marcus_sommer  solution should do the job.

 

2504485 -  Add only one value per row ID.PNG