Skip to main content

for a given vendor we have an invoice date and I would like to find the date of the last invoice relative to this current date. 

So for example we have date of invoice for given vendor 2.01.2023 and I would like to find date of last invoice for same vendor, that is for example 1.01.2023.

In celonis I would like to have in one column the date of the "current invoice" and in the other column the date of the previous invoice 

Hi Julia,

 

LEAD( Invoice_Date_Column , ORDER BY ( Invoice_Date_Column DESC ) , PARTITION BY ( Vendor Column ) ): this will give the date of the last invoice relative to the last date.

PS: If for every date there is a new invoice Id so that will work fine, if you have an invoice Id with different Dates and you just want the second last date so you need to add theINVOICE_ID_Column in the Partition By Field


Reply