8 Replies Latest reply: Sep 18, 2013 5:48 AM by Tresesco B RSS

    Sum up until dimension value

      Hello again...

       

      I have a quite similiar problem to http://community.qlik.com/thread/62049.

      But in my case it's a bit more complicated, having a master calendar attached and a second dimension.

       

      To be more explicit, here it is:

       

      Having a table ItemEntries:

      ItemNo, Qty, Date

      44444, 100, 24.01.2013

      55555, 300, 24.01.2013

      77777, 200, 24.01.2013

      55555, 200, 25.01.2013

      66666, 500, 25.01.2013

      77777, 300, 25.01.2013

       

      I want to sum up all items and their qty until the "masterdate". That means, I created a table  (in load script by for loop):

       

      MasterDate, ItemNo

      24.01.2013, 44444

      24.01.2013, 55555

      24.01.2013, 66666

      24.01.2013, 77777

      25.01.2013, 44444

      25.01.2013, 55555

      25.01.2013, 66666

      25.01.2013, 77777


      The challange is now to get the sum until the MasterDate. And like in the post of Adrien the expression =Sum({$<[Date]={'<=$(MasterDate)'}>} Qty) doesn't seem to work (same values for each ItemNo).

      The solution with accumulation wouldn't work here, if I see it right.


      Any idea? I've tried some things in the load script, but it seems that I have not the correct idea...

      Thanks a lot for your help!


      Best regards

      Andreas