Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
savithri_n_s
Contributor III
Contributor III

how to use distinct, avg and count together

Hi Team,

I want to find the distinct supplier and average of count of contractor name. I want expression which will give the average value as 15 from the below table

Example

Supplier count of contractor name

A  10

B   20

Not sure what is wrong with below expression

avg(DISTINCT {<[Supplier] = {"=Count([Contractor Name]) =-{*"}>} [Supplier])

Please help

Regards,

Savithri

2 Replies
Or
MVP
MVP

I'm not sure if you have a reason for writing the aggregation into the set analysis, but if you do, you can probably modify this accordingly. Either way, you will have to use aggr() to nest two aggregations.

avg(Aggr(Count(distinct [Contractor Name]),[Supplier]))

sunny_talwar

Or may be this

Avg(Aggr(Count(DISTINCT Supplier), [Contractor Name]))