diff --git a/definitions/staging/CAMPAIGN.sqlx b/definitions/staging/CAMPAIGN.sqlx new file mode 100644 index 0000000..dd2280d --- /dev/null +++ b/definitions/staging/CAMPAIGN.sqlx @@ -0,0 +1,22 @@ +config { + type: "view", + schema: "pphe_five9_stg", + tags: ["snapdaily"], + description: "All fields that are connected to the CAMPAIGN" +} + +select c.CAMPAIGN, + c.CAMPAIGN_ID, + cg.campaign_group_id, + cgi.campaign_group, + cit.CAMPAIGN_TYPE_ID, + ct.CAMPAIGN_TYPE +from ${ref("stg_MAPPING_CAMPAIGN")} c +join ${ref("stg_MAPPING_CAMPAIGN_GROUP")} cg +on c.CAMPAIGN_ID = cg.CAMPAIGN_ID +join ${ref("stg_MAPPING_CAMPAIGN_GROUP_ID")} cgi +on cg.campaign_group_id = cgi.campaign_group_id +join ${ref("stg_MAPPING_CAMPAIGN_ID_TYPE")} cit +on c.CAMPAIGN_ID = cit.CAMPAIGN_ID +join ${ref("stg_MAPPING_CAMPAIGN_TYPE")} ct +on ct.CAMPAIGN_TYPE_ID = cit.CAMPAIGN_TYPE_ID \ No newline at end of file