mirror of
https://gitlab.com/cief-data/dbt_cloud.git
synced 2026-08-28 08:44:11 +00:00
43 lines
1005 B
SQL
43 lines
1005 B
SQL
-- IMPORT
|
|
WITH currencies AS (
|
|
SELECT * FROM {{ ref('stg_exchange__currencies') }}
|
|
),
|
|
|
|
-- LOGIC
|
|
currencies_rename AS (
|
|
SELECT
|
|
currencies.currency_id,
|
|
currencies.name AS currency_name,
|
|
currencies.short_code AS currency_short_code,
|
|
currencies.symbol AS currency_symbol,
|
|
currencies.country_name AS currency_country_name,
|
|
currencies.created_datetime AS currency_created_datetime,
|
|
'{{ modules.datetime.datetime.now(modules.pytz.timezone("Asia/Kuala_Lumpur")) }}' AS _dbt_ran_datetime
|
|
|
|
FROM currencies
|
|
),
|
|
|
|
-- FINAL
|
|
final__dim_exchange__currencies AS (
|
|
SELECT
|
|
-- ids
|
|
currency_id,
|
|
|
|
-- dimensions
|
|
currency_name,
|
|
currency_short_code,
|
|
currency_symbol,
|
|
currency_country_name,
|
|
|
|
-- measures
|
|
|
|
-- date/times
|
|
currency_created_datetime,
|
|
|
|
-- metadata
|
|
_dbt_ran_datetime
|
|
|
|
FROM currencies_rename
|
|
)
|
|
|
|
SELECT * FROM final__dim_exchange__currencies |