2 Replies Latest reply: May 30, 2018 11:19 AM by Robin Hausdörfer RSS

    Peek value of next row within a group

    Christoph Albrecht

      I have a table like this:

       

      DateKey
      Date1A
      Date2B
      Date3A
      Date4A
      Date5B
      Date6B
      Date7B
      Date8A
      ......

       

      The result should look like:

       

      DateKeyDiff
      Date1A
      Date2B
      Date3ADate3-Date1
      Date4ADate4-Date3
      Date5BDate5-Date2
      Date6BDate6-Date5
      Date7BDate7-Date6
      Date8ADate8-Date4
      .........

       

      I can't solve the problem with peek, group by and sort by.

       

      Can anyone help me here?

       

      Thanks!