Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Measure - Summing the Amount for Field based on distinct criteria for the other field in table

Hi All,

I have data that is pulled into one table with QuoteID and Amount field.  I am writing an expression for measure where I want to divide the Amount by the number of counts in QuoteID and then sum all the Amounts in the table.  Below is what I put in the syntax but seems like there is error in expression.  The data has QuoteID and amount associated to each QuoteID.  QuoteID is unique to most records but some QuoteID occur more than once and hence the Amount is multiplied by the number of times QuoteID apprears hence I want to divide the Amount by the Distinct(QuoteID) and then sum all the Amounts in the table in visualization.  Can someone please help?

Regards,

Monica

Sum([Amount]/Count(Distinct([Quote ID]))

4 Replies
sunny_talwar

Try this:

Sum(Aggr(Avg(Amount), [Quote ID]))

Not applicable
Author

Thank you.  It works

sunny_talwar

Awesome, if it worked, I would ask you to close this thread by marking the correct answer.

Qlik Community Tip: Marking Replies as Correct or Helpful

Best,

Sunny

Anonymous
Not applicable
Author

As far as I know, marking your own answer as helpful or correct doesn't add you any points.