2 Replies Latest reply: Apr 19, 2016 5:21 AM by Stefan Wühl RSS

    SET ANALYSIS:HOW TO DO THE AVERAGE OF A DIFFERENCE

    Beatriz Manjón

      Hello all,

      Ihave some problems when doing the average of a difference in the set analysis as follows:

      The first part of the difference is set up as follows:

       

      • 1:

      ((sum(aggr(count(DISTINCT product),store, Date))

      /

      sum(aggr(count(DISTINCT store),Date))

      )

      -

      (sum(aggr(count(DISTINCT product),,store, Date))

      /

      sum(aggr(count(DISTINCT store),Date))))

       

       

      The second part of the difference is set up as follows:

      • 2:

       

      (sum(aggr(count(DISTINCT product),store, Date))

      /

      sum(aggr(count(DISTINCT id_tienda),Date)))

       

      • Being the difference 1-2

       

      ((sum(aggr(count(DISTINCT product),store, Date))

      /

      sum(aggr(count(DISTINCT store),Date))

      )

      -

      (sum(aggr(count(DISTINCT product),,store, Date))

      /

      sum(aggr(count(DISTINCT store),Date))))

       

      -

       

      (sum(aggr(count(DISTINCT product),store, Date))

      /

      sum(aggr(count(DISTINCT id_tienda),Date)))

       

      So, If I have two different dates for the same store and product, If I select one date, the difference shows the correct result,but when I do not select any date, I want to show the average and it is not showing in the correct way. Please see the example attached.


      Could anyone help me?


      Thanks in advance!