Skip to content

Latest commit

 

History

History
112 lines (72 loc) · 3.57 KB

README.md

File metadata and controls

112 lines (72 loc) · 3.57 KB

This dbt package contains macros that can be (re)used across dbt projects. The package also includes model required to collect dbt artifacts.

Installation Instructions

Check dbt Hub for the latest installation instructions, or read the docs for more information on installing packages.

Additionally, this package requires some new dbt cloud environment variable setup for writing data into Snowflake schema. Environment variable with following names need to be defined in your dbt Cloud project prior to this package use. These two variables will hold the schema name for writing dbt Artifacts & Test objects into your target database.

  1. DBT_ARTIFACTS_SCHEMA
  2. DBT_TEST_SCHEMA

Contents

Generic tests

Macros


Macros

lkp_exchange_rate_daily_oc (source)

Returns daily exchange rate for a particular division.

Usage:

{{ lkp_exchange_rate_daily(CURR_FROM_CODE,CURR_TO_CODE,EFF_FROM_D,ALIAS) }}

lkp_exchange_rate_daily (source)

Returns coroporate daily exchange rate.

Usage:

{{ lkp_exchange_rate_daily_oc(SOURCE_SYSTEM,CURR_FROM_CODE,CURR_TO_CODE,EFF_FROM_D,ALIAS) }}

lkp_exchange_rate_month (source)

Returns monthly exchange rate.

Usage:

{{ lkp_exchange_rate_month(FROM_CURRENCY_CODE ,TO_CURRENCY_CODE,FISCAL_YEAR_PERIOD_NO,EXCH_RATE_TYPE,ALIAS) }}

lkp_normalization (source)

Returns normalized value for a given source value.

Usage:

{{ lkp_normalization('SRC.SOURCE_SYSTEM','FINANCE','DOCUMENT_TYPE_CODE','UPPER(SRC.DOCUMENT_TYPE)','DOCUMENT_TYPE_LKP') }}

lkp_uom (source)

Returns normalized value for a given source value.

Usage:

{{ lkp_uom(ITEM_GUID,FROM_UOM,TO_UOM,ALIAS) }}

Getting started with dbt

Code of Conduct

Everyone interacting in the dbt project's codebases, issue trackers, chat rooms, and mailing lists is expected to follow the PyPA Code of Conduct.