0 Replies Latest reply: Jun 11, 2018 12:50 PM by Kalmer Kaljuste RSS

    Require help with incremental load when dimension changes

    Kalmer Kaljuste

      Hello!

       

      I'm sturggling to get my code to work. Please help me out guys.
      The issue is that i want to increase the value of the dimension "NewField" everytime the LineNr changes also the field "Controll" is there to let me know when i should increase the the value of the dimension.
      The red defines how it should be done.
      Honestly the Peek function for NewField is not working at all, only the rangesum gives me any result.

       

      concatenate(MasterTable)

      Load

          'Journey' as Fact,

          if(Controll=1, RangeSum(1, peek(NewField)+1),

            if(Controll=0, RangeSum(1, peek(NewField)), Peek(NewField))) as NewField,

          *

      ;

      Load

      if(Previous(_KEY_ProductID_TS_LineNr) = _KEY_ProductID_TS_LineNr, 0, 1) as Controll

      *,

      Resident tmp_Jour2

      order by Timestamp, ProductID, LineNr. asc;


      Untitled.png
      Any help is greatfully accepted!