0401修改
This commit is contained in:
@@ -7,20 +7,6 @@ table 00_KPI
|
||||
```
|
||||
lineageTag: 327243a7-d1c4-4efa-bec8-96f85ad40cec
|
||||
|
||||
measure 'chenwutest1 1' = ```
|
||||
|
||||
SUM ( Fact_Sales_Main_AIA[SALES_VALUE_CAL] )
|
||||
|
||||
```
|
||||
lineageTag: e759d580-5e15-4390-b0c0-68f39e297318
|
||||
|
||||
measure 'chenwutest1 2' = ```
|
||||
|
||||
SUM ( Fact_Sales_Main_CHPA[SALES_VALUE_CAL] )
|
||||
|
||||
```
|
||||
lineageTag: f42d8fd3-3a36-4646-8e70-020072dd89d5
|
||||
|
||||
measure '00.base.cu' =
|
||||
SUM ( Fact_Sales[CONUTING_UNIT] )
|
||||
//+ SUM ( Fact_Sales_Main_AIA[CONUTING_UNIT] )
|
||||
@@ -396,25 +382,25 @@ table 00_KPI
|
||||
VAR _count_TA = [00.base.if.countTA]
|
||||
RETURN
|
||||
SWITCH (
|
||||
TRUE ( ),
|
||||
( ISFILTERED ( Dim_RC ) || ISFILTERED ( Dim_Org )
|
||||
TRUE ( )
|
||||
, ( ISFILTERED ( Dim_RC ) || ISFILTERED ( Dim_Org )
|
||||
|| ISFILTERED ( Dim_IsTarget_AIASpecial )
|
||||
|| ISFILTERED ( Dim_HP_Potential_AIA ) )
|
||||
|| _count,
|
||||
CALCULATE (
|
||||
[00.base.value.ly],
|
||||
TREATAS (
|
||||
[00.base.value.ly]
|
||||
, TREATAS (
|
||||
VALUES ( Dim_Market[MKT_SOURCE] ),
|
||||
Dim_RC[MKT_SOURCE]
|
||||
),
|
||||
'0_Measure_CalGroup'[for_measure] = "_not_allmkt"
|
||||
),
|
||||
_count_TA,
|
||||
)
|
||||
, '0_Measure_CalGroup'[for_measure] = "_not_allmkt"
|
||||
)
|
||||
, _count_TA,
|
||||
CALCULATE (
|
||||
[00.base.value.ly],
|
||||
'0_Measure_CalGroup'[for_measure] = "_allmkt_TA"
|
||||
),
|
||||
CALCULATE (
|
||||
)
|
||||
, CALCULATE (
|
||||
[00.base.value.ly],
|
||||
'0_Measure_CalGroup'[for_measure] = "_allmkt"
|
||||
)
|
||||
@@ -900,44 +886,6 @@ table 00_KPI
|
||||
|
||||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||||
|
||||
measure 'chenwutest1 2 1' = ```
|
||||
|
||||
SUM ( Fact_Sales_Main_COUNTY[SALES_VALUE_CAL] )
|
||||
|
||||
```
|
||||
lineageTag: e9b9624d-3817-4f5d-b446-2e2e062b7472
|
||||
|
||||
measure 'chenwutest1 2 1 1' = ```
|
||||
|
||||
SUM ( Fact_Sales_Main_CHC[SALES_VALUE_CAL] )
|
||||
|
||||
```
|
||||
lineageTag: ffb5cf59-edcc-45ed-8358-826015e6bdf7
|
||||
|
||||
measure 'chenwutest1 2 1 1 1' = ```
|
||||
|
||||
SUM ( Fact_Sales_Main_DTP[SALES_VALUE_CAL] )
|
||||
|
||||
```
|
||||
lineageTag: e7a0ea7a-23e9-4160-8d48-ddddcc057a2e
|
||||
|
||||
measure 'chenwutest1 2 1 1 1 1' = ```
|
||||
|
||||
SUM ( Fact_Sales_Main_Retail[SALES_VALUE_CAL] )
|
||||
|
||||
```
|
||||
lineageTag: ef6de3f7-ee99-457a-bcf2-a56cf781d8c2
|
||||
|
||||
measure 'chenwutest1 2 1 1 1 1 1' = ```
|
||||
|
||||
SUM ( Fact_Sales_Main_EC[SALES_VALUE_CAL] )
|
||||
|
||||
```
|
||||
lineageTag: 7484c5d0-f2d7-4135-b161-265dc6b9f6e0
|
||||
|
||||
measure 'chenwutest1 2 1 1 1 1 1 1' = SUM ( Fact_Sales_Main_XH[SALES_VALUE_CAL] )
|
||||
lineageTag: ae2b39a3-19c9-41d4-adfc-e322d32f65d0
|
||||
|
||||
measure 'External.Prescription.LY.MTH' =
|
||||
VAR MKT =
|
||||
VALUES ( Dim_Market[MKT_SOURCE] )
|
||||
|
||||
@@ -1445,7 +1445,7 @@ table 'AIA.Measures'
|
||||
displayFolder: 01.General\02.1.TOPN
|
||||
lineageTag: f65f9380-1600-48d9-9a66-e4b9f395090f
|
||||
|
||||
measure YM_HasData_AIA = CALCULATE(FORMAT(MAX(Fact_Sales_Main_AIA[DATE_KEY]), "yyyyMM"), ALL(Fact_Sales),Fact_Sales[DATA_SOURCE] = "AIA(Monthly)" )
|
||||
measure YM_HasData_AIA = CALCULATE(FORMAT(MAX(FACT_SALES[DATE_KEY]), "yyyyMM"), ALL(Fact_Sales),Fact_Sales[DATA_SOURCE] = "AIA(Monthly)" )
|
||||
displayFolder: 03.Others
|
||||
lineageTag: f67a9f31-848b-4f84-8453-5e11486e9749
|
||||
|
||||
|
||||
@@ -115,7 +115,8 @@ table Dim_BrandDefaultMKT
|
||||
'Anti-HER2 Market',
|
||||
'Anti-HER2 mBC Market',
|
||||
'Fasenra Market',
|
||||
'Severe Asthma'
|
||||
'Severe Asthma',
|
||||
'DAPA Market'
|
||||
)
|
||||
THEN
|
||||
1
|
||||
@@ -155,7 +156,7 @@ table Dim_BrandDefaultMKT
|
||||
|
||||
changedProperty = IsHidden
|
||||
|
||||
annotation PBI_ResultType = Table
|
||||
annotation PBI_ResultType = Exception
|
||||
|
||||
annotation PBI_NavigationStepName = Navigation
|
||||
|
||||
|
||||
@@ -169,22 +169,6 @@ table Dim_Calendar
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column HasData_AIA =
|
||||
|
||||
VAR _end = [YM_HasData_AIA]
|
||||
VAR _start =
|
||||
( INT ( LEFT ( _end, 4 ) ) - 1 ) & "01"
|
||||
RETURN
|
||||
IF ( [YYYYMM] >= _start && [YYYYMM] <= _end, 1, 0 )
|
||||
/*
|
||||
用于AIA Dashboard的年月筛选。AIA只展示两年数据
|
||||
*/
|
||||
formatString: 0
|
||||
lineageTag: 28ea1db3-35a3-4be5-a6c9-30999ccd9232
|
||||
summarizeBy: sum
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column YYYYMM_EXTERNAL_AIA
|
||||
dataType: string
|
||||
lineageTag: 3d2b5b4e-57fd-496e-adf6-16b066dd8908
|
||||
|
||||
@@ -141,15 +141,6 @@ table Dim_Calendar_Alt
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column HasData_AIA
|
||||
formatString: 0
|
||||
lineageTag: d91ed9d4-8636-4e0e-9d9d-63ea67ed0bca
|
||||
summarizeBy: sum
|
||||
isNameInferred
|
||||
sourceColumn: Dim_Calendar[HasData_AIA]
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column YYYYMM_EXTERNAL_AIA
|
||||
lineageTag: 9a658880-79f1-4b7a-af50-10f383d01c94
|
||||
summarizeBy: none
|
||||
|
||||
@@ -51,7 +51,7 @@ table Dim_HP_Level
|
||||
|
||||
annotation PBI_NavigationStepName = Navigation
|
||||
|
||||
annotation PBI_ResultType = Exception
|
||||
annotation PBI_ResultType = Table
|
||||
|
||||
annotation TabularEditor_TableGroup = 04_DimTable
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ table Dim_KeyCompetitor
|
||||
|
||||
partition Dim_KeyCompetitor = m
|
||||
mode: import
|
||||
queryGroup: OLD
|
||||
queryGroup: Dim
|
||||
source = ```
|
||||
let
|
||||
Source = Value.NativeQuery(
|
||||
|
||||
@@ -1,246 +0,0 @@
|
||||
table Dim_MKTPackMapping
|
||||
lineageTag: 4faa718f-9d72-42fd-b611-ae3456efb818
|
||||
|
||||
column PACK_COD
|
||||
dataType: string
|
||||
lineageTag: f929b590-3327-45cc-9bdd-3e36fb798a43
|
||||
summarizeBy: none
|
||||
sourceColumn: PACK_COD
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column PROD_DES
|
||||
dataType: string
|
||||
lineageTag: 39cca25f-cf41-44b3-bf88-1060c058728e
|
||||
summarizeBy: none
|
||||
sourceColumn: PROD_DES
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column PROD_DES_C
|
||||
dataType: string
|
||||
lineageTag: f5a2d4f4-ef98-472c-a8c5-e10d4157861b
|
||||
summarizeBy: none
|
||||
sourceColumn: PROD_DES_C
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column MARKET
|
||||
dataType: string
|
||||
lineageTag: 236ff874-0645-4a1b-a952-a4584bbe3b90
|
||||
summarizeBy: none
|
||||
sourceColumn: MARKET
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column CLASS
|
||||
dataType: string
|
||||
lineageTag: a9af738b-c6a7-45bf-aaa1-457f6c190515
|
||||
summarizeBy: none
|
||||
sourceColumn: CLASS
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column VALUE_MARKET_RATIO
|
||||
dataType: double
|
||||
lineageTag: ed9c1da4-f249-48ec-9a22-35fa2aec2850
|
||||
summarizeBy: sum
|
||||
sourceColumn: VALUE_MARKET_RATIO
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||||
|
||||
column UNIT_MARKET_RATIO
|
||||
dataType: double
|
||||
lineageTag: 3aa2947e-e094-4d49-a034-c0d2db024515
|
||||
summarizeBy: sum
|
||||
sourceColumn: UNIT_MARKET_RATIO
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||||
|
||||
column COUNTINGUNIT_MARKET_RATIO
|
||||
dataType: double
|
||||
lineageTag: c7debf53-3444-481a-9f21-5e3c5710b2c0
|
||||
summarizeBy: sum
|
||||
sourceColumn: COUNTINGUNIT_MARKET_RATIO
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||||
|
||||
column DATA_SOURCE
|
||||
dataType: string
|
||||
lineageTag: 68d2c6a9-3b5f-4c1b-8e10-bea75569a878
|
||||
summarizeBy: none
|
||||
sourceColumn: DATA_SOURCE
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column MKT_SOURCE = [MARKET] & [DATA_SOURCE]
|
||||
lineageTag: 3831b652-2df2-4a51-bafc-021966147422
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column CLASS_SOURCE = [MARKET] & [CLASS] & [DATA_SOURCE]
|
||||
lineageTag: 24a198f0-9134-4367-aa72-b975194438a1
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column PDOT_MARKET_RATIO
|
||||
dataType: double
|
||||
lineageTag: a1e06cb5-6f0c-4e69-8c96-286c90adfe28
|
||||
summarizeBy: sum
|
||||
sourceColumn: PDOT_MARKET_RATIO
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||||
|
||||
column CLASS_DES = [CLASS]
|
||||
lineageTag: 8773177c-36be-440f-b0bf-5b64d1d4141e
|
||||
summarizeBy: none
|
||||
|
||||
changedProperty = SortByColumn
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column PACK_SOURCE = [PACK_COD] & [DATA_SOURCE] & [new_code]
|
||||
lineageTag: 893f7007-fe3e-404e-a05d-eceab4cc7571
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column KEY_COMPETITOR
|
||||
dataType: string
|
||||
lineageTag: 609d6b37-69a6-43ab-9b56-71cfdbfa60a0
|
||||
summarizeBy: none
|
||||
sourceColumn: KEY_COMPETITOR
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column NEW_CODE
|
||||
dataType: string
|
||||
lineageTag: 75a3a5f0-6b3e-4001-9623-c7fa4ac45f53
|
||||
summarizeBy: none
|
||||
sourceColumn: NEW_CODE
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column CMPS_DES =
|
||||
RELATED(Dim_PackInfo[CMPS_DES])
|
||||
// LOOKUPVALUE(Dim_PackInfo[CMPS_DES],Dim_PackInfo[PACK_SOURCE],[PACK_SOURCE])
|
||||
lineageTag: 63d4ad34-76a2-4200-b785-b22d45447d9c
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column MOLECULE_SOURCE = [CMPS_DES] & [DATA_SOURCE]
|
||||
lineageTag: 4ebdb8a9-984b-43cb-9326-46d0a83c33f0
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column KEY_COMPETITOR_CN
|
||||
dataType: string
|
||||
lineageTag: 3b7b1fd2-727c-4357-958c-60a9c0b21edb
|
||||
summarizeBy: none
|
||||
sourceColumn: KEY_COMPETITOR_CN
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column PDOT_TEXT = "counting unit"
|
||||
lineageTag: c9c27571-87a3-4ca2-9039-5b480a80c43d
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column PDOT_MARKET_RATIO_LEVEL = LOOKUPVALUE(Config_MarketRatio[brandratio_countingunit_level],Config_MarketRatio[MARKET],[MARKET],Config_MarketRatio[PACK_COD],[PACK_COD])
|
||||
lineageTag: 4538708d-0b3c-4676-8ba5-8c3c948fb07a
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column AIA_Remove
|
||||
dataType: int64
|
||||
formatString: 0
|
||||
lineageTag: 7f57ca04-d157-4e79-b8ef-c31fb5f2b36e
|
||||
summarizeBy: sum
|
||||
sourceColumn: AIA_Remove
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
partition Dim_MKTPackMapping = m
|
||||
mode: import
|
||||
queryGroup: OLD\非首页
|
||||
source = ```
|
||||
let
|
||||
Source =
|
||||
Value.NativeQuery(
|
||||
Databricks.Catalogs(
|
||||
ServerAddress, HttpPath, [
|
||||
Catalog = CatalogName,
|
||||
Database = null,
|
||||
EnableAutomaticProxyDiscovery = null,EnableQueryResultDownload="0"
|
||||
]
|
||||
){
|
||||
[Name = CatalogName, Kind = "Database"]
|
||||
}[Data],
|
||||
"
|
||||
SELECT DISTINCT
|
||||
A.PACK_COD,
|
||||
A.PROD_DES,
|
||||
A.PROD_DES_C,
|
||||
A.MARKET,CLASS,
|
||||
CAST(VALUE_MARKET_RATIO AS DECIMAL(38, 20)) VALUE_MARKET_RATIO,
|
||||
CAST(UNIT_MARKET_RATIO AS DECIMAL(38, 20)) UNIT_MARKET_RATIO,
|
||||
CAST(COUNTINGUNIT_MARKET_RATIO AS DECIMAL(38, 20)) COUNTINGUNIT_MARKET_RATIO,
|
||||
CAST(PDOT_MARKET_RATIO AS DECIMAL(38, 20)) PDOT_MARKET_RATIO,
|
||||
A.DATA_SOURCE,
|
||||
A.KEY_COMPETITOR,A.KEY_COMPETITOR_CN,A.NEW_CODE,
|
||||
CASE WHEN B.hidden_market is not null THEN 0 ELSE 1 END AS AIA_Remove
|
||||
FROM
|
||||
DM.DM_TD_EXTERNAL_MARKET_PACK_MAPPING A
|
||||
left join (
|
||||
select distinct
|
||||
hidden_market
|
||||
from dwd.dwd_gnd_ims_hidden_market
|
||||
where data_source = 'AIA') B
|
||||
on A.DATA_SOURCE = 'AIA(Monthly)' AND A.MARKET = B.hidden_market
|
||||
UNION ALL
|
||||
select
|
||||
'DTPOTHERS' as PACK_COD
|
||||
,'DTPOTHERS' as PROD_DES
|
||||
,'DTPOTHERS' as PROD_DES_C
|
||||
,'EGFR TKI Market' as MARKET
|
||||
,'Others' as CLASS
|
||||
,1 as VALUE_MARKET_RATIO
|
||||
,1 as UNIT_MARKET_RATIO
|
||||
,1 as COUNTINGUNIT_MARKET_RATIO
|
||||
,1 as PDOT_MARKET_RATIO
|
||||
,'DTP(Quarterly)' as DATA_SOURCE
|
||||
,'OTHERS' as KEY_COMPETITOR
|
||||
,'OTHERS' as KEY_COMPETITOR_CN
|
||||
,'' as NEW_CODE
|
||||
, 1
|
||||
"
|
||||
& UsingLimit,
|
||||
null,
|
||||
[
|
||||
EnableFolding = true
|
||||
]
|
||||
)
|
||||
in
|
||||
Source
|
||||
```
|
||||
|
||||
annotation PBI_ResultType = Exception
|
||||
|
||||
annotation PBI_NavigationStepName = Navigation
|
||||
|
||||
annotation TabularEditor_TableGroup = 04_DimTable
|
||||
|
||||
@@ -67,7 +67,7 @@ table Dim_Platform
|
||||
Source
|
||||
```
|
||||
|
||||
annotation PBI_ResultType = Exception
|
||||
annotation PBI_ResultType = Table
|
||||
|
||||
annotation PBI_NavigationStepName = Navigation
|
||||
|
||||
|
||||
@@ -186,24 +186,6 @@ table Fact_Sales
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column STORE_TYPE_SOURCE = [STORE_TYPE] & [DATA_SOURCE]
|
||||
lineageTag: 1152f877-9d11-4ad8-a4e9-e56b2d9ae477
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column PLATFORM_TYPE_SOURCE = [PLATFORM_TYPE] & [DATA_SOURCE]
|
||||
lineageTag: 3799fa82-b187-48de-9085-e7eb56137e2d
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column STORE_PLATFORM = [STORE_TYPE] & " - " & [PLATFORM_TYPE]
|
||||
lineageTag: 8b9050d4-c7f6-4a0e-9d00-1aff75be6332
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column CMPS_FLAG
|
||||
dataType: int64
|
||||
formatString: 0
|
||||
@@ -233,12 +215,6 @@ table Fact_Sales
|
||||
|
||||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||||
|
||||
column DEPT_SOURCE = [dept_name] & [DATA_SOURCE]
|
||||
lineageTag: d633ff86-610c-4194-9637-0943ed386d75
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column DEPT_NAME
|
||||
dataType: string
|
||||
lineageTag: 55ee1c72-c8d5-4bfc-8e89-bfec08ada73c
|
||||
@@ -272,18 +248,6 @@ table Fact_Sales
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column HP_SOURCE = [AIA_HP_FLAG] & [DATA_SOURCE]
|
||||
lineageTag: 70317408-2faf-4425-a64c-912904705571
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column INST_SOURCE = [INST_CODE] & [DATA_SOURCE]
|
||||
lineageTag: a4bfd8bf-f30f-4d48-9d28-6e3d6fb2023f
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column H_LEVEL
|
||||
dataType: int64
|
||||
lineageTag: 93973569-c447-41e6-b741-672a6539d97f
|
||||
@@ -310,24 +274,6 @@ table Fact_Sales
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column PRESCRIPTION_SOURCE = [PRESCRIPTION_TYPE] & [DATA_SOURCE]
|
||||
lineageTag: f7a5c002-152a-4f10-b177-ef6b5cc21719
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column REIMBURSETYPE_SOURCE = [REIMBURSE_TYPE] & [DATA_SOURCE]
|
||||
lineageTag: beb9f5b1-422d-4432-9d52-5083dad9f0db
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column REIMBURSE_SOURCE = [REIMBURSE] & [DATA_SOURCE]
|
||||
lineageTag: 02bac298-0bb2-44d6-9c74-9bf37f75af03
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column PRESCRIPTION_TYPE
|
||||
dataType: string
|
||||
lineageTag: 45ea0f30-12b1-4e20-93ea-e5cb2d06828a
|
||||
@@ -564,6 +510,78 @@ table Fact_Sales
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column STORE_TYPE_SOURCE
|
||||
dataType: string
|
||||
lineageTag: 430d4e99-08f2-4ded-a21c-4e52d19caf84
|
||||
summarizeBy: none
|
||||
sourceColumn: STORE_TYPE_SOURCE
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column STORE_PLATFORM
|
||||
dataType: string
|
||||
lineageTag: 757ab79c-ffaa-40b9-a2db-44a977ff1b41
|
||||
summarizeBy: none
|
||||
sourceColumn: STORE_PLATFORM
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column REIMBURSETYPE_SOURCE
|
||||
dataType: string
|
||||
lineageTag: ce0f0ae2-6cf9-4ecb-876e-720b5d09bfed
|
||||
summarizeBy: none
|
||||
sourceColumn: REIMBURSETYPE_SOURCE
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column REIMBURSE_SOURCE
|
||||
dataType: string
|
||||
lineageTag: 95c84fd0-f40c-4473-9bae-95e405df3c53
|
||||
summarizeBy: none
|
||||
sourceColumn: REIMBURSE_SOURCE
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column PRESCRIPTION_SOURCE
|
||||
dataType: string
|
||||
lineageTag: e04b9537-3b7f-4ec8-aedc-07c077e73269
|
||||
summarizeBy: none
|
||||
sourceColumn: PRESCRIPTION_SOURCE
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column PLATFORM_TYPE_SOURCE
|
||||
dataType: string
|
||||
lineageTag: 9c2d6c1c-e17c-4f94-aaa6-41e9d5065656
|
||||
summarizeBy: none
|
||||
sourceColumn: PLATFORM_TYPE_SOURCE
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column DEPT_SOURCE
|
||||
dataType: string
|
||||
lineageTag: 2e332296-d864-4799-b97c-3d6fb4066702
|
||||
summarizeBy: none
|
||||
sourceColumn: DEPT_SOURCE
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column INST_SOURCE
|
||||
dataType: string
|
||||
lineageTag: 3c319b8d-3dfe-4a24-981e-d5810532af61
|
||||
summarizeBy: none
|
||||
sourceColumn: INST_SOURCE
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column HP_SOURCE
|
||||
dataType: string
|
||||
lineageTag: 5c652aa6-ab3e-4bca-982d-9d38f6bef113
|
||||
summarizeBy: none
|
||||
sourceColumn: HP_SOURCE
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
partition Fact_Sales = m
|
||||
mode: import
|
||||
queryGroup: Fact_Sales
|
||||
@@ -610,6 +628,16 @@ table Fact_Sales
|
||||
CONCAT(AUDIT_COD,DATA_SOURCE) AS AUDIT_SOURCE,
|
||||
CONCAT(AUDIT_COD,DATA_SOURCE,'' ) AS AUDIT_KEY,
|
||||
CONCAT(MARKET,CLASS,DATA_SOURCE) AS CLASS_KEY,
|
||||
|
||||
CONCAT(STORE_TYPE,DATA_SOURCE) AS STORE_TYPE_SOURCE,
|
||||
CONCAT(STORE_TYPE,'-',PLATFORM_TYPE) AS STORE_PLATFORM,
|
||||
CONCAT(REIMBURSE_TYPE,DATA_SOURCE) AS REIMBURSETYPE_SOURCE,
|
||||
CONCAT(REIMBURSE,DATA_SOURCE) AS REIMBURSE_SOURCE,
|
||||
CONCAT(PRESCRIPTION_TYPE,DATA_SOURCE) AS PRESCRIPTION_SOURCE,
|
||||
CONCAT(PLATFORM_TYPE,DATA_SOURCE) AS PLATFORM_TYPE_SOURCE,
|
||||
CONCAT(dept_name,DATA_SOURCE) AS DEPT_SOURCE,
|
||||
CONCAT(INST_CODE,DATA_SOURCE) AS INST_SOURCE,
|
||||
CONCAT(AIA_HP_FLAG,DATA_SOURCE) AS HP_SOURCE,
|
||||
-------------------------------------
|
||||
--Retail藏数逻辑标签------------------
|
||||
PACK_FLAG,
|
||||
@@ -645,13 +673,10 @@ table Fact_Sales
|
||||
MERGED_DATA_DTP_OTHERS,
|
||||
EGFR_FLAG,
|
||||
-------------------------------------
|
||||
CORP_COD
|
||||
NULL AS CORP_COD
|
||||
from
|
||||
DM.DM_TF_EXT_UNIONALL_SALES_MAPPING
|
||||
--where
|
||||
--DATA_SOURCE = 'THC(Quarterly)'
|
||||
--and yyyymm >= 202501
|
||||
"
|
||||
"& Fact_Sales_SQL_limit
|
||||
& UsingLimit,
|
||||
null,
|
||||
[
|
||||
|
||||
@@ -209,30 +209,6 @@ table Fact_Sales_THC
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column PACK_CODE
|
||||
dataType: string
|
||||
lineageTag: 1aca511a-879e-45c6-b8fb-9684c9e51a2f
|
||||
summarizeBy: none
|
||||
sourceColumn: PACK_CODE
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column CORP_CODE
|
||||
dataType: string
|
||||
lineageTag: 188469e1-d875-4fcb-9c55-e86cb6badfc8
|
||||
summarizeBy: none
|
||||
sourceColumn: CORP_CODE
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column AUDIT_CODE
|
||||
dataType: string
|
||||
lineageTag: 5fbae632-435b-48a2-8f93-e23eb7afd177
|
||||
summarizeBy: none
|
||||
sourceColumn: AUDIT_CODE
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column CMPS_FLAG
|
||||
dataType: string
|
||||
lineageTag: 565b34fe-1d3d-4708-92b1-75f283e405ff
|
||||
@@ -385,24 +361,6 @@ table Fact_Sales_THC
|
||||
|
||||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||||
|
||||
column ETL_INSERT_DT
|
||||
dataType: dateTime
|
||||
formatString: General Date
|
||||
lineageTag: 8f45d181-1858-4c13-a9f7-0cb2ca77c429
|
||||
summarizeBy: none
|
||||
sourceColumn: ETL_INSERT_DT
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column ETL_UPDATE_DT
|
||||
dataType: dateTime
|
||||
formatString: General Date
|
||||
lineageTag: 16b492ce-7b45-47da-9f75-f7a092cde75b
|
||||
summarizeBy: none
|
||||
sourceColumn: ETL_UPDATE_DT
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column MARKET_KEY
|
||||
dataType: string
|
||||
lineageTag: 7827470a-6fd4-49c7-b432-75d6ce8986cb
|
||||
@@ -411,6 +369,30 @@ table Fact_Sales_THC
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column PACK_COD
|
||||
dataType: string
|
||||
lineageTag: fe7d5135-41de-4f1a-af98-22b14a760dfa
|
||||
summarizeBy: none
|
||||
sourceColumn: PACK_COD
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column CORP_COD
|
||||
dataType: string
|
||||
lineageTag: 57a11780-70d7-4454-a8e7-ba7fae398261
|
||||
summarizeBy: none
|
||||
sourceColumn: CORP_COD
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column AUDIT_COD
|
||||
dataType: string
|
||||
lineageTag: b4cf1c2e-9d9a-4101-b09c-988725796e51
|
||||
summarizeBy: none
|
||||
sourceColumn: AUDIT_COD
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
partition Fact_Sales_THC = m
|
||||
mode: import
|
||||
queryGroup: Fact_Sales
|
||||
@@ -428,7 +410,48 @@ table Fact_Sales_THC
|
||||
]
|
||||
){[Name = CatalogName, Kind = "Database"]}[Data],
|
||||
"
|
||||
SELECT *,CONCAT(MARKET,DATA_SOURCE) MARKET_KEY FROM DM.dm_tf_ext_thc_market_sales_cht
|
||||
SELECT
|
||||
MARKET,
|
||||
KEY_COMPETITOR,
|
||||
CLASS,
|
||||
YYYYMM,
|
||||
PACK_CODE AS PACK_COD,
|
||||
CORP_CODE AS CORP_COD,
|
||||
AUDIT_CODE AS AUDIT_COD,
|
||||
PLATFORM_TYPE,
|
||||
STORE_NAME,
|
||||
STORE_TYPE,
|
||||
REGION_TYPE,
|
||||
DATA_SOURCE,
|
||||
PACK_FLAG,
|
||||
PROD_FLAG,
|
||||
DTP_FLAG,
|
||||
CMPS_FLAG,
|
||||
NEW_CODE,
|
||||
INST_CODE,
|
||||
AIA_HP_FLAG,
|
||||
DEPT_NAME,
|
||||
H_LEVEL,
|
||||
REIMBURSE,
|
||||
REIMBURSE_TYPE,
|
||||
PRESCRIPTION_TYPE,
|
||||
PRESCRIPTION,
|
||||
PRESCRIPTION_LY,
|
||||
VA,
|
||||
UT,
|
||||
CU,
|
||||
PT,
|
||||
SALES_UNIT_CAL,
|
||||
SALES_UNIT_CAL_LY,
|
||||
SALES_VALUE_CAL,
|
||||
SALES_VALUE_CAL_LY,
|
||||
CONUTING_UNIT,
|
||||
CONUTING_UNIT_LY,
|
||||
PDOT,
|
||||
PDOT_LY,
|
||||
CONCAT(MARKET, DATA_SOURCE) MARKET_KEY
|
||||
FROM
|
||||
DM.dm_tf_ext_thc_market_sales_cht
|
||||
"
|
||||
& UsingLimit,
|
||||
null,
|
||||
@@ -440,7 +463,7 @@ table Fact_Sales_THC
|
||||
|
||||
annotation PBI_NavigationStepName = 导航
|
||||
|
||||
annotation PBI_ResultType = Exception
|
||||
annotation PBI_ResultType = Table
|
||||
|
||||
annotation TabularEditor_TableGroup = 05_FactTable
|
||||
|
||||
|
||||
@@ -539,133 +539,7 @@ table 'Measure THC'
|
||||
displayFolder: 01.Sales
|
||||
lineageTag: 0816b80a-c02d-4d15-853d-1abb961b1488
|
||||
|
||||
measure 'External.Sales.MTH.MID_THC5' = ```
|
||||
|
||||
VAR DS = SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||||
VAR DS1 = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||||
VAR MKT_FLAG =
|
||||
SWITCH(TRUE(),
|
||||
ISFILTERED(Dim_Market),
|
||||
MAX(Dim_Market[MKT_FLAG]),
|
||||
ISFILTERED(Dim_BrandDefaultMKT),
|
||||
CALCULATE(MAX(Dim_BrandDefaultMKT[MKT_FLAG]),Dim_BrandDefaultMKT[DATA_SOURCE] = DS1),
|
||||
0)
|
||||
VAR PROD_FLAG =
|
||||
SWITCH(TRUE(),
|
||||
ISFILTERED(Dim_Market),
|
||||
MAX(Dim_Market[PRD_FLAG]),
|
||||
ISFILTERED(Dim_BrandDefaultMKT),
|
||||
CALCULATE(MAX(Dim_BrandDefaultMKT[PRD_FLAG]),Dim_BrandDefaultMKT[DATA_SOURCE] = DS1),
|
||||
0)
|
||||
RETURN
|
||||
SWITCH (
|
||||
TRUE (),
|
||||
//若选择Molecule,选择地理,且市场是品牌报告里面的市场
|
||||
--ISFILTERED(Dim_IsTarget) &&
|
||||
// NOT ISFILTERED(Dim_Market) && NOT ISFILTERED(Dim_BrandDefaultMKT),BLANK(),
|
||||
ISFILTERED(Dim_CoreDept) && NOT ISFILTERED(Dim_Market) && NOT ISFILTERED(Dim_BrandDefaultMKT),BLANK(),
|
||||
DS IN {"Retail","EC"} && MKT_FLAG = 1
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PROD_COD] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_DES_C] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PROD_DES] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_CORP] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PACK_COD] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_CORP_C] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PROD_PACK_CORP] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_PACK] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PACK_DES] ) && NOT ISFILTERED ( Dim_PackInfo[PACK_LCH] )
|
||||
&& ISFILTERED(Dim_Geo) && ( ISFILTERED ( Dim_PackInfo[MOLECULE_CODE_DESC] )
|
||||
|| ISFILTERED ( Dim_PackInfo[MOLECULE_DES_C] ) ||ISFILTERED ( Dim_PackInfo[CMPS_COD] )
|
||||
|| ISFILTERED ( Dim_PackInfo[CMPS_DES] ) || ISFILTERED ( Dim_PackInfo[CMPS_DES_C] )),
|
||||
[External.Sales.MTH_THC_4],
|
||||
|
||||
//除开特定市场外,其余的retail,针对于class,选择地理或org维度,值为空
|
||||
DS = "Retail" && (ISFILTERED(Dim_Geo) || ISFILTERED(Dim_Org)) && ISFILTERED(Dim_Class)
|
||||
&& (ISFILTERED(Dim_Market) || ISFILTERED(Dim_BrandDefaultMKT)) && MKT_FLAG = 0,BLANK(),
|
||||
|
||||
//选择市场,只出现品牌报告里面的有市场;
|
||||
DS = "Retail" && (ISFILTERED(Dim_Geo) || ISFILTERED(Dim_Org))
|
||||
&& (ISFILTERED(Dim_Market) || ISFILTERED(Dim_BrandDefaultMKT)) && PROD_FLAG = 0,BLANK(),
|
||||
|
||||
--若不选pack,用于计算class相关KPI
|
||||
DS IN {"Retail","EC"}
|
||||
&& (ISFILTERED ( Dim_Geo ) || ISFILTERED ( Dim_Org ))
|
||||
&& NOT ISFILTERED(Dim_PackInfo),
|
||||
[External.Sales.MTH_THC_4],
|
||||
|
||||
//若选择Molecule,没选择地理
|
||||
DS IN {"Retail","EC"} && NOT ISFILTERED(Dim_Geo) && NOT ISFILTERED(Dim_Org)
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PROD_COD] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_DES_C] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PROD_DES] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_CORP] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PACK_COD] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_CORP_C] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PROD_PACK_CORP] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_PACK] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PACK_DES] ) && NOT ISFILTERED ( Dim_PackInfo[PACK_LCH] )
|
||||
&& ( ISFILTERED ( Dim_PackInfo[MOLECULE_CODE_DESC] )
|
||||
|| ISFILTERED ( Dim_PackInfo[MOLECULE_DES_C] ) ||ISFILTERED ( Dim_PackInfo[CMPS_COD] )
|
||||
|| ISFILTERED ( Dim_PackInfo[CMPS_DES] ) || ISFILTERED ( Dim_PackInfo[CMPS_DES_C] )),
|
||||
[External.Sales.MTH_THC_4],
|
||||
|
||||
//若选择Molecule,选择地理
|
||||
DS IN {"Retail","EC"}
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PROD_COD] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_DES_C] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PROD_DES] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_CORP] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PACK_COD] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_CORP_C] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PROD_PACK_CORP] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_PACK] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PACK_DES] ) && NOT ISFILTERED ( Dim_PackInfo[PACK_LCH] )
|
||||
&& ( ISFILTERED ( Dim_PackInfo[MOLECULE_CODE_DESC] )
|
||||
|| ISFILTERED ( Dim_PackInfo[MOLECULE_DES_C] ) ||ISFILTERED ( Dim_PackInfo[CMPS_COD] )
|
||||
|| ISFILTERED ( Dim_PackInfo[CMPS_DES] ) || ISFILTERED ( Dim_PackInfo[CMPS_DES_C] )),
|
||||
CALCULATE (
|
||||
[External.Sales.MTH_THC_4]
|
||||
// ,
|
||||
// Fact_Sales_THC[CMPS_FLAG] = 1
|
||||
),
|
||||
|
||||
//若选择BRAND,没有选择地理
|
||||
DS IN {"Retail","EC"}
|
||||
&& NOT ISFILTERED ( Dim_Geo ) && NOT ISFILTERED ( Dim_Org )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PACK_COD] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_PACK_CORP] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PACK_DES] ) && NOT ISFILTERED ( Dim_PackInfo[PACK_LCH] )
|
||||
&& (ISFILTERED ( Dim_PackInfo[PROD_COD] ) || ISFILTERED ( Dim_PackInfo[PROD_CORP_C] )
|
||||
|| ISFILTERED ( Dim_PackInfo[PROD_DES] ) || ISFILTERED ( Dim_PackInfo[PROD_DES_C] )),
|
||||
CALCULATE (
|
||||
[External.Sales.MTH_THC_4],
|
||||
Fact_Sales_THC[PROD_FLAG] IN {1, 2}
|
||||
),
|
||||
|
||||
//若选择BRAND,选择地理
|
||||
DS IN {"Retail","EC"}
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PACK_COD] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PROD_PACK_CORP] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PACK_DES] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PACK_LCH] )
|
||||
&& (ISFILTERED ( Dim_PackInfo[PROD_COD] ) || ISFILTERED ( Dim_PackInfo[PROD_CORP_C] )
|
||||
|| ISFILTERED ( Dim_PackInfo[PROD_DES] ) || ISFILTERED ( Dim_PackInfo[PROD_DES_C] )),
|
||||
CALCULATE (
|
||||
[External.Sales.MTH_THC_4]
|
||||
// ,
|
||||
// Fact_Sales_THC[GEO_FLAG] = 1
|
||||
),
|
||||
|
||||
//若选择PACKAGE,不选择地理维度,1表示pack+省份数据;2表示pack+全国的数据
|
||||
DS IN {"Retail","EC"} && NOT ISFILTERED ( Dim_Org ) && NOT ISFILTERED ( Dim_Geo )
|
||||
&& (ISFILTERED ( Dim_PackInfo[PACK_DES] ) || ISFILTERED ( Dim_PackInfo[PACK_LCH] )
|
||||
|| ISFILTERED ( Dim_PackInfo[PACK_COD] ) || ISFILTERED ( Dim_PackInfo[PROD_PACK_CORP] )),
|
||||
CALCULATE (
|
||||
[External.Sales.MTH_THC_4]
|
||||
// ,
|
||||
// Fact_Sales_THC[PACK_FLAG] IN { 1, 2 }
|
||||
),
|
||||
|
||||
|
||||
//若选择PACKAGE,且省份维度不是全国
|
||||
DS IN {"Retail","EC"}
|
||||
&& (ISFILTERED ( Dim_PackInfo[PACK_DES] ) || ISFILTERED ( Dim_PackInfo[PACK_LCH] )
|
||||
|| ISFILTERED ( Dim_PackInfo[PACK_COD] ) || ISFILTERED ( Dim_PackInfo[PROD_PACK_CORP] )),
|
||||
CALCULATE (
|
||||
[External.Sales.MTH_THC_4]
|
||||
// ,
|
||||
// Fact_Sales_THC[PACK_FLAG] = 1
|
||||
),
|
||||
[External.Sales.MTH_THC_4]
|
||||
)
|
||||
```
|
||||
measure 'External.Sales.MTH.MID_THC5' = [External.Sales.MTH_THC_4]
|
||||
displayFolder: 01.Sales
|
||||
lineageTag: 8de3068e-0b94-4eb3-b1cc-c063a3368d7e
|
||||
|
||||
@@ -1080,129 +954,7 @@ table 'Measure THC'
|
||||
displayFolder: 02.Sales LY
|
||||
lineageTag: 1795081a-b035-42ff-85d9-b667f1a563ab
|
||||
|
||||
measure 'External.Sales.LY.MTH.MID_THC5' = ```
|
||||
|
||||
VAR DS = SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||||
VAR DS1 = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||||
VAR MKT_FLAG =
|
||||
SWITCH(TRUE(),
|
||||
ISFILTERED(Dim_Market),
|
||||
MAX(Dim_Market[MKT_FLAG]),
|
||||
ISFILTERED(Dim_BrandDefaultMKT),
|
||||
CALCULATE(MAX(Dim_BrandDefaultMKT[MKT_FLAG]),Dim_BrandDefaultMKT[DATA_SOURCE] = DS1),
|
||||
0)
|
||||
VAR PROD_FLAG =
|
||||
SWITCH(TRUE(),
|
||||
ISFILTERED(Dim_Market),
|
||||
MAX(Dim_Market[PRD_FLAG]),
|
||||
ISFILTERED(Dim_BrandDefaultMKT),
|
||||
CALCULATE(MAX(Dim_BrandDefaultMKT[PRD_FLAG]),Dim_BrandDefaultMKT[DATA_SOURCE] = DS1),
|
||||
0)
|
||||
|
||||
RETURN
|
||||
SWITCH (
|
||||
TRUE (),
|
||||
// ISFILTERED(Dim_IsTarget) && NOT ISFILTERED(Dim_Market) && NOT ISFILTERED(Dim_BrandDefaultMKT),BLANK(),
|
||||
ISFILTERED(Dim_CoreDept) && NOT ISFILTERED(Dim_Market) && NOT ISFILTERED(Dim_BrandDefaultMKT),BLANK(),
|
||||
//若选择地理,且省份维度不是全国
|
||||
DS IN {"Retail","EC"} && MKT_FLAG = 1
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PROD_COD] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_DES_C] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PROD_DES] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_CORP] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PACK_COD] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_CORP_C] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PROD_PACK_CORP] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_PACK] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PACK_DES] ) && NOT ISFILTERED ( Dim_PackInfo[PACK_LCH] )
|
||||
&& ISFILTERED(Dim_Geo) && ( ISFILTERED ( Dim_PackInfo[MOLECULE_CODE_DESC] )
|
||||
|| ISFILTERED ( Dim_PackInfo[MOLECULE_DES_C] ) ||ISFILTERED ( Dim_PackInfo[CMPS_COD] )
|
||||
|| ISFILTERED ( Dim_PackInfo[CMPS_DES] ) || ISFILTERED ( Dim_PackInfo[CMPS_DES_C] )),
|
||||
[External.Sales.LY.MTH_THC4],
|
||||
|
||||
//除开特定市场外,其余的retail,针对于class,选择地理或org维度,值为空
|
||||
DS = "Retail" && (ISFILTERED(Dim_Geo) || ISFILTERED(Dim_Org)) && ISFILTERED(Dim_Class)
|
||||
&& (ISFILTERED(Dim_Market) || ISFILTERED(Dim_BrandDefaultMKT)) && MKT_FLAG = 0,BLANK(),
|
||||
|
||||
//选择市场,只出现品牌报告里面的有市场;
|
||||
DS = "Retail" && (ISFILTERED(Dim_Geo) || ISFILTERED(Dim_Org))
|
||||
&& (ISFILTERED(Dim_Market) || ISFILTERED(Dim_BrandDefaultMKT)) && PROD_FLAG = 0,BLANK(),
|
||||
|
||||
--若不选pack,用于计算class相关KPI
|
||||
DS IN {"Retail","EC"}
|
||||
&& (ISFILTERED ( Dim_Geo ) || ISFILTERED ( Dim_Org ))
|
||||
&& NOT ISFILTERED(Dim_PackInfo),
|
||||
[External.Sales.LY.MTH_THC4],
|
||||
|
||||
//若选择Molecule,没选择地理
|
||||
DS IN {"Retail","EC"} && NOT ISFILTERED(Dim_Geo) && NOT ISFILTERED(Dim_Org)
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PROD_COD] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_DES_C] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PROD_DES] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_CORP] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PACK_COD] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_CORP_C] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PROD_PACK_CORP] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_PACK] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PACK_DES] ) && NOT ISFILTERED ( Dim_PackInfo[PACK_LCH] )
|
||||
&& ( ISFILTERED ( Dim_PackInfo[MOLECULE_CODE_DESC] )
|
||||
|| ISFILTERED ( Dim_PackInfo[MOLECULE_DES_C] ) ||ISFILTERED ( Dim_PackInfo[CMPS_COD] )
|
||||
|| ISFILTERED ( Dim_PackInfo[CMPS_DES] ) || ISFILTERED ( Dim_PackInfo[CMPS_DES_C] )),
|
||||
[External.Sales.LY.MTH_THC4],
|
||||
|
||||
//若选择Molecule,选择地理
|
||||
DS IN {"Retail","EC"}
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PROD_COD] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_DES_C] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PROD_DES] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_CORP] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PACK_COD] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_CORP_C] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PROD_PACK_CORP] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_PACK] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PACK_DES] ) && NOT ISFILTERED ( Dim_PackInfo[PACK_LCH] )
|
||||
&& ( ISFILTERED ( Dim_PackInfo[MOLECULE_CODE_DESC] )
|
||||
|| ISFILTERED ( Dim_PackInfo[MOLECULE_DES_C] ) ||ISFILTERED ( Dim_PackInfo[CMPS_COD] )
|
||||
|| ISFILTERED ( Dim_PackInfo[CMPS_DES] ) || ISFILTERED ( Dim_PackInfo[CMPS_DES_C] )),
|
||||
CALCULATE (
|
||||
[External.Sales.LY.MTH_THC4],
|
||||
Fact_Sales[CMPS_FLAG] = 1
|
||||
),
|
||||
|
||||
//若选择BRAND,没有选择地理
|
||||
DS IN {"Retail","EC"}
|
||||
&& NOT ISFILTERED ( Dim_Geo ) && NOT ISFILTERED ( Dim_Org )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PACK_COD] ) && NOT ISFILTERED ( Dim_PackInfo[PROD_PACK_CORP] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PACK_DES] ) && NOT ISFILTERED ( Dim_PackInfo[PACK_LCH] )
|
||||
&& (ISFILTERED ( Dim_PackInfo[PROD_COD] ) || ISFILTERED ( Dim_PackInfo[PROD_CORP_C] )
|
||||
|| ISFILTERED ( Dim_PackInfo[PROD_DES] ) || ISFILTERED ( Dim_PackInfo[PROD_DES_C] )),
|
||||
CALCULATE (
|
||||
[External.Sales.LY.MTH_THC4],
|
||||
Fact_Sales[PROD_FLAG] IN {1, 2}
|
||||
),
|
||||
|
||||
//若选择BRAND,选择地理
|
||||
DS IN {"Retail","EC"}
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PACK_COD] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PROD_PACK_CORP] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PACK_DES] )
|
||||
&& NOT ISFILTERED ( Dim_PackInfo[PACK_LCH] )
|
||||
&& (ISFILTERED ( Dim_PackInfo[PROD_COD] ) || ISFILTERED ( Dim_PackInfo[PROD_CORP_C] )
|
||||
|| ISFILTERED ( Dim_PackInfo[PROD_DES] ) || ISFILTERED ( Dim_PackInfo[PROD_DES_C] )),
|
||||
CALCULATE (
|
||||
[External.Sales.LY.MTH_THC4],
|
||||
Fact_Sales[GEO_FLAG] = 1
|
||||
),
|
||||
|
||||
//若选择PACKAGE,不选择地理维度,1表示pack+省份数据;2表示pack+全国的数据
|
||||
DS IN {"Retail","EC"} && NOT ISFILTERED ( Dim_Org ) && NOT ISFILTERED ( Dim_Geo )
|
||||
&& (ISFILTERED ( Dim_PackInfo[PACK_DES] ) || ISFILTERED ( Dim_PackInfo[PACK_LCH] )
|
||||
|| ISFILTERED ( Dim_PackInfo[PACK_COD] ) || ISFILTERED ( Dim_PackInfo[PROD_PACK_CORP] )),
|
||||
CALCULATE (
|
||||
[External.Sales.LY.MTH_THC4],
|
||||
Fact_Sales[PACK_FLAG] IN { 1, 2 }
|
||||
),
|
||||
|
||||
|
||||
//若选择PACKAGE,且省份维度不是全国
|
||||
DS IN {"Retail","EC"}
|
||||
&& (ISFILTERED ( Dim_PackInfo[PACK_DES] ) || ISFILTERED ( Dim_PackInfo[PACK_LCH] )
|
||||
|| ISFILTERED ( Dim_PackInfo[PACK_COD] ) || ISFILTERED ( Dim_PackInfo[PROD_PACK_CORP] )),
|
||||
CALCULATE (
|
||||
[External.Sales.LY.MTH_THC4],
|
||||
Fact_Sales[PACK_FLAG] = 1
|
||||
),
|
||||
[External.Sales.LY.MTH_THC4]
|
||||
)
|
||||
```
|
||||
measure 'External.Sales.LY.MTH.MID_THC5' = [External.Sales.LY.MTH_THC4]
|
||||
displayFolder: 02.Sales LY
|
||||
lineageTag: 633605a2-7fd6-416a-979d-2cfef8156e53
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user