3 Replies Latest reply: Dec 15, 2014 11:16 AM by Christian Wolf RSS

    Removing Results with Peek or Previous

      Hello, I have a question about peek/previous. I have the following problem in my table:

       

      OrderOperationDateRecordType
      100101-01-2014Start
      100202-01-2014Middle
      100303-01-2014Middle
      100404-01-2014End
      100510-01-2014Middle
      100615-01-2014Middle
      101120-01-2014Start
      101222-01-2014Middle
      etc.

       

      For example, order 100 is completed at 04-01-2014, which is a given from a different dataset. Every operation after the enddate is just an administrative thing, where the operation is marked as complete.

       

      I want the order to end after operation number 4. I use the following code, which works well if there is only one Middle record after the end:

      if(Previous([ProductionOrder]) = [ProductionOrder] AND Previous([RecordType]) = 'end', 'Exclude', 'Include')as [Exclusion]

       

      But now only Operation 5 is excluded. How can I exclude operation 6 as well?