Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
jobsjoe123
Contributor
Contributor

Aggregated Distinct Sum

Hello guys, 

I have data in the form 

Anchor IDAnchor NameElement IDElement NameJan-19Feb-19Mar-19Apr-19May-19Jun-19Jul-19Aug-19
123456789A124Element410150101510150
123456789A123Element351010520251010
123456789A122Element23010105105510
122245678B124Element410150101510150
133332213C122Element23010105105510
133332213C121Element100101515201015
144444444D125Element5777456715
144444444D126Element615222430221025

 

Using a crosstable, I've transformed the values into a REVENUE column. Each element has a revenue for each month, and is tied to an Anchor.   Now I want to sum the revenue for each Element, without repeating the revenue numbers for Elements that are tied to multiple anchors. 

So Ideally, i want to write a set analysis that results in a value of 528, after aggregating the unique revenue values for each Element . See below:

Element 185
Element 285
Element 395
Element 475
Element 558
Element 6130
 528

 

How do I go about this please?

Labels (2)
3 Replies
dplr-rn
Partner - Master III
Partner - Master III

that will be tricky as is.

I would suggest splitting the table into 2

1 with the Anchor and Element Association

the other with the actual data but you should remove anchor columns and run a distinct on it.

Hope that nudge helps 

asinha1991
Creator III
Creator III

maybe this

sum(REVENUE)/COUNT(DISTINCT [Element Name]&[Anchor ID])

Brett_Bleess
Former Employee
Former Employee

If either of the other posts helped, be sure to use the Accept as Solution button to give them credit on whichever post did help.  If you did figure something else out, consider posting that and mark it so others will know the solution in the future.  

The best I have to try to help out a bit is a Design Blog post on Set Analysis.  There are further links at the bottom of the post too, hopefully this may help if you are still trying to figure out the details, and I am going to include Help link too just in case.

https://community.qlik.com/t5/Qlik-Design-Blog/A-Primer-on-Set-Analysis/ba-p/1468344

https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/ChartFunctions/...

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.