Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
francisvandergr
Partner - Creator II
Partner - Creator II

Wrong AVG in Chart

I have no good result for an avg when i count with 2 columns

I included an example.

Can someone help

1 Solution

Accepted Solutions
sunny_talwar

Check the attached

Capture.PNG

Change the expression for Qty from full accumulation to no accumulation and used the RangeSum(Above()) expression

RangeSum(Above(count(if(Project_Aanneemsom > '0' or Project_Aanneemsom < '0' or Meerwerk_Bedrag > '0' or Meerwerk_Bedrag < '0' ,Project_Code)), 0, RowNo()))

View solution in original post

3 Replies
swuehl
MVP
MVP

Try this as expression for Avg:

=[Total Amount]

/

Rangesum(Above(count(if(Project_Aanneemsom > '0' or Project_Aanneemsom < '0' or Meerwerk_Bedrag > '0' or Meerwerk_Bedrag < '0' ,Project_Code)),0,Rowno()))

sunny_talwar

Check the attached

Capture.PNG

Change the expression for Qty from full accumulation to no accumulation and used the RangeSum(Above()) expression

RangeSum(Above(count(if(Project_Aanneemsom > '0' or Project_Aanneemsom < '0' or Meerwerk_Bedrag > '0' or Meerwerk_Bedrag < '0' ,Project_Code)), 0, RowNo()))

swuehl
MVP
MVP

If you want to keep your totals, maybe use a Qty expression like

=FirstsortedValue(

Aggr(

  Rangesum( Above( count(if(Project_Aanneemsom > '0' or Project_Aanneemsom < '0' or Meerwerk_Bedrag > '0' or Meerwerk_Bedrag < '0' ,Project_Code)),0,rowno() ))

  ,Week)

, aggr(-Week,Week)

)

or if your Qty line values can't be negative, maybe just

=Max(

Aggr(

  Rangesum( Above( count(if(Project_Aanneemsom > '0' or Project_Aanneemsom < '0' or Meerwerk_Bedrag > '0' or Meerwerk_Bedrag < '0' ,Project_Code)),0,rowno() ))

  ,Week)

)