Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

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

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

Try this:

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

Not applicable

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

Thank you.  It works

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

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

mov
Esteemed Contributor III

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

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