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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
peisenrot
Contributor III
Contributor III

sum up but only one time the dimension

hello,

I want to sum up all Values of the dimension MaxRound but the each Name should be only 

MaxRound Name
4 Detlef
4 Detlef
3 Pia
3 Mike
2 Petra
2 Petra
   

 

so my sum should be: (4+3+3+2) and not (4+4+3+3+2+2). how can I add in the formular "Distinct Name"

Aggr(sum(MaxRound), distinct Name) is not working

Thanks for help

Pia

Labels (1)
4 Solutions

Accepted Solutions
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

How about 

Sum(Aggr(Max(MaxRound), Name))

-Rob

View solution in original post

Kushal_Chawda

@peisenrot  try below

=sum(aggr(sum(distinct MaxRound), Name))

View solution in original post

BrunPierre
Partner - Master II
Partner - Master II

You can try this too.

=Sum(Aggr(Only(MaxRound), Name))

View solution in original post

sidhiq91
Specialist II
Specialist II

@peisenrot  I tried something at the script level first. Please see the script below:

NoConcatenate
Table:
load * inline [
MaxRound, Name
4, Detlef
4, Detlef
3, Pia
3, Mike
2, Petra
2, Petra]
;

NoConcatenate
Table1:
Load *,
if(Name=Previous(Name) and MaxRound=Previous(MaxRound),'Duplicate','Not Duplicate') as Check
Resident Table;

Drop table Table;

Exit script;

In the front End: Sum({<Check={'Not Duplicate'}>}MaxRound)

Please like and accept it as a solution if this resolves your issue.

View solution in original post

4 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

How about 

Sum(Aggr(Max(MaxRound), Name))

-Rob

Kushal_Chawda

@peisenrot  try below

=sum(aggr(sum(distinct MaxRound), Name))

BrunPierre
Partner - Master II
Partner - Master II

You can try this too.

=Sum(Aggr(Only(MaxRound), Name))

sidhiq91
Specialist II
Specialist II

@peisenrot  I tried something at the script level first. Please see the script below:

NoConcatenate
Table:
load * inline [
MaxRound, Name
4, Detlef
4, Detlef
3, Pia
3, Mike
2, Petra
2, Petra]
;

NoConcatenate
Table1:
Load *,
if(Name=Previous(Name) and MaxRound=Previous(MaxRound),'Duplicate','Not Duplicate') as Check
Resident Table;

Drop table Table;

Exit script;

In the front End: Sum({<Check={'Not Duplicate'}>}MaxRound)

Please like and accept it as a solution if this resolves your issue.