5 Replies Latest reply: Apr 2, 2014 5:43 AM by Gao Adam RSS

    Sum a  value influenced by the same column values

    Gao Adam

      Hello Everyone, During Learning to use Qlikview ,I've got a problem ,Hope for everyone's Help Thanks

      First,I've a table like this without column D
      ----------------------------------------------

      A              B              C

        1              20             10

        1              30             20

        1              40             30

        2              10              2

        2              15              4

        2              20              6

        3              10              3

        3              20              6

        3              25              9   

      -----------------------------------------------

      Then I want to handle the table into the following table,and there's rule in handling the table that is

      -----------------------------------------------

      A                B                 C                D

      1                20               10                (B-C-D) 10                              A new start

      1                30               20                (B-C-D) 30-20-10=0                 the D in this row is all the D above this row

      1                39               30                (B-C-D) 39-30-10-0= -1                the D in this row is all the D above this row

      2                10               2                  8

      2                15               4                  3

      2                20               6                  3

      3                10               3                  7

      3                20               6                  7

      3                25               9                  2

      ---------------------------------------------------

      I handle the table in scripts ,So Hope for scripts in details to achieve this function ,Thank you very much for your help!!!