4 Replies Latest reply: Apr 11, 2017 9:51 AM by Sebastian Fagerlund RSS

    Running total costumers

    Sebastian Fagerlund


      Have the following data:


      Costumer; Product;      MeasuringPoint;      Date;                 Branch

      15;               X;               1;                    2016-05-02;                   ME

      15;               X;               1;                    2016-07-13;                   ME

      15;               Y;               0;                    2016-11-11;                    ME    

      15;               Z;               1;                    2016-12-02;                   ME

      17;               X;               0;                    2017-02-06;                   AX

      17;               X;               0;                    2016-12-10;                   AX

      18;               X;               0;                    2017-03-07;                   AX

      18;               Z;               1;                    2016-07-09;                   AX    

      19;               X;               0;                    2016-05-11;                   IU


      The data tell us which costumer have which product in store(MeasuringPoint=1) or not and which date the control was made.


      count(distinct Costumer) - Total customers

      count({$<[Date]=>} distinct Date) - to calculate total costumers without the Date interfering



      What i need is a measure for running total for customers(distinct). If i choose the Date 2016-12-03 i want all the visited costumers from that date, which is in this case 3.

      The total visited consumers is 4, so we have visited one more consumers since the Date we choice.

      And the measure need to work if a choose to just look at one branch and/or a product.


      Have tried different kind of rangesum, above, aggr but can't make it work..