Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
danielnevitt
Creator
Creator

Sum Distinct

Dear all,

I have the attached data and would appreciate some help calculating the sum of the abs_pos_vol by distinct our_reference.

The values are slightly different, however I am happy to sum either the lower or higher value.

Thanks,
Daniel

6 Replies
sunny_talwar

May be this for max

Sum(Aggr(
  Max(Aggr(
    abs_pos_vol
  , our_reference))
, our_reference))

 or this for Min

Sum(Aggr(
  Min(Aggr(
    abs_pos_vol
  , our_reference))
, our_reference))
danielnevitt
Creator
Creator
Author

Hi Sunny,

Thanks for the quick reply.

Unfortunately that doesn't work though.  The expression just returns a blank value.

Regards,
Daniel

sunny_talwar

What is abs_pos_vol? a field or expression?

danielnevitt
Creator
Creator
Author

abs_pos_vol is a numeric field.

Regards
Daniel

sunny_talwar

Sum(Aggr(
  Min(Aggr(
    abs_pos_vol
  , our_reference, abs_pos_vol))
, our_reference))
Brett_Bleess
Former Employee
Former Employee

Daniel, did Sunny's last post get you what you needed?  If so, please do not forget to close out your thread by using the Accept as Solution button on that post of Sunny's to do so.  This also gives him credit for the assistance and will let other Members know it worked.  If you did something different, you can post what you did and then mark that, but please be sure to close this out if possible.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.