6 Replies Latest reply: Aug 6, 2015 2:40 AM by Yakub Ali RSS

    Cumulative Sum Based on Dimensions

    Caio Santanna

      Hello, i was searching for answers to a problem I'm trying to solve, but I could not do it with what I found. So here is my question.

       

      I have 3 dimensions, Filial, Data and Codigo_Produto. For those 3, there is the field QTDE_ENTRADA, that can be seen on the fourth column ( entradas ). This column is a basic sum ( Sum(QTDE_ENTRADA) ).

       

      Then I have the last column that should be a cumulative column. Basically, it should respect the FILIAL and CODIGO_PRODUTO columns and consider all the previous or equal date in DATA column.

       

      So for example, the third line should be a sum considering FILIAL and CODIGO_PRODUTO with all the values <= DATA field. So, since third line DATA is "18/12/2014", it should cumulate everything equals or previous than itself (18/12/2014,12/09/2014,12/04/2014)

       

      Second line should cumulate itself and previous dates in DATA columns as well (12/09/2014,12/04/2014)...

      Print.PNG

      I don't know if I could make myself clear, I apologize for my English.

      Thanks in advance for the help.