Table connects all fields connected to CAMPAIGN

This commit is contained in:
Anna Saiapina 2024-02-28 14:28:50 +00:00 committed by GCP Dataform
parent cdf6725c1b
commit f538d21e6c

View File

@ -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