0415
This commit is contained in:
@@ -11,7 +11,7 @@ table 'AIA.Measures'
|
||||
ALL ( Dim_PackInfo ),
|
||||
ALL ( Dim_Corp ),
|
||||
ALL ( Dim_Class ),
|
||||
ALL ( Dim_MKTPackMapping[KEY_COMPETITOR] )
|
||||
ALL ( Dim_KeyCompetitor )
|
||||
)
|
||||
RETURN
|
||||
IF( PV = BLANK()&& CV = BLANK() ,BLANK(),T)
|
||||
@@ -108,137 +108,41 @@ table 'AIA.Measures'
|
||||
lineageTag: 8c5bc845-b87f-4683-a00a-2fd70aaabd6f
|
||||
|
||||
measure 'External.Sales.KPI.Mol.AIA' =
|
||||
|
||||
--取消先选择市场的限定
|
||||
IF (
|
||||
[External.Sales.KPI.Market] <> 0 || [External.Sales.KPI.Market] <> BLANK(),
|
||||
VAR MKT = MAX(Dim_Market[MKT_SOURCE])
|
||||
VAR CMPS =
|
||||
CALCULATETABLE(VALUES ( Dim_MKTPackMapping[MOLECULE_SOURCE] ),Dim_MKTPackMapping[MKT_SOURCE] = MKT)
|
||||
RETURN
|
||||
CALCULATE (
|
||||
[External.Sales.KPI],
|
||||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||||
REMOVEFILTERS ( Dim_PackInfo[PROD_COD] ),
|
||||
REMOVEFILTERS ( Dim_PackInfo[CORP_COD] ),
|
||||
REMOVEFILTERS ( Dim_PackInfo[CORP_DES] ),
|
||||
REMOVEFILTERS ( Dim_PackInfo[CORP_DES_C] ),
|
||||
REMOVEFILTERS ( Dim_PackInfo[CORP_TYPE] ),
|
||||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] ),
|
||||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP_C] ),
|
||||
REMOVEFILTERS ( Dim_MKTPackMapping[KEY_COMPETITOR] ), --新增
|
||||
ALL ( Dim_Corp ),
|
||||
ALLEXCEPT (
|
||||
Dim_PackInfo,
|
||||
Dim_PackInfo[CMPS_DES],
|
||||
Dim_PackInfo[CMPS_DES_C],
|
||||
Dim_PackInfo[MOLECULE_CODE_DESC]
|
||||
),
|
||||
KEEPFILTERS ( Dim_Market[Market] <> BLANK () ),
|
||||
TREATAS ( CMPS, Fact_Sales[MOLECULE_SOURCE] )
|
||||
)
|
||||
[External.Sales.KPI.Market] <> 0
|
||||
|| [External.Sales.KPI.Market] <> BLANK ( ),
|
||||
CALCULATE (
|
||||
[External.Sales.KPI],
|
||||
ALL ( Dim_Corp ),
|
||||
ALLEXCEPT (
|
||||
Dim_PackInfo,
|
||||
Dim_PackInfo[CMPS_DES],
|
||||
Dim_PackInfo[CMPS_DES_C],
|
||||
Dim_PackInfo[MOLECULE_CODE_DESC]
|
||||
),
|
||||
KEEPFILTERS ( VALUES ( Dim_PackInfo[CMPS_DES] ) )
|
||||
)
|
||||
|
||||
// IF (
|
||||
// ISFILTERED ( Dim_Market ) || ISFILTERED ( Dim_MarketTA )
|
||||
// || ISFILTERED ( Dim_BrandDefaultMKT ),
|
||||
// IF (
|
||||
// [External.Sales.KPI.Market] <> 0,
|
||||
// VAR MKT = MAX(Dim_Market[MKT_SOURCE])
|
||||
// VAR CMPS =
|
||||
// CALCULATETABLE(VALUES ( Dim_MKTPackMapping[MOLECULE_SOURCE] ),Dim_MKTPackMapping[MKT_SOURCE] = MKT)
|
||||
// RETURN
|
||||
// CALCULATE (
|
||||
// [External.Sales.KPI.AIA],
|
||||
// REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||||
// REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||||
// REMOVEFILTERS ( Dim_PackInfo[PROD_COD] ),
|
||||
// REMOVEFILTERS ( Dim_PackInfo[CORP_COD] ),
|
||||
// REMOVEFILTERS ( Dim_PackInfo[CORP_DES] ),
|
||||
// REMOVEFILTERS ( Dim_PackInfo[CORP_DES_C] ),
|
||||
// REMOVEFILTERS ( Dim_PackInfo[CORP_TYPE] ),
|
||||
// REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] ),
|
||||
// REMOVEFILTERS ( Dim_PackInfo[PROD_CORP_C] ),
|
||||
// REMOVEFILTERS ( Dim_MKTPackMapping[KEY_COMPETITOR] ), --新增
|
||||
// ALL ( Dim_Corp ),
|
||||
// ALLEXCEPT (
|
||||
// Dim_PackInfo,
|
||||
// Dim_PackInfo[CMPS_DES],
|
||||
// Dim_PackInfo[CMPS_DES_C],
|
||||
// Dim_PackInfo[MOLECULE_CODE_DESC]
|
||||
// ),
|
||||
// KEEPFILTERS ( Dim_Market[Market] <> BLANK () ),
|
||||
// TREATAS ( CMPS, Fact_Sales[MOLECULE_SOURCE] )
|
||||
// )
|
||||
// )
|
||||
// )
|
||||
)
|
||||
formatString: #,0
|
||||
displayFolder: 01.General\02.0.Basic\Sales
|
||||
lineageTag: 30d3ba61-f719-4f50-8399-f7ece1b019c3
|
||||
|
||||
measure 'External.Sales.LY.KPI.Mol.AIA' =
|
||||
|
||||
--取消先选择市场的限定
|
||||
IF (
|
||||
[External.Sales.LY.KPI.Market] <> 0 || [External.Sales.LY.KPI.Market] <> BLANK(),
|
||||
[External.Sales.LY.KPI.Market] <> 0
|
||||
|| [External.Sales.LY.KPI.Market] <> BLANK ( ),
|
||||
CALCULATE (
|
||||
[External.Sales.LY.KPI.AIA],
|
||||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||||
REMOVEFILTERS ( Dim_PackInfo[PROD_COD] ),
|
||||
REMOVEFILTERS ( Dim_PackInfo[CORP_COD] ),
|
||||
REMOVEFILTERS ( Dim_PackInfo[CORP_DES] ),
|
||||
REMOVEFILTERS ( Dim_PackInfo[CORP_DES_C] ),
|
||||
REMOVEFILTERS ( Dim_PackInfo[CORP_TYPE] ),
|
||||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] ),
|
||||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP_C] ),
|
||||
//REMOVEFILTERS ( Dim_MKTPackMapping[KEY_COMPETITOR] ), --新增
|
||||
ALL ( Dim_Corp ),
|
||||
ALLEXCEPT (
|
||||
Dim_PackInfo,
|
||||
Dim_PackInfo[CMPS_DES],
|
||||
Dim_PackInfo[CMPS_DES_C],
|
||||
Dim_PackInfo[MOLECULE_CODE_DESC]
|
||||
),
|
||||
KEEPFILTERS ( Dim_Market[Market] <> BLANK () )
|
||||
//),TREATAS ( CMPS, Fact_Sales[MOLECULE_SOURCE] )
|
||||
)
|
||||
[External.Sales.LY.KPI.AIA],
|
||||
ALL ( Dim_Corp ),
|
||||
ALLEXCEPT (
|
||||
Dim_PackInfo,
|
||||
Dim_PackInfo[CMPS_DES],
|
||||
Dim_PackInfo[CMPS_DES_C],
|
||||
Dim_PackInfo[MOLECULE_CODE_DESC]
|
||||
),
|
||||
KEEPFILTERS ( VALUES ( Dim_PackInfo[CMPS_DES] ) )
|
||||
)
|
||||
)
|
||||
|
||||
// IF (
|
||||
// ISFILTERED ( Dim_Market ) || ISFILTERED ( Dim_MarketTA )
|
||||
// || ISFILTERED ( Dim_BrandDefaultMKT ),
|
||||
// IF (
|
||||
// [External.Sales.LY.KPI.Market] <> 0,
|
||||
// VAR MKT = MAX(Dim_Market[MKT_SOURCE])
|
||||
// VAR CMPS =
|
||||
// CALCULATETABLE(VALUES ( Dim_MKTPackMapping[MOLECULE_SOURCE] ),Dim_MKTPackMapping[MKT_SOURCE] = MKT)
|
||||
// RETURN
|
||||
// CALCULATE (
|
||||
// [External.Sales.LY.KPI.AIA],
|
||||
// REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||||
// REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||||
// REMOVEFILTERS ( Dim_PackInfo[PROD_COD] ),
|
||||
// REMOVEFILTERS ( Dim_PackInfo[CORP_COD] ),
|
||||
// REMOVEFILTERS ( Dim_PackInfo[CORP_DES] ),
|
||||
// REMOVEFILTERS ( Dim_PackInfo[CORP_DES_C] ),
|
||||
// REMOVEFILTERS ( Dim_PackInfo[CORP_TYPE] ),
|
||||
// REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] ),
|
||||
// REMOVEFILTERS ( Dim_PackInfo[PROD_CORP_C] ),
|
||||
// REMOVEFILTERS ( Dim_MKTPackMapping[KEY_COMPETITOR] ), --新增
|
||||
// ALL ( Dim_Corp ),
|
||||
// ALLEXCEPT (
|
||||
// Dim_PackInfo,
|
||||
// Dim_PackInfo[CMPS_DES],
|
||||
// Dim_PackInfo[CMPS_DES_C],
|
||||
// Dim_PackInfo[MOLECULE_CODE_DESC]
|
||||
// ),
|
||||
// KEEPFILTERS ( Dim_Market[Market] <> BLANK () ),
|
||||
// TREATAS ( CMPS, Fact_Sales[MOLECULE_SOURCE] )
|
||||
// )
|
||||
// )
|
||||
// )
|
||||
formatString: #,0
|
||||
displayFolder: 01.General\02.0.Basic\Sales
|
||||
lineageTag: 1978fc8b-f600-48d3-bd19-262f8dbaa833
|
||||
@@ -277,44 +181,16 @@ table 'AIA.Measures'
|
||||
lineageTag: cfb7283b-4506-46fc-a45d-ed0e3ebdb53b
|
||||
|
||||
measure 'External.Sales.KPI.Class.AIA' =
|
||||
|
||||
IF (
|
||||
[External.Sales.KPI.Market.AIA] <> 0 || [External.Sales.KPI.Market.AIA] <> BLANK(),
|
||||
VAR MKT = MAX(Dim_Market[MKT_SOURCE])
|
||||
VAR CLASS =
|
||||
CALCULATETABLE(VALUES ( Dim_MKTPackMapping[CLASS_SOURCE] ),Dim_MKTPackMapping[MKT_SOURCE] = MKT)
|
||||
RETURN
|
||||
CALCULATE (
|
||||
[External.Sales.KPI],
|
||||
ALL ( Dim_PackInfo ),
|
||||
ALL ( Dim_Corp ),
|
||||
KEEPFILTERS (
|
||||
Dim_Market[Market] <> BLANK ()
|
||||
),
|
||||
TREATAS ( CLASS, Dim_MKTPackMapping[CLASS_SOURCE] )
|
||||
)
|
||||
[External.Sales.KPI.Market.AIA] <> 0
|
||||
|| [External.Sales.KPI.Market.AIA] <> BLANK ( ),
|
||||
CALCULATE (
|
||||
[External.Sales.KPI],
|
||||
ALL ( Dim_PackInfo ),
|
||||
ALL ( Dim_Corp ),
|
||||
TREATAS ( VALUES ( Fact_Sales[CLASS] ), Dim_Class[CLASS] )
|
||||
)
|
||||
)
|
||||
|
||||
// IF (
|
||||
// ISFILTERED ( Dim_MarketTA ) || ISFILTERED ( Dim_Market )
|
||||
// || ISFILTERED ( Dim_BrandDefaultMKT ),
|
||||
// IF (
|
||||
// [External.Sales.KPI.Market.AIA] <> 0,
|
||||
// VAR MKT = MAX(Dim_Market[MKT_SOURCE])
|
||||
// VAR CLASS =
|
||||
// CALCULATETABLE(VALUES ( Dim_MKTPackMapping[CLASS_SOURCE] ),Dim_MKTPackMapping[MKT_SOURCE] = MKT)
|
||||
// RETURN
|
||||
// CALCULATE (
|
||||
// [External.Sales.KPI.AIA],
|
||||
// ALL ( Dim_PackInfo ),
|
||||
// ALL ( Dim_Corp ),
|
||||
// KEEPFILTERS (
|
||||
// Dim_Market[Market] <> BLANK ()
|
||||
// ),
|
||||
// TREATAS ( CLASS, Dim_MKTPackMapping[CLASS_SOURCE] )
|
||||
// )
|
||||
// )
|
||||
// )
|
||||
formatString: #,0
|
||||
displayFolder: 01.General\02.0.Basic\Sales
|
||||
lineageTag: 05eee0e4-19c7-49c4-801e-7c69f84cbe57
|
||||
@@ -596,8 +472,8 @@ table 'AIA.Measures'
|
||||
ALL ( Dim_HP_Potential_AIA ),
|
||||
ORDERBY ( Dim_HP_Potential_AIA[POTENTIAL_VALUE], DESC )
|
||||
),
|
||||
Dim_HP_Potential_AIA[IS_DEFAULT_POTENTIAL_TYPE] = 1,
|
||||
Dim_HP_Potential_AIA[IS_DEFAULT_POTENTIAL_MKT] = 1
|
||||
Dim_HP_Potential_AIA[IS_DEFAULT_POTENTIAL_TYPE] = "1",
|
||||
Dim_HP_Potential_AIA[IS_DEFAULT_POTENTIAL_MKT] = "1"
|
||||
)
|
||||
-----------------------------------------------------------------
|
||||
-- DAX Code Comment Block --
|
||||
@@ -1925,8 +1801,7 @@ table 'AIA.Measures'
|
||||
"RMB", [AIATotal.Base.Value],
|
||||
"Unit", [AIATotal.Base.Unit],
|
||||
"CU", [AIATotal.Base.CountingUnit],
|
||||
"PDOT", [AIATotal.Base.PDOT],
|
||||
"张数", [AIATotal.Base.Prescription]
|
||||
"PDOT", [AIATotal.Base.PDOT]
|
||||
)
|
||||
/*
|
||||
单位转换
|
||||
@@ -1940,8 +1815,7 @@ table 'AIA.Measures'
|
||||
"RMB", [AIATotal.Base.Value.Ly],
|
||||
"Unit", [AIATotal.Base.Unit.Ly],
|
||||
"CU", [AIATotal.Base.CountingUnit.Ly],
|
||||
"PDOT", [AIATotal.Base.PDOT.Ly],
|
||||
"张数", [AIATotal.Base.Prescription.Ly]
|
||||
"PDOT", [AIATotal.Base.PDOT.Ly]
|
||||
)
|
||||
/*
|
||||
单位转换
|
||||
@@ -2279,7 +2153,7 @@ table 'AIA.Measures'
|
||||
RETURN
|
||||
DIVIDE ( _c - _l, _l ),
|
||||
KEEPFILTERS ( Dim_Market[MARKET] = _Com_Market ),
|
||||
KEEPFILTERS ( Dim_MKTPackMapping[CLASS] = _Class )
|
||||
KEEPFILTERS ( Dim_Class[CLASS] = _Class )
|
||||
),
|
||||
"Molecule",
|
||||
CALCULATE (
|
||||
@@ -2356,7 +2230,7 @@ table 'AIA.Measures'
|
||||
DIVIDE (
|
||||
CALCULATE (
|
||||
[AIATotal.SwitchValueType],
|
||||
KEEPFILTERS ( Dim_MKTPackMapping[CLASS] = _Class )
|
||||
KEEPFILTERS ( Dim_Class[CLASS] = _Class )
|
||||
),
|
||||
[AIATotal.SwitchValueType]
|
||||
),
|
||||
@@ -2981,14 +2855,6 @@ table 'AIA.Measures'
|
||||
measure 'MergedData.Text.SingleSelectWarning' = IF ( ISFILTERED ( dim_marketTa[ta] ), "TA/Marekt/Default Market只可选择一个" )
|
||||
lineageTag: 007c55f3-9b0c-4291-aabc-8ad9321980d8
|
||||
|
||||
measure 111 = ```
|
||||
SELECTEDVALUE ( Dim_DataSource[SOURCENAME] ) IN {"CHPA"}
|
||||
&& ( ISFILTERED ( Dim_Geo ) || ISFILTERED ( Dim_Org ) )
|
||||
```
|
||||
lineageTag: a25769bd-15f8-4fdf-a3e6-7cf755b87267
|
||||
|
||||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||||
|
||||
measure 'AIA.warning5.1' = ```
|
||||
|
||||
VAR _warning1 = ""//"拼DTP数据请先选择ONC相关市场(TA=ONC或Market=EGFR-TKI、Imfinzi、Anti-HER2 mBC、MET-TKI、Soliris related Market)"
|
||||
@@ -3175,7 +3041,7 @@ table 'AIA.Measures'
|
||||
CALCULATE(
|
||||
SUMX(
|
||||
'Fact_Sales_Total_AIA',
|
||||
[CONUTING_UNIT] //* [External.SelectPDOTMKTRatio] * [External.SelectRegionMKTRatio]
|
||||
Fact_Sales_Total_AIA[PDOT] //* [External.SelectPDOTMKTRatio] * [External.SelectRegionMKTRatio]
|
||||
),
|
||||
TREATAS( DISTINCT( Dim_Market[MARKET] ), Fact_Sales_Total_AIA[market] )
|
||||
)
|
||||
@@ -3193,7 +3059,7 @@ table 'AIA.Measures'
|
||||
CALCULATE(
|
||||
SUMX(
|
||||
'Fact_Sales_Total_AIA',
|
||||
[CONUTING_UNIT_ly] //* [External.SelectPDOTMKTRatio] * [External.SelectRegionMKTRatio]
|
||||
Fact_Sales_Total_AIA[PDOT_LY] //* [External.SelectPDOTMKTRatio] * [External.SelectRegionMKTRatio]
|
||||
),
|
||||
TREATAS( DISTINCT( Dim_Market[MARKET] ), Fact_Sales_Total_AIA[market] )
|
||||
)
|
||||
@@ -3207,43 +3073,6 @@ table 'AIA.Measures'
|
||||
|
||||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||||
|
||||
measure 'AIATotal.Base.Prescription' = ```
|
||||
CALCULATE(
|
||||
SUMX(
|
||||
'Fact_Sales_Total_AIA',
|
||||
[PRESCRIPTION]
|
||||
),
|
||||
TREATAS( DISTINCT( Dim_Market[MARKET] ), Fact_Sales_Total_AIA[market] )
|
||||
)
|
||||
/*
|
||||
底层度量值
|
||||
只适用AIA的Overview页面,默认使用market的筛选关系。
|
||||
*/
|
||||
|
||||
```
|
||||
displayFolder: 02.Page\02.1Overview\0.Base
|
||||
lineageTag: 210874ef-0c24-48b8-812a-3b1b39ac150f
|
||||
|
||||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||||
|
||||
measure 'AIATotal.Base.Prescription.Ly' = ```
|
||||
CALCULATE(
|
||||
SUMX(
|
||||
'Fact_Sales_Total_AIA',
|
||||
[PRESCRIPTION_ly]
|
||||
),
|
||||
TREATAS( DISTINCT( Dim_Market[MARKET] ), Fact_Sales_Total_AIA[market] )
|
||||
)
|
||||
/*
|
||||
底层度量值
|
||||
只适用AIA的Overview页面,默认使用market的筛选关系。
|
||||
*/
|
||||
```
|
||||
displayFolder: 02.Page\02.1Overview\0.Base
|
||||
lineageTag: 34513b6b-8113-4be6-b352-757f9d5722ee
|
||||
|
||||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||||
|
||||
measure 'AIATotal.Base.Unit' = ```
|
||||
CALCULATE(
|
||||
SUMX(
|
||||
@@ -3302,7 +3131,7 @@ table 'AIA.Measures'
|
||||
CALCULATE(
|
||||
SUMX(
|
||||
Fact_Sales_Total_AIA,
|
||||
[SALES_VALUE_CAL_ly] //* [External.SelectValueMKTRatio] * [External.SelectRegionMKTRatio]
|
||||
[SALES_VALUE_CAL_ly]
|
||||
),
|
||||
TREATAS( DISTINCT( Dim_Market[MARKET] ), Fact_Sales_Total_AIA[market] )
|
||||
)
|
||||
@@ -3979,5 +3808,5 @@ table 'AIA.Measures'
|
||||
|
||||
annotation PBI_ResultType = Table
|
||||
|
||||
annotation TabularEditor_TableGroup = 01_ParameterField
|
||||
annotation TabularEditor_TableGroup = 00_MeasureTable
|
||||
|
||||
|
||||
Reference in New Issue
Block a user