5 Replies Latest reply: Oct 21, 2010 11:09 AM by Dirk Groen RSS

    Summarize fieldvalues in Variable

    Fred Schonenberg

      Hi,

      Although it looks actually quite simple to me, I can't solve it.

      Table example:

       

      Accountnr

      Totaldeb

      1

      6454

      3

      87452

      5

      5145

      6

      12458

      10

      8514

      18

      67158

      20

      2917

      21

      7534

      101

      12208

      200

      48554



      Actually there are approx. 1000 accountnrs.

      What I would like to achieve is to summarize certain values into a variable, for example:
      The sum of Totaldeb for accountnr 1,5,6 and 20 should become variable varBanking.
      The sum of Totaldeb for accountnr 3,21 and 101 should become variable varStudy.
      Probably with a maximum number of 20 accounts per variable.

      QV Users should have the ability to change the range of accountnrs, through a (Comma seperated?) QV Inputfield (/variable)

      Any help will be appreciated.

       


      LOAD * INLINE [
      Accountnr, Totaldeb
      1, 6454
      3, 87452
      5, 5145
      6, 12458
      10, 8514
      18, 67158
      20, 2917
      21, 7534
      101, 12208
      200, 48554
      ];