4 Replies Latest reply: May 9, 2016 7:32 AM by Stefan Wühl RSS

    Strange behavior calculating Average

    Julio Pinto

      Hello, im relatively new to qlik and im having trouble to find the correct expression to calculate an average.


      I'm trying to draw an avg line, sum of sales per count of years, in a combinated chart, but the result im getting is wrong.This is the expression im using : Sum(Total(LINEPRICE))/count(Distinct(ANO)).




      As you can see, in a KPI object, count(distinct(ANO)) is working correctly, but not in the chart. Now if i change the expression in chart to Sum(Total(LINEPRICE)) / 11 i get the result as i expected:


      Can someone, please, tell me what im doing wrong?

      Thanks in advance and sorry for my english.