Skip to content

Commit

Permalink
Add quality on littlepay_export_ts to device_transaction_purchases
Browse files Browse the repository at this point in the history
  • Loading branch information
SorenSpicknall committed Oct 11, 2023
1 parent 9d87459 commit 1a1cb55
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ stg_littlepay__device_transaction_purchases AS (
_payments_key,
_content_hash,
FROM add_keys_drop_full_dupes
-- Some purchases initially are given a value of 'autoscan' for product_id, and then that
-- value is later updated. No other partial duplicate conditions exist at implementation time.
QUALIFY ROW_NUMBER() OVER (
PARTITION BY
littlepay_transaction_id,
purchase_id
ORDER BY littlepay_export_ts DESC
) = 1
)

SELECT * FROM stg_littlepay__device_transaction_purchases

0 comments on commit 1a1cb55

Please sign in to comment.