diff --git a/models/marts/ledger_current_state/contract_code_current.sql b/models/marts/ledger_current_state/contract_code_current.sql index a76ea68..90c7a40 100644 --- a/models/marts/ledger_current_state/contract_code_current.sql +++ b/models/marts/ledger_current_state/contract_code_current.sql @@ -26,8 +26,8 @@ with , cc.ledger_key_hash , row_number() over ( - partition by cd.contract_code_hash - order by cd.closed_at desc + partition by cc.contract_code_hash + order by cc.closed_at desc ) as rn from {{ ref('stg_contract_code') }} as cc {% if is_incremental() %}