V_QUERY_BBDW_REVENUECAMPAIGN

Fields

Field Field Type Null Description
FINANCIALTRANSACTIONLINEITEMFACTID int yes
REVENUECAMPAIGNSYSTEMID uniqueidentifier yes
CAMPAIGNPRIORITY nvarchar(100) yes
CAMPAIGNPRIORITYGOAL money yes
CAMPAIGNSUBPRIORITYGOAL money yes
CAMPAIGNSUBPRIORITY nvarchar(100) yes
CAMPAIGNNAME nvarchar(100) yes
CAMPAIGNDESCRIPTION nvarchar(300) yes
CAMPAIGNLOOKUPID nvarchar(100) yes
CAMPAIGNSTARTDATEDIMID int yes
CAMPAIGNSTARTDATE datetime yes
CAMPAIGNENDDATEDIMID int yes
CAMPAIGNENDDATE datetime yes
CURRENCYSYSTEMID uniqueidentifier yes

Definition

Copy
create view BBDW.[V_QUERY_BBDW_REVENUECAMPAIGN] as 

select
  rc.[FINANCIALTRANSACTIONLINEITEMFACTID],
  rc.[REVENUECAMPAIGNSYSTEMID],
  cp.[CAMPAIGNPRIORITY],
  cp.[CAMPAIGNPRIORITYGOAL],
  cp.[CAMPAIGNSUBPRIORITYGOAL],
  cp.[CAMPAIGNSUBPRIORITY],
  c.[CAMPAIGNNAME],
  c.[CAMPAIGNDESCRIPTION],
  c.[CAMPAIGNLOOKUPID],
  c.[CAMPAIGNSTARTDATEDIMID],
  c.[CAMPAIGNSTARTDATE],
  c.[CAMPAIGNENDDATEDIMID],
  c.[CAMPAIGNENDDATE],
  cur.[CURRENCYSYSTEMID]
from BBDW.[FACT_REVENUECAMPAIGN] rc
left join BBDW.[DIM_CAMPAIGN] c on rc.[CAMPAIGNDIMID] = c.[CAMPAIGNDIMID] and rc.[CAMPAIGNDIMID] <> 0
left join BBDW.[DIM_CAMPAIGNPRIORITY] cp on rc.[CAMPAIGNPRIORITYDIMID] = cp.[CAMPAIGNPRIORITYDIMID]    and rc.[CAMPAIGNPRIORITYDIMID] <> 0
outer apply BBDW.[DIM_CURRENCY] cur 
where cur.[ISORGANIZATIONCURRENCY] = 1