Skip to main content

Hello. I work as a data analyst in a logistics warehouse, and I am totally new to Celonis and not very experienced in SQL servers either, but I was given the seat, since former analyst has retired.

My task is to create a Item-weight master that daily updates unit weight , with average of unit weight calculated from 10 most recent weighted record.

 

Since there are no RANK or TOP functions in Celonis, I am confused how can this be done.

Can anyone tell me how is it possible to be done on celonis?

 

Thank you.

Hello, I understand you want to create this table in the backend, right?

 

I think that can easily be achieved in SQL using the order by function, here i leave a sample query that may come in handy:

 

WITH RankedRecords AS (

  SELECT 

    Innercode,

    Weight,

    Timestamp,

    ROW_NUMBER() OVER (PARTITION BY Innercode ORDER BY Timestamp DESC) AS rn

  FROM 

    YourTableName

)

, RecentRecords AS (

  SELECT 

    Innercode,

    Weight

  FROM 

    RankedRecords

  WHERE 

    rn <= 10

)

SELECT 

  Innercode,

  AVG(Weight) AS AverageWeight

FROM 

  RecentRecords

GROUP BY 

  Innercode;

 


Reply