18032 lines
707 KiB
Plaintext
18032 lines
707 KiB
Plaintext
table Measure
|
||
lineageTag: 257fa26f-1630-4cf2-b996-8e9485aad7ed
|
||
|
||
measure 'Latest Update Time' =
|
||
|
||
///返回数据刷新时间
|
||
"Refresh Time: "& FORMAT(MAX('refresh_time'[Refresh Time]),"YYYY/MM/DD")
|
||
// "Refresh Time: "& SELECTEDVALUE( 'refresh_time'[Refresh Time])
|
||
displayFolder: OLD\Others
|
||
lineageTag: d52eff13-60a5-4067-af94-f2f2a5860009
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure MAXYEAR = LEFT(MAXX(ALL(Fact_Sales),[YYYYMM]),4)
|
||
formatString: 0
|
||
displayFolder: OLD\Others
|
||
lineageTag: cddefe21-a876-4f40-8fb7-296769ff0781
|
||
|
||
measure MAXYEAR_1 = [MAXYEAR]-1
|
||
formatString: 0
|
||
displayFolder: OLD\Others
|
||
lineageTag: 58e93634-1583-4deb-bf6c-3ae3dedfbbb3
|
||
|
||
measure MAXYEAR_2 = [MAXYEAR]-2
|
||
formatString: 0
|
||
displayFolder: OLD\Others
|
||
lineageTag: 560c61a0-8adc-4ef4-bb9d-b8f518e3022b
|
||
|
||
measure MAXYEAR_3 = [MAXYEAR]-3
|
||
formatString: 0
|
||
displayFolder: OLD\Others
|
||
lineageTag: 14033593-5630-439f-8de7-a63ea8d8fe3a
|
||
|
||
measure 汇率计算 = ```
|
||
"Exchange Rate: 1USD="&ROUND(SELECTEDVALUE(Dim_ExchangRate[EXCHANGE_RATE]),2)&"RMB"
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: d8879ed5-c214-4516-8ed2-185ade54cd67
|
||
|
||
measure Max_CHPA_Date = "CHPA (M): " & CALCULATE(MAX(Fact_Sales[YYYYMM]),Dim_DataSource[DATA_SOURCE] = "IQVIA-CHPA(Monthly)",ALL())
|
||
displayFolder: OLD\Others
|
||
lineageTag: bb7d9a21-16a6-4099-a9b3-52e8db0ae83c
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure display_month = ```
|
||
//SUMX(SUMMARIZE('DM_TD_Calendar','DM_TD_Calendar'[DATE_FLAG],'DM_TD_Calendar'[YEAR]),[Year])
|
||
var min_year =CALCULATE( MAX(Dim_Calendar[YEAR]),ALL(Dim_Calendar)) - 2
|
||
var res_ =
|
||
SUMX(SUMMARIZE(Dim_Calendar,Dim_Calendar[MONTH],Dim_Calendar[YM_NUM]),[YM_NUM])
|
||
return IF( res_< min_year,BLANK(),res_)
|
||
```
|
||
formatString: 0
|
||
displayFolder: OLD\Others
|
||
lineageTag: fde3dd85-b3d4-44a7-a234-efec0f6521fe
|
||
|
||
measure show_filters = ```
|
||
|
||
VAR t_ =
|
||
{(IF (
|
||
ISFILTERED(MQY[Period]),
|
||
VAR ___x = "时间范围:"& [time sel] &" | "
|
||
RETURN ___x
|
||
),1)
|
||
,(IF (
|
||
ISFILTERED(Dim_Unit[DW]),
|
||
VAR ___x = "筛选单位:"& CONCATENATEX(VALUES(Dim_Unit[DW]),[DW],",") &" | "
|
||
RETURN ___x
|
||
),1)
|
||
,(IF (
|
||
ISFILTERED(Dim_Market[Market]),
|
||
VAR ___x = "Market:"& CONCATENATEX(VALUES(Dim_Market[Market]),[Market],",") &" | "
|
||
RETURN ___x
|
||
),1)
|
||
,(IF (
|
||
ISFILTERED(Dim_BrandDefaultMKT),
|
||
VAR ___x = "DefaultMarket:"& CONCATENATEX(VALUES(Dim_BrandDefaultMKT[MARKET]),[MARKET],",") &" | "
|
||
RETURN ___x
|
||
),1)
|
||
,(IF (
|
||
ISFILTERED('Dim_MarketTA'[TA]),
|
||
VAR ___x = "TA: "& CONCATENATEX(VALUES('Dim_MarketTA'[TA]),[TA],",") &" | "
|
||
RETURN ___x
|
||
),2)
|
||
,(IF (
|
||
ISFILTERED(Dim_Class[CLASS]),
|
||
VAR ___x = "Class: "& CONCATENATEX(VALUES(Dim_Class[CLASS]),[CLASS],",") &" | "
|
||
RETURN ___x
|
||
),2)
|
||
,(IF (
|
||
ISFILTERED(Dim_PackInfo[GENE_ORIG_DESC]),
|
||
VAR ___x = "Generics:"& CONCATENATEX(VALUES(Dim_PackInfo[GENE_ORIG_DESC]),[GENE_ORIG_DESC],",") &" | "
|
||
RETURN ___x
|
||
),3)
|
||
,(IF (
|
||
ISFILTERED(Dim_BrandMKT[VBP]),
|
||
VAR ___x = "is VBP:"& CONCATENATEX(VALUES(Dim_BrandMKT[VBP]),[VBP],",") &" | "
|
||
RETURN ___x
|
||
),4)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[PROD_DES_C]),
|
||
VAR ___x = "Brand:"& CONCATENATEX(VALUES('Dim_PackInfo'[PROD_DES_C]),[PROD_DES_C],",") &" | "
|
||
RETURN ___x
|
||
),5)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[MOLECULE_DES_C]),
|
||
VAR ___x = "Molecule:"& CONCATENATEX(VALUES('Dim_PackInfo'[MOLECULE_DES_C]),[MOLECULE_DES_C],",") &" | "
|
||
RETURN ___x
|
||
),7)
|
||
,(IF (
|
||
ISFILTERED('Dim_Corp'[CORP_CODE_DESC]),
|
||
VAR ___x = "Corp: "& CONCATENATEX(VALUES('Dim_Corp'[CORP_CODE_DESC]),[CORP_CODE_DESC],",") &" | "
|
||
RETURN ___x
|
||
),9)
|
||
,(IF (
|
||
ISFILTERED('Dim_Corp'[CORP_TYPE]),
|
||
VAR ___x = "CorpType: "& CONCATENATEX(VALUES('Dim_Corp'[CORP_TYPE]),[CORP_TYPE],",") &" | "
|
||
RETURN ___x
|
||
),10)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[PROD_PACK]),
|
||
VAR ___x = "Pack:"& CONCATENATEX(VALUES('Dim_PackInfo'[PROD_PACK]),[PROD_PACK],",") &" | "
|
||
RETURN ___x
|
||
),11)
|
||
,(IF (
|
||
ISFILTERED('Dim_GeoGroup'[PROVINCE_GROUP]),
|
||
VAR ___x = "ProvinceGroup:"& CONCATENATEX(VALUES('Dim_GeoGroup'[PROVINCE_GROUP]),[PROVINCE_GROUP],",") &" | "
|
||
RETURN ___x
|
||
),12)
|
||
,(IF (
|
||
ISFILTERED('Dim_Geo'[PROVINCE_C]),
|
||
VAR ___x = "Province:"& CONCATENATEX(VALUES('Dim_Geo'[PROVINCE_C]),[PROVINCE_C],",") &" | "
|
||
RETURN ___x
|
||
),12)
|
||
,(IF (
|
||
ISFILTERED('Dim_Geo'[CITY_C]),
|
||
VAR ___x = "City:"& CONCATENATEX(VALUES('Dim_Geo'[CITY_C]),[CITY_C],",") &" | "
|
||
RETURN ___x
|
||
),13)
|
||
,(IF (
|
||
ISFILTERED('Dim_Geo'[AZ_CITY_TIER]),
|
||
VAR ___x = "CityTier:"& CONCATENATEX(VALUES('Dim_Geo'[AZ_CITY_TIER]),[AZ_CITY_TIER],",") &" | "
|
||
RETURN ___x
|
||
),14)
|
||
,(IF (
|
||
ISFILTERED('Dim_Org'[RC_CODE_DESC]),
|
||
VAR ___x = "RC:"& CONCATENATEX(VALUES('Dim_Org'[RC_CODE_DESC]),[RC_CODE_DESC],",") &" | "
|
||
RETURN ___x
|
||
),17)
|
||
,(IF (
|
||
ISFILTERED('Dim_Org'[REGION_CODE_DESC]),
|
||
VAR ___x = "Region:"& CONCATENATEX(VALUES('Dim_Org'[REGION_CODE_DESC]),[REGION_CODE_DESC],",") &" | "
|
||
RETURN ___x
|
||
),18)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[ATC1_CODE_DESC]),
|
||
VAR ___x = "ATC1:"& CONCATENATEX(VALUES('Dim_PackInfo'[ATC1_CODE_DESC]),[ATC1_CODE_DESC],",") &" | "
|
||
RETURN ___x
|
||
),19)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[ATC2_CODE_DESC]),
|
||
VAR ___x = "ATC2:"& CONCATENATEX(VALUES('Dim_PackInfo'[ATC2_CODE_DESC]),[ATC2_CODE_DESC],",") &" | "
|
||
RETURN ___x
|
||
),20)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[ATC3_CODE_DESC]),
|
||
VAR ___x = "ATC3:"& CONCATENATEX(VALUES('Dim_PackInfo'[ATC3_CODE_DESC]),[ATC3_CODE_DESC],",") &" | "
|
||
RETURN ___x
|
||
),21)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[ATC4_CODE_DESC]),
|
||
VAR ___x = "ATC4:"& CONCATENATEX(VALUES('Dim_PackInfo'[ATC4_CODE_DESC]),[ATC4_CODE_DESC],",") &" | "
|
||
RETURN ___x
|
||
),22)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[APP1_COD_DES_C]),
|
||
VAR ___x = "NFC1:"& CONCATENATEX(VALUES('Dim_PackInfo'[APP1_COD_DES_C]),[APP1_COD_DES_C],",") &" | "
|
||
RETURN ___x
|
||
),23)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[APP2_COD_DES_C]),
|
||
VAR ___x = "NFC2:"& CONCATENATEX(VALUES('Dim_PackInfo'[APP2_COD_DES_C]),[APP2_COD_DES_C],",") &" | "
|
||
RETURN ___x
|
||
),24)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[APP3_COD_DES_C]),
|
||
VAR ___x = "NFC3:"& CONCATENATEX(VALUES('Dim_PackInfo'[APP3_COD_DES_C]),[APP3_COD_DES_C],",") &" | "
|
||
RETURN ___x
|
||
),25)
|
||
|
||
}
|
||
RETURN CONCATENATEX( t_ , [Value1] , "" )
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 4845d82c-98e4-42ce-a6de-1d44a48be351
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'time sel标题' =
|
||
|
||
SWITCH(TRUE(),SELECTEDVALUE(MQY[Period])="YTD","YTD:",
|
||
SELECTEDVALUE(MQY[Period])="MTH","MTH:",
|
||
SELECTEDVALUE(MQY[Period])="QTD","QTD:")
|
||
displayFolder: OLD\Others
|
||
lineageTag: f6b34f0d-d388-479a-960a-c0beb91b36ae
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 标题图标 = "( "&VALUES(Dim_Unit[DW])&" )"
|
||
displayFolder: OLD\Others
|
||
lineageTag: 3a97bf8f-d357-4af0-9fc0-f7d96969934e
|
||
|
||
measure ExchangeRate = SELECTEDVALUE(Dim_ExchangRate[EXCHANGE_RATE])
|
||
displayFolder: OLD\Others
|
||
lineageTag: 988f9161-5d72-4534-b260-80f19406e3d8
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.KPI' =
|
||
DIVIDE([External.Sales.KPI],[External.Sales.KPI.Market])
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:MS%:产品销量占市场销量的占比
|
||
------KPI公式:今年产品销量/市场销量
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\MS%
|
||
lineageTag: ff8ee87e-b2ec-4eb6-a5ac-e2611a5a1af4
|
||
|
||
measure 'External.△MS%.KPI' =
|
||
VAR CV = [External.MS%.KPI] VAR PV = [External.MS%.LY.KPI] RETURN CV - PV
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI公式:今年产品占市场的占比-去年产品占市场的占比
|
||
------创建时间:2024.4.15
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\△MS%
|
||
lineageTag: b30956a1-f3dc-4fec-9e16-1bbcab5c0c28
|
||
|
||
measure 'External.Sales.KPI.Market' =
|
||
VAR PV = [External.Sales.KPI]
|
||
VAR CV = [External.MKTPack.Count]
|
||
VAR T =
|
||
SWITCH (
|
||
TRUE ( )
|
||
, ISFILTERED ( AIA_Merge_Data[mergedata_5_2] ),
|
||
SUMX (
|
||
VALUES ( Dim_MergeDataSource[DATA_SOURCE] ),
|
||
CALCULATE (
|
||
[External.Sales.KPI.Market.MID]
|
||
, ALL ( Dim_PackInfo )
|
||
, ALL ( Dim_Corp )
|
||
, ALL ( Dim_Class )
|
||
, ALL ( Dim_KeyCompetitor )
|
||
, ALL ( AIA_AdvanceAnalysis_Key_Competitor )
|
||
)
|
||
)
|
||
, CALCULATE (
|
||
[External.Sales.KPI.Market.MID]
|
||
, ALL ( Dim_PackInfo )
|
||
, ALL ( Dim_Corp )
|
||
, ALL ( Dim_Class )
|
||
, ALL ( Dim_KeyCompetitor )
|
||
, ALL ( AIA_AdvanceAnalysis_Key_Competitor )--for AIA 3.1
|
||
)
|
||
)
|
||
RETURN
|
||
SWITCH (
|
||
TRUE ( )
|
||
, ISFILTERED ( Dim_CoreDept ) || ISFILTERED ( Dim_Dept )
|
||
|| ISFILTERED ( Dim_HP_Level )
|
||
|| ISFILTERED ( Dim_Reimburse )
|
||
|| ISFILTERED ( Dim_PrescriptionSource ),
|
||
IF ( PV <> BLANK ( ), T )
|
||
, IF ( CV <> BLANK ( ), T )
|
||
)
|
||
formatString: #,0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: 3366987f-e583-4933-96d9-b7a5b182df66
|
||
|
||
measure 'External.Gr%.KPI' =
|
||
VAR CV = [External.Sales.KPI]
|
||
VAR PV = [External.Sales.LY.KPI]
|
||
RETURN
|
||
IF ( CV <> BLANK ( ), DIVIDE ( CV - PV, PV ) )
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:产品同比增长率
|
||
------KPI公式:(今年产品销量-去年产品销量)/去年产品销量
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------))
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\GR%
|
||
lineageTag: 5a74d1fa-ec54-4bed-b146-40807f230b6a
|
||
|
||
measure 'External.EI.KPI' =
|
||
|
||
//IF(ROUND([External.Sales.LY.KPI],0) = 0 || ROUND([External.Sales.LY.KPI.Market],0) = 0,BLANK(),
|
||
DIVIDE (
|
||
DIVIDE ( [External.Sales.KPI], [External.Sales.LY.KPI] ),
|
||
DIVIDE ( [External.Sales.KPI.Market], [External.Sales.LY.KPI.Market] )
|
||
) * 100//)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:EI
|
||
------KPI公式:(今年产品销量/去年销量)/(今年市场销量/去年市场销量) * 100
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0
|
||
displayFolder: OLD\EI
|
||
lineageTag: a6c11284-3b7a-4284-b80e-bc9458ac844b
|
||
|
||
measure _BLANK = BLANK()
|
||
displayFolder: OLD\Others
|
||
lineageTag: 16ea66a2-f1dc-4416-ac33-863ddf318e89
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure ICO_CV = ```
|
||
"data:image/svg+xml;utf8,
|
||
<svg width='40' height='30' viewBox='0 0 48 68' fill='none' xmlns='http://www.w3.org/2000/svg'>
|
||
<g filter='url(#filter0_d_36_3)'>
|
||
<path d='M40.9218 32.7329C38.4604 28.5998 35.743 25.0864 32.6667 23.2264C32.923 22.2449 33.2306 21.1599 33.6921 20.1266C33.2307 17.4399 31.282 16.8715 29.8976 16.7682C32.9743 14.4433 35.8455 13.7717 35.8455 13.7717C36.2045 10.5685 33.2306 11.1368 33.2306 11.1368C30.2565 11.8085 27.898 13.0484 26.0521 14.5466C30.8205 9.48365 36.512 8.1917 36.512 8.1917C37.0247 4.11026 33.1793 4.83353 33.1793 4.83353C21.1298 7.57177 17.1305 17.7498 16.0538 21.3149C15.2847 20.9016 14.4131 20.6433 13.5411 20.4883V15.7867C13.5411 15.7867 15.9512 11.2402 20.5658 7.98511C22.2064 4.00701 17.8483 2.40536 17.8483 2.40536L13.5411 6.1768V1.21713C11.0287 -1.52141 8.5164 1.21713 8.5164 1.21713V21.6765C6.97819 22.7615 5.95275 24.4664 5.23466 26.5329C2.72225 33.9211 4.05543 41.3609 9.13163 47.2508C9.13163 47.2508 11.0288 54.7424 23.3348 57.9972C35.6918 61.2521 39.6398 60.0121 41.5372 57.9972C43.4342 55.9824 46.2542 41.7743 40.9218 32.7329ZM33.5383 11.6019C33.3331 12.8417 34.9226 13.7718 34.9226 13.7718C32.8205 13.41 33.4358 11.7568 33.5383 11.6019ZM33.5896 5.45361C33.3331 7.00347 35.3328 8.19178 35.3328 8.19178C32.6667 7.72681 33.487 5.60857 33.5896 5.45361ZM17.8483 2.97366C16.6177 5.45353 19.6429 7.93341 19.6429 7.93341C15.541 4.83353 17.8483 2.97366 17.8483 2.97366ZM8.7215 1.83714C10.4135 2.92203 13.336 2.19877 13.336 2.19877C11.2852 4.00701 8.7215 1.83714 8.7215 1.83714ZM27.0264 21.6765C26.4624 21.7282 25.8984 21.7798 25.3343 21.9348C26.1035 20.5916 27.0264 19.455 28.0005 18.4733L27.0264 21.6765ZM28.7184 17.3365C28.9747 20.075 32.8717 20.54 32.8717 20.54C27.7955 20.1783 28.7184 17.3365 28.7184 17.3365Z'
|
||
fill='#BA7C9D'/>
|
||
</g>
|
||
<defs>
|
||
<filter id='filter0_d_36_3' x='0' y='0' width='48' height='68' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'>
|
||
<feFlood flood-opacity='0' result='BackgroundImageFix'/>
|
||
<feColorMatrix in='SourceAlpha' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0' result='hardAlpha'/>
|
||
<feOffset dy='4'/>
|
||
<feGaussianBlur stdDeviation='2'/>
|
||
<feComposite in2='hardAlpha' operator='out'/>
|
||
<feColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0'/>
|
||
<feBlend mode='normal' in2='BackgroundImageFix' result='effect1_dropShadow_36_3'/>
|
||
<feBlend mode='normal' in='SourceGraphic' in2='effect1_dropShadow_36_3' result='shape'/>
|
||
</filter>
|
||
</defs>
|
||
</svg>"
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 203fb9d1-1952-47bf-b7cb-7a8f630a3785
|
||
dataCategory: ImageUrl
|
||
|
||
measure ICO_CVRM = ```
|
||
"data:image/svg+xml;utf8,<svg width='130' height='180' viewBox='0 0 73 58' fill='none' xmlns='http://www.w3.org/2000/svg'>
|
||
<g filter='url(#filter0_d_75_22)'>
|
||
<path d='M25.1703 15.8363C22.5587 16.2808 16.8353 18.9703 14.8349 26.1717' stroke='#BA7C9D'/>
|
||
</g>
|
||
<g filter='url(#filter1_d_75_22)'>
|
||
<path d='M45.6744 16.003C48.2861 16.4475 54.0094 19.137 56.0098 26.3384' stroke='#BA7C9D'/>
|
||
</g>
|
||
<g filter='url(#filter2_d_75_22)'>
|
||
<path d='M28.0043 46.9282C30.1539 48.4766 36.0865 50.666 42.6203 47.0367' stroke='#BA7C9D'/>
|
||
</g>
|
||
<g filter='url(#filter3_d_75_22)'>
|
||
<path d='M41.8457 12.5476C40.9227 10.9633 39.9036 9.61644 38.75 8.90346C38.8461 8.5272 38.9615 8.11129 39.1345 7.71521C38.9615 6.68528 38.2308 6.4674 37.7116 6.42782C38.8653 5.5366 39.9421 5.27914 39.9421 5.27914C40.0767 4.05127 38.9615 4.26912 38.9615 4.26912C37.8462 4.52658 36.9617 5.00189 36.2695 5.57621C38.0577 3.6354 40.192 3.14015 40.192 3.14015C40.3843 1.5756 38.9422 1.85285 38.9422 1.85285C34.4237 2.90251 32.9239 6.80408 32.5202 8.17072C32.2318 8.01228 31.9049 7.91326 31.5779 7.85383V6.05155C31.5779 6.05155 32.4817 4.30873 34.2122 3.06096C34.8274 1.53602 33.1931 0.922056 33.1931 0.922056L31.5779 2.36777V0.466567C30.6358 -0.583209 29.6936 0.466567 29.6936 0.466567V8.30932C29.1168 8.72522 28.7323 9.37877 28.463 10.1709C27.5208 13.0031 28.0208 15.855 29.9244 18.1128C29.9244 18.1128 30.6358 20.9846 35.2506 22.2323C39.8844 23.48 41.3649 23.0046 42.0764 22.2323C42.7878 21.4599 43.8453 16.0135 41.8457 12.5476ZM39.0768 4.44739C38.9999 4.92267 39.596 5.27917 39.596 5.27917C38.8077 5.14052 39.0384 4.50676 39.0768 4.44739ZM39.0961 2.09055C38.9999 2.68466 39.7498 3.14018 39.7498 3.14018C38.75 2.96195 39.0576 2.14995 39.0961 2.09055ZM33.1931 1.1399C32.7316 2.09052 33.8661 3.04114 33.8661 3.04114C32.3279 1.85285 33.1931 1.1399 33.1931 1.1399ZM29.7706 0.704236C30.4051 1.12011 31.501 0.842861 31.501 0.842861C30.7319 1.53602 29.7706 0.704236 29.7706 0.704236ZM36.6349 8.30932C36.4234 8.32914 36.2119 8.34893 36.0004 8.40833C36.2888 7.89344 36.6349 7.45775 37.0002 7.08145L36.6349 8.30932ZM37.2694 6.64567C37.3655 7.69541 38.8269 7.87365 38.8269 7.87365C36.9233 7.735 37.2694 6.64567 37.2694 6.64567Z'
|
||
fill='#BA7C9D'/>
|
||
</g>
|
||
<g filter='url(#filter4_d_75_22)'>
|
||
<path d='M68.9338 37.1644C68.9338 33.333 65.8549 30.0018 62.3862 30.0018C61.5202 30.0018 60.5313 30.2751 59.7695 30.8815C58.9571 31.5284 58.4226 32.5553 58.6399 33.8491C58.7863 34.7165 59.3686 35.4952 59.7277 35.9759L59.7685 36.0301L59.7802 36.0464C59.9868 36.3232 60.1346 36.5221 60.241 36.6976C60.2694 36.744 60.2949 36.7922 60.3172 36.8418V39.0395C60.3172 39.3266 60.2601 39.562 60.1477 39.9256L60.1048 40.0625C59.996 40.4088 59.8525 40.8653 59.7649 41.436C59.5831 42.6259 59.8429 43.7623 60.6128 44.6031C61.3735 45.4329 62.4861 45.8168 63.7019 45.8168C66.3958 45.8168 68.9214 43.1849 68.9214 40.1692C68.9668 39.0838 68.9668 38.1239 68.9338 37.1644ZM44.036 40.1677C44.036 43.1835 46.5609 45.8154 49.2555 45.8154C50.4713 45.8154 51.5839 45.4315 52.3446 44.6017C53.1142 43.7609 53.3743 42.6245 53.1921 41.4346C53.1046 40.8639 52.9614 40.4066 52.8522 40.061L52.8093 39.9242C52.6969 39.5605 52.6399 39.3252 52.6399 39.0381V36.8404C52.6623 36.7908 52.6878 36.7426 52.7161 36.6961C52.8224 36.5207 52.9702 36.3218 53.1769 36.045L53.1889 36.0287L53.2297 35.9741C53.5888 35.4945 54.1712 34.7158 54.3172 33.8473C54.5352 32.5535 53.9982 31.5267 53.1879 30.8798C52.4258 30.2733 51.4368 30 50.5712 30C47.1025 30 44.0236 33.3319 44.0236 37.1626C43.9903 38.1239 43.9903 39.0838 44.036 40.1677Z'
|
||
fill='#BA7C9D'/>
|
||
<path d='M52.2058 39.6804L55.1219 42.9493C55.2878 43.1151 55.3811 43.34 55.3814 43.5745V49.0687C55.3814 49.2257 55.4438 49.3763 55.5548 49.4873C55.6658 49.5983 55.8164 49.6606 55.9734 49.6606H57.0385C57.1163 49.6607 57.1934 49.6454 57.2653 49.6157C57.3372 49.5859 57.4025 49.5423 57.4576 49.4873C57.5126 49.4323 57.5563 49.367 57.5861 49.2951C57.6158 49.2232 57.6312 49.1462 57.6312 49.0683V43.4611C57.6312 43.2263 57.7241 43.001 57.8896 42.8344L60.6898 39.6822C60.7688 39.6028 60.8311 39.5084 60.8732 39.4047C60.9154 39.3009 60.9364 39.1898 60.9351 39.0778L60.9139 37.1542C60.9137 37.0839 60.8927 37.0153 60.8534 36.957C60.8142 36.8987 60.7586 36.8534 60.6935 36.8268C60.6285 36.8003 60.5571 36.7936 60.4882 36.8077C60.4194 36.8218 60.3563 36.856 60.307 36.906L57.1626 40.3815C56.9733 40.5707 56.7168 40.6769 56.4492 40.6769C56.1817 40.6769 55.9251 40.5707 55.7359 40.3815L52.5936 36.9078C52.5439 36.8582 52.4807 36.8242 52.4119 36.8103C52.343 36.7964 52.2716 36.8031 52.2065 36.8296C52.1415 36.8561 52.0857 36.9012 52.0462 36.9592C52.0066 37.0173 51.9851 37.0857 51.9842 37.1559L51.963 39.0785C51.9614 39.19 51.982 39.3006 52.0237 39.404C52.0654 39.5073 52.1273 39.6013 52.2058 39.6804Z'
|
||
fill='#BA7C9D'/>
|
||
</g>
|
||
<g filter='url(#filter5_d_75_22)'>
|
||
<path d='M12.9232 30C13.4155 30 13.8165 30.3991 13.8165 30.8946L13.8149 32.7985L13.0707 32.7652C9.46928 32.7569 6.67663 35.5504 6.67663 39.0505C6.67663 42.5524 9.4726 45.3924 12.9249 45.3924C13.8358 45.3915 14.7353 45.1895 15.5597 44.8007C16.384 44.4119 17.1129 43.8458 17.6948 43.1427L17.9384 42.8317C18.2864 42.3562 18.7836 41.9654 19.3803 41.7842L20.5073 41.7875C21.0012 41.7875 21.4023 42.1882 21.4023 42.6821V49.1054C21.4023 49.2232 21.3791 49.3398 21.3341 49.4485C21.2891 49.5573 21.2231 49.656 21.1399 49.7392C21.0568 49.8223 20.9581 49.8881 20.8495 49.9329C20.741 49.9776 20.6247 50.0004 20.5073 50H17.3865C17.2692 50.0002 17.1531 49.9772 17.0448 49.9324C16.9364 49.8875 16.8379 49.8217 16.7549 49.7386C16.6719 49.6555 16.6061 49.5568 16.5612 49.4481C16.5163 49.3395 16.4932 49.223 16.4932 49.1054V47.3462C15.3685 47.8442 14.1525 48.1008 12.9232 48.0994C7.99258 48.0994 4 44.0456 4 39.0489C4 34.0539 7.99258 30 12.9232 30ZM28.4527 31.8108C30.8989 33.9026 24.6142 40.7632 20.0996 40.7632C18.8632 40.7632 17.8588 41.415 17.2257 42.2797L17.0169 42.5457C16.5175 43.149 15.8919 43.6346 15.1844 43.968C14.4769 44.3013 13.7049 44.4743 12.9232 44.4746C9.96318 44.4746 7.56995 42.0436 7.56995 39.0489C7.56995 36.0625 9.95654 33.6748 12.9978 33.6781L13.2133 33.6947C14.1745 33.7529 15.3546 33.7695 16.5976 33.6914C18.4058 33.5783 19.9753 33.2857 21.1305 32.7852L21.5746 32.5923C25.9103 30.7233 26.961 30.5354 28.4527 31.8108ZM18.3428 36.6994H18.2102C16.4103 36.8856 15.1888 37.4609 14.0303 38.6881L13.7254 38.9907C13.3806 39.3183 12.9991 39.6045 12.5884 39.8437C12.3299 39.2484 12.3697 38.6831 12.6978 38.0861C12.7419 38.0096 12.7703 37.925 12.7815 37.8373C12.7926 37.7496 12.7862 37.6605 12.7626 37.5754C12.739 37.4902 12.6988 37.4106 12.6442 37.3412C12.5896 37.2718 12.5217 37.214 12.4446 37.1712C12.3675 37.1285 12.2826 37.1015 12.195 37.0921C12.1074 37.0826 12.0188 37.0907 11.9344 37.116C11.8499 37.1412 11.7713 37.1831 11.7032 37.2392C11.6351 37.2953 11.5788 37.3645 11.5377 37.4426C11.009 38.4021 10.951 39.3931 11.362 40.3575C11.1167 40.4257 10.8648 40.4772 10.6062 40.5105C10.4372 40.5388 10.2856 40.6316 10.1833 40.7696C10.081 40.9076 10.036 41.08 10.0576 41.2506C10.0793 41.4211 10.166 41.5767 10.2994 41.6845C10.4329 41.7924 10.6029 41.8442 10.7736 41.8291C12.242 41.6412 13.5497 40.9977 14.685 39.9102L15.2253 39.3665C16.0871 38.5434 16.9788 38.1626 18.3461 38.0213C18.498 38.0052 18.6396 37.937 18.7472 37.8283C18.8547 37.7195 18.9215 37.5768 18.9364 37.4243C18.9512 37.2719 18.913 37.1189 18.8284 36.9914C18.7439 36.8638 18.618 36.7695 18.4721 36.7243L18.3444 36.6977L18.3428 36.6994Z'
|
||
fill='#BA7C9D'/>
|
||
</g>
|
||
<defs>
|
||
<filter id='filter0_d_75_22' x='10.3531' y='15.3434' width='18.9011' height='18.9622' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'>
|
||
<feFlood flood-opacity='0' result='BackgroundImageFix'/>
|
||
<feColorMatrix in='SourceAlpha' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0' result='hardAlpha'/>
|
||
<feOffset dy='4'/>
|
||
<feGaussianBlur stdDeviation='2'/>
|
||
<feComposite in2='hardAlpha' operator='out'/>
|
||
<feColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0'/>
|
||
<feBlend mode='normal' in2='BackgroundImageFix' result='effect1_dropShadow_75_22'/>
|
||
<feBlend mode='normal' in='SourceGraphic' in2='effect1_dropShadow_75_22' result='shape'/>
|
||
</filter>
|
||
<filter id='filter1_d_75_22' x='41.5905' y='15.5101' width='18.9011' height='18.9622' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'>
|
||
<feFlood flood-opacity='0' result='BackgroundImageFix'/>
|
||
<feColorMatrix in='SourceAlpha' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0' result='hardAlpha'/>
|
||
<feOffset dy='4'/>
|
||
<feGaussianBlur stdDeviation='2'/>
|
||
<feComposite in2='hardAlpha' operator='out'/>
|
||
<feColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0'/>
|
||
<feBlend mode='normal' in2='BackgroundImageFix' result='effect1_dropShadow_75_22'/>
|
||
<feBlend mode='normal' in='SourceGraphic' in2='effect1_dropShadow_75_22' result='shape'/>
|
||
</filter>
|
||
<filter id='filter2_d_75_22' x='23.712' y='46.5225' width='23.1511' height='10.9902' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'>
|
||
<feFlood flood-opacity='0' result='BackgroundImageFix'/>
|
||
<feColorMatrix in='SourceAlpha' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0' result='hardAlpha'/>
|
||
<feOffset dy='4'/>
|
||
<feGaussianBlur stdDeviation='2'/>
|
||
<feComposite in2='hardAlpha' operator='out'/>
|
||
<feColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0'/>
|
||
<feBlend mode='normal' in2='BackgroundImageFix' result='effect1_dropShadow_75_22'/>
|
||
<feBlend mode='normal' in='SourceGraphic' in2='effect1_dropShadow_75_22' result='shape'/>
|
||
</filter>
|
||
<filter id='filter3_d_75_22' x='24' y='0' width='23' height='31' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'>
|
||
<feFlood flood-opacity='0' result='BackgroundImageFix'/>
|
||
<feColorMatrix in='SourceAlpha' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0' result='hardAlpha'/>
|
||
<feOffset dy='4'/>
|
||
<feGaussianBlur stdDeviation='2'/>
|
||
<feComposite in2='hardAlpha' operator='out'/>
|
||
<feColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0'/>
|
||
<feBlend mode='normal' in2='BackgroundImageFix' result='effect1_dropShadow_75_22'/>
|
||
<feBlend mode='normal' in='SourceGraphic' in2='effect1_dropShadow_75_22' result='shape'/>
|
||
</filter>
|
||
<filter id='filter4_d_75_22' x='40' y='30' width='32.9572' height='27.6606' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'>
|
||
<feFlood flood-opacity='0' result='BackgroundImageFix'/>
|
||
<feColorMatrix in='SourceAlpha' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0' result='hardAlpha'/>
|
||
<feOffset dy='4'/>
|
||
<feGaussianBlur stdDeviation='2'/>
|
||
<feComposite in2='hardAlpha' operator='out'/>
|
||
<feColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0'/>
|
||
<feBlend mode='normal' in2='BackgroundImageFix' result='effect1_dropShadow_75_22'/>
|
||
<feBlend mode='normal' in='SourceGraphic' in2='effect1_dropShadow_75_22' result='shape'/>
|
||
</filter>
|
||
<filter id='filter5_d_75_22' x='0' y='30' width='33' height='28' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'>
|
||
<feFlood flood-opacity='0' result='BackgroundImageFix'/>
|
||
<feColorMatrix in='SourceAlpha' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0' result='hardAlpha'/>
|
||
<feOffset dy='4'/>
|
||
<feGaussianBlur stdDeviation='2'/>
|
||
<feComposite in2='hardAlpha' operator='out'/>
|
||
<feColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0'/>
|
||
<feBlend mode='normal' in2='BackgroundImageFix' result='effect1_dropShadow_75_22'/>
|
||
<feBlend mode='normal' in='SourceGraphic' in2='effect1_dropShadow_75_22' result='shape'/>
|
||
</filter>
|
||
</defs>
|
||
</svg>"
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: b6a2ecae-6379-4ca1-b0ed-12a8a5070489
|
||
dataCategory: ImageUrl
|
||
|
||
measure ICO_DM = ```
|
||
"data:image/svg+xml;utf8,
|
||
<svg width='72' height='50' viewBox='0 0 72 66' fill='none' xmlns='http://www.w3.org/2000/svg'>
|
||
<g clip-path='url(#clip0_75_16)' filter='url(#filter0_d_75_16)'>
|
||
<g filter='url(#filter1_d_75_16)'>
|
||
<path d='M27.1148 8.09326C28.3399 8.09326 29.3381 9.08326 29.3381 10.3125L29.334 15.0356L27.4819 14.9531C18.5183 14.9325 11.5676 21.8625 11.5676 30.5456C11.5676 39.2329 18.5265 46.2784 27.1189 46.2784C29.386 46.2762 31.6249 45.7751 33.6766 44.8106C35.7283 43.846 37.5426 42.4417 38.9906 40.6973L39.597 39.9259C40.4633 38.7461 41.7008 37.7768 43.1858 37.3271L45.9908 37.3354C47.22 37.3354 48.2183 38.3295 48.2183 39.5546V55.4895C48.2183 55.7816 48.1606 56.0709 48.0485 56.3407C47.9365 56.6105 47.7723 56.8555 47.5653 57.0617C47.3584 57.2679 47.1128 57.4312 46.8426 57.5422C46.5724 57.6532 46.2829 57.7098 45.9908 57.7088H38.2234C37.9316 57.7093 37.6426 57.6523 37.3729 57.541C37.1031 57.4297 36.858 57.2663 36.6515 57.0602C36.445 56.8541 36.2811 56.6093 36.1693 56.3397C36.0576 56.0702 36 55.7813 36 55.4895V51.1253C33.2009 52.3607 30.1744 52.9972 27.1148 52.9939C14.8429 52.9939 4.90576 42.9371 4.90576 30.5415C4.90576 18.15 14.8429 8.09326 27.1148 8.09326ZM65.766 12.5854C71.8545 17.7746 56.2125 34.7944 44.976 34.7944C41.8988 34.7944 39.399 36.4114 37.8233 38.5564L37.3035 39.2164C36.0607 40.7131 34.5035 41.9177 32.7425 42.7447C30.9816 43.5717 29.0602 44.0007 27.1148 44.0014C19.7475 44.0014 13.791 37.9706 13.791 30.5415C13.791 23.133 19.731 17.2095 27.3004 17.2178L27.8366 17.259C30.2291 17.4034 33.1661 17.4446 36.2599 17.2508C40.7603 16.9703 44.6666 16.2443 47.5418 15.0026L48.6473 14.5241C59.4383 9.88764 62.0535 9.42151 65.766 12.5854ZM40.6035 24.7129H40.2735C35.7938 25.1749 32.7536 26.6021 29.8703 29.6464L29.1113 30.3971C28.2532 31.2098 27.3036 31.92 26.2815 32.5133C25.638 31.0365 25.737 29.634 26.5538 28.1531C26.6635 27.9632 26.7343 27.7534 26.762 27.5358C26.7897 27.3183 26.7737 27.0974 26.715 26.886C26.6563 26.6747 26.5561 26.4772 26.4202 26.3051C26.2843 26.1329 26.1154 25.9896 25.9235 25.8835C25.7316 25.7774 25.5204 25.7106 25.3024 25.6871C25.0843 25.6635 24.8637 25.6837 24.6536 25.7463C24.4434 25.809 24.2478 25.913 24.0783 26.0521C23.9088 26.1913 23.7687 26.3628 23.6663 26.5568C22.3504 28.9369 22.206 31.3954 23.229 33.7879C22.6185 33.957 21.9915 34.0849 21.348 34.1674C20.9272 34.2375 20.55 34.468 20.2954 34.8103C20.0408 35.1526 19.9287 35.5802 19.9826 36.0034C20.0365 36.4266 20.2522 36.8124 20.5845 37.08C20.9167 37.3476 21.3397 37.4761 21.7646 37.4385C25.4194 36.9724 28.674 35.376 31.4996 32.6783L32.8444 31.3294C34.9894 29.2875 37.2086 28.3429 40.6118 27.9923C40.9897 27.9524 41.3423 27.7832 41.61 27.5134C41.8777 27.2436 42.044 26.8897 42.0809 26.5114C42.1177 26.1331 42.0229 25.7537 41.8123 25.4373C41.6017 25.1209 41.2884 24.8869 40.9253 24.7748L40.6076 24.7088L40.6035 24.7129Z'
|
||
fill='#BA7C9D'/>
|
||
</g>
|
||
</g>
|
||
<defs>
|
||
<filter id='filter0_d_75_16' x='-1' y='0' width='74' height='74' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'>
|
||
<feFlood flood-opacity='0' result='BackgroundImageFix'/>
|
||
<feColorMatrix in='SourceAlpha' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0' result='hardAlpha'/>
|
||
<feOffset dy='4'/>
|
||
<feGaussianBlur stdDeviation='2'/>
|
||
<feComposite in2='hardAlpha' operator='out'/>
|
||
<feColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0'/>
|
||
<feBlend mode='normal' in2='BackgroundImageFix' result='effect1_dropShadow_75_16'/>
|
||
<feBlend mode='normal' in='SourceGraphic' in2='effect1_dropShadow_75_16' result='shape'/>
|
||
</filter>
|
||
<filter id='filter1_d_75_16' x='0.905762' y='8.09326' width='70.2225' height='57.6155' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'>
|
||
<feFlood flood-opacity='0' result='BackgroundImageFix'/>
|
||
<feColorMatrix in='SourceAlpha' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0' result='hardAlpha'/>
|
||
<feOffset dy='4'/>
|
||
<feGaussianBlur stdDeviation='2'/>
|
||
<feComposite in2='hardAlpha' operator='out'/>
|
||
<feColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0'/>
|
||
<feBlend mode='normal' in2='BackgroundImageFix' result='effect1_dropShadow_75_16'/>
|
||
<feBlend mode='normal' in='SourceGraphic' in2='effect1_dropShadow_75_16' result='shape'/>
|
||
</filter>
|
||
<clipPath id='clip0_75_16'>
|
||
<rect width='66' height='66' fill='white' transform='translate(3)'/>
|
||
</clipPath>
|
||
</defs>
|
||
</svg>"
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: f45ca194-3903-4c3a-afc2-d9099954fdd9
|
||
dataCategory: ImageUrl
|
||
|
||
measure ICO_Rank = ```
|
||
"data:image/svg+xml;utf8,<svg width='100' height='50' xmlns='http://www.w3.org/2000/svg' version='1.1'>
|
||
|
||
<!--<rect width='100%' height='100%' border='0' style='fill:gray'></rect>-->
|
||
<text x='30' y='40' font-size='24' fill='#666666'>Rank</text>
|
||
</svg>"
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 84ef7838-3dfa-4847-8651-cf3830c834fa
|
||
dataCategory: ImageUrl
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%Rank.KPI' = RANK(DENSE, ALL(Dim_Corp[CORP_DES]), ORDERBY([External.MS%.KPI], DESC))
|
||
formatString: #,0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: a764f2c5-750f-40c3-acd6-47f9e60ee42f
|
||
|
||
measure 'Sales_EI_MKT GR%' =
|
||
FORMAT([ExternalTotal.EI.KPI],"0") &" / " & FORMAT([ExternalTotal.Gr%.KPI.Market],"0%") & ""
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:EI+MKT GR%组合
|
||
------KPI公式:
|
||
------备注:1、带total的都是用于首页,用户要求首页不受数据权限控制。
|
||
------ 2、用于1.1卡片图,因为用户要求显示EI + MKT GR
|
||
------创建时间:2024.4.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
displayFolder: OLD\EI
|
||
lineageTag: 5b613633-dd5d-438a-9f24-4b009bbc9a56
|
||
|
||
measure 'External.Gr%.KPI.Market' =
|
||
VAR DS = SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||
VAR YEARS = MAX ( Dim_Calendar[YEAR] )
|
||
RETURN
|
||
SWITCH (
|
||
TRUE ( ),
|
||
//DS = "EC" && YEARS < 2023,BLANK(),
|
||
[External.Sales.LY.KPI.Market] <> BLANK ( ),
|
||
//ROUND([External.Sales.LY.KPI.Market],0) = 0,BLANK(),
|
||
DIVIDE (
|
||
[External.Sales.KPI.Market] - [External.Sales.LY.KPI.Market],
|
||
[External.Sales.LY.KPI.Market]
|
||
)
|
||
)
|
||
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:市场同比增长率
|
||
------KPI公式:(今年市场销量-去年市场销量)/去年市场销量
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\GR%
|
||
lineageTag: 89a0e48d-6566-43bd-be81-4282bb8ad1cb
|
||
|
||
measure 'External.Sales.KPI.AZ' =
|
||
|
||
CALCULATE( [External.Sales.KPI], Dim_Corp[CORP_DES] = "ASTRAZENECA")
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:月度KPI
|
||
------KPI公式:根据所选单位,显示不同的月度KPI值
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0
|
||
displayFolder: OLD\External Sales
|
||
lineageTag: 10b910ec-189f-4d00-8d5c-b6aab6ea086a
|
||
|
||
measure 'External.Sales.LY.KPI.AZ' =
|
||
|
||
CALCULATE( [External.Sales.LY.KPI], Dim_Corp[CORP_DES] = "ASTRAZENECA")
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:AZ去年同期月度KPI
|
||
------KPI公式:根据所选单位,显示不同的月度KPI值
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0
|
||
displayFolder: OLD\External Sales
|
||
lineageTag: d37020ff-8120-4807-a0c3-d00447a15e04
|
||
|
||
measure 'External.Gr%.KPI.AZ' =
|
||
|
||
DIVIDE([External.Sales.KPI.AZ]-[External.Sales.LY.KPI.AZ],[External.Sales.LY.KPI.AZ])
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:AZ产品同比增长率
|
||
------KPI公式:(AZ今年产品销量-AZ去年产品销量)/AZ去年产品销量
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\GR%
|
||
lineageTag: faa15ebe-bd3e-46f9-a254-c6998bf75100
|
||
|
||
measure 'External.MS%.KPI.AZ' =
|
||
DIVIDE([External.Sales.KPI.AZ],[External.Sales.KPI.Market])
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:MS%:AZ产品销量占市场销量的占比
|
||
------KPI公式:今年AZ产品销量/市场销量
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\MS%
|
||
lineageTag: 8f09e524-6c7c-489a-bc07-fa43fdb3a0d7
|
||
|
||
measure 'External.MS%.LY.KPI' =
|
||
DIVIDE([External.Sales.LY.KPI],[External.Sales.LY.KPI.Market])
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:MS%:去年产品销量占市场销量的占比
|
||
------KPI公式:去年产品销量/市场销量
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\中间KPI
|
||
lineageTag: 9ea49b02-2e6d-4c0c-91a3-668c74d3b391
|
||
|
||
measure 'External.MS%.LY.KPI.AZ' =
|
||
DIVIDE([External.Sales.LY.KPI.AZ],[External.Sales.LY.KPI.Market])
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:MS%:去年AZ产品销量占市场销量的占比
|
||
------KPI公式:去年AZ产品销量/市场销量
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\中间KPI
|
||
lineageTag: 07ab9a7e-f949-4fcd-b751-66c82b6945fd
|
||
|
||
measure 'External.△MS%.KPI.AZ' =
|
||
[External.MS%.KPI.AZ]- [External.MS%.LY.KPI.AZ]
|
||
|
||
|
||
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI公式:今年AZ产品占市场的占比-去年AZ产品占市场的占比
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\△MS%
|
||
lineageTag: 99604465-d1e7-4dfe-ba10-f945f0a1311b
|
||
|
||
measure 'External.EI.KPI.AZ' =
|
||
|
||
DIVIDE (
|
||
DIVIDE ( [External.Sales.KPI.AZ], [External.Sales.LY.KPI.AZ] ),
|
||
DIVIDE ( [External.Sales.KPI.Market], [External.Sales.LY.KPI.Market] )
|
||
) * 100
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:AZ产品的EI
|
||
------KPI公式:(今年AZ产品销量/去年AZ产品销量)/(今年市场销量/去年市场销量) * 100
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0
|
||
displayFolder: OLD\EI
|
||
lineageTag: 39583ce6-75af-42ee-b350-8d57fd37221d
|
||
|
||
measure 'Top Value' = SELECTEDVALUE('TOP'[RankNum], 10)
|
||
displayFolder: OLD\Others
|
||
lineageTag: 4f007e07-ef98-4358-8828-777e421799bf
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure Trend_Is_In_DateRange = ```
|
||
|
||
VAR MTHS = [Option_Trend_Mths.Value]-1
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
ISINSCOPE(Dim_Calendar_Alt[YYYYMM]),
|
||
VAR YM = SELECTEDVALUE(Dim_Calendar_Alt[YYYYMM])
|
||
VAR DATE1 = CALCULATE(MAX(Dim_Calendar[DATE]))
|
||
VAR DATE0 = DATE(YEAR(DATE1), MONTH(DATE1)-MTHS, 1)
|
||
RETURN int(YM>=FORMAT(DATE0,"yyyyMM") && YM<=FORMAT(DATE1,"yyyyMM")),
|
||
ISINSCOPE(Dim_Calendar_Alt[YEAR_QUATER]),
|
||
VAR YQ = SELECTEDVALUE(Dim_Calendar_Alt[YEAR_QUATER])
|
||
VAR DATE1 = CALCULATE(ENDOFQUARTER(Dim_Calendar[DATE]))
|
||
VAR DATE0 = DATE(YEAR(DATE1), MONTH(DATE1)-MTHS, 1)
|
||
RETURN int(YQ>=FORMAT(DATE0,"yyyy\QQ") && YQ<=FORMAT(DATE1,"yyyy\QQ"))
|
||
)
|
||
```
|
||
formatString: 0
|
||
displayFolder: OLD\Others
|
||
lineageTag: 1899b017-4bc4-4871-91d3-a7d3f68dfe34
|
||
|
||
measure 'Option_Trend_Mths.Value' = SELECTEDVALUE('Option_Trend_Mths'[Option_Trend_Mths], 12)
|
||
displayFolder: OLD\Others
|
||
lineageTag: f68a8a6c-d5f9-4043-8b29-91ce050bbe14
|
||
|
||
measure 日期选择控制 =
|
||
|
||
if(VALUE(LEFT(MAXX(ALL(Fact_Sales[YYYYMM]),[YYYYMM]),4))>=MAXX(Dim_Calendar,value([YEAR]))&&
|
||
VALUE(LEFT(MAXX(ALL(Fact_Sales[YYYYMM]),[YYYYMM]),4))-2<=MINX(Dim_Calendar,value([YEAR])),1,0)
|
||
displayFolder: OLD\Others
|
||
lineageTag: 8acf00a6-9dbc-4ded-9e26-5fd395f6f88f
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'IMSRankedBy.Value' = SELECTEDVALUE(Option_IMSRankedBy[Name],"MS%")
|
||
displayFolder: OLD\Others
|
||
lineageTag: 76986fd1-1256-4063-bb71-00ba8212dbf1
|
||
|
||
measure 'External.Trend.KPI' = ```
|
||
|
||
IF([External.Sales.KPI] <> BLANK(),
|
||
SWITCH([IMSRankedBy.Value],
|
||
"GR%", [External.Gr%.KPI],
|
||
"GRVal", [External.GRSales.KPI],
|
||
"MS%", [External.MS%.KPI],
|
||
"ΔMS%", [External.△MS%.KPI],
|
||
//else
|
||
[External.Sales.KPI]
|
||
))
|
||
```
|
||
displayFolder: OLD\Rank
|
||
lineageTag: 07a68f04-7e3e-4901-83c0-915ba9fd656a
|
||
|
||
formatStringDefinition =
|
||
SWITCH([IMSRankedBy.Value],
|
||
"MS%", "#,0.#%",
|
||
"GR%", "#,0.#%",
|
||
"ΔMS%", "#,0.#%",
|
||
"#,#"
|
||
)
|
||
|
||
measure 'External.GRSales.KPI' =
|
||
[External.Sales.KPI]-[External.Sales.LY.KPI]
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:增长金额
|
||
------KPI公式:今年销量-去年同期销量
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0
|
||
displayFolder: OLD\External Sales
|
||
lineageTag: ccd99a64-822f-4e91-aa03-ec31eeab1f42
|
||
|
||
measure 'External.Rank.KPI.TopN' =
|
||
|
||
INT(([External.Rank.KPI2.1]>0 && [External.Rank.KPI2.1] <= [Top Value]))
|
||
formatString: #,0
|
||
displayFolder: OLD\Others
|
||
lineageTag: fc639bf3-32d4-4056-9be7-3053ef2ccf1c
|
||
|
||
measure 'External.SalesRank.LY.KPI' = CALCULATE([External.SalesRank.KPI], SAMEPERIODLASTYEAR(Dim_Calendar[DATE]))
|
||
formatString: #,0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: 86b083b0-7cd4-4843-b30b-710520f210fb
|
||
|
||
measure 'External.SalesRank.KPI' = RANK(DENSE, ALL(Dim_Corp[CORP_DES]), ORDERBY([External.Sales.KPI], DESC))
|
||
formatString: #,0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: 27614e80-a19b-4b6d-91ff-8829ec9dcaf4
|
||
|
||
measure 'External.Gr%Rank.KPI' = RANK(DENSE, ALL(Dim_Corp[CORP_DES]), ORDERBY([External.Gr%.KPI], DESC))
|
||
formatString: #,0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: e8c98cb6-194f-4e0b-9b3d-ec868f4c3208
|
||
|
||
measure 'External.△MS%Rank.KPI' = [External.Rank.LY.KPI] - [External.Rank.KPI]
|
||
formatString: #,0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: 3ce12126-f686-4845-b4d4-b26c2c627524
|
||
|
||
measure 'External.Sales.KPI.Mol' =
|
||
IF (
|
||
ISFILTERED ( Dim_MarketTA ) || ISFILTERED ( Dim_Market )
|
||
|| ISFILTERED ( Dim_BrandDefaultMKT ),
|
||
IF (
|
||
[External.Sales.KPI.Market] <> 0,
|
||
CALCULATE (
|
||
[External.Sales.KPI],
|
||
REMOVEFILTERS ( Dim_PackInfo ),
|
||
REMOVEFILTERS ( Dim_KeyCompetitor ),
|
||
KEEPFILTERS ( VALUES ( Dim_PackInfo[CMPS_DES] ) )
|
||
)
|
||
)
|
||
)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:分子式销量
|
||
------KPI公式:
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
------修改时间:2024.5.30
|
||
------修改内容:只有选择了市场,才出现分子式销量
|
||
----------------------------------------------------------------------------
|
||
displayFolder: OLD\External Sales
|
||
lineageTag: 4c033ec1-f2be-4943-bc09-1f544369cb40
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.KPI.Mol' =
|
||
DIVIDE([External.Sales.KPI],[External.Sales.KPI.Mol])
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:MS%:产品销量占分子式销量的占比
|
||
------KPI公式:今年产品销量/分子式销量
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\MS%
|
||
lineageTag: 5876a193-78cf-4026-a4ed-cd295a2d9f80
|
||
|
||
measure 'External.Sales.LY.KPI.Mol' =
|
||
IF (
|
||
ISFILTERED ( Dim_MarketTA ) || ISFILTERED ( Dim_Market )
|
||
|| ISFILTERED ( Dim_BrandDefaultMKT ),
|
||
IF (
|
||
[External.Sales.LY.KPI.Market] <> 0,
|
||
CALCULATE (
|
||
[External.Sales.LY.KPI],
|
||
REMOVEFILTERS ( Dim_PackInfo ),
|
||
REMOVEFILTERS ( Dim_KeyCompetitor ),
|
||
KEEPFILTERS ( VALUES ( Dim_PackInfo[CMPS_DES] ) )
|
||
)
|
||
)
|
||
)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:分子式销量
|
||
------KPI公式:
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
------修改时间:2024.5.30
|
||
------修改内容:只有选择了市场,才出现分子式销量
|
||
----------------------------------------------------------------------------
|
||
displayFolder: OLD\External Sales
|
||
lineageTag: cc9236dc-e9e3-4766-9093-291028fc6eef
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Gr%.KPI.Mol' =
|
||
DIVIDE (
|
||
[External.Sales.KPI.Mol] - [External.Sales.LY.KPI.Mol],
|
||
[External.Sales.LY.KPI.Mol]
|
||
)
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:分子式同比增长率
|
||
------KPI公式:(今年分子式销量-去年分子式销量)/去年分子式销量
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\GR%
|
||
lineageTag: 5396f8cd-babb-46b3-8177-3f0a6d847cfc
|
||
|
||
measure 'External.MS%.LY.KPI.Mol' =
|
||
DIVIDE([External.Sales.LY.KPI],[External.Sales.LY.KPI.Mol])
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:MS%:去年产品销量占分子式销量的占比
|
||
------KPI公式:去年产品销量/分子式销量
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\中间KPI
|
||
lineageTag: bf0a7545-688a-434a-8005-4a34de339ecf
|
||
|
||
measure 'External.EI.KPI.Mol' =
|
||
|
||
DIVIDE (
|
||
DIVIDE ( [External.Sales.KPI.Mol], [External.Sales.LY.KPI.Mol] ),
|
||
DIVIDE ( [External.Sales.KPI.Market], [External.Sales.LY.KPI.Market] )
|
||
) * 100
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:分子式EI
|
||
------KPI公式:(今年分子式销量/去年分子式销量)/(今年市场销量/去年市场销量) * 100
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0
|
||
displayFolder: OLD\EI
|
||
lineageTag: 380412c8-cb68-4f84-9355-544597b1860c
|
||
|
||
measure 'External.HoHGR%.KPI' =
|
||
|
||
VAR CV = CALCULATE([External.Sales.KPI], MQY[Period]="HYTDAvg")
|
||
VAR PV = CALCULATE([External.Sales.KPI], MQY[Period]="RHYAvg")
|
||
RETURN IF(PV <> BLANK(),DIVIDE(CV-PV,PV))
|
||
//DIVIDE([External.SalesAvg.HALF] - [External.SalesAvg.LH.HALF],[External.SalesAvg.LH.HALF])
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Others
|
||
lineageTag: 76aa4bbf-c1e8-43ec-b0d1-b01266aca44f
|
||
|
||
measure 'External.Gr%.KPI.Leader' =
|
||
|
||
IF (
|
||
[External.Sales.KPI] <> BLANK (),
|
||
CALCULATE (
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_DES_C],
|
||
Dim_Corp[CORP_DES_C]
|
||
),
|
||
"@VAL", [External.Sales.KPI],
|
||
"@GR", [External.Gr%.KPI],
|
||
"VBP",
|
||
CALCULATE (
|
||
MIN ( Dim_PackInfo[VBP_DESC] ),
|
||
Dim_PackInfo[VBP_DESC] <> BLANK ()
|
||
)
|
||
),
|
||
ORDERBY ( [@GR], DESC )
|
||
)
|
||
RETURN
|
||
MAXX ( T, [@GR] ),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_PACK] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] )
|
||
)
|
||
)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:产品增长排名第一的公司+产品
|
||
------KPI公式:根据公司+产品的增长倒序排,取第一个公司+产品
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\GR%
|
||
lineageTag: 57c6a3c5-1be8-4db1-bf48-dce1d237857e
|
||
|
||
measure 'External.EI.KPI.TopCompetitor' =
|
||
|
||
IF (
|
||
[External.Sales.KPI] <> BLANK (),
|
||
CALCULATE (
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_DES_C],
|
||
Dim_Corp[CORP_DES],
|
||
Dim_Corp[CORP_DES_C]
|
||
),
|
||
"@VAL", [External.Sales.KPI],
|
||
"@EI", [External.EI.KPI]
|
||
),
|
||
[CORP_DES] <> "ASTRAZENECA"
|
||
&& [@VAL] <> BLANK ()
|
||
),
|
||
ORDERBY ( [@EI], DESC )
|
||
)
|
||
RETURN
|
||
MAXX ( T, [@EI] ),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_PACK] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] )
|
||
)
|
||
)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:EI
|
||
------KPI公式:排除az之后,根据公司+产品的EI倒序排,取最大的一个EI
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0
|
||
displayFolder: OLD\暂时弃用的KPI
|
||
lineageTag: a944456d-a854-46f2-9579-6546ad6b08c1
|
||
|
||
measure 'External.Gr%.KPI.TopCompetitor' =
|
||
|
||
IF (
|
||
[External.Sales.KPI] <> BLANK (),
|
||
CALCULATE (
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_DES_C],
|
||
Dim_Corp[CORP_DES],
|
||
Dim_Corp[CORP_DES_C]
|
||
),
|
||
"@VAL", [External.Sales.KPI],
|
||
"@GR", [External.GR%.KPI]
|
||
),
|
||
[CORP_DES] <> "ASTRAZENECA"
|
||
&& [@VAL] <> BLANK ()
|
||
),
|
||
ORDERBY ( [@GR], DESC )
|
||
)
|
||
RETURN
|
||
MAXX ( T, [@GR] ),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_PACK] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] )
|
||
)
|
||
)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:除AZ外,产品增长排名第一的公司+产品
|
||
------KPI公式:除AZ外,根据公司+产品的增长倒序排,取第一个公司+产品
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\GR%
|
||
lineageTag: 8148ab2b-59ac-42aa-a93b-d41cc06b2463
|
||
|
||
measure 'External.Rank.KPI' = ```
|
||
|
||
IF([External.Sales.KPI]<>BLANK(),
|
||
SWITCH(TRUE(),
|
||
ISINSCOPE(Dim_PackInfo[MOLECULE_CODE_DESC]), [External.Rank.KPI.MolENCN],
|
||
ISINSCOPE(Dim_PackInfo[PACK_DES]), [External.Rank.KPI.Pack],
|
||
ISINSCOPE(Dim_PackInfo[PROD_DES]), [External.Rank.KPI.Prod],
|
||
ISINSCOPE(Dim_PackInfo[CMPS_DES]), [External.Rank.KPI.CMPS],
|
||
ISINSCOPE(Dim_Class[CLASS]), [External.Rank.KPI.Class],
|
||
ISINSCOPE(Dim_Corp[CORP_DES]), [External.Rank.KPI.Corp],
|
||
BLANK()
|
||
)
|
||
)
|
||
```
|
||
formatString: #,0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: f690b2ea-5774-4b36-8786-8c4fa38c62e6
|
||
|
||
measure 'External.Rank.LY.KPI' = CALCULATE([External.Rank.KPI], SAMEPERIODLASTYEAR(Dim_Calendar[DATE]))
|
||
formatString: #,0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: 8603823c-e7ca-48a8-b583-5404ac112554
|
||
|
||
measure TITLE_TEST = SELECTEDVALUE('Fields.Rows'[Fields Fields])
|
||
displayFolder: OLD\Others
|
||
lineageTag: 31b104b7-f7d7-4d26-97fd-9b1446323d18
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Trend.KPI.AZ' = ```
|
||
|
||
SWITCH([IMSRankedBy.Value],
|
||
"GR%", [External.Gr%.KPI.AZ],
|
||
"GRVal", [External.GRSales.KPI.AZ],
|
||
"MS%", [External.MS%.KPI.AZ],
|
||
//else
|
||
[External.Sales.KPI.AZ]
|
||
)
|
||
```
|
||
displayFolder: OLD\Rank
|
||
lineageTag: 84fdd393-0c73-4a18-a3c3-94ee09c32b3c
|
||
|
||
formatStringDefinition =
|
||
SWITCH([IMSRankedBy.Value],
|
||
"MS%", "#,#%",
|
||
"GR%", "#,#.#%",
|
||
"#,#"
|
||
)
|
||
|
||
measure 'External.GRSales.KPI.AZ' =
|
||
[External.Sales.KPI.AZ]-[External.Sales.LY.KPI.AZ]
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:az增长金额
|
||
------KPI公式:AZ今年销量-AZ去年同期销量
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0
|
||
displayFolder: OLD\暂时弃用的KPI
|
||
lineageTag: 4a29d4a5-1769-4ce0-8478-fcbe16e2dc01
|
||
|
||
measure 'External.Trend.KPI.Sales' = ```
|
||
//按指定字段排序的销售金额趋势
|
||
IF(ISFILTERED(Dim_Corp),
|
||
IF([Trend_Is_In_DateRange]>0,
|
||
CALCULATE(
|
||
[External.Sales.KPI],
|
||
REMOVEFILTERS(Dim_Calendar),
|
||
REMOVEFILTERS(Dim_Calendar_Alt),
|
||
TREATAS(VALUES(Dim_Calendar_Alt[YYYYMM]),Dim_Calendar[YYYYMM]),
|
||
MQY[Period] = "MTH"
|
||
//DIM_GEO[province_name]="National"
|
||
)
|
||
)
|
||
,
|
||
IF([External.Sales.KPI]<>BLANK() && [External.Rank.KPI]<=[Top Value],
|
||
IF([Trend_Is_In_DateRange]>0,
|
||
CALCULATE(
|
||
[External.Sales.KPI],
|
||
REMOVEFILTERS(Dim_Calendar),
|
||
REMOVEFILTERS(Dim_Calendar_Alt),
|
||
TREATAS(VALUES(Dim_Calendar_Alt[YYYYMM]),Dim_Calendar[YYYYMM]),
|
||
MQY[Period] = "MTH"
|
||
//DIM_GEO[province_name]="National"
|
||
)
|
||
)
|
||
)
|
||
)
|
||
```
|
||
formatString: #,0
|
||
displayFolder: OLD\Others
|
||
lineageTag: 270622ee-c109-473b-a025-ea73bf3f9f1c
|
||
|
||
measure 'External.Trend.KPI.Sales.ALLCORP' = CALCULATE([External.Trend.KPI.Sales], REMOVEFILTERS(Dim_Corp))
|
||
formatString: #,0
|
||
displayFolder: OLD\Others
|
||
lineageTag: 1dfcb5b8-275d-4dfe-a24d-e6b0e822c8ff
|
||
|
||
measure ICO_GI =
|
||
"data:image/svg+xml;utf8,
|
||
<svg width='68' height='50' viewBox='0 0 68 64' fill='none' xmlns='http://www.w3.org/2000/svg'>
|
||
<g filter='url(#filter0_d_44_114)'>
|
||
<path d='M10.1054 48.6382C10.1054 43.2077 15.5529 43.0312 19.516 48.3531C23.4791 53.675 42.0143 62.8661 56.2868 47.62C70.5593 32.3738 65.6702 -2.74812 36.1991 7.50199C31.9228 8.99538 30.057 5.45197 29.3897 1.54199C28.9947 -2.97892 12.0529 2.75028 27.9052 14.6839C43.7575 26.6174 31.0375 40.4788 23.3701 40.4788C15.7027 40.4788 13.6463 36.6231 9.01591 38.7003C6.98671 39.5828 3.56838 43.6149 4.04504 46.3709C4.64427 49.9143 10.2961 51.8015 10.1054 48.6382Z' fill='#BA7C9D'/>
|
||
</g>
|
||
<defs>
|
||
<filter id='filter0_d_44_114' x='0' y='0' width='68' height='64' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'>
|
||
<feFlood flood-opacity='0' result='BackgroundImageFix'/>
|
||
<feColorMatrix in='SourceAlpha' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0' result='hardAlpha'/>
|
||
<feOffset dy='4'/>
|
||
<feGaussianBlur stdDeviation='2'/>
|
||
<feComposite in2='hardAlpha' operator='out'/>
|
||
<feColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0'/>
|
||
<feBlend mode='normal' in2='BackgroundImageFix' result='effect1_dropShadow_44_114'/>
|
||
<feBlend mode='normal' in='SourceGraphic' in2='effect1_dropShadow_44_114' result='shape'/>
|
||
</filter>
|
||
</defs>
|
||
</svg>
|
||
"
|
||
displayFolder: OLD\Others
|
||
lineageTag: ee7f87bc-489f-428b-b679-2aa0ebab0d68
|
||
dataCategory: ImageUrl
|
||
|
||
measure ICO_RD = ```
|
||
"data:image/svg+xml;utf8,
|
||
<svg width='72' height='50' viewBox='0 0 72 59' fill='none' xmlns='http://www.w3.org/2000/svg'>
|
||
<g filter='url(#filter0_d_42_8)'>
|
||
<path d='M67.9401 18.3723C67.9401 8.54714 60.0447 0.00454379 51.1494 0.00454379C48.9288 0.00454379 46.3927 0.705367 44.4393 2.26063C42.3559 3.91952 40.9852 6.55284 41.5424 9.87062C41.9178 12.0949 43.4113 14.0919 44.3321 15.3245L44.4366 15.4636L44.4666 15.5054C44.9965 16.2153 45.3756 16.7252 45.6483 17.1752C45.7212 17.2942 45.7865 17.4178 45.8437 17.5451V23.1808C45.8437 23.9171 45.6973 24.5207 45.4092 25.4533L45.2992 25.8041C45.0202 26.6922 44.652 27.863 44.4275 29.3264C43.9612 32.3779 44.6275 35.2921 46.6018 37.4482C48.5525 39.5761 51.4057 40.5605 54.5235 40.5605C61.4318 40.5605 67.9083 33.8113 67.9083 26.0777C68.0246 23.2944 68.0246 20.8329 67.9401 18.3723ZM4.09239 26.0741C4.09239 33.8077 10.5671 40.5569 17.4771 40.5569C20.5949 40.5569 23.4482 39.5725 25.3989 37.4445C27.3723 35.2884 28.0395 32.3742 27.5723 29.3228C27.3478 27.8593 26.9805 26.6868 26.7006 25.8005L26.5906 25.4496C26.3024 24.517 26.1561 23.9135 26.1561 23.1772V17.5415C26.2137 17.4143 26.2789 17.2908 26.3515 17.1716C26.6242 16.7216 27.0032 16.2117 27.5332 15.5018L27.5641 15.4599L27.6686 15.32C28.5894 14.0901 30.0829 12.0931 30.4574 9.86607C31.0164 6.5483 29.6393 3.91498 27.5614 2.25609C25.6071 0.700823 23.071 0 20.8513 0C11.956 0 4.06058 8.54442 4.06058 18.3678C3.97513 20.8329 3.97513 23.2944 4.09239 26.0741Z'
|
||
fill='#BA7C9D'/>
|
||
<path d='M25.0426 24.8243L32.5207 33.2069C32.946 33.6323 33.1853 34.2089 33.1861 34.8103V48.8995C33.1861 49.3021 33.346 49.6882 33.6307 49.9729C33.9154 50.2576 34.3015 50.4175 34.7041 50.4175H37.4356C37.6351 50.4177 37.8327 50.3785 38.0171 50.3022C38.2015 50.2259 38.3691 50.114 38.5102 49.973C38.6513 49.8319 38.7633 49.6644 38.8397 49.4801C38.9161 49.2958 38.9554 49.0982 38.9554 48.8986V34.5195C38.9555 33.9173 39.1937 33.3396 39.6181 32.9124L46.799 24.8288C47.0015 24.6252 47.1614 24.3832 47.2693 24.1172C47.3773 23.8511 47.4313 23.5662 47.428 23.279L47.3735 18.346C47.3731 18.1658 47.3192 17.9898 47.2186 17.8404C47.118 17.6909 46.9753 17.5748 46.8085 17.5066C46.6418 17.4384 46.4585 17.4213 46.282 17.4575C46.1056 17.4936 45.9438 17.5814 45.8173 17.7097L37.7537 26.6222C37.2685 27.1072 36.6105 27.3796 35.9244 27.3796C35.2384 27.3796 34.5804 27.1072 34.0951 26.6222L26.037 17.7142C25.9096 17.5869 25.7475 17.4999 25.571 17.4642C25.3944 17.4286 25.2113 17.4458 25.0445 17.5137C24.8777 17.5816 24.7346 17.6973 24.6332 17.8461C24.5318 17.995 24.4766 18.1704 24.4744 18.3505L24.4199 23.2808C24.4158 23.5666 24.4687 23.8503 24.5757 24.1153C24.6826 24.3803 24.8413 24.6214 25.0426 24.8243Z'
|
||
fill='#BA7C9D'/>
|
||
</g>
|
||
<defs>
|
||
<filter id='filter0_d_42_8' x='0' y='0' width='72' height='70' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'>
|
||
<feFlood flood-opacity='0' result='BackgroundImageFix'/>
|
||
<feColorMatrix in='SourceAlpha' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0' result='hardAlpha'/>
|
||
<feOffset dy='4'/>
|
||
<feGaussianBlur stdDeviation='2'/>
|
||
<feComposite in2='hardAlpha' operator='out'/>
|
||
<feColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0'/>
|
||
<feBlend mode='normal' in2='BackgroundImageFix' result='effect1_dropShadow_42_8'/>
|
||
<feBlend mode='normal' in='SourceGraphic' in2='effect1_dropShadow_42_8' result='shape'/>
|
||
</filter>
|
||
</defs>
|
||
</svg>"
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 40fb3517-1445-4bfc-ab18-30f284d4d7d0
|
||
dataCategory: ImageUrl
|
||
|
||
measure ICO_RE = ```
|
||
"data:image/svg+xml;utf8,
|
||
<svg width='68' height='60' viewBox='0 0 68 64' fill='none' xmlns='http://www.w3.org/2000/svg' style='display: block; margin: auto;'>
|
||
<g filter='url(#filter0_d_44_112)'>
|
||
<path d='M61.7232 32.7931C55.2054 9.67879 42.6914 0.942678 40.2496 14.5928L39.3171 21.2616L36.5475 19.2362V2.36603C36.5475 1.73852 36.301 1.13671 35.8621 0.692995C35.4232 0.249279 34.8279 0 34.2072 0C33.5865 0 32.9913 0.249279 32.5524 0.692995C32.1135 1.13671 31.8669 1.73852 31.8669 2.36603V19.1476L28.031 21.6489C27.6969 18.9524 27.3968 16.2517 27.1309 13.5475C26.7478 9.25411 22.8749 7.26142 21.0886 7.94743C6.94513 13.4075 2.16757 41.6319 4.60943 50.9886C5.98039 56.2387 9.13312 57.3587 17.7466 54.372C26.36 51.3806 32.2916 47.7126 31.1191 42.4112C30.3575 38.9718 29.4481 32.7371 28.6819 26.857L34.1288 23.3056L38.5647 26.549C37.6369 33.0731 36.5983 40.1198 36.266 41.6319C34.8488 48.0019 38.3201 49.6913 48.4799 53.5927C61.2201 58.4834 67.7702 54.2133 61.7278 32.7884L61.7232 32.7931Z'
|
||
fill='#BA7C9D'/>
|
||
</g>
|
||
<defs>
|
||
<filter id='filter0_d_44_112' x='0' y='0' width='68' height='64' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'>
|
||
<feFlood flood-opacity='0' result='BackgroundImageFix'/>
|
||
<feColorMatrix in='SourceAlpha' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0' result='hardAlpha'/>
|
||
<feOffset dy='4'/>
|
||
<feGaussianBlur stdDeviation='2'/>
|
||
<feComposite in2='hardAlpha' operator='out'/>
|
||
<feColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0'/>
|
||
<feBlend mode='normal' in2='BackgroundImageFix' result='effect1_dropShadow_44_112'/>
|
||
<feBlend mode='normal' in='SourceGraphic' in2='effect1_dropShadow_44_112' result='shape'/>
|
||
</filter>
|
||
</defs>
|
||
</svg>"
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: fde9c1e9-99c7-4bc1-ac6b-c72644491e01
|
||
dataCategory: ImageUrl
|
||
|
||
measure ICO_ONC = ```
|
||
"data:image/svg+xml;utf8,
|
||
<svg width='72' height='65' viewBox='0 0 72 74' fill='none' xmlns='http://www.w3.org/2000/svg'>
|
||
<g filter='url(#filter0_d_45_116)'>
|
||
<path d='M4.89921 42.5477C4.33225 43.3109 4.5568 44.3934 5.38336 44.8707L8.15943 46.4849C8.85685 46.8875 9.73562 46.7176 10.228 46.0835C10.5319 45.6964 10.9348 45.2172 11.4205 44.6941L38.3096 60.2185C38.1044 60.8921 37.9032 61.4992 37.7112 61.9509C37.4083 62.6944 37.6955 63.549 38.3979 63.9431L41.1839 65.5401C42.0104 66.0173 43.0688 65.6755 43.4377 64.7979C44.9257 61.306 47.6461 52.4184 43.5252 41.0043C41.3934 41.1971 39.1279 41.2437 36.7286 41.1442C37.0337 41.8485 37.2428 42.5203 37.4864 43.2119L26.5 36.8689C29.2337 36.3693 32.3164 36.1401 35.8312 36.3556C54.8992 37.5491 64.2464 27.6427 67.1269 23.8069C67.6938 23.0436 67.4693 21.9611 66.6427 21.4839L63.858 19.8647C63.1606 19.462 62.2818 19.632 61.7894 20.2661C61.4856 20.6532 61.0827 21.1323 60.597 21.6555L33.6992 6.12608C33.9094 5.44384 34.1179 4.86395 34.3062 4.39865C34.6092 3.65517 34.322 2.80054 33.6196 2.4065L30.8336 0.809472C30.007 0.332256 28.9487 0.674063 28.5711 1.5467C26.8863 5.49889 23.6157 16.3535 30.5026 29.9958C15.2531 30.8577 7.47949 39.1125 4.89921 42.5477ZM37.8225 30.0432C36.3424 27.6159 35.2392 25.2914 34.4536 23.0929L45.5175 29.4806C43.2293 29.9045 40.6597 30.12 37.8225 30.0432ZM55.2544 25.9182C54.238 26.5253 53.1034 27.0986 51.8556 27.6295L32.9049 16.6883C32.7321 15.3372 32.6613 14.068 32.6875 12.8892L55.2544 25.9182ZM16.7717 40.4363C17.788 39.8292 18.9226 39.2559 20.1705 38.725L39.0609 49.6314C39.2337 50.9825 39.3131 52.2567 39.2955 53.4405L16.7717 40.4363Z'
|
||
fill='#BA7C9D'/>
|
||
</g>
|
||
<defs>
|
||
<filter id='filter0_d_45_116' x='0.585327' y='0.593201' width='70.8555' height='73.163' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'>
|
||
<feFlood flood-opacity='0' result='BackgroundImageFix'/>
|
||
<feColorMatrix in='SourceAlpha' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0' result='hardAlpha'/>
|
||
<feOffset dy='4'/>
|
||
<feGaussianBlur stdDeviation='2'/>
|
||
<feComposite in2='hardAlpha' operator='out'/>
|
||
<feColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0'/>
|
||
<feBlend mode='normal' in2='BackgroundImageFix' result='effect1_dropShadow_45_116'/>
|
||
<feBlend mode='normal' in='SourceGraphic' in2='effect1_dropShadow_45_116' result='shape'/>
|
||
</filter>
|
||
</defs>
|
||
</svg>"
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 4bd622d8-6c3f-4d4b-b0dc-e05f267bd6d5
|
||
dataCategory: ImageUrl
|
||
|
||
measure show_filters2 = ```
|
||
|
||
VAR t_ =
|
||
{(IF (
|
||
ISFILTERED(MQY[Period]),
|
||
VAR ___x = "时间范围:"& [time sel] &"
|
||
"
|
||
RETURN ___x
|
||
),1)
|
||
,(IF (
|
||
ISFILTERED(Dim_Unit[DW]),
|
||
VAR ___x = "筛选单位:"& CONCATENATEX(VALUES(Dim_Unit[DW]),[DW],",") &"
|
||
"
|
||
RETURN ___x
|
||
),2)
|
||
,(IF (
|
||
ISFILTERED(Dim_Market[Market]),
|
||
VAR ___x = "
|
||
Market:"& CONCATENATEX(VALUES(Dim_Market[Market]),[Market],",") &"
|
||
"
|
||
RETURN ___x
|
||
),3)
|
||
|
||
,(IF (
|
||
ISFILTERED(Dim_BrandDefaultMKT),
|
||
VAR ___x = "
|
||
DefaultMarket:"& CONCATENATEX(VALUES(Dim_BrandDefaultMKT[MARKET]),[MARKET],",") &"
|
||
"
|
||
RETURN ___x
|
||
),4)
|
||
,(IF (
|
||
ISFILTERED('Dim_MarketTA'[TA]),
|
||
VAR ___x = "
|
||
TA: "& CONCATENATEX(VALUES('Dim_MarketTA'[TA]),[TA],",") &"
|
||
"
|
||
RETURN ___x
|
||
),5)
|
||
,(IF (
|
||
ISFILTERED(Dim_Class[CLASS]),
|
||
VAR ___x = "
|
||
Class: "& CONCATENATEX(VALUES(Dim_Class[CLASS]),[CLASS],",") &"
|
||
"
|
||
RETURN ___x
|
||
),6)
|
||
,(IF (
|
||
ISFILTERED(Dim_PackInfo[GENE_ORIG_DESC]),
|
||
VAR ___x = "Generics:"& CONCATENATEX(VALUES(Dim_PackInfo[GENE_ORIG_DESC]),[GENE_ORIG_DESC],",") &"
|
||
"
|
||
RETURN ___x
|
||
),7)
|
||
,(IF (
|
||
ISFILTERED(Dim_BrandMKT[VBP]),
|
||
VAR ___x = "is VBP:"& CONCATENATEX(VALUES(Dim_BrandMKT[VBP]),[VBP],",") &"
|
||
"
|
||
RETURN ___x
|
||
),8)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[PROD_DES_C]),
|
||
VAR ___x = "Brand:"& CONCATENATEX(VALUES('Dim_PackInfo'[PROD_DES_C]),[PROD_DES_C],",") &"
|
||
"
|
||
RETURN ___x
|
||
),9)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[MOLECULE_DES_C]),
|
||
VAR ___x = "Molecule:"& CONCATENATEX(VALUES('Dim_PackInfo'[MOLECULE_DES_C]),[MOLECULE_DES_C],",") &"
|
||
"
|
||
RETURN ___x
|
||
),10)
|
||
,(IF (
|
||
ISFILTERED('Dim_Corp'[CORP_CODE_DESC]),
|
||
VAR ___x = "Corp: "& CONCATENATEX(VALUES('Dim_Corp'[CORP_CODE_DESC]),[CORP_CODE_DESC],",") &"
|
||
"
|
||
RETURN ___x
|
||
),11)
|
||
,(IF (
|
||
ISFILTERED('Dim_Corp'[CORP_TYPE]),
|
||
VAR ___x = "CorpType: "& CONCATENATEX(VALUES('Dim_Corp'[CORP_TYPE]),[CORP_TYPE],",") &"
|
||
"
|
||
RETURN ___x
|
||
),12)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[PROD_PACK]),
|
||
VAR ___x = "Pack:"& CONCATENATEX(VALUES('Dim_PackInfo'[PROD_PACK]),[PROD_PACK],",") &"
|
||
"
|
||
RETURN ___x
|
||
),13)
|
||
,(IF (
|
||
ISFILTERED('Dim_GeoGroup'[PROVINCE_GROUP]),
|
||
VAR ___x = "ProvinceGroup:"& CONCATENATEX(VALUES('Dim_GeoGroup'[PROVINCE_GROUP]),[PROVINCE_GROUP],",") &"
|
||
"
|
||
RETURN ___x
|
||
),14)
|
||
,(IF (
|
||
ISFILTERED('Dim_Geo'[PROVINCE_C]),
|
||
VAR ___x = "Province:"& CONCATENATEX(VALUES('Dim_Geo'[PROVINCE_C]),[PROVINCE_C],",") &"
|
||
"
|
||
RETURN ___x
|
||
),14)
|
||
,(IF (
|
||
ISFILTERED('Dim_Geo'[CITY_C]),
|
||
VAR ___x = "City:"& CONCATENATEX(VALUES('Dim_Geo'[CITY_C]),[CITY_C],",") &"
|
||
"
|
||
RETURN ___x
|
||
),15)
|
||
,(IF (
|
||
ISFILTERED('Dim_Geo'[AZ_CITY_TIER]),
|
||
VAR ___x = "CityTier:"& CONCATENATEX(VALUES('Dim_Geo'[AZ_CITY_TIER]),[AZ_CITY_TIER],",") &"
|
||
"
|
||
RETURN ___x
|
||
),16)
|
||
,(IF (
|
||
ISFILTERED('Dim_Org'[RC_CODE_DESC]),
|
||
VAR ___x = "RC:"& CONCATENATEX(VALUES('Dim_Org'[RC_CODE_DESC]),[RC_CODE_DESC],",") &"
|
||
"
|
||
RETURN ___x
|
||
),17)
|
||
,(IF (
|
||
ISFILTERED('Dim_Org'[REGION_CODE_DESC]),
|
||
VAR ___x = "Region:"& CONCATENATEX(VALUES('Dim_Org'[REGION_CODE_DESC]),[REGION_CODE_DESC],",") &"
|
||
"
|
||
RETURN ___x
|
||
),18)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[ATC1_CODE_DESC]),
|
||
VAR ___x = "ATC1:"& CONCATENATEX(VALUES('Dim_PackInfo'[ATC1_CODE_DESC]),[ATC1_CODE_DESC],",") &"
|
||
"
|
||
RETURN ___x
|
||
),19)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[ATC2_CODE_DESC]),
|
||
VAR ___x = "ATC2:"& CONCATENATEX(VALUES('Dim_PackInfo'[ATC2_CODE_DESC]),[ATC2_CODE_DESC],",") &"
|
||
"
|
||
RETURN ___x
|
||
),20)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[ATC3_CODE_DESC]),
|
||
VAR ___x = "ATC3:"& CONCATENATEX(VALUES('Dim_PackInfo'[ATC3_CODE_DESC]),[ATC3_CODE_DESC],",") &"
|
||
"
|
||
RETURN ___x
|
||
),21)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[ATC4_CODE_DESC]),
|
||
VAR ___x = "ATC4:"& CONCATENATEX(VALUES('Dim_PackInfo'[ATC4_CODE_DESC]),[ATC4_CODE_DESC],",") &"
|
||
"
|
||
RETURN ___x
|
||
),22)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[APP1_COD_DES_C]),
|
||
VAR ___x = "NFC1:"& CONCATENATEX(VALUES('Dim_PackInfo'[APP1_COD_DES_C]),[APP1_COD_DES_C],",") &"
|
||
"
|
||
RETURN ___x
|
||
),23)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[APP2_COD_DES_C]),
|
||
VAR ___x = "NFC2:"& CONCATENATEX(VALUES('Dim_PackInfo'[APP2_COD_DES_C]),[APP2_COD_DES_C],",") &"
|
||
"
|
||
RETURN ___x
|
||
),24)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[APP3_COD_DES_C]),
|
||
VAR ___x = "NFC3:"& CONCATENATEX(VALUES('Dim_PackInfo'[APP3_COD_DES_C]),[APP3_COD_DES_C],",") &"
|
||
"
|
||
RETURN ___x
|
||
),25)
|
||
|
||
}
|
||
RETURN CONCATENATEX( t_ , [Value1] , "" )
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 216503f0-8d6d-43af-847a-3a51e5419176
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Rank.LY.KPI.Combo' = CALCULATE([External.Rank.KPI.Combo], SAMEPERIODLASTYEAR(Dim_Calendar[DATE]))
|
||
formatString: #,0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: 72cf6b6d-fba3-446f-ae99-1b17fd72a2a9
|
||
|
||
measure ICO_Chart = ```
|
||
"data:image/svg+xml;utf8,<svg t=1712822023093 class=icon viewBox=0 0 1024 1024 version=1.1 xmlns=http://www.w3.org/2000/svg p-id=2690 width=200 height=200><path d=M150.2 595.5c14.6 14.6 38.2 14.6 52.7 0 14.6-14.6 14.6-38.2 0-52.7-14.5-14.6-38.2-14.6-52.7 0s-14.5 38.2 0 52.7z fill=#13227a p-id=2691></path><path d=M176.6 625.1c-14.3 0-28.6-5.4-39.6-16.3-21.8-21.8-21.8-57.3 0-79.1 10.6-10.6 24.6-16.4 39.6-16.4 14.9 0 29 5.8 39.5 16.4 10.5 10.5 16.4 24.6 16.4 39.5 0 14.9-5.8 29-16.4 39.6-10.8 10.8-25.2 16.3-39.5 16.3z m-13.2-42.7c7.3 7.2 19.1 7.2 26.4 0 3.5-3.5 5.5-8.2 5.5-13.2s-1.9-9.7-5.5-13.2c-3.5-3.6-8.2-5.5-13.2-5.5s-9.7 1.9-13.2 5.5c-7.2 7.2-7.2 19.1 0 26.4z
|
||
fill=#13227a p-id=2692></path><path d=M374 371.8c14.6 14.6 38.2 14.6 52.7 0 14.6-14.6 14.6-38.2 0-52.7-14.5-14.6-38.2-14.6-52.7 0-14.5 14.5-14.5 38.1 0 52.7z fill=#13227a p-id=2693></path><path d=M400.4 401.3c-14.3 0-28.6-5.4-39.6-16.4-21.8-21.8-21.8-57.3 0-79.1 10.6-10.6 24.6-16.4 39.6-16.4 14.9 0 29 5.8 39.5 16.4 21.8 21.8 21.8 57.3 0 79.1-10.9 11-25.2 16.4-39.5 16.4z m0-74.6c-5 0-9.7 1.9-13.2 5.5-7.3 7.3-7.3 19.1 0 26.4 7.3 7.3 19.1 7.3 26.4 0 7.3-7.3 7.3-19.1 0-26.4-3.5-3.5-8.2-5.5-13.2-5.5z
|
||
fill=#13227a p-id=2694></path><path d=M120.7 718.3h111.9v149.2H120.7z fill=#13227a p-id=2695></path><path d=M232.6 886.2H120.7c-10.3 0-18.6-8.3-18.6-18.6V718.4c0-10.3 8.3-18.6 18.6-18.6h111.9c10.3 0 18.6 8.3 18.6 18.6v149.2c0 10.2-8.3 18.6-18.6 18.6z m-93.3-37.3h74.6V737h-74.6v111.9z fill=#13227a p-id=2696></path><path d=M344.4 494.6h111.9v373H344.4z fill=#13227a p-id=2697></path><path d=M456.3 886.2H344.4c-10.3 0-18.6-8.3-18.6-18.6v-373c0-10.3 8.3-18.6 18.6-18.6h111.9c10.3 0 18.6 8.3 18.6 18.6v373c0.1 10.2-8.3 18.6-18.6 18.6z m-93.2-37.3h74.6V513.2h-74.6v335.7z
|
||
fill=#13227a p-id=2698></path><path d=M568.2 606.5h111.9v261.1H568.2z fill=#13227a p-id=2699></path><path d=M680.1 886.2H568.2c-10.3 0-18.6-8.3-18.6-18.6V606.5c0-10.3 8.3-18.6 18.6-18.6h111.9c10.3 0 18.6 8.3 18.6 18.6v261.1c0.1 10.2-8.3 18.6-18.6 18.6z m-93.2-37.3h74.6V625.1h-74.6v223.8z fill=#13227a p-id=2700></path><path d=M792 345.4h111.9v522.1H792z fill=#13227a p-id=2701></path><path d=M903.9 886.2H792c-10.3 0-18.6-8.3-18.6-18.6V345.4c0-10.3 8.3-18.6 18.6-18.6h111.9c10.3 0 18.6 8.3 18.6 18.6v522.1c0 10.3-8.3 18.7-18.6 18.7z m-93.2-37.3h74.6V364h-74.6v484.9z
|
||
fill=#13227a p-id=2702></path><path d=M941.2 867.5H83.4 fill=#13227a p-id=2703></path><path d=M941.2 886.2H83.4c-10.3 0-18.6-8.3-18.6-18.6S73.1 849 83.4 849h857.8c10.3 0 18.6 8.3 18.6 18.6s-8.3 18.6-18.6 18.6z fill=#13227a p-id=2704></path><path d=M597.8 483.6c14.6 14.6 38.2 14.6 52.7 0 14.6-14.6 14.6-38.2 0-52.7-14.5-14.6-38.2-14.6-52.7 0-14.6 14.6-14.5 38.2 0 52.7z fill=#13227a p-id=2705></path><path d=M624.2 513.2c-14.3 0-28.6-5.4-39.6-16.4-21.8-21.8-21.8-57.3 0-79.1 10.6-10.6 24.6-16.4 39.6-16.4 14.9 0 29 5.8 39.5 16.4 21.8 21.8 21.8 57.3 0 79.1-10.9 10.9-25.2 16.4-39.5 16.4z m0-74.6c-5 0-9.7 1.9-13.2 5.5-7.3 7.3-7.3 19.1 0 26.4 7.3 7.3 19.1 7.3 26.4 0 7.3-7.3 7.3-19.1 0-26.4-3.6-3.5-8.2-5.5-13.2-5.5z
|
||
fill=#13227a p-id=2706></path><path d=M821.6 222.6c14.6 14.6 38.2 14.6 52.7 0 14.6-14.6 14.6-38.2 0-52.7-14.5-14.6-38.2-14.6-52.7 0-14.6 14.5-14.6 38.1 0 52.7z fill=#13227a p-id=2707></path><path d=M847.9 252.1c-14.3 0-28.6-5.4-39.6-16.4-21.8-21.8-21.8-57.3 0-79.1 10.6-10.6 24.6-16.4 39.6-16.4 14.9 0 29 5.8 39.5 16.4 21.8 21.8 21.8 57.3 0 79.1-10.8 11-25.1 16.4-39.5 16.4z m0.1-74.5c-5 0-9.7 1.9-13.2 5.5-7.3 7.3-7.3 19.1 0 26.4 7.3 7.3 19.1 7.3 26.4 0 7.3-7.3 7.3-19.1 0-26.4-3.6-3.6-8.3-5.5-13.2-5.5z
|
||
fill=#13227a p-id=2708></path><path d=M437.7 364l149.2 74.6 fill=#13227a p-id=2709></path><path d=M586.8 457.3c-2.8 0-5.6-0.6-8.3-2l-149.2-74.6c-9.2-4.6-12.9-15.8-8.3-25s15.8-12.9 25-8.3L595.2 422c9.2 4.6 12.9 15.8 8.3 25-3.2 6.5-9.8 10.3-16.7 10.3z fill=#13227a p-id=2710></path><path d=M213.9 531.9l149.2-149.2 fill=#13227a p-id=2711></path><path d=M213.9 550.5c-4.8 0-9.5-1.8-13.2-5.5-7.3-7.3-7.3-19.1 0-26.4l149.2-149.2c7.3-7.3 19.1-7.3 26.4 0 7.3 7.3 7.3 19.1 0 26.4L227.1 545.1c-3.7 3.6-8.4 5.4-13.2 5.4z
|
||
fill=#13227a p-id=2712></path><path d=M661.5 420l149.1-186.5 fill=#13227a p-id=2713></path><path d=M661.4 438.6c-4.1 0-8.2-1.3-11.6-4.1-8-6.4-9.3-18.2-2.9-26.2l149.2-186.5c6.5-8 18.2-9.3 26.2-2.9s9.3 18.2 2.9 26.2L676 431.6c-3.7 4.6-9.1 7-14.6 7z fill=#13227a p-id=2714></path><path d=M150.2 595.5c14.6 14.6 38.2 14.6 52.7 0 14.6-14.6 14.6-38.2 0-52.7-14.5-14.6-38.2-14.6-52.7 0s-14.5 38.2 0 52.7z fill=#13227a p-id=2715></path><path d=M176.6 625.1c-14.3 0-28.6-5.4-39.6-16.3-21.8-21.8-21.8-57.3 0-79.1 10.6-10.6 24.6-16.4 39.6-16.4 14.9 0 29 5.8 39.5 16.4 10.5 10.5 16.4 24.6 16.4 39.5 0 14.9-5.8 29-16.4 39.6-10.8 10.8-25.2 16.3-39.5 16.3z m-13.2-42.7c7.3 7.2 19.1 7.2 26.4 0 3.5-3.5 5.5-8.2 5.5-13.2s-1.9-9.7-5.5-13.2c-3.5-3.6-8.2-5.5-13.2-5.5s-9.7 1.9-13.2 5.5c-7.2 7.2-7.2 19.1 0 26.4z
|
||
fill=#13227a p-id=2716></path><path d=M374 371.8c14.6 14.6 38.2 14.6 52.7 0 14.6-14.6 14.6-38.2 0-52.7-14.5-14.6-38.2-14.6-52.7 0-14.5 14.5-14.5 38.1 0 52.7z fill=#13227a p-id=2717></path><path d=M400.4 401.3c-14.3 0-28.6-5.4-39.6-16.4-21.8-21.8-21.8-57.3 0-79.1 10.6-10.6 24.6-16.4 39.6-16.4 14.9 0 29 5.8 39.5 16.4 21.8 21.8 21.8 57.3 0 79.1-10.9 11-25.2 16.4-39.5 16.4z m0-74.6c-5 0-9.7 1.9-13.2 5.5-7.3 7.3-7.3 19.1 0 26.4 7.3 7.3 19.1 7.3 26.4 0 7.3-7.3 7.3-19.1 0-26.4-3.5-3.5-8.2-5.5-13.2-5.5z
|
||
fill=#13227a p-id=2718></path><path d=M120.7 825.9v41.7h111.9V745c-73.2 36-111.9 80.9-111.9 80.9z fill=#13227a p-id=2719></path><path d=M232.6 886.2H120.7c-10.3 0-18.6-8.3-18.6-18.6v-41.7c0-4.5 1.6-8.8 4.5-12.2 1.7-1.9 42-48.1 117.8-85.4 5.8-2.8 12.6-2.5 18.1 0.9 5.5 3.4 8.8 9.4 8.8 15.8v122.5c-0.1 10.3-8.4 18.7-18.7 18.7z m-93.3-37.3h74.6v-72.7c-39.4 23.2-64.8 47.1-74.6 57v15.7z fill=#13227a p-id=2720></path><path d=M344.4 707.9v159.6h111.9V701.7c-40.8-2.6-78.1 0-111.9 6.2z fill=#13227a
|
||
p-id=2721></path><path d=M456.3 886.2H344.4c-10.3 0-18.6-8.3-18.6-18.6V708c0-9 6.4-16.7 15.3-18.3 37.4-6.9 76.6-9.1 116.5-6.5 9.8 0.6 17.4 8.8 17.4 18.6v165.8c0 10.2-8.4 18.6-18.7 18.6z m-93.2-37.3h74.6V719.5c-25.5-0.7-50.4 0.7-74.6 4.3v125.1z fill=#13227a p-id=2722></path><path d=M568.2 867.5h111.9V737.1c-33-3-70.3-8.5-111.9-17.1v147.5z fill=#13227a p-id=2723></path><path d=M680.1 886.2H568.2c-10.3 0-18.6-8.3-18.6-18.6V720c0-5.6 2.5-10.9 6.9-14.5 4.3-3.5 10-4.9 15.6-3.8 39.4 8.1 76.4 13.8 109.8 16.8 9.6 0.9 17 8.9 17 18.6v130.4c-0.1 10.3-8.5 18.7-18.8 18.7z m-93.2-37.3h74.6V754c-23.5-2.6-48.5-6.4-74.6-11.3v106.2z
|
||
fill=#13227a p-id=2724></path><path d=M792 738.1v129.4h111.9v-159s-32.5 22.7-111.9 29.6z fill=#13227a p-id=2725></path><path d=M903.9 886.2H792c-10.3 0-18.6-8.3-18.6-18.6V738.1c0-9.7 7.4-17.7 17-18.6 72.2-6.3 102.7-26.2 103-26.4 5.7-3.8 13.2-4.2 19.2-1 6.1 3.2 9.9 9.5 9.9 16.4v159c0 10.3-8.3 18.7-18.6 18.7z m-93.2-37.3h74.6v-111c-16.8 6.2-41.2 12.9-74.6 17v94z fill=#13227a p-id=2726></path><path d=M597.8 483.6c14.6 14.6 38.2 14.6 52.7 0 14.6-14.6 14.6-38.2 0-52.7-14.5-14.6-38.2-14.6-52.7 0-14.6 14.6-14.5 38.2 0 52.7z
|
||
fill=#13227a p-id=2727></path><path d=M624.2 513.2c-14.3 0-28.6-5.4-39.6-16.4-21.8-21.8-21.8-57.3 0-79.1 10.6-10.6 24.6-16.4 39.6-16.4 14.9 0 29 5.8 39.5 16.4 21.8 21.8 21.8 57.3 0 79.1-10.9 10.9-25.2 16.4-39.5 16.4z m0-74.6c-5 0-9.7 1.9-13.2 5.5-7.3 7.3-7.3 19.1 0 26.4 7.3 7.3 19.1 7.3 26.4 0 7.3-7.3 7.3-19.1 0-26.4-3.6-3.5-8.2-5.5-13.2-5.5z fill=#13227a p-id=2728></path><path d=M821.6 222.6c14.6 14.6 38.2 14.6 52.7 0 14.6-14.6 14.6-38.2 0-52.7-14.5-14.6-38.2-14.6-52.7 0-14.6 14.5-14.6 38.1 0 52.7z
|
||
fill=#13227a p-id=2729></path><path d=M847.9 252.1c-14.3 0-28.6-5.4-39.6-16.4-21.8-21.8-21.8-57.3 0-79.1 10.6-10.6 24.6-16.4 39.6-16.4 14.9 0 29 5.8 39.5 16.4 21.8 21.8 21.8 57.3 0 79.1-10.8 11-25.1 16.4-39.5 16.4z m0.1-74.5c-5 0-9.7 1.9-13.2 5.5-7.3 7.3-7.3 19.1 0 26.4 7.3 7.3 19.1 7.3 26.4 0 7.3-7.3 7.3-19.1 0-26.4-3.6-3.6-8.3-5.5-13.2-5.5z fill=#13227a p-id=2730></path><path d=M437.7 364l149.2 74.6 fill=#13227a p-id=2731></path><path d=M586.8 457.3c-2.8 0-5.6-0.6-8.3-2l-149.2-74.6c-9.2-4.6-12.9-15.8-8.3-25s15.8-12.9 25-8.3L595.2 422c9.2 4.6 12.9 15.8 8.3 25-3.2 6.5-9.8 10.3-16.7 10.3z
|
||
fill=#13227a p-id=2732></path><path d=M213.9 531.9l149.2-149.2 fill=#13227a p-id=2733></path><path d=M213.9 550.5c-4.8 0-9.5-1.8-13.2-5.5-7.3-7.3-7.3-19.1 0-26.4l149.2-149.2c7.3-7.3 19.1-7.3 26.4 0 7.3 7.3 7.3 19.1 0 26.4L227.1 545.1c-3.7 3.6-8.4 5.4-13.2 5.4z fill=#13227a p-id=2734></path><path d=M661.5 420l149.1-186.5 fill=#13227a p-id=2735></path><path d=M661.4 438.6c-4.1 0-8.2-1.3-11.6-4.1-8-6.4-9.3-18.2-2.9-26.2l149.2-186.5c6.5-8 18.2-9.3 26.2-2.9s9.3 18.2 2.9 26.2L676 431.6c-3.7 4.6-9.1 7-14.6 7z
|
||
fill=#13227a p-id=2736></path></svg>"
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 3ab3f917-7cfb-435d-a217-983fa0e82e48
|
||
dataCategory: ImageUrl
|
||
|
||
measure ICO_Table = ```
|
||
"data:image/svg+xml;utf8,<svg t=1712822336836 class=icon viewBox=0 0 1024 1024 version=1.1 xmlns=http://www.w3.org/2000/svg p-id=6234 width=200 height=200><path d=M924.16 812.544V343.552h-58.368v208.384h-132.096V343.552h-58.368v208.384h-128.512V343.552H487.936v208.384H358.4V343.552H300.032v208.384H166.4V343.552H108.032V870.4h19.456v0.512h797.184l-0.512-58.368z m-58.368-201.728v201.728h-132.096v-201.728h132.096z m-190.976 0v201.728h-128.512v-201.728h128.512z m-186.88 0v201.728H358.4v-201.728h129.536z m-187.904 0v201.728H166.4v-201.728h133.632z
|
||
fill=#E1F1F9 p-id=6235></path><path d=M108.032 147.456h816.128v196.608H108.032z fill=#0FA7DB p-id=6236></path></svg>"
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 57b302e4-6e16-4054-8ecc-7b4d9553f51d
|
||
dataCategory: ImageUrl
|
||
|
||
measure 'External.△MS%.TopCompetitor.SelectMoleculeName' =
|
||
|
||
VAR DS = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||
VAR A = [External.△MS%.KPI.Top1CompetitorName]
|
||
RETURN CALCULATE(MAX(Dim_PackInfo[CMPS_DES]),Dim_PackInfo[PROD_CORP_C] = A,Dim_PackInfo[DATA_SOURCE] = DS,ALL())
|
||
displayFolder: OLD\Others
|
||
lineageTag: 50f28078-0b19-47ef-9635-6e3f5be587e3
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.△MS%Rank.KPI.Combo' = [External.Rank.LY.KPI.Combo] - [External.Rank.KPI.Combo]
|
||
formatString: #,0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: a665325e-e677-49bb-830d-5daf2a5b8ecf
|
||
|
||
measure 'External.Rank.KPI.ProdPackCorp' = ```
|
||
|
||
VAR T1 = CALCULATETABLE(SUMMARIZE(Fact_Sales,Dim_PackInfo[CORP_DES],Dim_PackInfo[PROD_DES],Dim_PackInfo[PACK_DES]) ,ALL())
|
||
VAR T2 = CALCULATETABLE(SUMMARIZE(Fact_Sales,Dim_PackInfo[CORP_DES_C],Dim_PackInfo[PROD_DES_C],Dim_PackInfo[PACK_DES]) ,ALL())
|
||
RETURN
|
||
IF([External.Sales.KPI]<>BLANK(),
|
||
SWITCH(TRUE(),
|
||
ISINSCOPE(Dim_PackInfo[CORP_DES]),RANK(DENSE, T1, ORDERBY([External.Sales.KPI], DESC)),
|
||
RANK(DENSE, T2, ORDERBY([External.Sales.KPI], DESC))
|
||
))
|
||
```
|
||
displayFolder: OLD\Rank
|
||
lineageTag: b9e1b732-b615-4d46-9d6b-588add43d15f
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Rank.KPI.MolENCN' = ```
|
||
|
||
IF([External.Sales.KPI]<>BLANK(),
|
||
CALCULATE(RANK(DENSE, ALL(Dim_PackInfo[MOLECULE_CODE_DESC],Dim_PackInfo[CMPS_COD]), ORDERBY([External.Sales.KPI], DESC)),
|
||
ALL(Dim_Corp)
|
||
)
|
||
)
|
||
// IF([External.Sales]<>BLANK(),
|
||
// CALCULATE(
|
||
// SWITCH([IMSRankedBy.Value],
|
||
// "GRVal", RANK(DENSE, ALL(DM_TD_EXTERNAL_PACKINFO[MOLECULE_CODE_DESC]),ORDERBY([External.GRSales.KPI], DESC)),
|
||
// "GR%", RANK(DENSE, ALL(DM_TD_EXTERNAL_PACKINFO[MOLECULE_CODE_DESC]), ORDERBY([External.Gr%.KPI], DESC)),
|
||
// "MS%", RANK(DENSE, ALL(DM_TD_EXTERNAL_PACKINFO[MOLECULE_CODE_DESC]), ORDERBY([External.MS%.KPI], DESC)),
|
||
// //else
|
||
// RANK(DENSE, ALL(DM_TD_EXTERNAL_PACKINFO[MOLECULE_CODE_DESC]), ORDERBY([External.Sales.KPI], DESC))
|
||
// ),
|
||
// ALL(DM_TD_EXTERNAL_CORP), REMOVEFILTERS(DM_TD_EXTERNAL_PACKINFO[MNFL_DES])
|
||
// )
|
||
// )
|
||
```
|
||
formatString: #,0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: b98c1e48-5210-438d-b860-768149de8023
|
||
|
||
measure ICO_Bulb = ```
|
||
"data:image/svg+xml;utf8,<svg t='1713321716414' class='icon' viewBox='0 0 1024 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='5683' width='200' height='200'><path d='M623 890l-65.2 55.2-0.1 0.1c-20.1 20-73.8 20-93.8 0L399.7 890M637.8 890H386.3c-5.1 0-9.1-4.1-9.1-9.1V772c0-5.1 4.1-9.1 9.1-9.1h251.5c5.1 0 9.1 4.1 9.1 9.1v108.8c0 5.1-4.1 9.2-9.1 9.2z' fill='#F2F2F1' p-id='5684'></path><path d='M822 365.1c0 82.3-33 156.8-86.5 211.1-58 60-59.5 151-59.5 151 0 39.5-18 42.3-49.5 42.3H521.4V64.2c166 0 300.6 134.7 300.6 300.9zM521.4 64.2v705.3H416.2c-31.5 0-49.5-5.5-49.5-42.3 0 0-1.6-91-59.5-151-53.5-54.3-86.5-128.9-86.5-211.1 0.1-166.2 134.6-300.9 300.7-300.9z'
|
||
fill='#FFDD60' p-id='5685'></path><path d='M511.3 64.5s-4-0.2-6-0.2-6 0.2-6 0.2C338.9 70.8 210.7 203 210.7 365.1c0 82.3 33 156.8 86.5 211.1 58 60 59.5 151 59.5 151 0 36.8 18 42.3 49.5 42.3h180.2c31.5 0 49.5-2.8 49.5-42.3 0 0 1.6-91 59.5-151 53.5-54.3 86.5-128.9 86.5-211.1C781.9 203 671 70.8 511.3 64.5z' fill='#FFF082' p-id='5686'></path><path d='M653.4 890h-281c-7 0-12.7-5.7-12.7-12.7v-0.1c0-7 5.7-12.7 12.7-12.7h281c7 0 12.7 5.7 12.7 12.7v0.1c-0.1 7-5.8 12.7-12.7 12.7zM653.4 849.5h-281c-7 0-12.7-5.7-12.7-12.7v-0.1c0-7 5.7-12.7 12.7-12.7h281c7 0 12.7 5.7 12.7 12.7v0.1c-0.1 7-5.8 12.7-12.7 12.7zM653.4 809.1h-281c-7 0-12.7-5.7-12.7-12.7v-0.1c0-7 5.7-12.7 12.7-12.7h281c7 0 12.7 5.7 12.7 12.7v0.1c-0.1 7-5.8 12.7-12.7 12.7z'
|
||
fill='#E5E4DD' p-id='5687'></path><path d='M614.8 267.7H491l-63 177.1h68.7l-18.6 121.3 114-178.7-45.7 0.9zM567.7 769.4h-40v-95.9c0-6.4-7.6-12.1-16.4-12.1-8.7 0-16.4 5.6-16.4 12.1v95.9h-40v-95.9c0-28.7 25.3-52.1 56.4-52.1 31.1 0 56.4 23.4 56.4 52.1v95.9z' fill='#FFDD60' p-id='5688'></path><path d='M561.2 939c0 9.5-24.8 21.2-49.9 21.2-26.7 0-49.9-11-49.9-21.2 0-11.7 22.3-21.2 49.9-21.2 27.6 0 49.9 9.5 49.9 21.2z' fill='#E5E4DD' p-id='5689'></path><path d='M386.9 160.7m-20 0a20 20 0 1 0 40 0 20 20 0 1 0-40 0Z'
|
||
fill='#FFFFFF' p-id='5690'></path><path d='M274.4 345.4h-1.2c-11-0.7-19.4-10.2-18.7-21.2 0.8-12.5 2.7-25.1 5.8-37.3 10.5-41.3 33.2-77.5 65.8-104.7 8.5-7.1 21.1-6 28.2 2.5 7.1 8.5 6 21.1-2.5 28.2-26.1 21.8-44.3 50.8-52.7 83.9-2.5 9.8-4.1 19.9-4.7 29.9-0.7 10.5-9.5 18.7-20 18.7z' fill='#FFFFFF' p-id='5691'></path></svg>"
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 012e47d2-944a-4b2a-a780-db233ecd898d
|
||
dataCategory: ImageUrl
|
||
|
||
measure 'Option_Trend_Qths.Value' = SELECTEDVALUE('Option_Trend_Mths'[Option_Trend_QMths], 24)
|
||
formatString: 0
|
||
displayFolder: OLD\Others
|
||
lineageTag: 233d77e7-3161-47c4-9a19-9edfbba98389
|
||
|
||
measure 'Trend_Is_In_DateRange.Q' = ```
|
||
|
||
VAR MTHS = [Option_Trend_Qths.Value]-1
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
ISINSCOPE(Dim_Calendar_Alt[YYYYMM]),
|
||
VAR YM = SELECTEDVALUE(Dim_Calendar_Alt[YYYYMM])
|
||
VAR DATE1 = CALCULATE(MAX(Dim_Calendar[DATE]))
|
||
VAR DATE0 = DATE(YEAR(DATE1), MONTH(DATE1)-MTHS, 1)
|
||
RETURN int(YM>=FORMAT(DATE0,"yyyyMM") && YM<=FORMAT(DATE1,"yyyyMM")),
|
||
ISINSCOPE(Dim_Calendar_Alt[YEAR_QUATER]),
|
||
VAR YQ = SELECTEDVALUE(Dim_Calendar_Alt[YEAR_QUATER])
|
||
VAR DATE1 = CALCULATE(ENDOFQUARTER(Dim_Calendar[DATE]))
|
||
VAR DATE0 = DATE(YEAR(DATE1), MONTH(DATE1)-MTHS, 1)
|
||
RETURN int(YQ>=FORMAT(DATE0,"yyyy\QQ") && YQ<=FORMAT(DATE1,"yyyy\QQ"))
|
||
)
|
||
```
|
||
formatString: 0
|
||
displayFolder: OLD\Others
|
||
lineageTag: bd787136-99ed-40a1-9a84-d51989bc412d
|
||
|
||
measure 'External.RQGR%.KPI' =
|
||
|
||
VAR CV = CALCULATE([External.Sales.KPI], MQY[Period]="QTDAvg")
|
||
VAR PV = CALCULATE(CALCULATE([External.Sales.KPI], PREVIOUSQUARTER(ENDOFQUARTER(Dim_Calendar[Date]))), MQY[Period]="QTDAvg")
|
||
RETURN IF(PV <> BLANK(), DIVIDE(CV-PV,PV))
|
||
// IF([External.Sales.KPI] <> BLANK(), DIVIDE([External.SalesAvg.QTD]-[External.SalesAvg.QTD.LQ],[External.SalesAvg.QTD.LQ]))
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:季度增长率
|
||
------KPI公式:(今年季度月平均销量-上季度月平均销量)/上季度月平均销量
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\GR%
|
||
lineageTag: fb23c401-367f-47a1-be96-8ab5a3691aac
|
||
|
||
measure 'External.Sales.LY.KPI' =
|
||
VAR MKT_FLAG =
|
||
SELECTEDVALUE ( Dim_Market[IS_HIDDEN_COUNTY], -1 )
|
||
RETURN
|
||
//如果选择market,且选择province_group,则隐藏ONC&RARE市场
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISFILTERED ( Dim_GeoGroup ),
|
||
SWITCH (
|
||
MKT_FLAG,
|
||
-1, [External.Sales.LY.MTH.MID],
|
||
1,
|
||
CALCULATE (
|
||
[External.Sales.LY.MTH.MID],
|
||
KEEPFILTERS (
|
||
TREATAS ( { 0, 3 }, Dim_GeoGroup[PROVINCE_GROUP_CATAGORY] )
|
||
)
|
||
),
|
||
2,
|
||
CALCULATE (
|
||
[External.Sales.LY.MTH.MID],
|
||
KEEPFILTERS (
|
||
TREATAS ( { 0, 2, 3 }, Dim_GeoGroup[PROVINCE_GROUP_CATAGORY] )
|
||
)
|
||
),
|
||
0,
|
||
CALCULATE (
|
||
[External.Sales.LY.MTH.MID],
|
||
KEEPFILTERS (
|
||
TREATAS ( { 0, 1, 3 }, Dim_GeoGroup[PROVINCE_GROUP_CATAGORY] )
|
||
)
|
||
)
|
||
),
|
||
ISFILTERED ( AIA_Merge_Data[mergedata_5_2] ),
|
||
SUMX (
|
||
VALUES ( Dim_MergeDataSource[DATA_SOURCE] ),
|
||
[External.Sales.LY.MTH.MID]
|
||
),
|
||
ISFILTERED ( Config_PageFlag_FreeReportNIAD ), [Retail.NIAD.Sales.LY],
|
||
[External.Sales.LY.MTH.MID]
|
||
)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:去年同期月度KPI
|
||
------KPI公式:根据所选单位,显示不同的月度KPI值
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0
|
||
displayFolder: 00Base\01
|
||
lineageTag: e493674e-3fdd-403b-afc4-a972300db7de
|
||
|
||
measure 'External.Sales.KPI.YTD' =
|
||
|
||
CALCULATE([External.Sales.KPI],ALL(Dim_Calendar),Dim_Unit[DW] = "RMB")
|
||
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:AZ季度kpi
|
||
------KPI公式:
|
||
------备注:用于计算季度增长
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0
|
||
displayFolder: OLD\External Sales
|
||
lineageTag: fa518a4f-37cc-4228-acd7-3f196b6406dd
|
||
|
||
measure show_Market = ```
|
||
|
||
// VAR DS = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||
// VAR t_ =
|
||
// IF (
|
||
// ISFILTERED(Dim_Market)||ISFILTERED(Dim_MarketTA)||ISFILTERED(Dim_BrandDefaultMKT),
|
||
// VAR ___x = "
|
||
// Market Definition:
|
||
// "& CONCATENATEX(CALCULATETABLE(VALUES(Dim_Market[MARKET_DESC]),Dim_Market[DATA_SOURCE] = DS),[MARKET_DESC],",") &""
|
||
// RETURN ___x
|
||
// )
|
||
// RETURN T_ //CONCATENATEX( t_ , [Value1] , "" )
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 7b50b0d7-b855-4155-8ce7-2618195da73d
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.EI.KPI.TopCompetitorName' =
|
||
|
||
IF (
|
||
[External.Sales.KPI] <> BLANK (),
|
||
CALCULATE (
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_DES_C],
|
||
Dim_Corp[CORP_DES],
|
||
Dim_Corp[CORP_DES_C]
|
||
),
|
||
"@VAL", [External.Sales.KPI],
|
||
"@EI", [External.EI.KPI]
|
||
),
|
||
[CORP_DES] <> "ASTRAZENECA"
|
||
&& [@VAL] <> BLANK ()
|
||
),
|
||
ORDERBY ( [@EI], DESC )
|
||
)
|
||
RETURN
|
||
MAXX ( T, [CORP_DES_C] & "(" & [PROD_DES_C] & ")" ),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_PACK] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] )
|
||
)
|
||
)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:EI
|
||
------KPI公式:排除az之后,根据公司+产品的EI倒序排,取最大的一个EI值对应的公司+产品
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
displayFolder: OLD\暂时弃用的KPI
|
||
lineageTag: 33bc9e60-9d48-44f6-83ff-4f618c530852
|
||
|
||
measure 'External.EI.KPI.Leader' =
|
||
|
||
IF (
|
||
[External.Sales.KPI] <> BLANK (),
|
||
CALCULATE (
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_DES],
|
||
Dim_Corp[CORP_DES]
|
||
),
|
||
"@VAL", [External.Sales.KPI],
|
||
"@EI", [External.EI.KPI],
|
||
"VBP",
|
||
CALCULATE (
|
||
MIN ( Dim_PackInfo[VBP_DESC] ),
|
||
Dim_PackInfo[VBP_DESC] <> BLANK ()
|
||
)
|
||
),
|
||
ORDERBY ( [@EI], DESC )
|
||
)
|
||
RETURN
|
||
MAXX ( T, [@EI] ),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_PACK] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] )
|
||
)
|
||
)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:EI
|
||
------KPI公式:根据公司+产品的EI倒序排,取最大的一个EI
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0
|
||
displayFolder: OLD\暂时弃用的KPI
|
||
lineageTag: 5337ec89-1167-47c8-aecf-8aa6d600a758
|
||
|
||
measure 'External.EI.KPI.LeaderName' =
|
||
|
||
IF (
|
||
[External.Sales.MTH] <> BLANK (),
|
||
CALCULATE (
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_DES],
|
||
Dim_Corp[CORP_DES]
|
||
),
|
||
"@VAL", [External.Sales.KPI],
|
||
"@EI", [External.EI.KPI],
|
||
"VBP",
|
||
CALCULATE (
|
||
MIN ( Dim_PackInfo[VBP_DESC] ),
|
||
Dim_PackInfo[VBP_DESC] <> BLANK ()
|
||
)
|
||
),
|
||
ORDERBY ( [@EI], DESC )
|
||
)
|
||
RETURN
|
||
MAXX ( T, [CORP_DES] & "(" & [PROD_DES] & ")" ),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_PACK] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] )
|
||
)
|
||
)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:EI
|
||
------KPI公式:根据公司+产品的EI倒序排,取最大的一个EI对应的公司+产品
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
displayFolder: OLD\暂时弃用的KPI
|
||
lineageTag: 8f2b08e2-24a0-409a-9655-d178266d39a1
|
||
|
||
measure 'External.Gr%.KPI.LeaderName' =
|
||
|
||
IF (
|
||
[External.Sales.KPI] <> BLANK (),
|
||
CALCULATE (
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_DES_C],
|
||
Dim_Corp[CORP_DES_C]
|
||
),
|
||
"@VAL", [External.Sales.KPI],
|
||
"@GR", [External.Gr%.KPI],
|
||
"VBP",
|
||
CALCULATE (
|
||
MIN ( Dim_PackInfo[VBP_DESC] ),
|
||
Dim_PackInfo[VBP_DESC] <> BLANK ()
|
||
)
|
||
),
|
||
ORDERBY ( [@GR], DESC )
|
||
)
|
||
RETURN
|
||
MAXX ( T, [CORP_DES_C] & "(" & [PROD_DES_C] & ")" ),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_PACK] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] )
|
||
)
|
||
)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:产品增长排名第一的公司+产品
|
||
------KPI公式:根据公司+产品的增长倒序排,取第一个公司+产品
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
----------------------------------------------------------------------------
|
||
displayFolder: OLD\GR%
|
||
lineageTag: 7814c9bd-683a-49d5-a92c-6f346eef232d
|
||
|
||
measure 'External.Gr%.KPI.TopCompetitorName' =
|
||
|
||
IF (
|
||
[External.Sales.KPI] <> BLANK (),
|
||
CALCULATE (
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_DES_C],
|
||
Dim_Corp[CORP_DES],
|
||
Dim_Corp[CORP_DES_C]
|
||
),
|
||
"@VAL", [External.Sales.KPI],
|
||
"@GR", [External.Gr%.KPI]
|
||
),
|
||
[CORP_DES] <> "ASTRAZENECA"
|
||
&& [@VAL] <> BLANK ()
|
||
),
|
||
ORDERBY ( [@GR], DESC )
|
||
)
|
||
RETURN
|
||
MAXX ( T, [CORP_DES_C] & "(" & [PROD_DES_C] & ")" ),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_PACK] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] )
|
||
)
|
||
)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:除AZ外,产品增长排名第一的公司+产品
|
||
------KPI公式:除AZ外,根据公司+产品的增长倒序排,取第一个公司+产品
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
----------------------------------------------------------------------------
|
||
displayFolder: OLD\GR%
|
||
lineageTag: 449f250a-3ff6-41c7-b960-33eabb9b41f9
|
||
|
||
measure 'External.Sales.HALF' = ```
|
||
|
||
VAR H = MAX(Dim_Calendar[HALF_YEAR])
|
||
RETURN
|
||
CALCULATE([External.Sales.MTH],ALL(Dim_Calendar),Dim_Calendar[HALF_YEAR] = H)
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:半年销量
|
||
------KPI公式:所选月份的半年销量
|
||
------备注:用于计算半年月平均增长
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
```
|
||
formatString: #,0
|
||
displayFolder: OLD\暂时弃用的KPI
|
||
lineageTag: 198a5039-a526-4fab-90b1-0a5c72d63d46
|
||
|
||
measure 'External.SelectUnit' =
|
||
|
||
SELECTEDVALUE ( 'Dim_Unit'[DW], "M RMB" )
|
||
displayFolder: OLD\Others
|
||
lineageTag: 80db969c-cb8b-4fb1-a94b-1904c1af37d5
|
||
|
||
measure 'External.Sales.KPI' =
|
||
VAR MKT_FLAG =
|
||
SELECTEDVALUE ( Dim_Market[IS_HIDDEN_COUNTY], -1 )
|
||
RETURN
|
||
//如果选择market,且选择province_group,则隐藏ONC&RARE市场
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISFILTERED ( Dim_GeoGroup ),
|
||
SWITCH (
|
||
MKT_FLAG,
|
||
-1, [External.Sales.MTH.MID],
|
||
1,
|
||
CALCULATE (
|
||
[External.Sales.MTH.MID],
|
||
KEEPFILTERS (
|
||
TREATAS ( { 0, 3 }, Dim_GeoGroup[PROVINCE_GROUP_CATAGORY] )
|
||
)
|
||
),
|
||
2,
|
||
CALCULATE (
|
||
[External.Sales.MTH.MID],
|
||
KEEPFILTERS (
|
||
TREATAS ( { 0, 2, 3 }, Dim_GeoGroup[PROVINCE_GROUP_CATAGORY] )
|
||
)
|
||
),
|
||
0,
|
||
CALCULATE (
|
||
[External.Sales.MTH.MID],
|
||
KEEPFILTERS (
|
||
TREATAS ( { 0, 1, 3 }, Dim_GeoGroup[PROVINCE_GROUP_CATAGORY] )
|
||
)
|
||
)
|
||
),
|
||
ISFILTERED ( AIA_Merge_Data[mergedata_5_2] ),
|
||
SUMX (
|
||
VALUES ( Dim_MergeDataSource[DATA_SOURCE] ),
|
||
[External.Sales.MTH.MID]
|
||
),
|
||
ISFILTERED ( Config_PageFlag_FreeReportNIAD ), [Retail.NIAD.Sales],
|
||
[External.Sales.MTH.MID]
|
||
)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:月度KPI
|
||
------KPI公式:根据所选单位,显示不同的月度KPI值
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0
|
||
displayFolder: 00Base\01
|
||
lineageTag: ca23bb68-7a5d-43ba-9fd3-71c11fccad0e
|
||
|
||
measure 'External.SelectVBP' =
|
||
|
||
SELECTEDVALUE ( 'Dim_BrandMKT'[VBPFLAG], 3 )
|
||
displayFolder: OLD\Others
|
||
lineageTag: 044b8f17-591e-4897-9d0e-d2c86a46cf68
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.SelectUnitMKTRatio' = 1//SELECTEDVALUE ( 'Dim_MKTPackMapping'[UNIT_MARKET_RATIO], 1 )
|
||
displayFolder: OLD\Others
|
||
lineageTag: defcb061-e439-44aa-aaf1-9d0a7519d828
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.SelectValueMKTRatio' = 1//SELECTEDVALUE ( 'Dim_MKTPackMapping'[VALUE_MARKET_RATIO], 1 )
|
||
displayFolder: OLD\Others
|
||
lineageTag: 3639de67-68be-4511-9edd-2b1ffc68a997
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.SelectPDOTMKTRatio' = 1//SELECTEDVALUE ( 'Dim_MKTPackMapping'[PDOT_MARKET_RATIO], 1 )
|
||
displayFolder: OLD\Others
|
||
lineageTag: 9ee9a714-c744-4172-a653-4dce0b4b38fc
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'time sel' = ```
|
||
|
||
VAR Period = SELECTEDVALUE(MQY[Period])
|
||
VAR MAXMTH = [MAX_EXTERNAL_MTH]
|
||
VAR D0 = SWITCH(Period
|
||
,"MTH", MIN(Dim_Calendar[YYYYMM])
|
||
,"QTD", FORMAT(CALCULATE(MIN(Dim_Calendar[DATE]), DATESQTD(Dim_Calendar[DATE])),"yyyyMM")
|
||
,"YTD", FORMAT(CALCULATE(MIN(Dim_Calendar[DATE]), DATESYTD(Dim_Calendar[DATE])),"yyyyMM")
|
||
|
||
)
|
||
VAR D1 = SWITCH(Period
|
||
,"MTH", MAX(Dim_Calendar[YYYYMM])
|
||
,"QTD", MAX(Dim_Calendar[YYYYMM])
|
||
,"YTD", MAX(Dim_Calendar[YYYYMM])
|
||
)
|
||
VAR DATE0 = IF(D0>MAXMTH, MAXMTH&"(!)", D0)
|
||
VAR DATE1 = IF(D1>MAXMTH, MAXMTH&"(!)", D1)
|
||
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
DATE0=DATE1,DATE1,
|
||
Period = "QTD", DATE0&"-"&DATE1,
|
||
Period = "YTD", DATE0&"-"&DATE1,
|
||
DATE0&"-"&DATE1
|
||
)
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 8e129a3b-c573-489b-8d39-9090e5ec3e3b
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure MAX_EXTERNAL_MTH = MAXX(ALL(Fact_Sales), Fact_Sales[YYYYMM])
|
||
displayFolder: OLD\Others
|
||
lineageTag: 26fdc71c-e73d-4a31-84e4-e7251face351
|
||
|
||
measure 'External.PriceUnit.MTH' = DIVIDE([External.Value.MTH],[External.Unit.MTH])
|
||
formatString: #,0.0
|
||
displayFolder: OLD\Others
|
||
lineageTag: 6a9f8b4f-ada6-43ac-aebb-fd31fc553f38
|
||
|
||
measure 'External.PriceUnit.KPI' =
|
||
[External.PriceUnit.MTH]
|
||
// SWITCH([External.SelectTimeType],
|
||
// "MTH",[External.PriceUnit.MTH],
|
||
// "QTD", CALCULATE ( [External.PriceUnit.MTH], DATESQTD ( 'TD_EXTERNAL_CALENDAR'[DATE] ) ),
|
||
// "YTD", CALCULATE ( [External.PriceUnit.MTH], DATESYTD ( 'TD_EXTERNAL_CALENDAR'[DATE] ) )
|
||
// )
|
||
formatString: #,0.0
|
||
displayFolder: OLD\Others
|
||
lineageTag: b024cdab-d0c5-4ad8-9a9c-1de74e42be16
|
||
|
||
measure 'External.PriceCU.MTH' = DIVIDE([External.Value.MTH],[External.CountingUnit.MTH])
|
||
formatString: #,0.0
|
||
displayFolder: OLD\Others
|
||
lineageTag: 2d8ea106-6b96-481c-89db-5ce0956ebee2
|
||
|
||
measure 'External.PriceCU.KPI' =
|
||
[External.PriceCU.MTH]
|
||
// SWITCH([External.SelectTimeType],
|
||
// "MTH",[External.PriceCU.MTH],
|
||
// "QTD", CALCULATE ( [External.PriceCU.MTH], DATESQTD ( 'TD_EXTERNAL_CALENDAR'[DATE] ) ),
|
||
// "YTD", CALCULATE ( [External.PriceCU.MTH], DATESYTD ( 'TD_EXTERNAL_CALENDAR'[DATE] ) )
|
||
// )
|
||
formatString: #,0.0
|
||
displayFolder: OLD\Others
|
||
lineageTag: 35c7d273-ea57-4895-8ed8-54f22fec1c68
|
||
|
||
measure 'External.△MS%.KPI.BottomGeo' = ```
|
||
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
SUMMARIZE (
|
||
Dim_Geo,
|
||
Dim_Geo[PROVINCE_C],
|
||
"@VAL", [External.Sales.KPI],
|
||
"@delta", [External.△MS%.KPI]
|
||
),
|
||
ORDERBY ( [@delta], ASC )
|
||
)
|
||
RETURN
|
||
MAXX ( T, [@delta] )
|
||
|
||
|
||
|
||
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI公式:获取省份对应的最小△MS%值
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
----------------------------------------------------------------------------
|
||
```
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\过渡性KPI
|
||
lineageTag: c15e0531-f024-4996-a1a6-938e5a33c63d
|
||
|
||
measure 'External.△MS%.KPI.TopGeo' =
|
||
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( Dim_Geo, Dim_Geo[PROVINCE_C] ),
|
||
"@VAL", [External.Sales.KPI],
|
||
"@delta", [External.△MS%.KPI]
|
||
),
|
||
ORDERBY ( [@delta], DESC )
|
||
)
|
||
RETURN
|
||
MAXX ( T, [@delta] )
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:省份的最大△MS%值
|
||
------KPI公式:根据省份的△MS%值进行倒序排序,第一个。
|
||
------备注:用于geography analysis地理维度分析页面
|
||
------创建时间:2024.5.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\过渡性KPI
|
||
lineageTag: 1c9daf30-f2a4-4e99-81bb-50e55bef91b5
|
||
|
||
measure 'External.MS%.KPI.TopGeo' = ```
|
||
|
||
CALCULATE (
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( Dim_Geo, Dim_Geo[PROVINCE_C] ),
|
||
"@VAL", [External.Sales.KPI],
|
||
"@MS", [External.MS%.KPI]
|
||
),
|
||
ORDERBY ( [@MS], DESC )
|
||
)
|
||
RETURN
|
||
MAXX ( T, [@MS] ),
|
||
REMOVEFILTERS ( Dim_Geo[PROVINCE_C] )
|
||
)
|
||
/*---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:最大省份市场占比值
|
||
------KPI公式:根据省份的市场占比倒序排,取第一个
|
||
|
||
------备注:用于3.1地图说明
|
||
------创建时间:2024.6.10
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------*/
|
||
```
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\过渡性KPI
|
||
lineageTag: 8206b098-4d95-42bc-a876-640d0769fb85
|
||
|
||
measure 'External.MS%.KPI.BottomGeo' = ```
|
||
|
||
CALCULATE (
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
SUMMARIZE (
|
||
Dim_Geo,
|
||
Dim_Geo[PROVINCE_C],
|
||
"@VAL", [External.Sales.KPI],
|
||
"@MS", [External.MS%.KPI]
|
||
),
|
||
ORDERBY ( [@MS], ASC )
|
||
)
|
||
RETURN
|
||
MAXX ( T, [@MS] ),
|
||
REMOVEFILTERS ( Dim_Geo[PROVINCE_C] )
|
||
)
|
||
/*---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:最小省份市场占比值
|
||
------KPI公式:根据省份的市场占比顺序排,取第一个
|
||
|
||
------备注:用于3.1地图说明
|
||
------创建时间:2024.6.10
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------*/
|
||
```
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\过渡性KPI
|
||
lineageTag: fc25d707-c07d-4b19-846d-67112b6f1874
|
||
|
||
measure 'External.GR%.KPI.BottomGeo' = ```
|
||
|
||
CALCULATE (
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
SUMMARIZE (
|
||
Dim_Geo,
|
||
Dim_Geo[PROVINCE_C],
|
||
"@VAL", [External.Sales.KPI],
|
||
"@GR", [External.GR%.KPI]
|
||
),
|
||
ORDERBY ( [@GR], ASC )
|
||
)
|
||
RETURN
|
||
MAXX ( T, [@GR] ),
|
||
REMOVEFILTERS ( Dim_Geo[PROVINCE_C] )
|
||
)
|
||
/*---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:最小省份增长值
|
||
------KPI公式:根据省份的同比增长顺序排,取第一个
|
||
|
||
------备注:用于3.1地图说明
|
||
------创建时间:2024.6.10
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------*/
|
||
```
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\过渡性KPI
|
||
lineageTag: 29a03e71-14a7-46e7-a5ed-79728c8943ae
|
||
|
||
measure 'External.GR%.KPI.TopGeo' = ```
|
||
|
||
CALCULATE (
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( Dim_Geo, Dim_Geo[PROVINCE_C] ),
|
||
"@VAL", [External.Sales.KPI],
|
||
"@GR", [External.GR%.KPI]
|
||
),
|
||
ORDERBY ( [@GR], DESC )
|
||
)
|
||
RETURN
|
||
MAXX ( T, [@GR] ),
|
||
REMOVEFILTERS ( Dim_Geo[PROVINCE_C] )
|
||
)
|
||
/*---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:最大省份增长值
|
||
------KPI公式:根据省份的同比增长顺序排,取第一个
|
||
|
||
------备注:用于3.1地图说明
|
||
------创建时间:2024.6.10
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------*/
|
||
```
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\过渡性KPI
|
||
lineageTag: 570526ab-80c5-4c06-9253-7879cdd2846a
|
||
|
||
measure 'External.Province.KPI.Bottom' = ```
|
||
|
||
IF (
|
||
[External.Sales.KPI] <> BLANK (),
|
||
SWITCH (
|
||
[IMSRankedBy.Value],
|
||
"GR%", [External.GR%.KPI.BottomGeo],
|
||
"ΔMS%", [External.△MS%.KPI.BottomGeo],
|
||
"MS%", [External.MS%.KPI.BottomGeo],
|
||
//else
|
||
[External.Sales.KPI]
|
||
)
|
||
)
|
||
/*---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:根据不同的kpi名字取不同的kpi值
|
||
------KPI公式:取最小值
|
||
|
||
------备注:用于3.1地图说明
|
||
------创建时间:2024.6.10
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------*/
|
||
```
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\中间KPI
|
||
lineageTag: 4cc51c22-668d-4f51-8f6c-9d45e67cf7c8
|
||
|
||
measure 'External.Province.KPI.TopGeo' = ```
|
||
|
||
IF (
|
||
[External.Sales.KPI] <> BLANK (),
|
||
SWITCH (
|
||
[IMSRankedBy.Value],
|
||
"GR%", [External.GR%.KPI.TopGeo],
|
||
"ΔMS%", [External.△MS%.KPI.TopGeo],
|
||
"MS%", [External.MS%.KPI.TopGeo],
|
||
//else
|
||
[External.Sales.KPI]
|
||
)
|
||
)
|
||
/*---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:根据不同的kpi名字取不同的kpi值
|
||
------KPI公式:取最大值
|
||
|
||
------备注:用于3.1地图说明
|
||
------创建时间:2024.6.10
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------*/
|
||
```
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\中间KPI
|
||
lineageTag: 7d8b33eb-9c75-4859-a11d-14e0f1914cbd
|
||
|
||
measure SelectedMin = ```
|
||
"Min " & ROUND([External.Province.KPI.Bottom]*100,0) & "%"
|
||
/*---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:最小值
|
||
------KPI公式:根据选择的kpi,获取最小值是多少
|
||
|
||
------备注:用于3.1地图
|
||
------创建时间:2024.6.10
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------*/
|
||
```
|
||
displayFolder: OLD\特定视觉对象使用KPI3.1说明
|
||
lineageTag: 5c3395a3-f32b-4aa6-bf27-a320bf63c3db
|
||
|
||
measure SelectedMax = ```
|
||
"Max " & ROUND([External.Province.KPI.TopGeo]*100,0) & "%"
|
||
|
||
/*---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:最大值
|
||
------KPI公式:根据选择的kpi,获取最大值是多少
|
||
|
||
------备注:用于3.1地图
|
||
------创建时间:2024.6.10
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------*/
|
||
```
|
||
displayFolder: OLD\特定视觉对象使用KPI3.1说明
|
||
lineageTag: 6603dfb7-723a-49e3-aa57-700023c85c81
|
||
|
||
measure 'External.Trend.KPI.Sales.Q' = ```
|
||
//按指定字段排序的销售金额趋势
|
||
IF(ISFILTERED(Dim_Corp),
|
||
IF([Trend_Is_In_DateRange.Q]>0,
|
||
CALCULATE(
|
||
[External.Sales.KPI],
|
||
REMOVEFILTERS(Dim_Calendar),
|
||
REMOVEFILTERS(Dim_Calendar_Alt),
|
||
TREATAS(VALUES(Dim_Calendar_Alt[YYYYMM]),Dim_Calendar[YYYYMM]),
|
||
MQY[Period] = "MTH"
|
||
//DIM_GEO[province_name]="National"
|
||
)
|
||
)
|
||
,
|
||
IF([External.Sales.KPI]<>BLANK() && [External.Rank.KPI]<=[Top Value],
|
||
IF([Trend_Is_In_DateRange.Q]>0,
|
||
CALCULATE(
|
||
[External.Sales.KPI],
|
||
REMOVEFILTERS(Dim_Calendar),
|
||
REMOVEFILTERS(Dim_Calendar_Alt),
|
||
TREATAS(VALUES(Dim_Calendar_Alt[YYYYMM]),Dim_Calendar[YYYYMM]),
|
||
MQY[Period] = "MTH"
|
||
//DIM_GEO[province_name]="National"
|
||
)
|
||
)
|
||
)
|
||
)
|
||
```
|
||
formatString: #,0
|
||
displayFolder: OLD\Others
|
||
lineageTag: 1d3b762f-a9f8-40b6-a2f2-f05fffc6c08b
|
||
|
||
measure 'External.Rank.KPI.Prod.Top' = ```
|
||
|
||
IF([External.Sales.KPI]<>BLANK(),
|
||
CALCULATE(RANK(DENSE, ALL(Dim_PackInfo[PROD_DES]), ORDERBY([External.Sales.KPI], DESC)),
|
||
ALL(Dim_PackInfo[CMPS_DES])
|
||
)
|
||
)
|
||
// IF([External.Sales]<>BLANK(),
|
||
// CALCULATE(
|
||
// SWITCH([IMSRankedBy.Value],
|
||
// "GRVal", RANK(DENSE, ALL(DM_TD_EXTERNAL_PACKINFO[PROD_DES]), ORDERBY([External.GRSales.KPI], DESC)),
|
||
// "GR%", RANK(DENSE, ALL(DM_TD_EXTERNAL_PACKINFO[PROD_DES]), ORDERBY([External.Gr%.KPI], DESC)),
|
||
// "MS%", RANK(DENSE, ALL(DM_TD_EXTERNAL_PACKINFO[PROD_DES]), ORDERBY([External.MS%.KPI], DESC)),
|
||
// //else
|
||
// RANK(DENSE, ALL(DM_TD_EXTERNAL_PACKINFO[PROD_DES]), ORDERBY([External.Sales.KPI], DESC))
|
||
// ),
|
||
// ALL(DM_TD_EXTERNAL_PACKINFO[CMPS_DES]), REMOVEFILTERS(DM_TD_EXTERNAL_PACKINFO[MNFL_DES])
|
||
// )
|
||
// )
|
||
```
|
||
formatString: #,0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: 348064f0-b4d3-496d-9dc1-a020f13ceabb
|
||
|
||
measure 'External.GRSales.KPI.Market' =
|
||
[External.Sales.KPI.Market]-[External.Sales.LY.KPI.Market]
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:市场增长金额
|
||
------KPI公式:今年市场销量-去年同期市场销量
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0
|
||
displayFolder: OLD\External Sales
|
||
lineageTag: c59fabfa-d74b-426c-9718-9dbd8c4a36a0
|
||
|
||
measure 'External.Gr%.KPI.AllGeo' = ```
|
||
CALCULATE([External.Gr%.KPI],Dim_GeoGroup[PROVINCE_GROUP] = "全国")
|
||
/*---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:全国的gr%值
|
||
------KPI公式:同比增长
|
||
|
||
------备注:用于3.1气泡图
|
||
------创建时间:2024.6.10
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------*/
|
||
```
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\特定视觉对象使用KPI3.1说明
|
||
lineageTag: 04d2f13b-49cd-4982-864c-83f38e3e615c
|
||
|
||
measure 'External.MS%.KPI.AllGeo' = ```
|
||
CALCULATE([External.MS%.KPI],Dim_GeoGroup[PROVINCE_GROUP] = "全国")
|
||
/*---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:全国的MS%值
|
||
------KPI公式:
|
||
|
||
------备注:用于3.1气泡图
|
||
------创建时间:2024.6.10
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------*/
|
||
```
|
||
displayFolder: OLD\特定视觉对象使用KPI3.1说明
|
||
lineageTag: 48707d51-bb1e-4955-bb44-27839a77cd6f
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.TopCompetitor.SelectClassName' =
|
||
VAR DS = SELECTEDVALUE ( Dim_DataSource[DATA_SOURCE] )
|
||
VAR A = [External.MS%.KPI.Top1CompetitorName]
|
||
VAR B =
|
||
CALCULATE (
|
||
MAX ( Dim_PackInfo[PACK_COD] ),
|
||
Dim_PackInfo[PROD_CORP_C] = A,
|
||
Dim_PackInfo[DATA_SOURCE] = DS,
|
||
ALL ( )
|
||
)
|
||
VAR C =
|
||
CALCULATE (
|
||
MAX ( Dim_Class[CLASS] ),
|
||
Dim_PackInfo[PACK_COD] = B,
|
||
Dim_PackInfo[DATA_SOURCE] = DS,
|
||
ALL ( )
|
||
)
|
||
RETURN
|
||
C
|
||
displayFolder: OLD\Others
|
||
lineageTag: 97acf227-63ff-4b0f-9a2d-43dd5c4b7e03
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.SelectProvName.Label' = SELECTEDVALUE(Dim_Geo[PROVINCE_C])
|
||
displayFolder: OLD\Others
|
||
lineageTag: c01ba926-76b8-448e-9054-57d90640f73e
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.ClassName.Label' = "Class Name"
|
||
displayFolder: OLD\Others
|
||
lineageTag: 59db023e-91b2-4494-8661-cf16c3c5c39f
|
||
|
||
measure 'External.MolName.Label' = "Molecule Name"
|
||
displayFolder: OLD\Others
|
||
lineageTag: 10ea7251-db42-4b44-be4d-b7388d9e4ba2
|
||
|
||
measure 'External.MKTLeaderMS.Label' = "Market Leader By MS%:"
|
||
displayFolder: OLD\Others
|
||
lineageTag: 26a2b26c-9862-4f99-b1d7-4544433a031f
|
||
|
||
measure 'External.△MS%.Leader.SelectMoleculeName' =
|
||
VAR DS = SELECTEDVALUE ( Dim_DataSource[DATA_SOURCE] )
|
||
VAR A = [External.△MS%.KPI.Top1PlayerName]
|
||
RETURN
|
||
CALCULATE (
|
||
MAX ( Dim_PackInfo[CMPS_DES] ),
|
||
Dim_PackInfo[PROD_CORP_C] = A,
|
||
Dim_PackInfo[DATA_SOURCE] = DS,
|
||
ALL ( )
|
||
)
|
||
displayFolder: OLD\Others
|
||
lineageTag: 8be26376-5072-42ab-9d11-aedc08010dda
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.Leader.SelectClassName' =
|
||
IF (
|
||
COUNTROWS ( VALUES ( Fact_Sales[MARKET] ) ) = 1,
|
||
CALCULATE (
|
||
MAX ( Fact_Sales[MARKET] ),
|
||
TREATAS (
|
||
{ [External.MS%.KPI.Top1PlayerName] },
|
||
Dim_PackInfo[PROD_CORP_C]
|
||
),
|
||
ALL ( Dim_PackInfo )
|
||
),
|
||
"请先选择市场"
|
||
)
|
||
displayFolder: OLD\Others
|
||
lineageTag: 6216c487-0225-4f91-8a04-06a5df7c42a5
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.Leader.SelectMoleculeName' =
|
||
VAR DS = SELECTEDVALUE ( Dim_DataSource[DATA_SOURCE] )
|
||
VAR A = [External.MS%.KPI.Top1PlayerName]
|
||
RETURN
|
||
CALCULATE (
|
||
MAX ( Dim_PackInfo[CMPS_DES] ),
|
||
Dim_PackInfo[PROD_CORP_C] = A,
|
||
Dim_PackInfo[DATA_SOURCE] = DS,
|
||
ALL ( )
|
||
)
|
||
displayFolder: OLD\Others
|
||
lineageTag: 5392d9af-f38f-457e-9f83-67b7b5082b64
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.TopCompetitor.SelectMoleculeName' =
|
||
|
||
VAR DS = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||
VAR A = [External.MS%.KPI.Top1CompetitorName]
|
||
RETURN CALCULATE(MAX(Dim_PackInfo[CMPS_DES]),Dim_PackInfo[PROD_CORP_C] = A,Dim_PackInfo[DATA_SOURCE] = DS,ALL())
|
||
displayFolder: OLD\Others
|
||
lineageTag: 44643fbd-3218-4a27-a664-43e5d03fd2e9
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.△MS%.Leader.SelectClassName' =
|
||
IF (
|
||
COUNTROWS ( VALUES ( Fact_Sales[MARKET] ) ) = 1,
|
||
CALCULATE (
|
||
MAX ( Fact_Sales[MARKET] ),
|
||
TREATAS (
|
||
{ [External.△MS%.KPI.Top1PlayerName] },
|
||
Dim_PackInfo[PROD_CORP_C]
|
||
),
|
||
ALL ( Dim_PackInfo )
|
||
),
|
||
"请先选择市场"
|
||
)
|
||
displayFolder: OLD\Others
|
||
lineageTag: b0033167-23d7-44db-be6b-dd1a3a04b977
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.△MS%.TopCompetitor.SelectClassName' =
|
||
VAR DS = SELECTEDVALUE ( Dim_DataSource[DATA_SOURCE] )
|
||
VAR A = [External.△MS%.KPI.Top1CompetitorName]
|
||
VAR B =
|
||
CALCULATE (
|
||
MAX ( Dim_PackInfo[PACK_COD] ),
|
||
Dim_PackInfo[PROD_CORP_C] = A,
|
||
Dim_PackInfo[DATA_SOURCE] = DS,
|
||
ALL ( )
|
||
)
|
||
VAR C =
|
||
CALCULATE (
|
||
MAX ( Dim_Class[CLASS] ),
|
||
Dim_PackInfo[PACK_COD] = B,
|
||
Dim_PackInfo[DATA_SOURCE] = DS,
|
||
ALL ( )
|
||
)
|
||
RETURN
|
||
C
|
||
displayFolder: OLD\Others
|
||
lineageTag: e0c36b59-e1d2-4a08-80c4-4031d16e5686
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MKTLeaderΔMS.Label' = "Market Leader By ΔMS%:"
|
||
displayFolder: OLD\Others
|
||
lineageTag: 3f6e2171-791a-4fd4-aac3-9a924a1cc7f4
|
||
|
||
measure 'External.TopCompetitorMS.Label' = "Top Competitor By MS%:"
|
||
displayFolder: OLD\Others
|
||
lineageTag: 1ad735d0-0622-4fb1-b29c-3dae65d2e066
|
||
|
||
measure 'External.TopCompetitorΔMS.Label' = "Top Competitor By ΔMS%:"
|
||
displayFolder: OLD\Others
|
||
lineageTag: f738aa77-bcfe-438d-aaf9-b9053e8ff4d0
|
||
|
||
measure 'External.Trend.KPI.Sales.Q.ALLCORP' = CALCULATE([External.Trend.KPI.Sales.Q], REMOVEFILTERS(Dim_Corp))
|
||
formatString: #,0
|
||
displayFolder: OLD\Others
|
||
lineageTag: 9667f116-dbb0-4b0d-98aa-37f5b416494f
|
||
|
||
measure 'Trend_Is_In_DateRange.H' = ```
|
||
|
||
VAR MTHS = [Option_Trend_Hths.Value]-1
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
ISINSCOPE(Dim_Calendar_Alt[YYYYMM]),
|
||
VAR YM = SELECTEDVALUE(Dim_Calendar_Alt[YYYYMM])
|
||
VAR DATE1 = CALCULATE(MAX(Dim_Calendar[DATE]))
|
||
VAR DATE0 = DATE(YEAR(DATE1), MONTH(DATE1)-MTHS, 1)
|
||
RETURN int(YM>=FORMAT(DATE0,"yyyyMM") && YM<=FORMAT(DATE1,"yyyyMM")),
|
||
ISINSCOPE(Dim_Calendar_Alt[YEAR_QUATER]),
|
||
VAR YQ = SELECTEDVALUE(Dim_Calendar_Alt[YEAR_QUATER])
|
||
VAR DATE1 = CALCULATE(ENDOFQUARTER(Dim_Calendar[DATE]))
|
||
VAR DATE0 = DATE(YEAR(DATE1), MONTH(DATE1)-MTHS, 1)
|
||
RETURN int(YQ>=FORMAT(DATE0,"yyyy\QQ") && YQ<=FORMAT(DATE1,"yyyy\QQ")),
|
||
ISINSCOPE(Dim_Calendar_Alt[HALF_YEAR]),
|
||
VAR YQ = SELECTEDVALUE(Dim_Calendar_Alt[HALF_YEAR])
|
||
VAR YH = MAX(Dim_Calendar[HALF_YEAR])
|
||
VAR DATE1 = CALCULATE(MAX(Dim_Calendar[DATE]),Dim_Calendar[HALF_YEAR] = YH,ALL(Dim_Calendar))
|
||
VAR DATE0 = DATE(YEAR(DATE1), MONTH(DATE1)-MTHS, 1)
|
||
RETURN int(YQ>=FORMAT(DATE0,"yyyy\QQ") && YQ<=FORMAT(DATE1,"yyyy\QQ"))
|
||
)
|
||
```
|
||
formatString: 0
|
||
displayFolder: OLD\Others
|
||
lineageTag: 6209dd90-2fd0-4ea9-99d2-954a324392c6
|
||
|
||
measure 'Option_Trend_Hths.Value' = SELECTEDVALUE('Option_Trend_Mths'[Option_Trend_Hths], 48)
|
||
displayFolder: OLD\Others
|
||
lineageTag: fd3f12a2-3547-4c26-a029-cedf2fe9da32
|
||
|
||
measure 'External.SalesRank.KPI2' = ```
|
||
|
||
VAR No_=
|
||
ROWNUMBER(
|
||
ALLSELECTED('Dim_PackInfo'[MOLECULE_CODE_DESC],'Dim_PackInfo'[PACK_DES],'Dim_PackInfo'[MOLECULE_DES_C],'Dim_PackInfo'[CMPS_DES]),
|
||
ORDERBY([External.Sales.KPI],DESC),
|
||
PARTITIONBY('Dim_PackInfo'[PACK_DES])
|
||
)
|
||
RETURN FORMAT(No_,"0")
|
||
|
||
```
|
||
displayFolder: OLD\Rank
|
||
lineageTag: 47679383-dc3d-44cd-aab7-def3d5f9e355
|
||
|
||
measure 'External.MS%.KPI.Class' =
|
||
|
||
DIVIDE([External.Sales.KPI],[External.Sales.KPI.Class])
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:MS%:产品销量占Class销量的占比
|
||
------KPI公式:今年产品销量/Class销量
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\MS%
|
||
lineageTag: c2671ba1-0044-4a26-ae06-b26ef0630194
|
||
|
||
measure 'External.Sales.KPI.Class' =
|
||
IF (
|
||
ISFILTERED ( Dim_MarketTA ) || ISFILTERED ( Dim_Market )
|
||
|| ISFILTERED ( Dim_BrandDefaultMKT ),
|
||
IF (
|
||
[External.Sales.KPI.Market] <> 0,
|
||
CALCULATE (
|
||
[External.Sales.KPI]
|
||
, ALLSELECTED ( Dim_DataSource )
|
||
, REMOVEFILTERS ( Dim_PackInfo )
|
||
, TREATAS (
|
||
VALUES ( Fact_Sales[CLASS_KEY] ),
|
||
Dim_Class[CLASS_SOURCE]
|
||
)
|
||
)
|
||
)
|
||
)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:class的销量
|
||
------KPI公式:计算class的销量
|
||
------备注:用于计算share in class
|
||
------创建时间:2024.5.15
|
||
------修改时间:2024.5.30
|
||
------修改内容:根据业务要求,只有用户选择了market,才显示topclass kpi
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0
|
||
displayFolder: OLD\中间KPI
|
||
lineageTag: d4d34d02-e8bc-4631-9f44-e2384926d484
|
||
|
||
measure 'External.△MS%.KPI.Top1Class' = ```
|
||
|
||
VAR DS = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
VAR DS1 = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||
VAR BRANDMKT_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 R = CALCULATE([External.△MS%.TopNClass], 'TopN'[TopN]=1)
|
||
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
DS = "Retail" && BRANDMKT_FLAG = 1,R,
|
||
DS = "Retail",BLANK(),
|
||
R)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI公式:根据class的△MS%倒序排,取最大的一个△MS%
|
||
------备注:根据业务要求,只有用户选择了market,才显示topclass kpi
|
||
------创建时间:2024.5.15
|
||
------修改时间:2024.5.30
|
||
------修改内容:根据业务要求,只有用户选择了market,才显示topclass kpi
|
||
----------------------------------------------------------------------------
|
||
```
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Top
|
||
lineageTag: f50ddcca-a30d-4502-b6f6-8e206267542a
|
||
|
||
measure 'External.△MS%.KPI.Top1ClassName' = ```
|
||
|
||
VAR DS = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
VAR DS1 = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||
VAR BRANDMKT_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 R = CALCULATE([External.△MS%.TopNClassName], 'TopN'[TopN]=1)
|
||
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
DS = "Retail" && BRANDMKT_FLAG = 1,R,
|
||
DS = "Retail",BLANK(),
|
||
R)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI公式:根据class的△MS%倒序排,取最大的一个△MS%对应的class名称
|
||
------备注:根据业务要求,只有用户选择了market,才显示topclass kpi
|
||
------创建时间:2024.5.15
|
||
------修改时间:2024.5.30
|
||
------修改内容:根据业务要求,只有用户选择了market,才显示topclass kpi
|
||
----------------------------------------------------------------------------
|
||
```
|
||
displayFolder: OLD\Top
|
||
lineageTag: 751fc269-f369-423d-8dc8-c84af0ef7967
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.SelectVBPUnit' =
|
||
|
||
SELECTEDVALUE ( 'Dim_BrandMKT'[VALUETYPE], "RMB" )
|
||
displayFolder: OLD\Others
|
||
lineageTag: 5223f079-a153-4864-9996-89f41e5f5801
|
||
|
||
measure 'Warning.Text' =
|
||
|
||
IF(
|
||
NOT(ISEMPTY(INTERSECT({15,16,17,18,19,24,25,26,27,28}, VALUES('Measures Val'[Measures Order])))) && ISEMPTY(INTERSECT({212}, VALUES('Fields.Rows'[Fields Order]))) && NOT(ISFILTERED(Dim_Market[MARKET]))&& NOT(ISFILTERED(Dim_BrandDefaultMKT)),
|
||
"⚠️计算Molecule/Class相关KPI请选择对应的市场。"
|
||
)
|
||
displayFolder: OLD\Others
|
||
lineageTag: b6bd8b75-bc83-40e7-b170-2a559195f793
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Warning.TextGeo' = ```
|
||
|
||
VAR A =
|
||
IF(
|
||
NOT(ISEMPTY(INTERSECT({14,15,16,17,20,21}, VALUES('MarketGeo Val'[val 个订单])))) && NOT(ISFILTERED(Dim_Market[MARKET]))&& NOT(ISFILTERED(Dim_BrandDefaultMKT)),
|
||
"⚠️计算Molecule/Class相关KPI请选择对应的市场。"
|
||
)
|
||
RETURN A
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 9e419cbb-4446-41b5-8e5f-82f4f94f9395
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Warning.TextTop' =
|
||
|
||
IF(SELECTEDVALUE(Fields_Leader[Fields_Leader (组)]) IN {"Top Class","Top Molecule"},
|
||
IF(
|
||
NOT(ISFILTERED(Dim_Market[MARKET]))&&NOT(ISFILTERED(Dim_BrandDefaultMKT)),
|
||
"⚠️计算Molecule/Class相关KPI请选择对应的市场。"
|
||
))
|
||
displayFolder: OLD\Others
|
||
lineageTag: b6aa9a8d-e053-436a-8921-26aa2bc71011
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'AZBrand.ISVBP' = IF([VBP_AZ] IN {"VBP-OUT","VBP-N/A","VBP"}, TRUE())
|
||
formatString: """TRUE"";""TRUE"";""FALSE"""
|
||
displayFolder: OLD\Others
|
||
lineageTag: 99f8e0c1-68ff-4ead-aced-000b68c6cc46
|
||
|
||
measure VBP_AZ =
|
||
|
||
IF(ISFILTERED(Dim_BrandMKT),
|
||
CALCULATE(MAX(Dim_PackInfo[VBP_DESC]), TREATAS(VALUES(Dim_BrandMKT[IMSBRAND]),Dim_PackInfo[PROD_DES]))
|
||
)
|
||
displayFolder: OLD\Others
|
||
lineageTag: 6c4a5c2e-b902-4f2e-8b26-d8fd80c76467
|
||
|
||
measure Line = "/"
|
||
displayFolder: OLD\Others
|
||
lineageTag: d7def097-81ea-4a20-8e67-405d86491879
|
||
|
||
measure 'External.Rank.KPI.Trend' = ```
|
||
|
||
IF([External.Sales.KPI]<>BLANK(),
|
||
SWITCH(TRUE(),
|
||
ISINSCOPE(Dim_PackInfo[PACK_DES]), [External.Rank.KPI.PackDesc],
|
||
ISINSCOPE(Dim_PackInfo[PROD_DES]), [External.Rank.KPI.Prod],
|
||
ISINSCOPE(Dim_PackInfo[CMPS_DES]), [External.Rank.KPI.CMPS],
|
||
ISINSCOPE ( Dim_Class[CLASS]), [External.Rank.KPI.Class],
|
||
ISINSCOPE(Dim_Corp[CORP_DES]), [External.Rank.KPI.Corp],
|
||
BLANK()
|
||
)
|
||
)
|
||
```
|
||
formatString: 0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: 14fcfd00-f16b-4ceb-8357-03c8b609a797
|
||
|
||
measure 'External.△MS%.KPI.AllGeo' =
|
||
|
||
CALCULATE (
|
||
SUMX ( VALUES ( Dim_GeoGroup[PROVINCE_GROUP] ), [External.△MS%.KPI] ),
|
||
Dim_GeoGroup[PROVINCE_GROUP] <> "全国",
|
||
ALL ( Dim_GeoGroup )
|
||
)
|
||
|
||
|
||
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI公式:今年产品占市场的占比-去年产品占市场的占比
|
||
------备注:用于geography analysis地理维度分析页面
|
||
------创建时间:2024.5.15
|
||
----------------------------------------------------------------------------
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\暂时弃用的KPI
|
||
lineageTag: 1481f4cd-fa9f-4164-b1f3-e139fca899b5
|
||
|
||
measure 'External.GRSalesContr%.KPI' =
|
||
|
||
DIVIDE([External.GRSales.KPI],[External.GRSales.KPI.Market])
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:增长金额占比
|
||
------KPI公式:产品增长销量 / 市场增长销量
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\MS%
|
||
lineageTag: 9bd1cd29-8035-4397-8da2-7ea12c743fe6
|
||
|
||
measure ICO_NIAD = ```
|
||
"data:image/svg+xml;utf8,
|
||
<svg width='62' height='50' viewBox='0 0 62 62' fill='none' xmlns='http://www.w3.org/2000/svg'>
|
||
<g clip-path='url(#clip0_75_18)'>
|
||
<g filter='url(#filter0_d_75_18)'>
|
||
<path d='M44.242 42.1905L52.9468 33.486C59.6844 26.7486 59.6844 15.7922 52.9468 9.05304C46.2129 2.31926 35.249 2.31205 28.5133 9.05304L20.3579 17.2064L44.242 42.1905ZM17.7584 19.8076L9.05182 28.5104C2.31606 35.246 2.31606 46.2096 9.05182 52.9451C10.655 54.5503 12.5594 55.8231 14.6557 56.6906C16.752 57.558 18.999 58.003 21.2677 58C23.5372 58.0033 25.7851 57.5585 27.8823 56.691C29.9796 55.8236 31.8849 54.5506 33.489 52.9451L41.6443 44.7882L17.7584 19.8076Z' fill='#BA7C9D'/>
|
||
</g>
|
||
<path d='M47.2218 14.8201C45.3395 12.9407 42.7882 11.8851 40.1282 11.8851C37.4682 11.8851 34.9169 12.9407 33.0345 14.8201L29.4869 18.3678C29.3107 18.5427 29.1906 18.766 29.1416 19.0094C29.0926 19.2528 29.117 19.5052 29.2117 19.7347C29.3065 19.9642 29.4672 20.1603 29.6737 20.2982C29.8801 20.4362 30.1228 20.5097 30.371 20.5094C30.5358 20.5103 30.6991 20.4782 30.8513 20.4148C31.0034 20.3515 31.1413 20.2583 31.2568 20.1408L34.8028 16.5932C36.2157 15.1847 38.1293 14.3938 40.1243 14.3938C42.1192 14.3938 44.0329 15.1847 45.4457 16.5932C45.684 16.8124 45.9979 16.9312 46.3217 16.9246C46.6454 16.918 46.9542 16.7866 47.1834 16.5578C47.4126 16.3289 47.5445 16.0205 47.5517 15.6967C47.5589 15.3729 47.4407 15.0589 47.2218 14.8201Z'
|
||
fill='white'/>
|
||
</g>
|
||
<defs>
|
||
<filter id='filter0_d_75_18' x='0' y='4' width='62' height='62' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'>
|
||
<feFlood flood-opacity='0' result='BackgroundImageFix'/>
|
||
<feColorMatrix in='SourceAlpha' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0' result='hardAlpha'/>
|
||
<feOffset dy='4'/>
|
||
<feGaussianBlur stdDeviation='2'/>
|
||
<feComposite in2='hardAlpha' operator='out'/>
|
||
<feColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0'/>
|
||
<feBlend mode='normal' in2='BackgroundImageFix' result='effect1_dropShadow_75_18'/>
|
||
<feBlend mode='normal' in='SourceGraphic' in2='effect1_dropShadow_75_18' result='shape'/>
|
||
</filter>
|
||
<clipPath id='clip0_75_18'>
|
||
<rect width='62' height='62' fill='white'/>
|
||
</clipPath>
|
||
</defs>
|
||
</svg>"
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: ad230db1-d2ed-4432-9011-747dc55c673a
|
||
dataCategory: ImageUrl
|
||
|
||
measure 日期选择控制2 =
|
||
|
||
if(VALUE(LEFT(MAXX(ALL(Fact_Sales[YYYYMM]),[YYYYMM]),4))>=MAXX(Dim_Calendar,value([YEAR]))&&
|
||
VALUE(LEFT(MAXX(ALL(Fact_Sales[YYYYMM]),[YYYYMM]),4))-3<=MINX(Dim_Calendar,value([YEAR])),1,0)
|
||
formatString: 0
|
||
displayFolder: OLD\Others
|
||
lineageTag: aa28a1d2-4b41-4f3b-8970-7af798d2ecbe
|
||
|
||
measure Max_COUNTY_Date = "County (Q): " & CALCULATE(MAX(Fact_Sales[YYYYMM]),Dim_DataSource[DATA_SOURCE] = "IQVIA-COUNTY(Quarterly)",ALL())
|
||
displayFolder: OLD\Others
|
||
lineageTag: 40192850-2991-42ec-8d14-50cb6779998e
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure Max_Retail_Date = "Retail (Q): " & CALCULATE(MAX(Fact_Sales[YYYYMM]),Dim_DataSource[DATA_SOURCE] = "Retail(Quarterly)",ALL())
|
||
displayFolder: OLD\Others
|
||
lineageTag: 803d6449-30fa-41f8-a5a4-94e9afbc180e
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure Max_THC_Date = "THC省 (Q): " & CALCULATE(MAX(Fact_Sales[YYYYMM]),Dim_DataSource[DATA_SOURCE] = "THC(Quarterly)",ALL())
|
||
displayFolder: OLD\Others
|
||
lineageTag: 404142ca-1955-4b8d-8b3f-806e83d7a7e9
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure Max_CHC_Date = "CHC (Q): " & CALCULATE(MAX(Fact_Sales[YYYYMM]),Dim_DataSource[DATA_SOURCE] = "CHC(Quarterly)",ALL())
|
||
displayFolder: OLD\Others
|
||
lineageTag: c10eda14-da4b-42fb-af11-d0b174ca6931
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure Max_EC_Date = "EC (Q): " & CALCULATE(MAX(Fact_Sales[YYYYMM]),Dim_DataSource[DATA_SOURCE] = "EC(Monthly)",ALL())
|
||
displayFolder: OLD\Others
|
||
lineageTag: cb314415-5e9f-4ab3-8ebd-a98084531d13
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'RetailTotal.Value.MTH' = CALCULATE(SUM(Fact_Retail_Total[KPI_VAL]),Fact_Retail_Total[KPI_NAME] = "corp_type_sales_amount")
|
||
formatString: 0
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 547482e4-2ff1-47b4-886c-6ba5aae7d7b3
|
||
|
||
measure RC_Name =
|
||
|
||
SWITCH(SELECTEDVALUE(Dim_DataSource[SOURCENAME]),
|
||
"CHPA","RC",
|
||
"Retail","RC",
|
||
"CHC","RC",
|
||
"THC","RC",
|
||
BLANK()
|
||
)
|
||
displayFolder: OLD\Others
|
||
lineageTag: 72380957-d569-483b-8955-84fab08257d1
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure Region_Name =
|
||
|
||
SWITCH(SELECTEDVALUE(Dim_DataSource[SOURCENAME]),
|
||
"CHPA","Region",
|
||
"Retail","Region",
|
||
"CHC","Region",
|
||
"THC","Region",
|
||
BLANK()
|
||
)
|
||
displayFolder: OLD\Others
|
||
lineageTag: 77cb0683-c2c3-4190-9990-14c1c801ac69
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Org.BackColor' =
|
||
|
||
SWITCH(SELECTEDVALUE(Dim_DataSource[SOURCENAME]),
|
||
"CHPA","#E6E6E6",
|
||
"Retail","#E6E6E6",
|
||
"CHC","#E6E6E6",
|
||
"THC","#E6E6E6",
|
||
"#FFFFFF"
|
||
)
|
||
displayFolder: OLD\Others
|
||
lineageTag: 6ba3d108-38f8-40fb-8b29-1c205d2353bc
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure OptionGeoName =
|
||
|
||
VAR A = SELECTEDVALUE(Option_Geo[Value])
|
||
VAR DS = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
RETURN IF(A IN {"RC","Region"} && DS = "County",BLANK(),A)
|
||
// SWITCH(SELECTEDVALUE(TD_EXTERNAL_DATA_SOURCE[SOURCENAME]),
|
||
// "CHPA",SELECTEDVALUE(Option_Geo[Value]),
|
||
// "Retail",SELECTEDVALUE(Option_Geo[Value]),
|
||
// BLANK()
|
||
// )
|
||
displayFolder: OLD\Others
|
||
lineageTag: a76e46cb-5f49-4baf-897e-fb687b0127cf
|
||
|
||
measure 'RetailTotal.Value.LY.MTH' = CALCULATE(SUM(Fact_Retail_Total[KPI_VAL_LY]),Fact_Retail_Total[KPI_NAME] = "corp_type_sales_amount")
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 1f8e468f-0671-417f-af7b-504b3c0318d9
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'RetailTotal.Unit.MTH' = CALCULATE(SUM(Fact_Retail[KPI_VOL]),Fact_Retail[KPI_NAME] = "sales_amount")
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: b8f0e567-2740-4de5-9cb4-b03328c4f97b
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'RetailTotal.Unit.LY.MTH' = CALCULATE(SUM(Fact_Retail[KPI_VOL_LY]),Fact_Retail[KPI_NAME] = "sales_amount")
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 74677414-9f84-4eac-9fb8-40269719abfe
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'RetailTotal.Sales.MTH' = ```
|
||
|
||
SWITCH([External.SelectUnit],
|
||
"RMB",[RetailTotal.Value.MTH],
|
||
"K RMB",DIVIDE([RetailTotal.Value.MTH],1000),
|
||
"M RMB",DIVIDE([RetailTotal.Value.MTH],1000000),
|
||
"USD",DIVIDE([RetailTotal.Value.MTH],[ExchangeRate]),
|
||
"K USD",DIVIDE(DIVIDE([RetailTotal.Value.MTH],[ExchangeRate]),1000),
|
||
"M USD",DIVIDE(DIVIDE([RetailTotal.Value.MTH],[ExchangeRate]),1000000)
|
||
// 7,[ExternalTotal.Unit.LY.MTH],
|
||
// 8,DIVIDE([ExternalTotal.Unit.LY.MTH],1000),
|
||
// 9,DIVIDE([ExternalTotal.Unit.LY.MTH],1000000),
|
||
// 10,[ExternalTotal.CountingUnit.LY.MTH],
|
||
// 11,DIVIDE([ExternalTotal.CountingUnit.LY.MTH],1000),
|
||
// 12,DIVIDE([ExternalTotal.CountingUnit.LY.MTH],1000000),
|
||
// 13,[ExternalTotal.PDOT.LY.MTH],
|
||
// 14,DIVIDE([ExternalTotal.PDOT.LY.MTH],1000),
|
||
// 15,DIVIDE([ExternalTotal.PDOT.LY.MTH],1000000)
|
||
)
|
||
```
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 269cf4e3-b70a-4d8f-9f6c-582e8cb50d22
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'RetailTotal.Sales.LY.MTH' = ```
|
||
|
||
SWITCH([External.SelectUnit],
|
||
"RMB",[RetailTotal.Value.LY.MTH],
|
||
"K RMB",DIVIDE([RetailTotal.Value.LY.MTH],1000),
|
||
"M RMB",DIVIDE([RetailTotal.Value.LY.MTH],1000000),
|
||
"USD",DIVIDE([RetailTotal.Value.LY.MTH],[ExchangeRate]),
|
||
"K USD",DIVIDE(DIVIDE([RetailTotal.Value.LY.MTH],[ExchangeRate]),1000),
|
||
"M USD",DIVIDE(DIVIDE([RetailTotal.Value.LY.MTH],[ExchangeRate]),1000000)
|
||
// 7,[ExternalTotal.Unit.LY.MTH],
|
||
// 8,DIVIDE([ExternalTotal.Unit.LY.MTH],1000),
|
||
// 9,DIVIDE([ExternalTotal.Unit.LY.MTH],1000000),
|
||
// 10,[ExternalTotal.CountingUnit.LY.MTH],
|
||
// 11,DIVIDE([ExternalTotal.CountingUnit.LY.MTH],1000),
|
||
// 12,DIVIDE([ExternalTotal.CountingUnit.LY.MTH],1000000),
|
||
// 13,[ExternalTotal.PDOT.LY.MTH],
|
||
// 14,DIVIDE([ExternalTotal.PDOT.LY.MTH],1000),
|
||
// 15,DIVIDE([ExternalTotal.PDOT.LY.MTH],1000000)
|
||
)
|
||
```
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: bb6cd395-8940-48bd-905c-1837f9a6f595
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'RetailTotal.Sales.KPI' =
|
||
[RetailTotal.Sales.MTH]
|
||
// SWITCH([External.SelectTimeType],
|
||
// "MTH",[RetailTotal.Sales.MTH],
|
||
// "QTD",CALCULATE([RetailTotal.Sales.MTH],DATESQTD(TD_EXTERNAL_CALENDAR[DATE])),
|
||
// "YTD",CALCULATE([RetailTotal.Sales.MTH],DATESYTD(TD_EXTERNAL_CALENDAR[DATE]))
|
||
// )
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 2dccc2bb-cc57-4433-ab37-a2f93df41870
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'RetailTotal.Sales.LY.KPI' =
|
||
[RetailTotal.Sales.LY.MTH]
|
||
// SWITCH([External.SelectTimeType],
|
||
// "MTH",[RetailTotal.Sales.LY.MTH],
|
||
// "QTD",CALCULATE([RetailTotal.Sales.LY.MTH],DATESQTD(TD_EXTERNAL_CALENDAR[DATE])),
|
||
// "YTD",CALCULATE([RetailTotal.Sales.LY.MTH],DATESYTD(TD_EXTERNAL_CALENDAR[DATE]))
|
||
// )
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: f5c2939e-f59d-4504-b632-b078cc178e3d
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'RetailTotal.Gr%.KPI' = ```
|
||
|
||
// VAR DS = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
// VAR CY =
|
||
// SWITCH(TRUE(),
|
||
// DS IN{"CHPA","EC"},
|
||
// CALCULATE(AVERAGEX(VALUES(Dim_Calendar[YYYYMM]),[RetailTotal.Sales.KPI])),
|
||
|
||
// DS IN{"County","Retail","CHC","THC"},
|
||
// CALCULATE(AVERAGEX(VALUES(Dim_Calendar[YYYYMM]),[RetailTotal.Sales.KPI])))
|
||
// VAR LY =
|
||
// SWITCH(TRUE(),
|
||
// DS IN{"CHPA","EC"},
|
||
// CALCULATE([RetailTotal.Sales.KPI]/6, SAMEPERIODLASTYEAR(Dim_Calendar[DATE]))
|
||
// ,
|
||
// DS IN{"County","Retail","CHC","THC"},
|
||
// CALCULATE([RetailTotal.Sales.KPI]/2, SAMEPERIODLASTYEAR(Dim_Calendar[DATE]))
|
||
// )
|
||
|
||
// RETURN
|
||
// DIVIDE(CY-LY,LY)
|
||
|
||
|
||
DIVIDE([RetailTotal.Sales.KPI]-[RetailTotal.Sales.LY.KPI],[RetailTotal.Sales.LY.KPI])
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
// IF(
|
||
// DIVIDE(
|
||
// CALCULATE(AVERAGEX(VALUES(Dim_Calendar[YYYYMM]),[RetailTotal.Sales.KPI])),
|
||
// CALCULATE([RetailTotal.Sales.KPI]/6,SAMEPERIODLASTYEAR(Dim_Calendar[DATE])))-1
|
||
// =-1,BLANK(),
|
||
// DIVIDE(
|
||
// CALCULATE(AVERAGEX(VALUES(Dim_Calendar[YYYYMM]),[RetailTotal.Sales.KPI])),
|
||
// CALCULATE([RetailTotal.Sales.KPI]/6,SAMEPERIODLASTYEAR(Dim_Calendar[DATE])))-1
|
||
// )
|
||
```
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 37c328ab-0fcc-4a46-a43c-0182e27fefa6
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'RetailTotal.Value.Top' = CALCULATE(SUM(Fact_Retail[KPI_VAL]),Fact_Retail[KPI_NAME] = "top_corp_sales_amount")
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: d3134d77-713d-4f4c-95f0-ac513efe241e
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.ProvinceName.Label' = "Province:"
|
||
displayFolder: OLD\Others
|
||
lineageTag: 444d6fcc-d115-4000-984a-6e72cfa982f6
|
||
|
||
measure 'External.MSName.Label' = "MS%:"
|
||
displayFolder: OLD\Others
|
||
lineageTag: 5fad8b56-c3c9-429c-a789-eb65d4dac048
|
||
|
||
measure 'External.ΔMSName.Label' = "ΔMS%:"
|
||
displayFolder: OLD\Others
|
||
lineageTag: 90f830ca-89a6-4bdd-a828-97871d5ab266
|
||
|
||
measure 'External.GRName.Label' = "Gr%:"
|
||
displayFolder: OLD\Others
|
||
lineageTag: fb72fa73-c343-4f46-bbf7-b5d07b9c862a
|
||
|
||
measure 'Retail.Gr%.Top1Brand' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(MAX(Fact_Retail[KPI_VAL]),
|
||
Fact_Retail[KPI_NAME] = "top1_brand_gr",
|
||
Fact_Retail[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar )
|
||
)
|
||
displayFolder: OLD\2.1Top
|
||
lineageTag: 2b42b7ad-095a-4c82-927d-c8fe494efe0a
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Gr%.Top2Brand' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(MAX(Fact_Retail[KPI_VAL]),
|
||
Fact_Retail[KPI_NAME] = "top2_brand_gr",
|
||
Fact_Retail[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar )
|
||
)
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 7efd8f38-552b-41a9-8a1f-63508396ce15
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.incremental.Top1BrandName' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(MAX(Fact_Retail[STR_KPI_VAL]),
|
||
Fact_Retail[KPI_NAME] = "top1_incremental_brand",
|
||
Fact_Retail[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar )
|
||
)
|
||
displayFolder: OLD\2.1Top
|
||
lineageTag: dc40d807-9e29-4283-a190-fdaa3cd82fd4
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.incremental.Top2BrandName' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(MAX(Fact_Retail[STR_KPI_VAL]),
|
||
Fact_Retail[KPI_NAME] = "top2_incremental_brand",
|
||
Fact_Retail[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar )
|
||
)
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 8ee8e666-734c-42f5-ba9d-cfd6589c1242
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.incrementalGr%.Top1Brand' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(MAX(Fact_Retail[KPI_VAL]),
|
||
Fact_Retail[KPI_NAME] = "top1_incremental_gr",
|
||
Fact_Retail[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar ))
|
||
displayFolder: OLD\2.1Top
|
||
lineageTag: f134001a-3737-48dd-9d27-8066dc66efc3
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.incrementalGr%.Top2Brand' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(MAX(Fact_Retail[KPI_VAL]),
|
||
Fact_Retail[KPI_NAME] = "top2_incremental_gr",
|
||
Fact_Retail[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar ))
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: e2511d67-a8ce-41b6-b0e8-0c3e690a8171
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Rank.Top' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(SUM(Fact_Retail[KPI_VAL]),
|
||
Fact_Retail[KPI_NAME] = "top_corp_rank",
|
||
Fact_Retail[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar ))
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: dd503fea-9a6e-47cf-9a7c-490e6bdda462
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Unit.LY.MTH' = CALCULATE(SUM(Fact_Retail[KPI_VOL_LY]),Fact_Retail[KPI_NAME] = "top_corp_sales_amount")
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 20896c3d-dab7-4a9f-956a-c1b7aab9e629
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Unit.MTH' = CALCULATE(SUM(Fact_Retail[KPI_VOL]),Fact_Retail[KPI_NAME] = "top_corp_sales_amount")
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 4eeff077-1571-49b8-9674-f1b77eb276a4
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Value.LY.MTH' = CALCULATE(SUM(Fact_Retail[KPI_VAL_LY]),Fact_Retail[KPI_NAME] = "top_corp_sales_amount")
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 41213c4c-15d7-47bc-9fc9-9a303bcadf92
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Value.MTH' = CALCULATE(SUM(Fact_Retail[KPI_VAL]),Fact_Retail[KPI_NAME] = "top_corp_sales_amount")
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 90285b9b-bb38-4781-9c73-e1da756378d5
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Value.MTH.Market' = CALCULATE(SUM(Fact_Retail[KPI_VAL]),Fact_Retail[KPI_NAME] = "top_corp_sales_amount",Fact_Retail[TOTAL_FLAG] = "Y")
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 85525fab-4460-4665-84d6-e96c46f08836
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Value.Top' = CALCULATE(SUM(Fact_Retail[KPI_VAL]),Fact_Retail[KPI_NAME] = "top_corp_sales_amount")
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 51fe056e-3889-4796-aa91-59e35af2bca4
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Value.Top1BrandName' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(MAX(Fact_Retail[STR_KPI_VAL]),
|
||
Fact_Retail[KPI_NAME] = "top1_brand_val",
|
||
Fact_Retail[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar ))
|
||
displayFolder: OLD\2.1Top
|
||
lineageTag: 0618b652-b74a-49d6-a24c-cd051966db5e
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Value.Top2BrandName' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(MAX(Fact_Retail[STR_KPI_VAL]),
|
||
Fact_Retail[KPI_NAME] = "top2_brand_val",
|
||
Fact_Retail[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar ))
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 1e4a3885-0c73-41f8-8c02-2983beabe5b2
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'RetailDTP.BrandRank.Top' = CALCULATE(SUM(Fact_Retail[KPI_VAL]),Fact_Retail[KPI_NAME] = "dtp_top_corp_brand_rank")
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 9de19e83-136c-481a-96c4-d8f1e79057cd
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'RetailDTP.Value.Top' = CALCULATE(SUM(Fact_Retail[KPI_VAL]),Fact_Retail[KPI_NAME] = "dtp_top_corp_brand_sales_amount")
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 019e3a4b-7ab9-41d5-ab9c-1e04ed00cb76
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Value.Top.All' = CALCULATE([Retail.Value.Top],Fact_Retail[TOTAL_FLAG] = "Y")
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 43408aa9-2dc1-43f5-950e-280f30984238
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Value.Top.CV' = CALCULATE([Retail.Value.Top],Fact_Retail[TOTAL_FLAG] = "N")
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: cd860a5f-7c35-48a7-abde-50d2e878ad4d
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Rank.Top.All' = CALCULATE([Retail.Rank.Top],Fact_Retail[TOTAL_FLAG] = "Y",Fact_Retail[PACK_CODE] = "",Fact_Retail[DTP_FLAG] = 0)
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: a6636e14-75bd-4ed4-ad7a-471045a4311d
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Rank.Top.TA' =
|
||
|
||
IF(SELECTEDVALUE(Dim_MarketTA[TA]) = "ONCO",
|
||
CALCULATE (
|
||
[Retail.Rank.Top],
|
||
Fact_Retail[YTD] = "N",
|
||
Fact_Retail[DTP_FLAG] = 1,
|
||
Fact_Retail[PACK_CODE] = "",ALL(Dim_PackInfo),ALL(Dim_MarketTA[TA])
|
||
),
|
||
CALCULATE (
|
||
[Retail.Rank.Top],
|
||
Fact_Retail[YTD] = "N",
|
||
Fact_Retail[TOTAL_FLAG] = "N",
|
||
Fact_Retail[DTP_FLAG] = 0,
|
||
Fact_Retail[PACK_CODE] = "",ALL(Dim_PackInfo),
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_Retail[TA_SOURCE]
|
||
),ALL(Dim_MarketTA[TA])
|
||
))
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: a78b47f3-31f9-494b-9271-5bfa43763ab1
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Rank.DTP' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(SUM(Fact_Retail[KPI_VAL]),
|
||
Fact_Retail[KPI_NAME] = "top_corp_rank",
|
||
Fact_Retail[TOTAL_FLAG] = "N",
|
||
Fact_Retail[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar ))
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 871587ae-407f-4b24-9213-b8a2a6f29042
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Rank.KPI' =
|
||
|
||
SWITCH(TRUE(),
|
||
--默认显示的排名
|
||
NOT ISFILTERED(Dim_MarketTA) && NOT ISFILTERED(Dim_PackInfo) && NOT ISFILTERED(Dim_GeoGroup) && NOT ISFILTERED(Dim_Org),
|
||
CALCULATE([Retail.Rank.Top.All]),
|
||
--选择TA时的排名
|
||
ISFILTERED(Dim_MarketTA) && NOT ISFILTERED(Dim_PackInfo) && NOT ISFILTERED(Dim_GeoGroup) && NOT ISFILTERED(Dim_Org),
|
||
CALCULATE([Retail.Rank.Top.TA]),
|
||
BLANK()
|
||
)
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 14c8eb3e-ea36-4fb9-9907-591dc319a8c4
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Sales.MTH' = ```
|
||
|
||
SWITCH([External.SelectUnit],
|
||
"RMB",[Retail.Value.MTH],
|
||
"K RMB",DIVIDE([Retail.Value.MTH],1000),
|
||
"M RMB",DIVIDE([Retail.Value.MTH],1000000),
|
||
"USD",DIVIDE([Retail.Value.MTH],[ExchangeRate]),
|
||
"K USD",DIVIDE(DIVIDE([Retail.Value.MTH],[ExchangeRate]),1000),
|
||
"M USD",DIVIDE(DIVIDE([Retail.Value.MTH],[ExchangeRate]),1000000)
|
||
)
|
||
```
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: ad4cc318-74f4-4a19-acc1-64f73c6decd9
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.LY.KPI2.1' =
|
||
[External.Sales.LY.MTH2.1]
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:去年同期月度KPI
|
||
------KPI公式:根据所选单位,显示不同的月度KPI值
|
||
------备注:用于2.1,retail部分的值是直取
|
||
------创建时间:2024.5.15
|
||
------修改时间:2024.7.9
|
||
------修改内容:改为计算组的方式实现
|
||
----------------------------------------------------------------------------
|
||
displayFolder: 00Base\02_2.1\03
|
||
lineageTag: 13be0861-4ed5-43c4-9f29-1b1582e9da0a
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.KPI2.1' =
|
||
[External.Sales.MTH2.1]
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:月度KPI
|
||
------KPI公式:根据所选单位,显示不同的月度KPI值
|
||
------备注:用于特定的视觉对象,2.1相关视觉对象,因为retail部分的值是直取,无法通过最底层数据汇总。
|
||
------创建时间:2024.5.15
|
||
------修改时间:2024.6.9
|
||
------修改内容:改为计算组的方式实现
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0
|
||
displayFolder: 00Base\02_2.1\03
|
||
lineageTag: 0fbfad8c-dd72-4114-b288-bd1bfeb84f98
|
||
|
||
measure 'External.Sales.MTH2.1' = ```
|
||
VAR DS = [00.SOURCENAME]
|
||
VAR DW_TYPE = SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
|
||
VAR _DW = SELECTEDVALUE ( Dim_Unit[DW] )
|
||
RETURN
|
||
SWITCH (
|
||
TRUE ( ),
|
||
//Retail
|
||
DS = "Retail" && DW_TYPE = "Value" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org )
|
||
&& NOT ISFILTERED ( Dim_Geo ),
|
||
CALCULATE (
|
||
Switch_Unit_Value ( _DW, [00.DirectRetail.national_corp_rank] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Corp[CORP_COD] ),
|
||
Fact_Direct_Retail_national_corp_rank[corp_cod]
|
||
)
|
||
),
|
||
-------------------------------------------------EC--------------------------------------------
|
||
-------------------------------选择EC,且没选择其他维度-------------
|
||
DS = "EC" && ISFILTERED ( Dim_Corp )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Sales.MTH],
|
||
Fact_EC[TA] = "",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
DS = "EC" && ISFILTERED ( Dim_Corp )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Sales.MTH],
|
||
Fact_EC[TA] = "",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
DS = "EC" && ISFILTERED ( Dim_Corp )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Sales.MTH],
|
||
Fact_EC[TA] = "",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方"
|
||
),
|
||
DS = "EC" && ISFILTERED ( Dim_Corp )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Sales.MTH],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[TA] = ""
|
||
),
|
||
--选择其他TA+公司时的金额
|
||
DS = "EC" && ISFILTERED ( Dim_Corp )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA[TA] )
|
||
&& NOT ISFILTERED ( Dim_Market[MARKET] )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Sales.MTH],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
//ALL(Dim_PackInfo),
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
DS = "EC" && ISFILTERED ( Dim_Corp )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA[TA] )
|
||
&& NOT ISFILTERED ( Dim_Market[MARKET] )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Sales.MTH],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
//ALL(Dim_PackInfo),
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
DS = "EC" && ISFILTERED ( Dim_Corp )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA[TA] )
|
||
&& NOT ISFILTERED ( Dim_Market[MARKET] )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Sales.MTH],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
//ALL(Dim_PackInfo),
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
DS = "EC" && ISFILTERED ( Dim_Corp )
|
||
&& ISFILTERED ( Dim_MarketTA[TA] )
|
||
&& NOT ISFILTERED ( Dim_Market[MARKET] )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Sales.MTH],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
//ALL(Dim_PackInfo),
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
|
||
-- total hang
|
||
DS = "EC" && NOT ISFILTERED ( Dim_MarketTA[TA] )
|
||
&& NOT ISFILTERED ( Dim_Market[MARKET] )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ), [03.EC.Direct.Total2.1],
|
||
DS = "EC" && ISFILTERED ( Dim_MarketTA[TA] )
|
||
&& NOT ISFILTERED ( Dim_Market[MARKET] )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ), [03.EC.Direct.Total2.1.TA],
|
||
[External.Sales.MTH.MID]
|
||
)
|
||
/*---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:Value
|
||
------KPI公式:1、若只选了公司,其余维度没选(用户进来默认选项),显示公司在整个retail数据中的总量
|
||
2、若选择了TA是ONCO,且其余维度没有选择,取DTP_FLAG是1的数据;
|
||
3、若选择了TA,且TA不是ONCO,且其余维度没有选择,取TA+公司的数据。
|
||
|
||
------备注:1、DTP的数据不参与retail总计计算,其余外部渠道数据默认是0;
|
||
2、2.1的KPI是直取的,有另外一张事实表存放retail的相关KPI数据
|
||
------创建时间:2024.6.10
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------*/
|
||
```
|
||
displayFolder: 00Base\02_2.1\01
|
||
lineageTag: 0ab291ad-227d-41ed-bdc7-c9a906d92533
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.LY.MTH2.1' = ```
|
||
VAR DS = [00.SOURCENAME]
|
||
VAR DW_TYPE = SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
|
||
VAR _DW = SELECTEDVALUE ( Dim_Unit[DW] )
|
||
VAR Result =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
//Retail
|
||
DS = "Retail" && DW_TYPE = "Value" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org )
|
||
&& NOT ISFILTERED ( Dim_Geo ),
|
||
CALCULATE (
|
||
Switch_Unit_Value ( _DW, [00.DirectRetail.national_corp_rank.LY] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Corp[CORP_COD] ),
|
||
Fact_Direct_Retail_national_corp_rank[corp_cod]
|
||
)
|
||
),
|
||
-------------------------------------------------EC--------------------------------------------
|
||
-------------------------------选择EC,且没选择其他维度-------------
|
||
DS = "EC" && ISFILTERED ( Dim_Corp )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Sales.LY.MTH],
|
||
Fact_EC[TA] = "",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
DS = "EC" && ISFILTERED ( Dim_Corp )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Sales.LY.MTH],
|
||
Fact_EC[TA] = "",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
DS = "EC" && ISFILTERED ( Dim_Corp )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Sales.LY.MTH],
|
||
Fact_EC[TA] = "",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方"
|
||
),
|
||
DS = "EC" && ISFILTERED ( Dim_Corp )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Sales.LY.MTH],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[TA] = ""
|
||
),
|
||
--选择其他TA+公司时的金额
|
||
DS = "EC" && ISFILTERED ( Dim_Corp )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA[TA] )
|
||
&& NOT ISFILTERED ( Dim_Market[MARKET] )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Sales.LY.MTH],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
//ALL(Dim_PackInfo),
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
DS = "EC" && ISFILTERED ( Dim_Corp )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA[TA] )
|
||
&& NOT ISFILTERED ( Dim_Market[MARKET] )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Sales.LY.MTH],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
//ALL(Dim_PackInfo),
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
DS = "EC" && ISFILTERED ( Dim_Corp )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA[TA] )
|
||
&& NOT ISFILTERED ( Dim_Market[MARKET] )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Sales.LY.MTH],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
//ALL(Dim_PackInfo),
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
DS = "EC" && ISFILTERED ( Dim_Corp )
|
||
&& ISFILTERED ( Dim_MarketTA[TA] )
|
||
&& NOT ISFILTERED ( Dim_Market[MARKET] )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Sales.LY.MTH],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
//ALL(Dim_PackInfo),
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
|
||
-- total hang
|
||
DS = "EC" && NOT ISFILTERED ( Dim_MarketTA[TA] )
|
||
&& NOT ISFILTERED ( Dim_Market[MARKET] )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ), [03.EC.Direct.Total2.1.LY],
|
||
DS = "EC" && ISFILTERED ( Dim_MarketTA[TA] )
|
||
&& NOT ISFILTERED ( Dim_Market[MARKET] )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ), [03.EC.Direct.Total2.1.TA.LY],
|
||
[External.Sales.LY.MTH.MID]
|
||
)
|
||
RETURN
|
||
IF ( [External.Sales.KPI2.1] <> BLANK ( ), Result )
|
||
/*---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:Value
|
||
------KPI公式:1、若只选了公司,其余维度没选(用户进来默认选项),显示公司在整个retail数据中的总量
|
||
2、若选择了TA是ONCO,且其余维度没有选择,取DTP_FLAG是1的数据;
|
||
3、若选择了TA,且TA不是ONCO,且其余维度没有选择,取TA+公司的数据。
|
||
|
||
------备注:1、DTP的数据不参与retail总计计算,其余外部渠道数据默认是0;
|
||
2、2.1的KPI是直取的,有另外一张事实表存放retail的相关KPI数据
|
||
------创建时间:2024.6.10
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------*/
|
||
```
|
||
displayFolder: 00Base\02_2.1\01
|
||
lineageTag: f715e9ce-076e-4748-a238-612e59677cb8
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Gr%.KPI2.1' =
|
||
VAR CV = [External.Sales.KPI2.1]
|
||
VAR PV = [External.Sales.LY.KPI2.1]
|
||
RETURN
|
||
IF ( PV <> BLANK ( ), DIVIDE ( CV - PV, PV ) )
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:Gr%
|
||
------KPI公式:(今年产品销量-去年产品销量)/去年产品销量
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------)
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: 00Base\02_2.1
|
||
lineageTag: f7d6f09b-a271-4d5a-82d3-90360ddc6656
|
||
|
||
measure 'External.RQGR%.KPI2.1' = ```
|
||
VAR CV =
|
||
CALCULATE ( [External.Sales.KPI2.1], MQY[Period] = "QTDAvg" )
|
||
VAR PV =
|
||
CALCULATE (
|
||
CALCULATE (
|
||
[External.Sales.KPI2.1],
|
||
PREVIOUSQUARTER ( ENDOFQUARTER ( Dim_Calendar[DATE] ) )
|
||
),
|
||
MQY[Period] = "QTDAvg"
|
||
)
|
||
RETURN
|
||
IF ( CV <> BLANK ( ), DIVIDE ( CV - PV, PV ) )
|
||
/*---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:季度增长率
|
||
------KPI公式:(所选月份季度月平均值 - 上季度月平均值) / 上季度月平均值
|
||
|
||
------备注:用于特定的视觉对象2.1,因为其原生kpi值是直取的
|
||
------创建时间:2024.6.10
|
||
------修改时间:2024.7.9
|
||
------修改内容:调整算法,改为计算组的方式实现
|
||
----------------------------------------------------------------------------*/
|
||
```
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: 00Base\02_2.1
|
||
lineageTag: 2f5cb575-8a7a-49ce-a601-94bf732b534d
|
||
|
||
measure 'External.MS%.KPI2.1' =
|
||
DIVIDE (
|
||
[External.Sales.KPI2.1],
|
||
[External.Sales.KPI.Market2.1]
|
||
)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:MS%:产品销量占市场销量的占比
|
||
------KPI公式:今年产品销量/市场销量
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: 00Base\02_2.1
|
||
lineageTag: c04d966d-ad71-4ddf-b6ab-83b1552f1e98
|
||
|
||
measure 'External.MS%.LY.KPI2.1' =
|
||
DIVIDE([External.Sales.LY.KPI2.1],[External.Sales.LY.KPI.Market2.1])
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:MS%:去年同期产品销量占去年同期市场销量的占比
|
||
------KPI公式:去年同期产品销量/去年同期市场销量
|
||
------备注:用于计算2.1的ΔMS%值
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
displayFolder: OLD\中间KPI
|
||
lineageTag: 7de61fd3-7ebb-4783-925a-166f490caf7e
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.△MS%.KPI2.1' =
|
||
|
||
VAR CV = [External.MS%.KPI2.1]
|
||
VAR PV = [External.MS%.LY.KPI2.1]
|
||
RETURN
|
||
IF(PV <> BLANK (),
|
||
CV - PV)
|
||
|
||
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:△MS%值
|
||
------KPI公式:
|
||
------备注:因为retail的数据直取,因此针对于2.1视觉对象的相关kpi,不能使用原来的kpi,需要重新写一套
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\特定视觉对象使用KPI2.1
|
||
lineageTag: 10a58fb6-0805-4e84-a4b0-02ef2cff7c62
|
||
|
||
measure 'External.EI.KPI2.1' =
|
||
|
||
//IF(ROUND([External.Sales.LY.KPI2.1],0) = 0 || ROUND([External.Sales.LY.KPI.Market2.1],0) = 0,BLANK(),
|
||
DIVIDE (
|
||
DIVIDE ( [External.Sales.KPI2.1], [External.Sales.LY.KPI2.1] ),
|
||
DIVIDE ( [External.Sales.KPI.Market2.1], [External.Sales.LY.KPI.Market2.1] )
|
||
) * 100//)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:EI
|
||
------KPI公式:(今年产品销量/去年销量)/(今年市场销量/去年市场销量) * 100
|
||
------备注:因为retail的数据直取,因此针对于2.1视觉对象的相关kpi,不能使用原来的kpi,需要重新写一套
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0
|
||
displayFolder: OLD\特定视觉对象使用KPI2.1
|
||
lineageTag: 0422bc80-561f-45af-a472-add554a56cb0
|
||
|
||
measure 'External.SelectCountingUnitMKTRatio' = ```
|
||
1//SELECTEDVALUE( 'Dim_MKTPackMapping'[COUNTINGUNIT_MARKET_RATIO],1 )
|
||
---目前COUNTINGUNIT逻辑已经在dbr做逻辑了
|
||
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 78a4fae7-69ca-4014-b373-178c50088554
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.KPI.Market2.1' =
|
||
VAR DS = [00.SOURCENAME]
|
||
VAR DW_TYPE = SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
|
||
VAR _DW = SELECTEDVALUE ( Dim_Unit[DW] )
|
||
RETURN
|
||
SWITCH (
|
||
TRUE ( ),
|
||
//Retail
|
||
DS = "Retail" && DW_TYPE = "Value" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE ( Switch_Unit_Value ( _DW, [01.DirectRetail.rx_market.Sales.Total] ) ),
|
||
//EC
|
||
DS = "EC" && DW_TYPE = "Value" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ), [03.EC.Direct.Total2.1],
|
||
DS = "EC" && DW_TYPE = "Value" && NOT ISFILTERED ( Dim_Market )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ), [03.EC.Direct.Total2.1.TA],
|
||
CALCULATE (
|
||
[External.Sales.KPI.Market.MID],
|
||
ALL ( Dim_PackInfo ),
|
||
ALL ( Dim_Corp ),
|
||
ALL ( Dim_Class ),
|
||
ALL ( Dim_KeyCompetitor ),
|
||
ALL ( Dim_Dept ),
|
||
ALL ( Dim_CoreDept[CORE_DEPT] )
|
||
)
|
||
)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:市场金额
|
||
------KPI公式:
|
||
------备注:用于2.1,retail部分的值是直取的
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
displayFolder: 00Base\02_2.1\04
|
||
lineageTag: 6eefa808-4f5e-440e-be8b-9be762eaea64
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.LY.KPI.Market2.1' =
|
||
VAR DS = [00.SOURCENAME]
|
||
VAR DW_TYPE = SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
|
||
VAR _DW = SELECTEDVALUE ( Dim_Unit[DW] )
|
||
RETURN
|
||
SWITCH (
|
||
TRUE ( ),
|
||
//Retail
|
||
DS = "Retail" && DW_TYPE = "Value" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE ( Switch_Unit_Value ( _DW, [01.DirectRetail.rx_market.Sales.Total.LY] ) ),
|
||
//EC
|
||
DS = "EC" && DW_TYPE = "Value" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ), [03.EC.Direct.Total2.1.LY],
|
||
DS = "EC" && DW_TYPE = "Value" && NOT ISFILTERED ( Dim_Market )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ), [03.EC.Direct.Total2.1.TA.LY],
|
||
CALCULATE (
|
||
[External.Sales.LY.KPI.Market.MID],
|
||
ALL ( Dim_PackInfo ),
|
||
ALL ( Dim_Corp ),
|
||
ALL ( Dim_Class ),
|
||
ALL ( Dim_KeyCompetitor ),
|
||
ALL ( Dim_Dept ),
|
||
ALL ( Dim_CoreDept[CORE_DEPT] )
|
||
)
|
||
)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:市场金额
|
||
------KPI公式:
|
||
------备注:用于2.1,retail部分的值是直取的
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
displayFolder: 00Base\02_2.1\04
|
||
lineageTag: e2fab734-0f98-4ebe-9c9b-1c1f39796178
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'RetailTotal.Rank.Top' =
|
||
|
||
VAR YM =
|
||
MAX ( Dim_Calendar[YYYYMM] )
|
||
RETURN
|
||
CALCULATE (
|
||
SUM ( Fact_Retail_Total[KPI_VAL] ),
|
||
Fact_Retail_Total[KPI_NAME] = "top_corp_rank",
|
||
Fact_Retail_Total[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar )
|
||
)
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: f50fee8d-8b82-40cf-829e-8bcde957224f
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'RetailTotal.Rank.Top.TA' =
|
||
CALCULATE (
|
||
[RetailTotal.Rank.Top],
|
||
Fact_Retail_Total[TOTAL_FLAG] = "N",
|
||
Fact_Retail_Total[DTP_FLAG] = 0,
|
||
ALL ( Dim_PackInfo_Total ),
|
||
KEEPFILTERS ( Dim_Corp[CORP_DES] = "ASTRAZENECA" ),
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA_Total[TA_SOURCE] ),
|
||
Fact_Retail_Total[TA_SOURCE]
|
||
)
|
||
)
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 6fb09e1f-ab7f-4daf-b71c-5f4b94b043b7
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'RetailTotal.Rank.Top.All' =
|
||
|
||
CALCULATE (
|
||
[RetailTotal.Rank.Top],
|
||
Fact_Retail_Total[TOTAL_FLAG] = "Y",
|
||
Fact_Retail_Total[DTP_FLAG] = 0
|
||
)
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 90cc01a9-867e-4b41-80a5-794d49a7d567
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Rank.Top.PackAll' = CALCULATE([Retail.Rank.Top],Fact_Retail[TOTAL_FLAG] = "Y",Fact_Retail[DTP_FLAG] = 0)
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: a5580f37-5f81-4171-8cba-5260c2127383
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Rank.Top.PackTA' =
|
||
|
||
IF(SELECTEDVALUE(Dim_MarketTA[TA]) = "ONCO",
|
||
CALCULATE (
|
||
[Retail.Rank.Top],
|
||
Fact_Retail[YTD] = "N",
|
||
Fact_Retail[DTP_FLAG] = 1
|
||
),
|
||
CALCULATE (
|
||
[Retail.Rank.Top],
|
||
Fact_Retail[YTD] = "N",
|
||
Fact_Retail[TOTAL_FLAG] = "N",
|
||
Fact_Retail[DTP_FLAG] = 0
|
||
)
|
||
)
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: bdfadcca-e02c-43ca-9b5d-03d3fd30d255
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.SelectRegionMKTRatio' = 1//SELECTEDVALUE ( 'Dim_RC'[REGION_RATIO], 1 )
|
||
displayFolder: OLD\Others
|
||
lineageTag: 8c52d65f-c9d4-49e8-a683-da302bd58e81
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.KPI3.1' = ```
|
||
--[External.Value.MID]
|
||
VAR DS =
|
||
SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||
RETURN
|
||
SWITCH (
|
||
TRUE (),
|
||
DS = "Retail"
|
||
&& NOT ISFILTERED (Dim_PackInfo)
|
||
&& NOT ISFILTERED (Dim_MarketTA)
|
||
&& NOT ISFILTERED (Dim_Market)
|
||
&& NOT ISFILTERED (Dim_Corp)
|
||
&& NOT ISFILTERED (Dim_BrandDefaultMKT)
|
||
&& NOT ISFILTERED (Dim_Class[CLASS])
|
||
&& NOT ISFILTERED (Dim_Org)
|
||
&& NOT ISFILTERED (Dim_Geo),BLANK(),
|
||
|
||
[External.Sales.KPI]
|
||
)
|
||
|
||
/*---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:产品销量
|
||
------KPI公式:若外部渠道是retail,其余维度没有选择,则显示全国的值,非全国的值不显示,其余渠道的数据按之前的逻辑显示。
|
||
|
||
------备注:
|
||
------创建时间:2024.6.10
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------*/
|
||
```
|
||
formatString: #,0
|
||
displayFolder: OLD\特定视觉对象使用KPI3.12
|
||
lineageTag: b457f227-9541-47fc-ae7f-9051fa450b3d
|
||
|
||
measure 'External.Sales.LY.KPI3.1' = ```
|
||
|
||
VAR DS =
|
||
SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||
RETURN
|
||
SWITCH (
|
||
TRUE (),
|
||
DS = "Retail"
|
||
&& NOT ISFILTERED (Dim_PackInfo)
|
||
&& NOT ISFILTERED (Dim_MarketTA)
|
||
&& NOT ISFILTERED (Dim_Market)
|
||
&& NOT ISFILTERED (Dim_Corp)
|
||
&& NOT ISFILTERED (Dim_BrandDefaultMKT)
|
||
&& NOT ISFILTERED (Dim_Class[CLASS])
|
||
&& NOT ISFILTERED (Dim_Org)
|
||
&& NOT ISFILTERED (Dim_Geo),BLANK(),
|
||
|
||
[External.Sales.LY.KPI]
|
||
)
|
||
|
||
/*---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:去年同期产品销量
|
||
------KPI公式:若外部渠道是retail,其余维度没有选择,则显示全国的值,非全国的值不显示,其余渠道的数据按之前的逻辑显示。
|
||
|
||
------备注:
|
||
------创建时间:2024.6.10
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------*/
|
||
```
|
||
displayFolder: OLD\中间KPI
|
||
lineageTag: ce22259b-4fe5-4e64-bfd4-4bd41537bdec
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.KPI.Market3.1' = ```
|
||
|
||
VAR A = [External.MKTPack.Count]
|
||
RETURN
|
||
IF (
|
||
A <> BLANK (),
|
||
CALCULATE (
|
||
[External.Sales.KPI.Market.MID],
|
||
ALL ( Dim_PackInfo ),
|
||
ALL ( Dim_Class ),
|
||
ALL ( Dim_Corp ),
|
||
ALL ( Dim_KeyCompetitor ),
|
||
ALL ( Dim_Dept ),
|
||
ALL ( Dim_CoreDept[CORE_DEPT] )
|
||
)
|
||
)
|
||
|
||
/*---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:市场销量
|
||
------KPI公式:除了市场维度,不受其余维度影响
|
||
|
||
------备注:
|
||
------创建时间:2024.6.10
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------*/
|
||
```
|
||
formatString: #,0
|
||
displayFolder: OLD\特定视觉对象使用KPI3.12
|
||
lineageTag: cccd2feb-42d2-4515-b2ae-58f534442bba
|
||
|
||
measure 'External.EI.KPI3.1' =
|
||
|
||
VAR A = [External.Gr%.KPI3.1]
|
||
VAR B = [External.Gr%.KPI.Market3.1]
|
||
RETURN IF(A <> BLANK(),DIVIDE(1+A,1+B)*100)
|
||
// DIVIDE (
|
||
// DIVIDE ( [External.Sales.KPI3.1], [External.Sales.LY.KPI3.1] ),
|
||
// DIVIDE ( [External.Sales.KPI.Market3.1], [External.Sales.LY.KPI.Market3.1] )
|
||
// ) * 100//)
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:EI
|
||
------KPI公式:(今年产品销量/去年销量)/(今年市场销量/去年市场销量) * 100
|
||
------备注:1、因为retail的数据直取,因此针对于3.1视觉对象的相关kpi,不能使用原来的kpi,需要重新写一套
|
||
------ 2、业务要求,retail进来默认显示全国,因为retail只买了部分到省份的数据,若不控制,显示的是这些到省份的数据,值不对。
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: 0
|
||
displayFolder: OLD\特定视觉对象使用KPI3.12
|
||
lineageTag: 05f45221-575d-484c-b0ae-a09c22d2418f
|
||
|
||
measure 'External.Sales.LY.KPI.Market3.1' =
|
||
|
||
VAR A = [External.MKTPack.Count]
|
||
RETURN
|
||
IF (
|
||
A <> BLANK (),
|
||
CALCULATE (
|
||
[External.Sales.LY.KPI.Market.MID],
|
||
ALL ( Dim_PackInfo ),
|
||
ALL ( Dim_Class ),
|
||
ALL ( Dim_Corp ),
|
||
ALL ( Dim_KeyCompetitor ),
|
||
ALL ( Dim_Dept ),
|
||
ALL ( Dim_CoreDept[CORE_DEPT] )
|
||
)
|
||
)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:市场金额
|
||
------KPI公式:
|
||
------备注:用于3.1,retail部分的值是直取的
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0
|
||
displayFolder: OLD\中间KPI
|
||
lineageTag: c0b97921-5ed4-4262-b0ad-182a82644d00
|
||
|
||
measure 'External.△MS%.KPI3.1' =
|
||
|
||
VAR CV = [External.MS%.KPI3.1]
|
||
VAR PV = [External.MS%.LY.KPI3.1]
|
||
RETURN
|
||
IF(PV <> BLANK (),
|
||
CV - PV)
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:△MS%值
|
||
------KPI公式:
|
||
------备注:1、因为retail的数据直取,因此针对于3.1视觉对象的相关kpi,不能使用原来的kpi,需要重新写一套
|
||
------ 2、业务要求,retail进来默认显示全国,因为retail只买了部分到省份的数据,若不控制,显示的是这些到省份的数据,值不对。
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\特定视觉对象使用KPI3.12
|
||
lineageTag: 0746119f-2e04-4b39-90c7-6aaa83d6da84
|
||
|
||
measure 'External.Gr%.KPI3.1' =
|
||
|
||
VAR CV = [External.Sales.KPI3.1]
|
||
VAR PV = [External.Sales.LY.KPI3.1]
|
||
RETURN
|
||
IF(PV <> BLANK(),DIVIDE(CV-PV,PV))
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:产品同比增长率
|
||
------KPI公式:(今年产品销量-去年产品销量)/去年产品销量
|
||
------备注:用于3.1、3.2,用户要求retail进来只看到全国,只有选择具体的产品,才显示产品下省份的数据
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\特定视觉对象使用KPI3.12
|
||
lineageTag: ecb441fd-d680-48db-b519-1c35fc8430ab
|
||
|
||
measure 'External.MS%.KPI3.1' = ```
|
||
DIVIDE([External.Sales.KPI3.1],[External.Sales.KPI.Market3.1])
|
||
// SWITCH(TRUE(),//SELECTEDVALUE(Dim_Org[rc_name_en],BLANK())=BLANK()&&[External.EI.KPI3.1]<>BLANK(),1,
|
||
|
||
// SELECTEDVALUE(Dim_DataSource[SOURCENAME])="Retail"&&SELECTEDVALUE(Dim_Org[rc_name_en])="ROC"&&(SELECTEDVALUE(Dim_Market[MARKET])="NIAD (Non-Insulin Anti-Diabetic) Market"||SELECTEDVALUE(Dim_Market[MARKET])="Inhaled Extended Market by Brand") &&NOT ISFILTERED(Dim_PackInfo),1,
|
||
|
||
// DIVIDE([External.Sales.KPI3.1],[External.Sales.KPI.Market3.1]))
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:MS%:产品销量占市场销量的占比
|
||
------KPI公式:今年产品销量/市场销量
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------)))
|
||
```
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\特定视觉对象使用KPI3.12
|
||
lineageTag: 4a0ac15b-ab50-4818-a718-e470c1a8e70c
|
||
|
||
measure 'External.MS%.LY.KPI3.1' =
|
||
DIVIDE([External.Sales.LY.KPI3.1],[External.Sales.LY.KPI.Market3.1])
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:MS%:去年同期产品销量占去年同期市场销量的占比
|
||
------KPI公式:去年同期产品销量/去年同期市场销量
|
||
------备注:用于计算3.1的ΔMS%值
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
displayFolder: OLD\中间KPI
|
||
lineageTag: 1d6b19a6-f8cc-4d5c-8da3-b1489b257aef
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Gr%.KPI.Market3.1' =
|
||
|
||
VAR CV = [External.Sales.KPI.Market3.1]
|
||
VAR PV = [External.Sales.LY.KPI.Market3.1]
|
||
RETURN
|
||
IF(PV <> BLANK(),DIVIDE(CV-PV,PV))
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:市场同比增长率
|
||
------KPI公式:(今年市场销量-去年市场销量)/去年市场销量
|
||
------备注:用于3.1、3.2,用户要求retail进来只看到全国,只有选择具体的产品,才显示产品下省份的数据
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\特定视觉对象使用KPI3.12
|
||
lineageTag: b3559bfb-876f-40e2-a627-36cce31e06fc
|
||
|
||
measure 'External.△MS%.KPI.Mol' =
|
||
VAR CV = [External.MS%.KPI.Mol]
|
||
VAR PV = [External.MS%.LY.KPI.Mol]
|
||
RETURN
|
||
CV - PV
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI公式:今年产品占分子式的占比-去年产品占分子式的占比
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\△MS%
|
||
lineageTag: 171837f2-c067-4146-bf38-14787b14e994
|
||
|
||
measure 'External.2.1.Text' = ```
|
||
|
||
VAR R = ""
|
||
// 请先选择具体市场。
|
||
// 仅NIAD及Inhaled Extended Market可查看省份公司排名。"
|
||
// VAR C = "请先选择具体市场。
|
||
// 若不选市场,数据代表以下4个TA的表现:CV+DM+GI+RE Market"
|
||
VAR T = "2025年THC仅有全国数据,THC省份历史数据请至Free Report中查看"
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
SELECTEDVALUE(Dim_DataSource[SOURCENAME]) = "Retail",R,
|
||
// SELECTEDVALUE(Dim_DataSource[SOURCENAME]) = "CHC",C,
|
||
SELECTEDVALUE(Dim_DataSource[SOURCENAME]) = "THC",T
|
||
)
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: fc14a8c3-8bd4-4a04-a6ed-c9f7ac0735ef
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.1.3.Text' = ```
|
||
|
||
VAR A = ""
|
||
// "THC 2024年采买半年度数据,Market Trend曲线中最后一期为24H1 MS%"
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
ISFILTERED(Dim_DataSource) && "THC" IN VALUES(Dim_DataSource[SOURCENAME]),A
|
||
)
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 52e8b1cb-07db-422c-b8ff-86530cbbc810
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Trend.KPI2.2' = ```
|
||
|
||
IF([External.Sales.KPI2.1] <> BLANK(),
|
||
SWITCH([IMSRankedBy.Value],
|
||
"GR%", [External.Gr%.KPI2.1],
|
||
"GRVal", [External.GRSales.KPI2.1],
|
||
"MS%", [External.MS%.KPI2.1],
|
||
"ΔMS%", [External.△MS%.KPI2.1],
|
||
//else
|
||
[External.Sales.KPI2.1]
|
||
))
|
||
```
|
||
formatString: #,0.00%;-#,0.00%;#,0.00%
|
||
displayFolder: OLD\特定视觉对象使用KPI2.2
|
||
lineageTag: 7235cd42-3054-480b-867f-7ff47c103660
|
||
|
||
measure 'External.GRSales.KPI2.1' =
|
||
|
||
VAR CV = [External.Sales.KPI2.1]
|
||
VAR PV = [External.Sales.LY.KPI2.1]
|
||
RETURN
|
||
IF(CV <> BLANK(),CV-PV)
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:增长金额
|
||
------KPI公式:今年销量-去年同期销量
|
||
------备注:用于2.1
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
displayFolder: OLD\特定视觉对象使用KPI2.2
|
||
lineageTag: 3ffabba1-31ab-40c5-85c2-823fcb4c078b
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.KPI.Trend2.2' = ```
|
||
|
||
IF([External.Sales.KPI2.1]<>BLANK() && [External.Rank.KPI2.1]<=[Top Value] && [External.Rank.KPI2.1]<>BLANK() ,
|
||
IF([Trend_Is_In_DateRange]>0,
|
||
CALCULATE(
|
||
[External.Trend.KPI2.2],
|
||
REMOVEFILTERS(Dim_Calendar),
|
||
REMOVEFILTERS(Dim_Calendar_Alt),
|
||
TREATAS(VALUES(Dim_Calendar_Alt[YYYYMM]),Dim_Calendar[YYYYMM]),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
)
|
||
)
|
||
```
|
||
displayFolder: OLD\特定视觉对象使用KPI2.2
|
||
lineageTag: c6d7df5c-cfd8-4426-b882-d846d1070ce5
|
||
|
||
formatStringDefinition =
|
||
SWITCH([IMSRankedBy.Value],
|
||
"MS%", "#,0.0%",
|
||
"GR%", "#,0%",
|
||
"#,#"
|
||
)
|
||
|
||
measure 'External.Sales.KPI.Trend.Q2.2' = ```
|
||
|
||
IF([External.Sales.KPI2.1]<>BLANK() && [External.Rank.KPI2.1]<=[Top Value] && [External.Rank.KPI2.1]<>BLANK(),
|
||
IF([Trend_Is_In_DateRange.Q]>0,
|
||
CALCULATE(
|
||
[External.Trend.KPI2.2],
|
||
REMOVEFILTERS(Dim_Calendar),
|
||
REMOVEFILTERS(Dim_Calendar_Alt),
|
||
TREATAS(VALUES(Dim_Calendar_Alt[YYYYMM]),Dim_Calendar[YYYYMM]),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
)
|
||
)
|
||
```
|
||
displayFolder: OLD\特定视觉对象使用KPI2.2
|
||
lineageTag: 281ae276-d059-4864-a285-8b55f15bdf3e
|
||
|
||
formatStringDefinition =
|
||
SWITCH([IMSRankedBy.Value],
|
||
"MS%", "#,0.0%",
|
||
"GR%", "#,0%",
|
||
"#,#"
|
||
)
|
||
|
||
measure 'External.Sales.LY.KPI.Market.MID' =
|
||
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
|
||
)
|
||
RETURN
|
||
SWITCH (
|
||
TRUE ( ),
|
||
DS1 = "Retail(Quarterly)" && ISFILTERED ( Dim_Geo )
|
||
&& MKT_FLAG = 2,
|
||
BLANK ( ),
|
||
ISFILTERED ( Config_PageFlag_FreeReportNIAD ), [Retail.NIAD.Sales.LY],
|
||
[External.Sales.LY.MTH]
|
||
)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:去年同期月度KPI
|
||
------KPI公式:根据所选单位,显示不同的月度KPI值
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
displayFolder: OLD\中间KPI
|
||
lineageTag: cf712216-772f-4983-b2e4-ee6b1e557c82
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.KPI.Market.MID' =
|
||
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
|
||
)
|
||
RETURN
|
||
SWITCH (
|
||
TRUE ( ),
|
||
DS1 = "Retail(Quarterly)" && ISFILTERED ( Dim_Geo )
|
||
&& MKT_FLAG = 2,
|
||
BLANK ( ),
|
||
ISFILTERED ( Config_PageFlag_FreeReportNIAD ), [Retail.NIAD.Sales],
|
||
[External.Sales.MTH]
|
||
)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:去年同期月度KPI
|
||
------KPI公式:根据所选单位,显示不同的月度KPI值
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
displayFolder: OLD\中间KPI
|
||
lineageTag: b3a8ca9b-31f2-411d-86ae-8521377e39d9
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Sales.LY.MTH' = ```
|
||
|
||
SWITCH([External.SelectUnit],
|
||
"RMB",[Retail.Value.LY.MTH],
|
||
"K RMB",DIVIDE([Retail.Value.LY.MTH],1000),
|
||
"M RMB",DIVIDE([Retail.Value.LY.MTH],1000000),
|
||
"USD",DIVIDE([Retail.Value.LY.MTH],[ExchangeRate]),
|
||
"K USD",DIVIDE(DIVIDE([Retail.Value.LY.MTH],[ExchangeRate]),1000),
|
||
"M USD",DIVIDE(DIVIDE([Retail.Value.LY.MTH],[ExchangeRate]),1000000)
|
||
)
|
||
```
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 82ea6d89-3e1d-4f02-ac08-dc0a4af92953
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.KPI.Trend' =
|
||
|
||
IF(ISINSCOPE(Dim_Calendar_Alt[YYYYMM])||ISINSCOPE(Dim_Calendar_Alt[YEAR_QUATER]),
|
||
IF (
|
||
SELECTEDVALUE ( 'Fields.YQ'[Fields.YQ 个订单] ) = 1,
|
||
IF (
|
||
[Trend_Is_In_DateRange] > 0,
|
||
CALCULATE (
|
||
[External.MS%.KPI],
|
||
REMOVEFILTERS ( Dim_Calendar ),
|
||
REMOVEFILTERS ( Dim_Calendar_Alt ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
),
|
||
IF (
|
||
[Trend_Is_In_DateRange.Q] > 0,
|
||
CALCULATE (
|
||
[External.MS%.KPI],
|
||
REMOVEFILTERS ( Dim_Calendar ),
|
||
REMOVEFILTERS ( Dim_Calendar_Alt ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
)
|
||
),[External.MS%.KPI])
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Cross
|
||
lineageTag: e0abaf06-a16e-4c42-b11d-1bf5a6080f1a
|
||
|
||
measure 'External.Gr%.KPI.Trend' =
|
||
|
||
IF (
|
||
SELECTEDVALUE ( 'Fields.YQ'[Fields.YQ 个订单] ) = 1,
|
||
IF (
|
||
[Trend_Is_In_DateRange] > 0,
|
||
CALCULATE (
|
||
[External.Gr%.KPI],
|
||
REMOVEFILTERS ( Dim_Calendar ),
|
||
REMOVEFILTERS ( Dim_Calendar_Alt ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
),
|
||
IF (
|
||
[Trend_Is_In_DateRange.Q] > 0,
|
||
CALCULATE (
|
||
[External.Gr%.KPI],
|
||
REMOVEFILTERS ( Dim_Calendar ),
|
||
REMOVEFILTERS ( Dim_Calendar_Alt ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
)
|
||
)
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Cross
|
||
lineageTag: a9130d92-fbf2-4563-a6d6-c2b1ee736299
|
||
|
||
measure 'External.GRSales.KPI.Trend' =
|
||
|
||
IF (
|
||
SELECTEDVALUE ( 'Fields.YQ'[Fields.YQ 个订单] ) = 1,
|
||
IF (
|
||
[Trend_Is_In_DateRange] > 0,
|
||
CALCULATE (
|
||
[External.GRSales.KPI],
|
||
REMOVEFILTERS ( Dim_Calendar ),
|
||
REMOVEFILTERS ( Dim_Calendar_Alt ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
),
|
||
IF (
|
||
[Trend_Is_In_DateRange.Q] > 0,
|
||
CALCULATE (
|
||
[External.GRSales.KPI],
|
||
REMOVEFILTERS ( Dim_Calendar ),
|
||
REMOVEFILTERS ( Dim_Calendar_Alt ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
)
|
||
)
|
||
formatString: #,0
|
||
displayFolder: OLD\Cross
|
||
lineageTag: 446cf228-23e4-4d29-a5ba-1edbd7bdbebc
|
||
|
||
measure 'External.RQGR%.KPI.Trend' =
|
||
|
||
IF (
|
||
SELECTEDVALUE ( 'Fields.YQ'[Fields.YQ 个订单] ) = 1,
|
||
IF (
|
||
[Trend_Is_In_DateRange] > 0,
|
||
CALCULATE (
|
||
[External.RQGR%.KPI],
|
||
REMOVEFILTERS ( Dim_Calendar ),
|
||
REMOVEFILTERS ( Dim_Calendar_Alt ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
),
|
||
IF (
|
||
[Trend_Is_In_DateRange.Q] > 0,
|
||
CALCULATE (
|
||
[External.RQGR%.KPI],
|
||
REMOVEFILTERS ( Dim_Calendar ),
|
||
REMOVEFILTERS ( Dim_Calendar_Alt ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
)
|
||
)
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\External Sales
|
||
lineageTag: 1b89990a-5844-42d3-accf-79d2452f126a
|
||
|
||
measure 'External.△MS%.KPI.Mol.Trend' =
|
||
|
||
IF (
|
||
SELECTEDVALUE ( 'Fields.YQ'[Fields.YQ 个订单] ) = 1,
|
||
IF (
|
||
[Trend_Is_In_DateRange] > 0,
|
||
CALCULATE (
|
||
[External.△MS%.KPI.Mol],
|
||
REMOVEFILTERS ( Dim_Calendar ),
|
||
REMOVEFILTERS ( Dim_Calendar_Alt ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
),
|
||
IF (
|
||
[Trend_Is_In_DateRange.Q] > 0,
|
||
CALCULATE (
|
||
[External.△MS%.KPI.Mol],
|
||
REMOVEFILTERS ( Dim_Calendar ),
|
||
REMOVEFILTERS ( Dim_Calendar_Alt ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
)
|
||
)
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Cross
|
||
lineageTag: d813cf36-bb05-42c9-a6fc-86fdbc086c02
|
||
|
||
measure 'External.△MS%.KPI.Trend' =
|
||
|
||
IF (
|
||
SELECTEDVALUE ( 'Fields.YQ'[Fields.YQ 个订单] ) = 1,
|
||
IF (
|
||
[Trend_Is_In_DateRange] > 0,
|
||
CALCULATE (
|
||
[External.△MS%.KPI],
|
||
REMOVEFILTERS ( Dim_Calendar ),
|
||
REMOVEFILTERS ( Dim_Calendar_Alt ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
),
|
||
IF (
|
||
[Trend_Is_In_DateRange.Q] > 0,
|
||
CALCULATE (
|
||
[External.△MS%.KPI],
|
||
REMOVEFILTERS ( Dim_Calendar ),
|
||
REMOVEFILTERS ( Dim_Calendar_Alt ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
)
|
||
)
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Cross
|
||
lineageTag: 29720407-ea49-43a9-ae2a-df32d7072958
|
||
|
||
measure 'External.GRSalesContr%.KPI.Trend' =
|
||
|
||
IF (
|
||
SELECTEDVALUE ( 'Fields.YQ'[Fields.YQ 个订单] ) = 1,
|
||
IF (
|
||
[Trend_Is_In_DateRange] > 0,
|
||
CALCULATE (
|
||
[External.GRSalesContr%.KPI],
|
||
REMOVEFILTERS ( Dim_Calendar ),
|
||
REMOVEFILTERS ( Dim_Calendar_Alt ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
),
|
||
IF (
|
||
[Trend_Is_In_DateRange.Q] > 0,
|
||
CALCULATE (
|
||
[External.GRSalesContr%.KPI],
|
||
REMOVEFILTERS ( Dim_Calendar ),
|
||
REMOVEFILTERS ( Dim_Calendar_Alt ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
)
|
||
)
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Cross
|
||
lineageTag: d0c84a23-5999-4d56-aaf6-d61a7f099824
|
||
|
||
measure 'External.Gr%.KPI.Mol.Trend' =
|
||
|
||
IF (
|
||
SELECTEDVALUE ( 'Fields.YQ'[Fields.YQ 个订单] ) = 1,
|
||
IF (
|
||
[Trend_Is_In_DateRange] > 0,
|
||
CALCULATE (
|
||
[External.Gr%.KPI.Mol],
|
||
REMOVEFILTERS ( Dim_Calendar ),
|
||
REMOVEFILTERS ( Dim_Calendar_Alt ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
),
|
||
IF (
|
||
[Trend_Is_In_DateRange.Q] > 0,
|
||
CALCULATE (
|
||
[External.Gr%.KPI.Mol],
|
||
REMOVEFILTERS ( Dim_Calendar ),
|
||
REMOVEFILTERS ( Dim_Calendar_Alt ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
)
|
||
)
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Cross
|
||
lineageTag: c9b751a0-d657-4b19-bac6-52c9286beb86
|
||
|
||
measure 'External.Sales.KPI.Mol.Trend' =
|
||
|
||
IF (
|
||
SELECTEDVALUE ( 'Fields.YQ'[Fields.YQ 个订单] ) = 1,
|
||
IF (
|
||
[Trend_Is_In_DateRange] > 0,
|
||
CALCULATE (
|
||
[External.Sales.KPI.Mol],
|
||
REMOVEFILTERS ( Dim_Calendar ),
|
||
REMOVEFILTERS ( Dim_Calendar_Alt ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
),
|
||
IF (
|
||
[Trend_Is_In_DateRange.Q] > 0,
|
||
CALCULATE (
|
||
[External.Sales.KPI.Mol],
|
||
REMOVEFILTERS ( Dim_Calendar ),
|
||
REMOVEFILTERS ( Dim_Calendar_Alt ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
)
|
||
)
|
||
formatString: #,0
|
||
displayFolder: OLD\Cross
|
||
lineageTag: d1a92e3c-8bc4-405f-9398-0af39f85f96c
|
||
|
||
measure 'External.MS%.KPI.Class.Trend' =
|
||
|
||
IF (
|
||
SELECTEDVALUE ( 'Fields.YQ'[Fields.YQ 个订单] ) = 1,
|
||
IF (
|
||
[Trend_Is_In_DateRange] > 0,
|
||
CALCULATE (
|
||
[External.MS%.KPI.Class],
|
||
REMOVEFILTERS ( Dim_Calendar ),
|
||
REMOVEFILTERS ( Dim_Calendar_Alt ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
),
|
||
IF (
|
||
[Trend_Is_In_DateRange.Q] > 0,
|
||
CALCULATE (
|
||
[External.MS%.KPI.Class],
|
||
REMOVEFILTERS ( Dim_Calendar ),
|
||
REMOVEFILTERS ( Dim_Calendar_Alt ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
)
|
||
)
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Cross
|
||
lineageTag: 96dd747e-69be-4086-972a-47ee60633b43
|
||
|
||
measure 'show_filters 3' = ```
|
||
|
||
VAR t_ =
|
||
{
|
||
(IF (
|
||
ISFILTERED(Dim_Market[Market]),
|
||
VAR ___x = "Market:"& CONCATENATEX(VALUES(Dim_Market[Market]),[Market],",")
|
||
RETURN ___x
|
||
),1)
|
||
,
|
||
(IF(ISFILTERED(Dim_Class[CLASS]),
|
||
VAR ___x = "Class:"& VALUES(Dim_Class[CLASS])
|
||
RETURN ___x
|
||
),2)
|
||
,
|
||
(IF(ISFILTERED(Dim_PackInfo[MOLECULE_CODE_DESC]),
|
||
VAR ___x = "Molecule:"& VALUES('Dim_PackInfo'[MOLECULE_CODE_DESC])
|
||
RETURN ___x
|
||
),3)
|
||
,
|
||
(IF(ISFILTERED(Dim_PackInfo[PROD_CORP_C]),
|
||
VAR ___x = "Brand:"& VALUES('Dim_PackInfo'[PROD_CORP_C])
|
||
RETURN ___x
|
||
),4)
|
||
,
|
||
(IF(ISFILTERED(Dim_PackInfo[PROD_PACK_CORP]),
|
||
VAR ___x = "Package:"& VALUES('Dim_PackInfo'[PROD_PACK_CORP])
|
||
RETURN ___x
|
||
),5)
|
||
|
||
}
|
||
RETURN CONCATENATEX( t_ , [Value1] , "" )
|
||
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: e668d1e0-58fb-4ab8-a021-d5a23368771e
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.△MS%.KPI.Class' =
|
||
VAR CV = [External.MS%.KPI.Class]
|
||
VAR PV = [External.MS%.LY.KPI.Class]
|
||
RETURN
|
||
CV - PV
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI公式:今年产品占Class的占比-去年产品占Class的占比
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
----------------------------------------------------------------------------
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\△MS%
|
||
lineageTag: 35d356a8-a910-4f91-a114-f791037680e5
|
||
|
||
measure 'External.MS%.LY.KPI.Class' =
|
||
DIVIDE([External.Sales.LY.KPI],[External.Sales.LY.KPI.Class])
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:MS%:去年产品销量占Class销量的占比
|
||
------KPI公式:去年产品销量/分子式销量
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
displayFolder: OLD\中间KPI
|
||
lineageTag: 6ada01c9-1601-4d72-afa5-6fa47390aa73
|
||
|
||
measure 'External.Sales.LY.KPI.Class' =
|
||
IF (
|
||
ISFILTERED ( Dim_MarketTA ) || ISFILTERED ( Dim_Market )
|
||
|| ISFILTERED ( Dim_BrandDefaultMKT ),
|
||
IF (
|
||
[External.Sales.LY.KPI.Market] <> 0,
|
||
CALCULATE (
|
||
[External.Sales.LY.KPI],
|
||
ALLSELECTED ( Dim_DataSource ),
|
||
REMOVEFILTERS ( Dim_PackInfo ),
|
||
TREATAS (
|
||
VALUES ( Fact_Sales[CLASS_KEY] ),
|
||
Dim_Class[CLASS_SOURCE]
|
||
)
|
||
)
|
||
)
|
||
)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:class的销量
|
||
------KPI公式:计算class的销量
|
||
------备注:用于计算share in class
|
||
------创建时间:2024.5.15
|
||
------修改时间:2024.5.30
|
||
------修改内容:根据业务要求,只有用户选择了market,才显示topclass kpi
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0
|
||
displayFolder: OLD\中间KPI
|
||
lineageTag: f98868f7-be20-46bc-9d4e-68ca9037ae99
|
||
|
||
measure 'External.Sales.KPI.Cross' =
|
||
|
||
IF (
|
||
SELECTEDVALUE ( 'Fields.YQ'[Fields.YQ 个订单] ) = 1,
|
||
IF (
|
||
[Trend_Is_In_DateRange] > 0,
|
||
CALCULATE (
|
||
[External.Sales.KPI],
|
||
REMOVEFILTERS ( Dim_Calendar ),
|
||
REMOVEFILTERS ( Dim_Calendar_Alt ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
),
|
||
IF (
|
||
[Trend_Is_In_DateRange.Q] > 0,
|
||
CALCULATE (
|
||
[External.Sales.KPI],
|
||
REMOVEFILTERS ( Dim_Calendar ),
|
||
REMOVEFILTERS ( Dim_Calendar_Alt ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
)
|
||
)
|
||
formatString: #,0
|
||
displayFolder: OLD\Cross
|
||
lineageTag: 5c1d96ad-f5f6-42ec-9ee3-e7066a0c4aa6
|
||
|
||
measure 'External.Sales.LY.KPI.Cross' =
|
||
|
||
IF (
|
||
SELECTEDVALUE ( 'Fields.YQ'[Fields.YQ 个订单] ) = 1,
|
||
IF (
|
||
[Trend_Is_In_DateRange] > 0,
|
||
CALCULATE (
|
||
[External.Sales.LY.KPI],
|
||
REMOVEFILTERS ( Dim_Calendar ),
|
||
REMOVEFILTERS ( Dim_Calendar_Alt ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
),
|
||
IF (
|
||
[Trend_Is_In_DateRange.Q] > 0,
|
||
CALCULATE (
|
||
[External.Sales.LY.KPI],
|
||
REMOVEFILTERS ( Dim_Calendar ),
|
||
REMOVEFILTERS ( Dim_Calendar_Alt ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
MQY[Period] = "MTH"
|
||
)
|
||
)
|
||
)
|
||
formatString: #,0
|
||
displayFolder: OLD\Cross
|
||
lineageTag: 8d5d3f04-3652-493f-a32c-4dda8841f10a
|
||
|
||
measure 'Trend_Is_In_DateRange.Q1' = ```
|
||
|
||
VAR MTHS = 39
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
ISINSCOPE(Dim_Calendar_Alt[YYYYMM]),
|
||
VAR YM = SELECTEDVALUE(Dim_Calendar_Alt[YYYYMM])
|
||
VAR DATE1 = CALCULATE(MAX(Dim_Calendar[DATE]))
|
||
VAR DATE0 = DATE(YEAR(DATE1), MONTH(DATE1)-MTHS, 1)
|
||
RETURN int(YM>=FORMAT(DATE0,"yyyyMM") && YM<=FORMAT(DATE1,"yyyyMM")),
|
||
ISINSCOPE(Dim_Calendar_Alt[YEAR_QUATER]),
|
||
VAR YQ = SELECTEDVALUE(Dim_Calendar_Alt[YEAR_QUATER])
|
||
VAR DATE1 = CALCULATE(ENDOFQUARTER(Dim_Calendar[DATE]))
|
||
VAR DATE0 = DATE(YEAR(DATE1), MONTH(DATE1)-MTHS, 1)
|
||
RETURN int(YQ>=FORMAT(DATE0,"yyyy\QQ") && YQ<=FORMAT(DATE1,"yyyy\QQ"))
|
||
)
|
||
```
|
||
formatString: General Date
|
||
displayFolder: OLD\Others
|
||
lineageTag: 38087fc6-7474-48c9-a1aa-53c15abe9dd4
|
||
|
||
measure 日期控制 = CALCULATE([ExternalTotal.Sales.KPI], MQY[Period]="MTH")
|
||
displayFolder: OLD\Others
|
||
lineageTag: 01bb60bf-be6d-4079-8822-e720b98719a2
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure show_filters4 = ```
|
||
|
||
VAR t_ =
|
||
{(IF (
|
||
ISFILTERED(Dim_Calendar[YYYYMM_EXTERNAL]),
|
||
VAR ___x = "时间范围:"& MIN(Dim_Calendar[YYYYMM]) &" - "& MAX(Dim_Calendar[YYYYMM]) &" | "
|
||
RETURN ___x
|
||
),1)
|
||
// ,(IF (
|
||
// ISFILTERED(Dim_Unit[DW]),
|
||
// VAR ___x = "筛选单位:"& CONCATENATEX(VALUES(Dim_Unit[DW]),[DW],",") &" | "
|
||
// RETURN ___x
|
||
// ),1)
|
||
,(IF (
|
||
ISFILTERED(Dim_Market[Market]),
|
||
VAR ___x = "Market:"& CONCATENATEX(VALUES(Dim_Market[Market]),[Market],",") &" | "
|
||
RETURN ___x
|
||
),1)
|
||
,(IF (
|
||
ISFILTERED(Dim_BrandDefaultMKT),
|
||
VAR ___x = "DefaultMarket:"& CONCATENATEX(VALUES(Dim_BrandDefaultMKT[MARKET]),[MARKET],",") &" | "
|
||
RETURN ___x
|
||
),1)
|
||
,(IF (
|
||
ISFILTERED('Dim_MarketTA'[TA]),
|
||
VAR ___x = "TA: "& CONCATENATEX(VALUES('Dim_MarketTA'[TA]),[TA],",") &" | "
|
||
RETURN ___x
|
||
),2)
|
||
,(IF (
|
||
ISFILTERED(Dim_Class[CLASS]),
|
||
VAR ___x = "Class: "& CONCATENATEX(VALUES(Dim_Class[CLASS]),[CLASS],",") &" | "
|
||
RETURN ___x
|
||
),2)
|
||
,(IF (
|
||
ISFILTERED(Dim_PackInfo[GENE_ORIG_DESC]),
|
||
VAR ___x = "Generics:"& CONCATENATEX(VALUES(Dim_PackInfo[GENE_ORIG_DESC]),[GENE_ORIG_DESC],",") &" | "
|
||
RETURN ___x
|
||
),3)
|
||
,(IF (
|
||
ISFILTERED(Dim_BrandMKT[VBP]),
|
||
VAR ___x = "is VBP:"& CONCATENATEX(VALUES(Dim_BrandMKT[VBP]),[VBP],",") &" | "
|
||
RETURN ___x
|
||
),4)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[PROD_DES_C]),
|
||
VAR ___x = "Brand:"& CONCATENATEX(VALUES('Dim_PackInfo'[PROD_DES_C]),[PROD_DES_C],",") &" | "
|
||
RETURN ___x
|
||
),5)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[MOLECULE_DES_C]),
|
||
VAR ___x = "Molecule:"& CONCATENATEX(VALUES('Dim_PackInfo'[MOLECULE_DES_C]),[MOLECULE_DES_C],",") &" | "
|
||
RETURN ___x
|
||
),7)
|
||
,(IF (
|
||
ISFILTERED('Dim_Corp'[CORP_CODE_DESC]),
|
||
VAR ___x = "Corp: "& CONCATENATEX(VALUES('Dim_Corp'[CORP_CODE_DESC]),[CORP_CODE_DESC],",") &" | "
|
||
RETURN ___x
|
||
),9)
|
||
,(IF (
|
||
ISFILTERED('Dim_Corp'[CORP_TYPE]),
|
||
VAR ___x = "CorpType: "& CONCATENATEX(VALUES('Dim_Corp'[CORP_TYPE]),[CORP_TYPE],",") &" | "
|
||
RETURN ___x
|
||
),10)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[PROD_PACK]),
|
||
VAR ___x = "Pack:"& CONCATENATEX(VALUES('Dim_PackInfo'[PROD_PACK]),[PROD_PACK],",") &" | "
|
||
RETURN ___x
|
||
),11)
|
||
,(IF (
|
||
ISFILTERED('Dim_GeoGroup'[PROVINCE_GROUP]),
|
||
VAR ___x = "Province:"& CONCATENATEX(VALUES('Dim_GeoGroup'[PROVINCE_GROUP]),[PROVINCE_GROUP],",") &" | "
|
||
RETURN ___x
|
||
),12)
|
||
,(IF (
|
||
ISFILTERED('Dim_Geo'[PROVINCE_C]),
|
||
VAR ___x = "Province:"& CONCATENATEX(VALUES('Dim_Geo'[PROVINCE_C]),[PROVINCE_C],",") &" | "
|
||
RETURN ___x
|
||
),12)
|
||
,(IF (
|
||
ISFILTERED('Dim_Geo'[CITY_C]),
|
||
VAR ___x = "City:"& CONCATENATEX(VALUES('Dim_Geo'[CITY_C]),[CITY_C],",") &" | "
|
||
RETURN ___x
|
||
),13)
|
||
,(IF (
|
||
ISFILTERED('Dim_Geo'[AZ_CITY_TIER]),
|
||
VAR ___x = "CityTier:"& CONCATENATEX(VALUES('Dim_Geo'[AZ_CITY_TIER]),[AZ_CITY_TIER],",") &" | "
|
||
RETURN ___x
|
||
),14)
|
||
,(IF (
|
||
ISFILTERED('Dim_Org'[RC_CODE_DESC]),
|
||
VAR ___x = "RC:"& CONCATENATEX(VALUES('Dim_Org'[RC_CODE_DESC]),[RC_CODE_DESC],",") &" | "
|
||
RETURN ___x
|
||
),17)
|
||
,(IF (
|
||
ISFILTERED('Dim_Org'[REGION_CODE_DESC]),
|
||
VAR ___x = "Region:"& CONCATENATEX(VALUES('Dim_Org'[REGION_CODE_DESC]),[REGION_CODE_DESC],",") &" | "
|
||
RETURN ___x
|
||
),18)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[ATC1_CODE_DESC]),
|
||
VAR ___x = "ATC1:"& CONCATENATEX(VALUES('Dim_PackInfo'[ATC1_CODE_DESC]),[ATC1_CODE_DESC],",") &" | "
|
||
RETURN ___x
|
||
),19)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[ATC2_CODE_DESC]),
|
||
VAR ___x = "ATC2:"& CONCATENATEX(VALUES('Dim_PackInfo'[ATC2_CODE_DESC]),[ATC2_CODE_DESC],",") &" | "
|
||
RETURN ___x
|
||
),20)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[ATC3_CODE_DESC]),
|
||
VAR ___x = "ATC3:"& CONCATENATEX(VALUES('Dim_PackInfo'[ATC3_CODE_DESC]),[ATC3_CODE_DESC],",") &" | "
|
||
RETURN ___x
|
||
),21)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[ATC4_CODE_DESC]),
|
||
VAR ___x = "ATC4:"& CONCATENATEX(VALUES('Dim_PackInfo'[ATC4_CODE_DESC]),[ATC4_CODE_DESC],",") &" | "
|
||
RETURN ___x
|
||
),22)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[APP1_COD_DES_C]),
|
||
VAR ___x = "NFC1:"& CONCATENATEX(VALUES('Dim_PackInfo'[APP1_COD_DES_C]),[APP1_COD_DES_C],",") &" | "
|
||
RETURN ___x
|
||
),23)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[APP2_COD_DES_C]),
|
||
VAR ___x = "NFC2:"& CONCATENATEX(VALUES('Dim_PackInfo'[APP2_COD_DES_C]),[APP2_COD_DES_C],",") &" | "
|
||
RETURN ___x
|
||
),24)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[APP3_COD_DES_C]),
|
||
VAR ___x = "NFC3:"& CONCATENATEX(VALUES('Dim_PackInfo'[APP3_COD_DES_C]),[APP3_COD_DES_C],",") &" | "
|
||
RETURN ___x
|
||
),25)
|
||
|
||
}
|
||
RETURN CONCATENATEX( t_ , [Value1] , "" )
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 519d66f3-f381-4d77-97e2-06d1d166bc69
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'retail 加权铺货率' =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
--case 1
|
||
ISFILTERED ( Dim_Geo[PROVINCE_C] )
|
||
&& ISFILTERED ( Dim_Market[MARKET] )
|
||
&& ( NOT SELECTEDVALUE ( Dim_Market[MARKET] ) IN
|
||
{
|
||
"Inhaled Extended Market",
|
||
"NIAD (Non-Insulin Anti-Diabetic) Market",
|
||
"BUDESONIDE Market"
|
||
} ), [retail 加权铺货率 品牌],
|
||
--case 2
|
||
ISFILTERED ( Dim_Org ) && NOT ISFILTERED ( Dim_Geo[PROVINCE_C] ),
|
||
BLANK ( ),
|
||
[retail 加权铺货率 品牌&pack]
|
||
)
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 74a79657-bce4-4020-b37e-875a2828e46e
|
||
|
||
measure 'retail 加权铺货率 品牌' =
|
||
VAR a =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL] ),
|
||
Fact_Retail[KPI_NAME] = "weig_dist_rate",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
VAR aa =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL] ),
|
||
Fact_Retail[KPI_NAME] = "weig_dist_rate",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
),
|
||
Fact_Retail[GEO_KEY] = "roc"
|
||
),
|
||
BLANK ( )
|
||
)
|
||
RETURN
|
||
IF ( NOT ISFILTERED ( Dim_Geo[PROVINCE_C] ), aa / 100, a / 100 )
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 64cf01c2-b6bb-4333-aff7-b7aace01541c
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'retail 加权铺货率 品牌 Δ' =
|
||
VAR a =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL_LY] ),
|
||
Fact_Retail[KPI_NAME] = "weig_dist_rate",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
VAR aa =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL_LY] ),
|
||
Fact_Retail[KPI_NAME] = "weig_dist_rate",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
),
|
||
Fact_Retail[GEO_KEY] = "roc"
|
||
),
|
||
BLANK ( )
|
||
)
|
||
RETURN
|
||
[retail 加权铺货率 品牌]
|
||
- IF ( NOT ISFILTERED ( Dim_Geo[PROVINCE_C] ), aa / 100, a / 100 )
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 94352593-c82f-4a4b-93c5-c83f0a7038ad
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'retail 加权铺货率 品牌&pack' =
|
||
VAR a =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISINSCOPE ( Dim_Calendar_Alt[YYYYMM] ),--PACK
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL] ),
|
||
Fact_Retail[KPI_NAME] = "weig_dist_rate"
|
||
|| Fact_Retail[KPI_NAME] = "weighted_spread_rate",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
)
|
||
),
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL] ),
|
||
Fact_Retail[KPI_NAME] = "weig_dist_rate"
|
||
|| Fact_Retail[KPI_NAME] = "weighted_spread_rate",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
)
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
VAR aa =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISINSCOPE ( Dim_Calendar_Alt[YYYYMM] ),--PACK
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL] ),
|
||
Fact_Retail[KPI_NAME] = "weig_dist_rate"
|
||
|| Fact_Retail[KPI_NAME] = "weighted_spread_rate",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
Fact_Retail[GEO_KEY] = "roc"
|
||
),
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL] ),
|
||
Fact_Retail[KPI_NAME] = "weig_dist_rate"
|
||
|| Fact_Retail[KPI_NAME] = "weighted_spread_rate",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
),
|
||
Fact_Retail[GEO_KEY] = "roc"
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
RETURN
|
||
IF ( NOT ISFILTERED ( Dim_Geo[PROVINCE_C] ), aa / 100, a / 100 )
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 310b224d-1336-4f88-a00f-9fc4744c20f1
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'retail 加权铺货率 品牌&pack Δ' =
|
||
VAR a =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISINSCOPE ( Dim_Calendar_Alt[YYYYMM] ),--PACK
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL_LY] ),
|
||
Fact_Retail[KPI_NAME] = "weig_dist_rate"
|
||
|| Fact_Retail[KPI_NAME] = "weighted_spread_rate",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
)
|
||
),
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL_LY] ),
|
||
Fact_Retail[KPI_NAME] = "weig_dist_rate"
|
||
|| Fact_Retail[KPI_NAME] = "weighted_spread_rate",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
)
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
VAR aa =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISINSCOPE ( Dim_Calendar_Alt[YYYYMM] ),--PACK
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL_LY] ),
|
||
Fact_Retail[KPI_NAME] = "weig_dist_rate"
|
||
|| Fact_Retail[KPI_NAME] = "weighted_spread_rate",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
Fact_Retail[GEO_KEY] = "roc"
|
||
),
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL_LY] ),
|
||
Fact_Retail[KPI_NAME] = "weig_dist_rate"
|
||
|| Fact_Retail[KPI_NAME] = "weighted_spread_rate",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
),
|
||
Fact_Retail[GEO_KEY] = "roc"
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
RETURN
|
||
[retail 加权铺货率 品牌&pack]
|
||
- IF ( NOT ISFILTERED ( Dim_Geo[PROVINCE_C] ), aa / 100, a / 100 )
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 25a18d38-3c12-4440-888c-c6c999899abc
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'retail 加权铺货率 Δ' =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
--case 1
|
||
ISFILTERED ( Dim_Geo[PROVINCE_C] )
|
||
&& ISFILTERED ( Dim_Market[MARKET] )
|
||
&& ( NOT SELECTEDVALUE ( Dim_Market[MARKET] ) IN
|
||
{
|
||
"Inhaled Extended Market",
|
||
"NIAD (Non-Insulin Anti-Diabetic) Market",
|
||
"BUDESONIDE Market",
|
||
"Fasenra Market",
|
||
"Severe Asthma"
|
||
} ), [retail 加权铺货率 品牌 Δ],
|
||
--case 2
|
||
|
||
ISFILTERED ( Dim_Org ) && NOT ISFILTERED ( Dim_Geo[PROVINCE_C] ),
|
||
BLANK ( ),
|
||
[retail 加权铺货率 品牌&pack Δ]
|
||
)
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 81ffbcef-b476-45a2-bb33-80da1e5aefc5
|
||
|
||
measure 'retail 数字铺货率' =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
--case 1
|
||
ISFILTERED ( Dim_Geo[PROVINCE_C] )
|
||
&& ISFILTERED ( Dim_Market[MARKET] )
|
||
&& ( NOT SELECTEDVALUE ( Dim_Market[MARKET] ) IN
|
||
{
|
||
"Inhaled Extended Market",
|
||
"NIAD (Non-Insulin Anti-Diabetic) Market",
|
||
"BUDESONIDE Market",
|
||
"Fasenra Market",
|
||
"Severe Asthma"
|
||
} ), [retail 数字铺货率 品牌],
|
||
--case 2
|
||
ISFILTERED ( Dim_Org ) && NOT ISFILTERED ( Dim_Geo[PROVINCE_C] ),
|
||
BLANK ( ),
|
||
[retail 数字铺货率 品牌&pack]
|
||
)
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 035d6b8c-5b2e-46e7-aae0-19a362e659a9
|
||
|
||
measure 'retail 数字铺货率 品牌' =
|
||
VAR a =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL] ),
|
||
Fact_Retail[KPI_NAME] = "num_dist_rate",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
VAR aa =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL] ),
|
||
Fact_Retail[KPI_NAME] = "num_dist_rate",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
),
|
||
Fact_Retail[GEO_KEY] = "roc"
|
||
),
|
||
BLANK ( )
|
||
)
|
||
RETURN
|
||
IF ( NOT ISFILTERED ( Dim_Geo[PROVINCE_C] ), aa / 100, a / 100 )
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: a14afef4-d3a5-4423-a5f2-0f7beca54936
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'retail 数字铺货率 品牌 Δ' =
|
||
VAR a =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL_LY] ),
|
||
Fact_Retail[KPI_NAME] = "num_dist_rate",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
VAR aa =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL_LY] ),
|
||
Fact_Retail[KPI_NAME] = "num_dist_rate",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
),
|
||
Fact_Retail[GEO_KEY] = "roc"
|
||
),
|
||
BLANK ( )
|
||
)
|
||
RETURN
|
||
[retail 数字铺货率 品牌]
|
||
- IF ( NOT ISFILTERED ( Dim_Geo[PROVINCE_C] ), aa / 100, a / 100 )
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 0d93793b-c0c5-48ae-b902-7c6036126cf6
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'retail 数字铺货率 品牌&pack' =
|
||
VAR a =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISINSCOPE ( Dim_Calendar_Alt[YYYYMM] ),--PACK
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL] ) / 100,
|
||
Fact_Retail[KPI_NAME] = "num_dist_rate"
|
||
|| Fact_Retail[KPI_NAME] = "digital_spread_rate",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
)
|
||
),
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL] ) / 100,
|
||
Fact_Retail[KPI_NAME] = "num_dist_rate"
|
||
|| Fact_Retail[KPI_NAME] = "digital_spread_rate",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
)
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
VAR aa =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISINSCOPE ( Dim_Calendar_Alt[YYYYMM] ),--PACK
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL] ) / 100,
|
||
Fact_Retail[KPI_NAME] = "num_dist_rate"
|
||
|| Fact_Retail[KPI_NAME] = "digital_spread_rate",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
Fact_Retail[GEO_KEY] = "ROC"
|
||
),
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL] ) / 100,
|
||
Fact_Retail[KPI_NAME] = "num_dist_rate"
|
||
|| Fact_Retail[KPI_NAME] = "digital_spread_rate",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
),
|
||
Fact_Retail[GEO_KEY] = "ROC"
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
RETURN
|
||
IF ( NOT ISFILTERED ( Dim_Geo[PROVINCE_C] ), aa, a )
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 4023e5d0-4da1-4777-92f2-d59f2dd060e3
|
||
|
||
measure 'retail 数字铺货率 品牌&pack Δ' =
|
||
VAR a =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISINSCOPE ( Dim_Calendar_Alt[YYYYMM] ),--PACK
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL_LY] ),
|
||
Fact_Retail[KPI_NAME] = "num_dist_rate"
|
||
|| Fact_Retail[KPI_NAME] = "digital_spread_rate",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
)
|
||
),
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL_LY] ),
|
||
Fact_Retail[KPI_NAME] = "num_dist_rate"
|
||
|| Fact_Retail[KPI_NAME] = "digital_spread_rate",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
)
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
VAR aa =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISINSCOPE ( Dim_Calendar_Alt[YYYYMM] ),--PACK
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL_LY] ),
|
||
Fact_Retail[KPI_NAME] = "num_dist_rate"
|
||
|| Fact_Retail[KPI_NAME] = "digital_spread_rate",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
),
|
||
Fact_Retail[GEO_KEY] = "roc"
|
||
),
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL_LY] ),
|
||
Fact_Retail[KPI_NAME] = "num_dist_rate"
|
||
|| Fact_Retail[KPI_NAME] = "digital_spread_rate",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
),
|
||
Fact_Retail[GEO_KEY] = "roc"
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
RETURN
|
||
[retail 数字铺货率 品牌&pack]
|
||
- IF ( NOT ISFILTERED ( Dim_Geo[PROVINCE_C] ), aa / 100, a / 100 )
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 54351433-e26b-4143-b145-599aec14312e
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'retail 数字铺货率 Δ' =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
--case 1
|
||
ISFILTERED ( Dim_Geo[PROVINCE_C] )
|
||
&& ISFILTERED ( Dim_Market[MARKET] )
|
||
&& ( NOT SELECTEDVALUE ( Dim_Market[MARKET] ) IN
|
||
{
|
||
"Inhaled Extended Market",
|
||
"NIAD (Non-Insulin Anti-Diabetic) Market",
|
||
"BUDESONIDE Market",
|
||
"Fasenra Market",
|
||
"Severe Asthma"
|
||
} ), [retail 数字铺货率 品牌 Δ],
|
||
--case 2
|
||
|
||
ISFILTERED ( Dim_Org ) && NOT ISFILTERED ( Dim_Geo[PROVINCE_C] ),
|
||
BLANK ( ),
|
||
[retail 数字铺货率 品牌&pack Δ]
|
||
)
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: a72b69be-d639-45b9-9436-f755ef8878d3
|
||
|
||
measure 'retail by counting unit' =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
--不选市场为空
|
||
NOT ISFILTERED ( Dim_Market[MARKET] ), BLANK ( ),
|
||
--
|
||
ISFILTERED ( Dim_Market[MARKET] )
|
||
&& ( ISFILTERED ( Dim_GeoGroup ) || ISFILTERED ( Dim_Org ) )
|
||
&& ( NOT SELECTEDVALUE ( Dim_Market[MARKET] ) IN
|
||
{
|
||
"Inhaled Extended Market",
|
||
"NIAD (Non-Insulin Anti-Diabetic) Market",
|
||
"BUDESONIDE Market",
|
||
"Fasenra Market",
|
||
"Severe Asthma"
|
||
} )
|
||
&& NOT ISFILTERED ( Fact_Retail[prod or pack] )
|
||
&& NOT ISFILTERED ( Fact_Retail[PACK_CORP] ), [retail by counting unit 汇总 FLAG1],
|
||
|
||
--
|
||
ISFILTERED ( Dim_Market[MARKET] )
|
||
&& ( ISFILTERED ( Dim_GeoGroup ) || ISFILTERED ( Dim_Org ) )
|
||
&& ( NOT SELECTEDVALUE ( Dim_Market[MARKET] ) IN
|
||
{
|
||
"Inhaled Extended Market",
|
||
"NIAD (Non-Insulin Anti-Diabetic) Market",
|
||
"BUDESONIDE Market",
|
||
"Fasenra Market",
|
||
"Severe Asthma"
|
||
} )
|
||
&& ( ISFILTERED ( Fact_Retail[prod or pack] )
|
||
|| ISFILTERED ( Fact_Retail[PACK_CORP] )
|
||
|| ISFILTERED ( Dim_PackInfo[PROD_CORP_C] ) ),
|
||
BLANK ( ),
|
||
[retail by counting unit 汇总]
|
||
)
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: e44fdea5-7b76-4751-9120-3f50dc91db39
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'retail by counting unit org' =
|
||
VAR a =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
CALCULATE (
|
||
SUMX (
|
||
Fact_Retail,
|
||
Fact_Retail[KPI_VAL] * [External.SelectRegionMKTRatio]
|
||
),
|
||
Fact_Retail[KPI_NAME] = "brand_price_by_counting_unit_fm"
|
||
|| Fact_Retail[KPI_NAME] = "pack_price_by_counting_unit_fm",
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
),
|
||
TREATAS (
|
||
VALUES ( Dim_RC[AUDIT_SOURCE] ),
|
||
Dim_Geo[AUDIT_KEY]
|
||
),
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] )
|
||
),
|
||
BLANK ( )
|
||
)
|
||
VAR b =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
CALCULATE (
|
||
SUMX (
|
||
Fact_Retail,
|
||
Fact_Retail[KPI_VAL] * [External.SelectRegionMKTRatio]
|
||
),
|
||
Fact_Retail[KPI_NAME] = "brand_price_fz"
|
||
|| Fact_Retail[KPI_NAME] = "pack_price_fz",
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
),
|
||
TREATAS (
|
||
VALUES ( Dim_RC[AUDIT_SOURCE] ),
|
||
Dim_Geo[AUDIT_KEY]
|
||
),
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] )
|
||
),
|
||
BLANK ( )
|
||
)
|
||
RETURN
|
||
b / a
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: af9dc5a4-2601-4b41-b078-c4ee57b06e8f
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'retail by counting unit 品牌' =
|
||
VAR a =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISINSCOPE ( Dim_Calendar_Alt[YYYYMM] ),--PACK
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL] ),
|
||
Fact_Retail[KPI_NAME] = "brand_price_by_counting_unit",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
)
|
||
),
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL] ),
|
||
Fact_Retail[KPI_NAME] = "brand_price_by_counting_unit",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
)
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
VAR aa =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISINSCOPE ( Dim_Calendar_Alt[YYYYMM] ),--PACK
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL] ),
|
||
Fact_Retail[KPI_NAME] = "brand_price_by_counting_unit",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
Fact_Retail[GEO_KEY] = "roc"
|
||
),
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL] ),
|
||
Fact_Retail[KPI_NAME] = "brand_price_by_counting_unit",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
),
|
||
Fact_Retail[GEO_KEY] = "roc"
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
RETURN
|
||
IF ( NOT ISFILTERED ( Dim_Geo[PROVINCE_C] ), aa, a )
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 10eb5943-5489-4f9f-997a-bd498141641c
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'retail by counting unit 品牌&pack' =
|
||
VAR a =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISINSCOPE ( Dim_Calendar_Alt[YYYYMM] ),--PACK
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL] ),
|
||
Fact_Retail[KPI_NAME] = "brand_price_by_counting_unit"
|
||
|| Fact_Retail[KPI_NAME] = "pack_price_by_counting_unit",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
)
|
||
),
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL] ),
|
||
Fact_Retail[KPI_NAME] = "brand_price_by_counting_unit"
|
||
|| Fact_Retail[KPI_NAME] = "pack_price_by_counting_unit",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
)
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
VAR aa =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISINSCOPE ( Dim_Calendar_Alt[YYYYMM] ),--PACK
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL] ),
|
||
Fact_Retail[KPI_NAME] = "brand_price_by_counting_unit"
|
||
|| Fact_Retail[KPI_NAME] = "pack_price_by_counting_unit",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
Fact_Retail[GEO_KEY] = "roc"
|
||
),
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL] ),
|
||
Fact_Retail[KPI_NAME] = "brand_price_by_counting_unit"
|
||
|| Fact_Retail[KPI_NAME] = "pack_price_by_counting_unit",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
),
|
||
Fact_Retail[GEO_KEY] = "roc"
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
RETURN
|
||
IF ( NOT ISFILTERED ( Dim_Geo[PROVINCE_C] ), aa, a )
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: b7600760-acd6-4665-8c2c-3049462c3536
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'retail by pack' =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
--不选市场为空
|
||
NOT ISFILTERED ( Dim_Market[MARKET] ), BLANK ( ),
|
||
|
||
--
|
||
ISFILTERED ( Dim_Market[MARKET] )
|
||
&& ( ISFILTERED ( Dim_GeoGroup ) || ISFILTERED ( Dim_Org ) )
|
||
&& ( NOT SELECTEDVALUE ( Dim_Market[MARKET] ) IN
|
||
{
|
||
"Inhaled Extended Market",
|
||
"NIAD (Non-Insulin Anti-Diabetic) Market",
|
||
"BUDESONIDE Market",
|
||
"Fasenra Market",
|
||
"Severe Asthma"
|
||
} ),
|
||
BLANK ( ),
|
||
[retail by pack 汇总]
|
||
|
||
)
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 2eb23696-da23-4367-961c-0cc325d7d17f
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'retail by pack org' =
|
||
VAR a =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISINSCOPE ( Dim_Calendar_Alt[YYYYMM] ),--PACK
|
||
CALCULATE (
|
||
SUMX (
|
||
Fact_Retail,
|
||
Fact_Retail[KPI_VAL] * [External.SelectRegionMKTRatio]
|
||
),
|
||
Fact_Retail[KPI_NAME] = "brand_price_fm"
|
||
|| Fact_Retail[KPI_NAME] = "pack_price_fm",
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
TREATAS (
|
||
VALUES ( Dim_RC[AUDIT_SOURCE] ),
|
||
Dim_Geo[AUDIT_KEY]
|
||
),
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] )
|
||
),
|
||
CALCULATE (
|
||
SUMX (
|
||
Fact_Retail,
|
||
Fact_Retail[KPI_VAL] * [External.SelectRegionMKTRatio]
|
||
),
|
||
Fact_Retail[KPI_NAME] = "brand_price_fm"
|
||
|| Fact_Retail[KPI_NAME] = "pack_price_fm",
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
),
|
||
TREATAS (
|
||
VALUES ( Dim_RC[AUDIT_SOURCE] ),
|
||
Dim_Geo[AUDIT_KEY]
|
||
),
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] )
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
VAR b =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISINSCOPE ( Dim_Calendar_Alt[YYYYMM] ),--PACK
|
||
CALCULATE (
|
||
SUMX (
|
||
Fact_Retail,
|
||
Fact_Retail[KPI_VAL] * [External.SelectRegionMKTRatio]
|
||
),
|
||
Fact_Retail[KPI_NAME] = "brand_price_fz"
|
||
|| Fact_Retail[KPI_NAME] = "pack_price_fz",
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
TREATAS (
|
||
VALUES ( Dim_RC[AUDIT_SOURCE] ),
|
||
Dim_Geo[AUDIT_KEY]
|
||
),
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] )
|
||
),
|
||
CALCULATE (
|
||
SUMX (
|
||
Fact_Retail,
|
||
Fact_Retail[KPI_VAL] * [External.SelectRegionMKTRatio]
|
||
),
|
||
Fact_Retail[KPI_NAME] = "brand_price_fz"
|
||
|| Fact_Retail[KPI_NAME] = "pack_price_fz",
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
),
|
||
TREATAS (
|
||
VALUES ( Dim_RC[AUDIT_SOURCE] ),
|
||
Dim_Geo[AUDIT_KEY]
|
||
),
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] )
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
RETURN
|
||
b / a
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 657d3525-a2f7-4391-9e1e-e750fbe2bfb3
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'EC.Sales.MTH' = ```
|
||
|
||
SWITCH([External.SelectUnit],
|
||
"RMB",[EC.Value.MTH],
|
||
"K RMB",DIVIDE([EC.Value.MTH],1000),
|
||
"M RMB",DIVIDE([EC.Value.MTH],1000000),
|
||
"USD",DIVIDE([EC.Value.MTH],[ExchangeRate]),
|
||
"K USD",DIVIDE(DIVIDE([EC.Value.MTH],[ExchangeRate]),1000),
|
||
"M USD",DIVIDE(DIVIDE([EC.Value.MTH],[ExchangeRate]),1000000)
|
||
)
|
||
```
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 0802fe57-c045-454a-b7e7-43c00140fdcf
|
||
|
||
measure 'EC.Value.MTH' =
|
||
CALCULATE (
|
||
SUM ( Fact_EC[KPI_VAL] ),
|
||
Fact_EC[KPI_NAME] = "top_corp_sales"
|
||
)
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: f4d949b0-a689-4ffa-a17d-ea7a0424ab6e
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'EC.Value.LY.MTH' =
|
||
CALCULATE (
|
||
SUM ( Fact_EC[KPI_VAL_LY] ),
|
||
Fact_EC[KPI_NAME] = "top_corp_sales"
|
||
)
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 38455814-4547-4d2c-8f5c-39e1d0648b9f
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'EC.Sales.LY.MTH' = ```
|
||
|
||
SWITCH([External.SelectUnit],
|
||
"RMB",[EC.Value.LY.MTH],
|
||
"K RMB",DIVIDE([EC.Value.LY.MTH],1000),
|
||
"M RMB",DIVIDE([EC.Value.LY.MTH],1000000),
|
||
"USD",DIVIDE([EC.Value.LY.MTH],[ExchangeRate]),
|
||
"K USD",DIVIDE(DIVIDE([EC.Value.LY.MTH],[ExchangeRate]),1000),
|
||
"M USD",DIVIDE(DIVIDE([EC.Value.LY.MTH],[ExchangeRate]),1000000)
|
||
)
|
||
```
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 1aa1f6da-dd84-488f-960f-db4e29eb30e4
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'ECTotal.Rank.Top.All' =
|
||
|
||
CALCULATE (
|
||
[ECTotal.Rank.Top],
|
||
Fact_EC_Total[TA] = ""
|
||
)
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 0a592b66-291e-4d64-b7de-97051c9fd596
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure '1.2 MARK' =
|
||
SWITCH(
|
||
TRUE(),SELECTEDVALUE(Dim_DataSource[SOURCENAME])="EC"&&(SELECTEDVALUE(Dim_CorpType[Value1])="az"||SELECTEDVALUE(Dim_CorpType[Value1])="total"),
|
||
|
||
1,0
|
||
|
||
)
|
||
displayFolder: OLD\Others
|
||
lineageTag: 2a710020-7ac6-4e0a-989f-2cb5547f5641
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'retail 加权铺货率 new' =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
SELECTEDVALUE ( Dim_PackInfo[PACK_DES] ) = "", 1,
|
||
2
|
||
)
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: a194ea67-e41a-4162-ad16-465b9d075640
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'retail by counting unit 汇总 FLAG1' =
|
||
VAR a =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISINSCOPE ( Dim_Calendar_Alt[YYYYMM] ),--PACK
|
||
CALCULATE (
|
||
SUMX (
|
||
Fact_Retail,
|
||
Fact_Retail[KPI_VAL] * [External.SelectRegionMKTRatio]
|
||
),
|
||
Fact_Retail[KPI_NAME] = "pack_price_by_counting_unit_fm",
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
TREATAS (
|
||
VALUES ( Dim_RC[AUDIT_SOURCE] ),
|
||
Dim_Geo[AUDIT_KEY]
|
||
),
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
Fact_Retail[PROD_FLAG] = 1
|
||
),
|
||
CALCULATE (
|
||
SUMX (
|
||
Fact_Retail,
|
||
Fact_Retail[KPI_VAL] * [External.SelectRegionMKTRatio]
|
||
),
|
||
Fact_Retail[KPI_NAME] = "pack_price_by_counting_unit_fm",
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
),
|
||
TREATAS (
|
||
VALUES ( Dim_RC[AUDIT_SOURCE] ),
|
||
Dim_Geo[AUDIT_KEY]
|
||
),
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
Fact_Retail[PROD_FLAG] = 1
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
VAR b =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISINSCOPE ( Dim_Calendar_Alt[YYYYMM] ),--PACK
|
||
CALCULATE (
|
||
SUMX (
|
||
Fact_Retail,
|
||
Fact_Retail[KPI_VAL] * [External.SelectRegionMKTRatio]
|
||
),
|
||
Fact_Retail[KPI_NAME] = "pack_price_fz",
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
TREATAS (
|
||
VALUES ( Dim_RC[AUDIT_SOURCE] ),
|
||
Dim_Geo[AUDIT_KEY]
|
||
),
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
Fact_Retail[PROD_FLAG] = 1
|
||
),
|
||
CALCULATE (
|
||
SUMX (
|
||
Fact_Retail,
|
||
Fact_Retail[KPI_VAL] * [External.SelectRegionMKTRatio]
|
||
),
|
||
Fact_Retail[KPI_NAME] = "pack_price_fz",
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
),
|
||
TREATAS (
|
||
VALUES ( Dim_RC[AUDIT_SOURCE] ),
|
||
Dim_Geo[AUDIT_KEY]
|
||
),
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
Fact_Retail[PROD_FLAG] = 1
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
RETURN
|
||
b / a
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 4a399bb1-2e7e-4fa4-9763-0cb41920eada
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'retail by pack 汇总' =
|
||
VAR a =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISINSCOPE ( Dim_Calendar_Alt[YYYYMM] ),--PACK
|
||
CALCULATE (
|
||
SUMX (
|
||
Fact_Retail,
|
||
Fact_Retail[KPI_VAL] * [External.SelectRegionMKTRatio]
|
||
),
|
||
Fact_Retail[KPI_NAME] = "pack_price_fm",
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
TREATAS (
|
||
VALUES ( Dim_RC[AUDIT_SOURCE] ),
|
||
Dim_Geo[AUDIT_SOURCE]
|
||
),
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] )
|
||
),
|
||
CALCULATE (
|
||
SUMX (
|
||
Fact_Retail,
|
||
Fact_Retail[KPI_VAL] * [External.SelectRegionMKTRatio]
|
||
),
|
||
Fact_Retail[KPI_NAME] = "pack_price_fm",
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
),
|
||
TREATAS (
|
||
VALUES ( Dim_RC[AUDIT_SOURCE] ),
|
||
Dim_Geo[AUDIT_SOURCE]
|
||
),
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] )
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
VAR b =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISINSCOPE ( Dim_Calendar_Alt[YYYYMM] ),--PACK
|
||
CALCULATE (
|
||
SUMX (
|
||
Fact_Retail,
|
||
Fact_Retail[KPI_VAL] * [External.SelectRegionMKTRatio]
|
||
),
|
||
Fact_Retail[KPI_NAME] = "pack_price_fz",
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
TREATAS (
|
||
VALUES ( Dim_RC[AUDIT_SOURCE] ),
|
||
Dim_Geo[AUDIT_SOURCE]
|
||
),
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] )
|
||
),
|
||
CALCULATE (
|
||
SUMX (
|
||
Fact_Retail,
|
||
Fact_Retail[KPI_VAL] * [External.SelectRegionMKTRatio]
|
||
),
|
||
Fact_Retail[KPI_NAME] = "pack_price_fz",
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
),
|
||
TREATAS (
|
||
VALUES ( Dim_RC[AUDIT_SOURCE] ),
|
||
Dim_Geo[AUDIT_SOURCE]
|
||
),
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] )
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
RETURN
|
||
b / a
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 967a13ce-d18b-4689-ac2c-1e5caf39d980
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'retail by pack 品牌' =
|
||
//疑似用不到了
|
||
VAR a =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL] ),
|
||
Fact_Retail[KPI_NAME] = "brand_price",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
VAR aa =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
CALCULATE (
|
||
AVERAGE ( Fact_Retail[KPI_VAL] ),
|
||
Fact_Retail[KPI_NAME] = "brand_price",
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
),
|
||
Fact_Retail[GEO_KEY] = "roc"
|
||
),
|
||
BLANK ( )
|
||
)
|
||
RETURN
|
||
IF ( NOT ISFILTERED ( Dim_Geo[PROVINCE_C] ), aa, a )
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: c669a7f2-e318-407b-9c72-765abfb54a71
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'retail weig_dist_rate' =
|
||
|
||
|
||
if(max(DIM_CALENDAR_ALT[YYYYMM])<=max(DIM_CALENDAR[YYYYMM])
|
||
&&VALUE(max(DIM_CALENDAR_ALT[YYYYMM]))>=VALUE((LEFT(max(DIM_CALENDAR[YYYYMM]),4)-2)&RIGHT(max(DIM_CALENDAR[YYYYMM]),2)),
|
||
|
||
CALCULATE(sum(Fact_Retail[Kpi_val]),Fact_Retail[KPI_name]="weig_dist_rate",all(Fact_Retail[PACK_CODE]),all(Dim_Calendar),all(Dim_Calendar_Alt),all(Fact_Retail[prod or pack])) ,blank())
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: c0ef06de-279a-44af-8900-d3d274406a8e
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Price' = CALCULATE(sumx(Fact_Retail,[Kpi_val]), Fact_Retail[KPI_NAME]="pack_price_fz")
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 94846b24-eca4-4da2-aea7-85e4f90d6b4c
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'retail by counting unit 汇总' =
|
||
VAR a =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISINSCOPE ( Dim_Calendar_Alt[YYYYMM] ),--PACK
|
||
CALCULATE (
|
||
SUMX (
|
||
Fact_Retail,
|
||
Fact_Retail[KPI_VAL] * [External.SelectRegionMKTRatio]
|
||
),
|
||
Fact_Retail[KPI_NAME] = "pack_price_by_counting_unit_fm",
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
TREATAS (
|
||
VALUES ( Dim_RC[AUDIT_SOURCE] ),
|
||
Dim_Geo[AUDIT_KEY]
|
||
),
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] )
|
||
),
|
||
CALCULATE (
|
||
SUMX (
|
||
Fact_Retail,
|
||
Fact_Retail[KPI_VAL] * [External.SelectRegionMKTRatio]
|
||
),
|
||
Fact_Retail[KPI_NAME] = "pack_price_by_counting_unit_fm",
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
),
|
||
TREATAS (
|
||
VALUES ( Dim_RC[AUDIT_SOURCE] ),
|
||
Dim_Geo[AUDIT_KEY]
|
||
),
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] )
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
VAR b =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISINSCOPE ( Dim_Calendar_Alt[YYYYMM] ),--PACK
|
||
CALCULATE (
|
||
SUMX (
|
||
Fact_Retail,
|
||
Fact_Retail[KPI_VAL] * [External.SelectRegionMKTRatio]
|
||
),
|
||
Fact_Retail[KPI_NAME] = "pack_price_fz",
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
TREATAS (
|
||
VALUES ( Dim_RC[AUDIT_SOURCE] ),
|
||
Dim_Geo[AUDIT_KEY]
|
||
),
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] )
|
||
),
|
||
CALCULATE (
|
||
SUMX (
|
||
Fact_Retail,
|
||
Fact_Retail[KPI_VAL] * [External.SelectRegionMKTRatio]
|
||
),
|
||
Fact_Retail[KPI_NAME] = "pack_price_fz",
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
),
|
||
TREATAS (
|
||
VALUES ( Dim_RC[AUDIT_SOURCE] ),
|
||
Dim_Geo[AUDIT_KEY]
|
||
),
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] )
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
RETURN
|
||
b / a
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 4ad3834b-c589-4876-bb58-ccbca2f75e85
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'retail by PACK 汇总 FLAG1' =
|
||
VAR a =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISINSCOPE ( Dim_Calendar_Alt[YYYYMM] ),--PACK
|
||
CALCULATE (
|
||
SUMX (
|
||
Fact_Retail,
|
||
Fact_Retail[KPI_VAL] * [External.SelectRegionMKTRatio]
|
||
),
|
||
Fact_Retail[KPI_NAME] = "pack_price_fm",
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
TREATAS (
|
||
VALUES ( Dim_RC[AUDIT_SOURCE] ),
|
||
Dim_Geo[AUDIT_SOURCE]
|
||
),
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
Fact_Retail[PROD_FLAG] = 1
|
||
),
|
||
CALCULATE (
|
||
SUMX (
|
||
Fact_Retail,
|
||
Fact_Retail[KPI_VAL] * [External.SelectRegionMKTRatio]
|
||
),
|
||
Fact_Retail[KPI_NAME] = "pack_price_fm",
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
),
|
||
TREATAS (
|
||
VALUES ( Dim_RC[AUDIT_SOURCE] ),
|
||
Dim_Geo[AUDIT_SOURCE]
|
||
),
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
Fact_Retail[PROD_FLAG] = 1
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
VAR b =
|
||
IF (
|
||
MAX ( Dim_Calendar_Alt[YYYYMM] )
|
||
<= MAX ( Dim_Calendar[YYYYMM] )
|
||
&& VALUE ( MAX ( Dim_Calendar_Alt[YYYYMM] ) )
|
||
>= VALUE (
|
||
( LEFT ( MAX ( Dim_Calendar[YYYYMM] ), 4 ) - 2 )
|
||
& RIGHT ( MAX ( Dim_Calendar[YYYYMM] ), 2 )
|
||
),
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISINSCOPE ( Dim_Calendar_Alt[YYYYMM] ),--PACK
|
||
CALCULATE (
|
||
SUMX (
|
||
Fact_Retail,
|
||
Fact_Retail[KPI_VAL] * [External.SelectRegionMKTRatio]
|
||
),
|
||
Fact_Retail[KPI_NAME] = "pack_price_fz",
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YYYYMM] ),
|
||
Dim_Calendar[YYYYMM]
|
||
),
|
||
TREATAS (
|
||
VALUES ( Dim_RC[AUDIT_SOURCE] ),
|
||
Dim_Geo[AUDIT_SOURCE]
|
||
),
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
Fact_Retail[PROD_FLAG] = 1
|
||
),
|
||
CALCULATE (
|
||
SUMX (
|
||
Fact_Retail,
|
||
Fact_Retail[KPI_VAL] * [External.SelectRegionMKTRatio]
|
||
),
|
||
Fact_Retail[KPI_NAME] = "pack_price_fz",
|
||
TREATAS (
|
||
VALUES ( Dim_Calendar_Alt[YEAR_QUATER] ),
|
||
Dim_Calendar[YEAR_QUATER]
|
||
),
|
||
TREATAS (
|
||
VALUES ( Dim_RC[AUDIT_SOURCE] ),
|
||
Dim_Geo[AUDIT_SOURCE]
|
||
),
|
||
ALL ( Dim_Calendar[YYYYMM_EXTERNAL] ),
|
||
Fact_Retail[PROD_FLAG] = 1
|
||
)
|
||
),
|
||
BLANK ( )
|
||
)
|
||
RETURN
|
||
b / a
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 68f62c65-faae-41d9-b4e0-776589ceb73f
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'RETAIL 合计'
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 0816059f-0af9-4679-a042-1aaef63c1830
|
||
|
||
measure '铺货率.Ori' = CALCULATE(AVERAGE(Fact_Retail[KPI_VAL]) ,Fact_Retail[KPI_NAME]="num_dist_rate")
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 3ceef553-6ae0-4de6-9c4e-665ec5611563
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure '数字铺货率.Ori.Pack' = CALCULATE(AVERAGE(Fact_Retail[KPI_VAL])/100 ,Fact_Retail[KPI_NAME]="num_dist_rate"||Fact_Retail[KPI_NAME]="digital_spread_rate")
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 71117abf-a695-4572-b50f-60a6d092c135
|
||
|
||
measure '数字铺货率.Ori.Pack.Total' = CALCULATE([数字铺货率.Ori.Pack],Fact_Retail[GEO_KEY] = "ROC")
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 6d521766-d64a-4450-acac-5350bfb64644
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'ECTotal.Rank.Top' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE (
|
||
SUM ( Fact_EC_Total[Kpi_val] ),
|
||
//Fact_EC_Total[platform] = "B2C全平台(京东+天猫)",
|
||
//Fact_EC_Total[store_type] = "自营+三方",
|
||
Fact_EC_Total[KPI_name]="top_rank",
|
||
Fact_EC_Total[yyyymm] = YM,
|
||
REMOVEFILTERS(Dim_Calendar)
|
||
)
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 31737f1a-f210-4272-a7cb-6ececbf3992f
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'EC.Rank.Top' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE (
|
||
SUM ( Fact_EC[Kpi_val] ),
|
||
//Fact_EC_Total[platform] = "B2C全平台(京东+天猫)",
|
||
//Fact_EC_Total[store_type] = "自营+三方",
|
||
Fact_EC[KPI_name]="top_rank",
|
||
Fact_EC[yyyymm] = YM,
|
||
REMOVEFILTERS(Dim_Calendar)
|
||
)
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 3a71c6f7-f709-4fb2-be29-779218474242
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'ECTotal.Rank.Top.TA' =
|
||
|
||
CALCULATE (
|
||
[ECTotal.Rank.Top],
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA_Total[TA_SOURCE] ),
|
||
Fact_EC_Total[TA_SOURCE]
|
||
)
|
||
)
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 939d0af0-d991-44d5-b265-94d4f8bee1da
|
||
|
||
measure 'EC.Rank.Top.All' =
|
||
|
||
CALCULATE (
|
||
[EC.Rank.Top],
|
||
Fact_EC[TA] = ""
|
||
)
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 9d3280e4-e020-457b-90c8-a30dcc44b2f0
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'EC.Rank.Top.TA' =
|
||
|
||
CALCULATE (
|
||
[EC.Rank.Top],
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
)
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: ce2958ea-07b9-4a36-807c-837f5d7f8767
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'EC.incrementalGr%.Top1Brand' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(MAX(Fact_EC[KPI_VAL]),
|
||
Fact_EC[KPI_NAME] = "incremental_brand_gr",
|
||
Fact_EC[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar ))
|
||
displayFolder: OLD\2.1Top
|
||
lineageTag: e6bdf2b3-012b-47b2-8745-adf3e4327383
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'EC.incremental.Top1BrandName' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(MAX(Fact_EC[STR_KPI_VAL]),
|
||
Fact_EC[KPI_NAME] = "incremental_brand",
|
||
Fact_EC[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar ))
|
||
displayFolder: OLD\2.1Top
|
||
lineageTag: 131b0323-e9b5-4639-b077-401bd46dd85c
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'EC.Gr%.Top1Brand' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(MAX(Fact_EC[KPI_VAL]),
|
||
Fact_EC[KPI_NAME] = "top1_brand_gr",
|
||
Fact_EC[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar ))
|
||
displayFolder: OLD\2.1Top
|
||
lineageTag: 4b658679-783c-4f79-82d0-3cfbff128e78
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'EC.Value.Top1BrandName' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(MAX(Fact_EC[STR_KPI_VAL]),
|
||
Fact_EC[KPI_NAME] = "top1_brand_val",
|
||
Fact_EC[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar ))
|
||
displayFolder: OLD\2.1Top
|
||
lineageTag: 697eef2d-eb05-4ec1-b5ea-1789bc21f411
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.4.1.Text' = ```
|
||
|
||
VAR R = "" //"Retail渠道直取数据导出"
|
||
// VAR T = "2025年THC仅有全国数据,THC省份历史数据请至Free Report中查看"
|
||
VAR XIEHE = "科室数据源尚未交付25Q2、25Q3天津数据,使用时请注意"
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
// ISFILTERED(Dim_DataSource) && "THC" IN VALUES(Dim_DataSource[SOURCENAME]),T,
|
||
ISFILTERED(Dim_DataSource) && "Retail" IN VALUES(Dim_DataSource[SOURCENAME]),R,
|
||
ISFILTERED(Dim_DataSource) && "科室市场" IN VALUES(Dim_DataSource[SOURCENAME]),XIEHE
|
||
)
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 7aa0cb68-f7a1-4801-b6af-7349aced891a
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Export.Sales' = SUM(Fact_Retail_RawData[sales_amount])
|
||
formatString: #,0
|
||
displayFolder: OLD\Retail自助导出KPI
|
||
lineageTag: c53387d3-d717-47a7-be2e-8d8916522080
|
||
|
||
measure 'Retail.Export.MS%.YTD' = CALCULATE([Retail.Export.MS%],MQY[Period] = "YTD",ALL(Dim_Calendar),ALL(MQY))
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\Retail自助导出KPI
|
||
lineageTag: 2861bbae-e331-435f-9992-b44e69d29c55
|
||
|
||
measure 'Retail.Export.Gr%.YTD' = CALCULATE([Retail.Export.Gr%],MQY[Period] = "YTD",ALL(Dim_Calendar),ALL(MQY))
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\Retail自助导出KPI
|
||
lineageTag: e76a7109-24de-428b-85f5-f2b7c802d8f5
|
||
|
||
measure 'Retail.Export.ΔMS%.YTD' = CALCULATE([Retail.Export.ΔMS%],MQY[Period] = "YTD",ALL(Dim_Calendar),ALL(MQY))
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\Retail自助导出KPI
|
||
lineageTag: 81532d9a-7714-4033-be1f-effbcaa65a49
|
||
|
||
measure 'Retial.Export.Top1Brand.Gr%' = SUM(Fact_Retail_RawData[top1_brand_gr])
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Retail自助导出KPI
|
||
lineageTag: c24b6278-3f29-489d-aa69-e7c3b2eff22d
|
||
|
||
measure 'Retial.Export.Top2Brand.Gr%' = SUM(Fact_Retail_RawData[top2_brand_gr])
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Retail自助导出KPI
|
||
lineageTag: aab942e0-a739-465a-9a23-30c72a7a9ae0
|
||
|
||
measure 'Retial.Export.Top1BrandName' = MAX(Fact_Retail_RawData[top1_brand_val])
|
||
displayFolder: OLD\Retail自助导出KPI
|
||
lineageTag: a6736746-ccce-4529-b443-108b41a41df6
|
||
|
||
annotation PBI_FormatHint = {"isText":true}
|
||
|
||
measure 'Retial.Export.Top2BrandName' = MAX(Fact_Retail_RawData[top2_brand_val])
|
||
displayFolder: OLD\Retail自助导出KPI
|
||
lineageTag: 6049daff-d6ac-4daa-b878-8c733a111276
|
||
|
||
annotation PBI_FormatHint = {"isText":true}
|
||
|
||
measure 'Retial.Export.Top1incrementalBrandName' = max(Fact_Retail_RawData[top1_incremental_brand])
|
||
displayFolder: OLD\Retail自助导出KPI
|
||
lineageTag: 08f4b5a5-6fe3-4b63-a4fa-04645abb73b3
|
||
|
||
annotation PBI_FormatHint = {"isText":true}
|
||
|
||
measure 'Retial.Export.Top2incrementalBrandName' = MAX(Fact_Retail_RawData[top2_incremental_brand])
|
||
displayFolder: OLD\Retail自助导出KPI
|
||
lineageTag: 565b1d86-0651-45b4-84f7-2f8869a41b9a
|
||
|
||
annotation PBI_FormatHint = {"isText":true}
|
||
|
||
measure 'Retial.Export.Top1incrementalBrand.Gr%' = SUM(Fact_Retail_RawData[top1_incremental_gr])
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Retail自助导出KPI
|
||
lineageTag: 534922bb-26bf-4f95-92b5-6052e76c0104
|
||
|
||
measure 'Retial.Export.Top2incrementalBrand.Gr%' = SUM(Fact_Retail_RawData[top2_incremental_gr])
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Retail自助导出KPI
|
||
lineageTag: df42c78a-7bc7-4a56-a405-fdcbfbbbd320
|
||
|
||
measure 'External.Corp.Name' =
|
||
SWITCH(MAX(Dim_Corp[CORP_DES_C]),
|
||
"阿斯利康制药集团",1,2)
|
||
displayFolder: OLD\Others
|
||
lineageTag: 3d2e6d3f-e492-4777-a833-1a36afa34ece
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Export.Sales.LY' = SUM(Fact_Retail_RawData[sales_amount_ly])
|
||
displayFolder: OLD\Retail自助导出KPI
|
||
lineageTag: 415c9050-0165-4e3b-ab34-53bef6780764
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Export.Sales.Total' = SUM(Fact_Retail_RawData[sales_amount_total])
|
||
displayFolder: OLD\Retail自助导出KPI
|
||
lineageTag: 8f3919ea-82c1-4e9a-a478-5ae3a19823f8
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Export.Sales.LY.Total' = SUM(Fact_Retail_RawData[sales_amount_ly_total])
|
||
displayFolder: OLD\Retail自助导出KPI
|
||
lineageTag: 11059929-6459-416b-9d4e-7f25f4999f2b
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Export.MS%.LY' = DIVIDE([Retail.Export.Sales.LY],[Retail.Export.Sales.LY.Total])
|
||
displayFolder: OLD\Retail自助导出KPI
|
||
lineageTag: d0df13b8-a416-4a82-8967-752108c1d55f
|
||
|
||
measure 'Retail.Export.Gr%' = DIVIDE([Retail.Export.Sales]-[Retail.Export.Sales.LY],[Retail.Export.Sales.LY])
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Retail自助导出KPI
|
||
lineageTag: 5c521162-105d-4d5d-b686-14866717be48
|
||
|
||
measure 'Retail.Export.MS%' = DIVIDE([Retail.Export.Sales],[Retail.Export.Sales.Total])
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\Retail自助导出KPI
|
||
lineageTag: 8b750295-aa41-49bd-92ae-fb8c1d473136
|
||
|
||
measure 'Retail.Export.Sales.YTD' = CALCULATE([Retail.Export.Sales],MQY[Period] = "YTD",ALL(Dim_Calendar),ALL(MQY))
|
||
formatString: #,0
|
||
displayFolder: OLD\Retail自助导出KPI
|
||
lineageTag: bc4dfd1c-6f23-483c-a3ed-2ee09876ab8e
|
||
|
||
measure 'Retail.Export.ΔMS%' = [Retail.Export.MS%] - [Retail.Export.MS%.LY]
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Retail自助导出KPI
|
||
lineageTag: bb1ee00d-80b9-4158-9753-0491ca673ec2
|
||
|
||
measure 'RetailBrand.KeyBrand.Rank.QTD' = SUM(Fact_Retail_Brand[key_brand_rank_qtd])
|
||
formatString: 0
|
||
displayFolder: OLD\Retail品牌数据报表KPI
|
||
lineageTag: 05dd1b5c-9283-4797-b65e-b8a817b77234
|
||
|
||
measure 'RetailBrand.KeyBrand.Rank.YTD' = SUM(Fact_Retail_Brand[key_brand_rank_ytd])
|
||
formatString: 0
|
||
displayFolder: OLD\Retail品牌数据报表KPI
|
||
lineageTag: c2754f89-9e74-4101-a4d5-96eead740c40
|
||
|
||
measure 'RetailBrand.KeyBrand.Name.QTD' = MAX(Fact_Retail_Brand[key_brand_qtd])
|
||
formatString: 0
|
||
displayFolder: OLD\Retail品牌数据报表KPI
|
||
lineageTag: 5f4cfb7d-c712-448b-80e8-a201c2f74020
|
||
|
||
measure 'RetailBrand.KeyBrand.Name.YTD' = MAX(Fact_Retail_Brand[key_brand_ytd])
|
||
displayFolder: OLD\Retail品牌数据报表KPI
|
||
lineageTag: 01f17b32-e32e-46a1-84d1-b581dba31b6d
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'RetailBrand.TopBrand.Gr%.QTD' = SUM(Fact_Retail_Brand[top_brand_gr_qtd])
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Retail品牌数据报表KPI
|
||
lineageTag: 2ad7ef37-44a0-4748-93e9-81ed0da462f9
|
||
|
||
measure 'RetailBrand.TopBrand.Gr%.YTD' = SUM(Fact_Retail_Brand[top_brand_gr_ytd])
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Retail品牌数据报表KPI
|
||
lineageTag: 43b176cf-0b23-4cbe-b883-abf86ec96560
|
||
|
||
measure 'RetailBrand.TopBrand.MS%.YTD' = SUM(Fact_Retail_Brand[top_brand_ms_ytd])
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\Retail品牌数据报表KPI
|
||
lineageTag: df0affef-8f59-4848-97a4-f718c89987d7
|
||
|
||
measure 'RetailBrand.TopBrand.MS%.QTD' = SUM(Fact_Retail_Brand[top_brand_ms_qtd])
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\Retail品牌数据报表KPI
|
||
lineageTag: 5378981d-7cce-4003-bd41-81f4de2f0d4c
|
||
|
||
measure 'RetailBrand.TopBrand.Name.QTD' = MAX(Fact_Retail_Brand[top_brand_qtd])
|
||
displayFolder: OLD\Retail品牌数据报表KPI
|
||
lineageTag: 2ffc7941-e136-4ff8-8929-8169ed9c285c
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'RetailBrand.TopBrand.Name.YTD' = MAX(Fact_Retail_Brand[top_brand_ytd])
|
||
displayFolder: OLD\Retail品牌数据报表KPI
|
||
lineageTag: 6c6d6398-e220-465d-976c-83a21ef38f6d
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'RetailBrand.TopBrand.Inc.MS%.QTD' = SUM(Fact_Retail_Brand[top_brand_inc_ms_qtd])
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\Retail品牌数据报表KPI
|
||
lineageTag: 1548880d-69bc-4073-8c26-db82535f6b41
|
||
|
||
measure 'RetailBrand.TopBrand.Inc.MS%.YTD' = SUM(Fact_Retail_Brand[top_brand_inc_ms_ytd])
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\Retail品牌数据报表KPI
|
||
lineageTag: f403150d-a1c0-4d50-b437-8ed521a51ce2
|
||
|
||
measure 'Retail.Export.Sales.QTD' = CALCULATE([Retail.Export.Sales],MQY[Period] = "QTD",ALL(Dim_Calendar),ALL(MQY))
|
||
formatString: #,0
|
||
displayFolder: OLD\Retail自助导出KPI
|
||
lineageTag: deed741e-4b46-42b5-b121-43fab3f8eb16
|
||
|
||
measure 'External.1.1.Text.EC' = ```
|
||
|
||
VAR E = "EC渠道 DM=NIAD,CV不含中成药及PCSK9,GI=GI Oral (OTC+Rx)。"
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
ISFILTERED(Dim_DataSource) && "EC" IN VALUES(Dim_DataSource[SOURCENAME]),E
|
||
)
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: ea2adf27-ed2b-4175-9203-57e3e9932520
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.2.1.Text.EC' = ```
|
||
|
||
VAR SO = "SO(Self-Operation):中康数据包含京东健康大药房/阿里健康大药房及AZ旗舰店;SO目前属于AZ电商团队业务范畴"
|
||
VAR POP = "POP(Platform Open Plan):电商平台上的三方卖家,如海王星辰/老百姓等零售连锁入驻电商平台开的旗舰店;POP目前属于AZ零售团队业务范畴"
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
ISFILTERED(Dim_StoreType) && "SO" IN VALUES(Dim_StoreType[STORE_TYPE]),SO,
|
||
ISFILTERED(Dim_DataSource) && "POP" IN VALUES(Dim_StoreType[STORE_TYPE]),POP
|
||
)
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 76322594-cda5-4e1d-8ade-896419fee310
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Gr%.KPI.Class' =
|
||
DIVIDE (
|
||
[External.Sales.KPI.Class] - [External.Sales.LY.KPI.Class],
|
||
[External.Sales.LY.KPI.Class]
|
||
)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:产品同比增长率
|
||
------KPI公式:(今年产品销量-去年产品销量)/去年产品销量
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\GR%
|
||
lineageTag: f2b3ad7a-5111-4e41-81b5-2da8e59dd883
|
||
|
||
measure 'External.Sales.KPI.DS' =
|
||
CALCULATE (
|
||
[01.Value],
|
||
ALL ( Dim_Calendar ),
|
||
TREATAS (
|
||
VALUES ( Dim_Geo[DATA_SOURCE] ),
|
||
Dim_DataSource[DATA_SOURCE]
|
||
)
|
||
)
|
||
displayFolder: OLD\External Sales
|
||
lineageTag: 380baf7f-833e-4297-9a56-5c8d9a7f6f50
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.KPI.Filter' =
|
||
|
||
CALCULATE([External.Value.MTH],MQY[Period]="mth")
|
||
displayFolder: OLD\External Sales
|
||
lineageTag: 301fa5ea-de21-48e3-a333-ac18f0dbef45
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.GRSalesContr%.KPI.EC' =
|
||
|
||
VAR A = CALCULATE([External.GRSales.KPI],ALLSELECTED())
|
||
RETURN
|
||
DIVIDE([External.GRSales.KPI],A)
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:增长金额占比
|
||
------KPI公式:产品增长销量 / 市场增长销量
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\MS%
|
||
lineageTag: 6a5b16a9-d6c6-4937-87ca-ccdfcbd96c00
|
||
|
||
measure 'External.Sales.LY.KPI.Market.EC' =
|
||
|
||
VAR A = [External.MKTPack.Count]
|
||
RETURN
|
||
IF (
|
||
A <> BLANK (),
|
||
CALCULATE (
|
||
[External.Sales.LY.KPI.Market.MID],
|
||
ALL ( Dim_PackInfo ),
|
||
ALL ( Dim_Class ),
|
||
ALL ( Dim_Corp ),
|
||
ALL ( Dim_StoreType ),
|
||
ALL ( Dim_Platform ),
|
||
ALL ( Dim_KeyCompetitor ),
|
||
ALL ( Dim_Dept ),
|
||
ALL ( Dim_CoreDept[CORE_DEPT] )
|
||
)
|
||
)
|
||
formatString: #,0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: 2a26c37d-dd42-4f84-a6b5-7c120311debc
|
||
|
||
measure 'External.Sales.KPI.Market.EC' =
|
||
VAR A = [External.MKTPack.Count]
|
||
RETURN
|
||
IF (
|
||
A <> BLANK ( ),
|
||
CALCULATE (
|
||
[External.Sales.KPI.Market.MID],
|
||
ALL ( Dim_PackInfo ),
|
||
ALL ( Dim_Class ),
|
||
ALL ( Dim_Corp ),
|
||
ALL ( Dim_StoreType ),
|
||
ALL ( Dim_Platform ),
|
||
ALL ( Dim_KeyCompetitor ),
|
||
ALL ( Dim_Dept ),
|
||
ALL ( Dim_CoreDept[CORE_DEPT] )
|
||
)
|
||
)
|
||
formatString: #,0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: df77ff37-8ea3-4ece-8f54-ddd1cded7f0b
|
||
|
||
measure 'External.GRSales.KPI.Market.EC' =
|
||
[External.Sales.KPI.Market.EC]-[External.Sales.LY.KPI.Market.EC]
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:市场增长金额
|
||
------KPI公式:今年市场销量-去年同期市场销量
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
displayFolder: OLD\External Sales
|
||
lineageTag: 2bad0ba6-7b79-46ee-b094-37bdbd4eee00
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Rank.KPI.Corp2.1' = ```
|
||
|
||
IF([External.Sales.KPI2.1]<>BLANK(),
|
||
CALCULATE(RANK(DENSE, ALL(Dim_Corp[CORP_DES_C]), ORDERBY([External.Sales.KPI2.1], DESC)),
|
||
REMOVEFILTERS(Dim_Corp[CORP_TYPE])
|
||
)
|
||
)
|
||
```
|
||
displayFolder: OLD\Rank
|
||
lineageTag: fba3689a-0fcc-48b0-8187-db7ed3bd4944
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.4.2.Text' = ```
|
||
|
||
VAR R = ""
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
ISFILTERED(Dim_DataSource) && "Retail" IN VALUES(Dim_DataSource[SOURCENAME]),R
|
||
)
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 182c797d-d8f7-4da6-9b86-658b63d032a4
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.KPI.GEO' = ```
|
||
|
||
CALCULATE([External.Sales.KPI],ALL(Dim_Calendar))
|
||
|
||
```
|
||
displayFolder: OLD\External Sales
|
||
lineageTag: b6751573-5f30-42b5-ac0e-5e8ca75dfeac
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'EC.Gr%.Top2Brand' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(MAX(Fact_EC[KPI_VAL]),
|
||
Fact_EC[KPI_NAME] = "top2_brand_gr",
|
||
Fact_EC[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar ))
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 251f8d2b-8f26-4a0b-ac3b-ed759c52bc2b
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'EC.incremental.Top2BrandName' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(MAX(Fact_EC[STR_KPI_VAL]),
|
||
Fact_EC[KPI_NAME] = "incrementa2_brand",
|
||
Fact_EC[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar ))
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 55104ad6-8d23-4979-b4e3-1478b04558c1
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'EC.incrementalGr%.Top2Brand' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(MAX(Fact_EC[KPI_VAL]),
|
||
Fact_EC[KPI_NAME] = "incrementa2_brand_gr",
|
||
Fact_EC[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar ))
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: abe94190-cf30-4092-9446-3738072596e6
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'EC.Value.Top2BrandName' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(MAX(Fact_EC[STR_KPI_VAL]),
|
||
Fact_EC[KPI_NAME] = "top2_brand_val",
|
||
Fact_EC[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar ))
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: c5ad1965-2389-4964-ac53-f33063a664bb
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure Trend_Is_In_DateRange1 = ```
|
||
|
||
VAR MTHS = 12
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
ISINSCOPE(Dim_Calendar_Alt[YYYYMM]),
|
||
VAR YM = SELECTEDVALUE(Dim_Calendar_Alt[YYYYMM])
|
||
VAR DATE1 = CALCULATE(MAX(Dim_Calendar[DATE]))
|
||
VAR DATE0 = DATE(YEAR(DATE1), MONTH(DATE1)-MTHS, 1)
|
||
RETURN int(YM>=FORMAT(DATE0,"yyyyMM") && YM<=FORMAT(DATE1,"yyyyMM")),
|
||
ISINSCOPE(Dim_Calendar_Alt[YEAR_QUATER]),
|
||
VAR YQ = SELECTEDVALUE(Dim_Calendar_Alt[YEAR_QUATER])
|
||
VAR DATE1 = CALCULATE(ENDOFQUARTER(Dim_Calendar[DATE]))
|
||
VAR DATE0 = DATE(YEAR(DATE1), MONTH(DATE1)-MTHS, 1)
|
||
RETURN int(YQ>=FORMAT(DATE0,"yyyy\QQ") && YQ<=FORMAT(DATE1,"yyyy\QQ"))
|
||
)
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: d7d5c251-ee9f-4b04-9962-3f654f0e4312
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.EC.Contr%' =
|
||
|
||
VAR A = CALCULATE([External.Sales.KPI],ALL(Fact_Sales[STORE_PLATFORM]))
|
||
RETURN
|
||
DIVIDE([External.Sales.KPI],A)
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\External Sales
|
||
lineageTag: a5055d83-e3f9-4eaf-a706-539419a687dd
|
||
|
||
measure 'External.SalesContr%.KPI.EC' =
|
||
|
||
VAR A = CALCULATE([External.Sales.KPI],ALLSELECTED())
|
||
RETURN
|
||
DIVIDE([External.Sales.KPI],A)
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\MS%
|
||
lineageTag: e7618252-bcf1-4bc1-9c8a-601387c164d4
|
||
|
||
measure ICO_OnLine =
|
||
"data:image/svg+xml;utf8,
|
||
<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'>
|
||
<path d='M20 6H4C3.44772 6 3 6.44772 3 7V20C3 20.5523 3.44772 21 4 21H20C20.5523 21 21 20.5523 21 20V7C21 6.44772 20.5523 6 20 6Z' stroke='white' stroke-width='1.25' stroke-linejoin='round'/>
|
||
<path d='M8.97461 12.0039H14.9746' stroke='white' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'/>
|
||
<path d='M3 6.5L6.5 2.5H17.5L21 6.5' stroke='white' stroke-width='1.25' stroke-linecap='round' stroke-linejoin='round'/>
|
||
</svg>
|
||
"
|
||
displayFolder: OLD\Others
|
||
lineageTag: ce48d50c-e847-4843-bee3-451768635c7b
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'EC.Page.Link' =
|
||
|
||
VAR T = CALCULATE([External.Sales.KPI.DS],Dim_DataSource[SOURCENAME] = "EC",ALL())
|
||
RETURN
|
||
IF(T<> BLANK(),"EC Deep Dive电商分析")
|
||
displayFolder: OLD\Others
|
||
lineageTag: 3a4d8a44-7787-493c-a532-aea1617cc40b
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'EC.Page.Link.Comments' =
|
||
|
||
VAR T = CALCULATE([External.Sales.KPI.DS],Dim_DataSource[SOURCENAME] = "EC",ALL())
|
||
RETURN
|
||
IF(T = BLANK(),"对不起,你没有访问此报告页的权限")
|
||
displayFolder: OLD\Others
|
||
lineageTag: 7134d18b-74cf-4093-a8ec-3041709ef34a
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Page.Link.Comments' =
|
||
|
||
VAR T = CALCULATE([External.Sales.KPI.DS],Dim_DataSource[SOURCENAME] = "Retail",ALL())
|
||
RETURN
|
||
IF(T = BLANK(),"对不起,你没有访问此报告页的权限")
|
||
displayFolder: OLD\Others
|
||
lineageTag: 0e4c91f7-e710-493b-afa3-3c4328ecde7a
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Page.Link' =
|
||
|
||
VAR T = CALCULATE([External.Sales.KPI.DS],Dim_DataSource[SOURCENAME] = "Retail",ALL())
|
||
RETURN
|
||
IF(T<> BLANK(),"Price Distribution价格与铺货")
|
||
displayFolder: OLD\Others
|
||
lineageTag: 6c530976-7cf0-49cc-9752-5ad9799a8a5e
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.2.3.Text' = ```
|
||
|
||
VAR _W = "选择Class时,请先选择Market。"
|
||
VAR R = "仅含AZ零售相关市场产品数据。"
|
||
VAR E = "仅含AZ EC相关市场产品数据。"
|
||
VAR _IF = (NOT ISFILTERED(Dim_Market[MARKET])) && SELECTEDVALUE('Fields.Rows'[Fields Order]) =213
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
ISFILTERED(Dim_DataSource) && "EC" IN VALUES(Dim_DataSource[SOURCENAME]),IF(_IF,_W&E,E),
|
||
ISFILTERED(Dim_DataSource) && "Retail" IN VALUES(Dim_DataSource[SOURCENAME]),IF(_IF,_W&R,R),
|
||
IF(_IF,_W)
|
||
)
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 4595e978-4613-4125-8cee-9afce2d58502
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure Max_XIEHE_Date = ```
|
||
"科室市场 (Q): " & CALCULATE(MAX(Fact_Sales[YYYYMM]),Dim_DataSource[DATA_SOURCE] =
|
||
"XH Data(Quarterly)",ALL())
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 46b9db2c-e0d5-454a-83ad-dd50b5c4e911
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure Max_AIA_Date = "AIA (M): " & CALCULATE(MAX(Fact_Sales[YYYYMM]),Dim_DataSource[DATA_SOURCE] = "AIA(Monthly)",ALL())
|
||
displayFolder: OLD\Others
|
||
lineageTag: ac46ce9a-ad4e-4da4-9076-3f92b3fe4f5c
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure color =
|
||
|
||
SWITCH(
|
||
TRUE(),
|
||
CONTAINS(VALUES('Dim_DataSource'[SOURCENAME]), 'Dim_DataSource'[SOURCENAME], "AIA"), "#8E2D63",
|
||
"#FFFFFF"
|
||
)
|
||
// SWITCH(TRUE(),
|
||
// SELECTEDVALUE('Dim_DataSource'[SOURCENAME]) = "AIA" ,"#8E2D63","#FFFFFF")
|
||
displayFolder: OLD\Others
|
||
lineageTag: 7f9b3807-7339-4472-bcc0-ee7ffd341c55
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure color2 =
|
||
|
||
SWITCH(
|
||
TRUE(),
|
||
CONTAINS(VALUES('Dim_DataSource'[SOURCENAME]), 'Dim_DataSource'[SOURCENAME], "AIA"), "#E6E6E6",
|
||
"#FFFFFF")
|
||
// SWITCH(TRUE(),
|
||
// SELECTEDVALUE('Dim_DataSource'[SOURCENAME]) = "AIA","#E6E6E6","#FFFFFF")
|
||
displayFolder: OLD\Others
|
||
lineageTag: 8633197e-5848-4425-af51-a206b5e6fefb
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.1.1.1.Text' = ```
|
||
|
||
VAR A = "季度数据,请选择3/6/9/12月份代表Q1/Q2/Q3/Q4,请勿选择MTH"
|
||
VAR B =""
|
||
VAR C= "因CHPA新版城市数据仍在核查中,因此暂时关闭城市数据,CHPA全国数据仍可正常使用"
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
// "CHPA" IN VALUES(Dim_DataSource[SOURCENAME]),c
|
||
ISFILTERED(Dim_DataSource) && "Quarterly" IN VALUES(Dim_DataSource[DATA_TYPE])&& (NOT "Retail" IN VALUES(Dim_DataSource[SOURCENAME])),A
|
||
)
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 95599829-e50a-4c3c-857f-81bbc150953a
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.1.1.2.Text' = ```
|
||
|
||
VAR A = "AIA数据口径为两年共有且自23年起月度连续有数的目标机构"
|
||
// VAR B = "THC 2024年采买半年度数据,2024年GR请选择【Half-Year】"
|
||
VAR R = "Retail渠道 DM = NIAD"
|
||
// VAR E = "EC渠道 DM=NIAD,CV不含中成药及PCSK9,GI=GI Oral (OTC+Rx)。"
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
ISFILTERED(Dim_DataSource) && "AIA" IN VALUES(Dim_DataSource[SOURCENAME]),A,
|
||
// ISFILTERED(Dim_DataSource) && "THC" IN VALUES(Dim_DataSource[SOURCENAME]),B,
|
||
// ISFILTERED(Dim_DataSource) && "CHC" IN VALUES(Dim_DataSource[SOURCENAME]),B,
|
||
ISFILTERED(Dim_DataSource) && "Retail" IN VALUES(Dim_DataSource[SOURCENAME]),R
|
||
)
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 687e11a6-6862-43ee-8472-5390010c8e1a
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'TopN.Value' = SELECTEDVALUE('TopN'[TopN], 1)
|
||
displayFolder: OLD\Top
|
||
lineageTag: d855dc32-68e1-4dba-8ef0-d480006b1c8f
|
||
|
||
measure 'External.MS%.TopNCompetitor' = CALCULATE([External.MS%.TopNPlayer], Dim_PackInfo[CORP_DES]<>"ASTRAZENECA")
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Top
|
||
lineageTag: c00ef5a9-de6a-4d53-82c0-287e22702bae
|
||
|
||
measure 'External.MS%.TopNCompetitorName' = CALCULATE([External.MS%.TopNPlayerName], Dim_PackInfo[CORP_DES]<>"ASTRAZENECA")
|
||
displayFolder: OLD\Top
|
||
lineageTag: f42d0bc7-9e1f-41f1-8587-078d8ca17043
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Value.Test' = [External.Value.MID]
|
||
displayFolder: OLD\性能测试KPI
|
||
lineageTag: 46c108a3-a914-40f6-bb36-24806ab93581
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Value.LY.Test' = [External.Value.LY.MID]
|
||
displayFolder: OLD\性能测试KPI
|
||
lineageTag: 70ba52a2-64d8-4b7b-bedd-7714002e12b4
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Gr%.Test' =
|
||
|
||
VAR CV = [External.Value.Test]
|
||
VAR PV = [External.Value.LY.Test]
|
||
RETURN
|
||
IF(PV <> BLANK(),DIVIDE(CV-PV,PV))
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\性能测试KPI
|
||
lineageTag: 9314261c-b8b9-43de-a49c-f2bf342c7d02
|
||
|
||
measure 'External.Value.Market.Test' =
|
||
|
||
CALCULATE([External.Value.Test],
|
||
ALL(Dim_Class),ALL(Dim_Corp),ALL(Dim_PackInfo)
|
||
)
|
||
displayFolder: OLD\性能测试KPI
|
||
lineageTag: bae21851-e8c0-4dc1-8d4e-ff77bb8e21e4
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Value.LY.Market.Test' =
|
||
|
||
CALCULATE([External.Value.LY.Test],
|
||
ALL(Dim_Class),ALL(Dim_Corp),ALL(Dim_PackInfo)
|
||
)
|
||
displayFolder: OLD\性能测试KPI
|
||
lineageTag: b4e3c730-0e41-4c81-ac70-cb18558957a2
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.Test' = DIVIDE([External.Value.Test],[External.Value.Market.Test])
|
||
displayFolder: OLD\性能测试KPI
|
||
lineageTag: ea886d43-33a3-40fc-bf12-36ca1c05b81d
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.LY.Test' = DIVIDE([External.Value.LY.Test],[External.Value.LY.Market.Test])
|
||
formatString: 0.00%;-0.00%;0.00%
|
||
displayFolder: OLD\性能测试KPI
|
||
lineageTag: f4c60dae-7876-4f44-b223-43172d3d89cf
|
||
|
||
measure 'External.ΔMS%.Test' = [External.MS%.Test] - [External.MS%.LY.Test]
|
||
formatString: 0.00%;-0.00%;0.00%
|
||
displayFolder: OLD\性能测试KPI
|
||
lineageTag: 93f6310d-f26b-4727-9260-364de778f283
|
||
|
||
measure 'External.Gr%.Market.Test' =
|
||
|
||
VAR CV = [External.Value.Market.Test]
|
||
VAR PV = [External.Value.LY.Market.Test]
|
||
RETURN
|
||
IF(PV <> BLANK(),DIVIDE(CV-PV,PV))
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\性能测试KPI
|
||
lineageTag: de94ddc6-4b09-4d7d-ad0c-a6c03a9bdcd5
|
||
|
||
measure 'External.EI.Test' =
|
||
|
||
VAR A = [External.Gr%.Test]
|
||
VAR B = [External.Gr%.Market.Test]
|
||
RETURN IF(A <> BLANK(),DIVIDE(1+A,1+B)*100)
|
||
formatString: 0
|
||
displayFolder: OLD\性能测试KPI
|
||
lineageTag: a311d3c4-a212-4838-b700-a670e6148cfe
|
||
|
||
measure 'External.MS%.TopNCompetitor.Test' = CALCULATE([External.MS%.TopNPlayer.Test], Dim_PackInfo[CORP_DES]<>"ASTRAZENECA")
|
||
displayFolder: OLD\性能测试KPI
|
||
lineageTag: 00e3a585-951f-404f-9688-5289b912423b
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.TopNCompetitorName.Test' = CALCULATE([External.MS%.TopNPlayerName.Test], Dim_PackInfo[CORP_DES]<>"ASTRAZENECA")
|
||
displayFolder: OLD\性能测试KPI
|
||
lineageTag: a376bfdd-84fa-44b9-8225-775667462ef4
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.KPI.Top1Player.Test' = CALCULATE([External.MS%.TopNPlayer], 'TopN'[TopN]=1)
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\性能测试KPI
|
||
lineageTag: 0dcb0572-050b-424b-9597-edb8f96e96d3
|
||
|
||
measure 'External.MS%.KPI.Top1PlayerName.Test' = CALCULATE([External.MS%.TopNPlayerName.Test], 'TopN'[TopN]=1)
|
||
displayFolder: OLD\性能测试KPI
|
||
lineageTag: a5f81b2b-553f-41ad-8445-1d445353fd22
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.KPI.Top1Competitor.Test' = CALCULATE([External.MS%.TopNCompetitor.Test],'TopN'[TopN] = 1)
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\性能测试KPI
|
||
lineageTag: c526842d-dc1b-4278-bef1-640e5d2c48e0
|
||
|
||
measure 'External.MS%.KPI.Top1CompetitorName.Test' = CALCULATE([External.MS%.TopNCompetitorName.Test], 'TopN'[TopN]=1)
|
||
displayFolder: OLD\性能测试KPI
|
||
lineageTag: a7e7835b-f7c7-497d-9bfe-ae6227cb1101
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.TopNPlayer.Test' =
|
||
|
||
VAR CV = [External.Value.Test]
|
||
VAR T = CALCULATETABLE(
|
||
INDEX([TopN.Value],
|
||
ADDCOLUMNS(SUMMARIZE(FACT_Sales, Dim_PackInfo[PROD_CORP_C]), "@VAL", [External.MS%.Test]), ORDERBY([@VAL], DESC)
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_PACK] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] )
|
||
)
|
||
RETURN IF(CV <> BLANK(),MAXX(T, [@VAL]))
|
||
displayFolder: OLD\性能测试KPI
|
||
lineageTag: e12baea7-5a94-446b-a401-c6743724c516
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.TopNPlayerName.Test' =
|
||
|
||
VAR CV = [External.Value.Test]
|
||
VAR T = CALCULATETABLE(
|
||
INDEX([TopN.Value],
|
||
ADDCOLUMNS(SUMMARIZE(FACT_Sales, Dim_PackInfo[PROD_CORP_C]), "@VAL", [External.Value.Test]), ORDERBY([@VAL], DESC)
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_PACK] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] )
|
||
)
|
||
RETURN IF(CV <> BLANK(),MAXX(T, [PROD_CORP_C] ))
|
||
displayFolder: OLD\性能测试KPI
|
||
lineageTag: 14aeac91-a9c2-4cf1-947a-5d3d79bc7b49
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.GRSales.MTH' = [External.Sales.MTH]-[External.Sales.LY.MTH]
|
||
displayFolder: OLD\Top
|
||
lineageTag: 24bd3f4d-e777-48e5-ab21-62f18238f860
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.GRSales.TopNPlayer' = ```
|
||
|
||
VAR CV = [External.Sales.KPI.Market]
|
||
VAR T =
|
||
CALCULATETABLE(
|
||
INDEX([TopN.Value],
|
||
ADDCOLUMNS(SUMMARIZE(FACT_Sales, Dim_PackInfo[PROD_CORP_C]), "@GRVAL", [External.GRSales.MTH], "@VAL", [External.Sales.KPI]), ORDERBY([@GRVAL], DESC)
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_PACK] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] )
|
||
)
|
||
RETURN IF(CV <> BLANK(),MAXX(T, [@VAL] ))
|
||
```
|
||
formatString: #,0
|
||
displayFolder: OLD\Top
|
||
lineageTag: 811e2b9a-d4e2-41e6-a294-a72360c880fd
|
||
|
||
measure 'External.GRSales.TopNPlayerGr' = ```
|
||
|
||
VAR CV = [External.Sales.KPI.Market]
|
||
VAR T =
|
||
CALCULATETABLE(
|
||
INDEX([TopN.Value],
|
||
ADDCOLUMNS(SUMMARIZE(FACT_Sales, Dim_PackInfo[PROD_CORP_C]), "@VAL", [External.GRSales.MTH], "@GR", [External.Gr%.KPI]), ORDERBY([@VAL], DESC)
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_PACK] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] )
|
||
)
|
||
RETURN IF(CV <> BLANK(),MAXX(T, [@GR] ))
|
||
```
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Top
|
||
lineageTag: 1ffab892-83c6-4e58-a910-151b18f7174e
|
||
|
||
measure 'External.GRSales.TopNPlayerVBPName' = ```
|
||
|
||
VAR CV = [External.Sales.KPI.Market]
|
||
VAR T =
|
||
CALCULATETABLE(
|
||
INDEX([TopN.Value],
|
||
ADDCOLUMNS(SUMMARIZE(FACT_Sales, Dim_PackInfo[PROD_VBP],Dim_PackInfo[PROD_CORP_C]), "@VAL", [External.GRSales.MTH]), ORDERBY([@VAL], DESC)
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_PACK] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] )
|
||
)
|
||
RETURN IF(CV <> BLANK(),MAXX(T, [PROD_VBP] ))
|
||
```
|
||
displayFolder: OLD\Top
|
||
lineageTag: 741f426e-cc82-4ceb-882a-48e7abbae2ca
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Value.Test.Ori' = SUMX ( Fact_Sales, [SALES_VALUE_CAL] )
|
||
displayFolder: OLD\性能测试KPI
|
||
lineageTag: 72e29bc3-50af-4ec1-a986-281173994335
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.3.1.Text' = ```
|
||
|
||
VAR R = "2025年THC仅有全国数据,THC省份历史数据请至Free Report中查看"
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
ISFILTERED(Dim_DataSource) && "THC" IN VALUES(Dim_DataSource[SOURCENAME]),R
|
||
)
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 3f8cd6fb-9a4f-4483-8fc2-418d75c4f595
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.5.1.Text' = ```
|
||
|
||
VAR R = "2025年THC仅有全国数据,THC省份历史数据请至Free Report中查看"
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
ISFILTERED(Dim_DataSource) && "THC" IN VALUES(Dim_DataSource[SOURCENAME]),R
|
||
)
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: b585b358-84bf-4537-bd2b-4a97b1620b1e
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.4.1.Text.Retail' =
|
||
VAR R = "Retail渠道直取数据导出"
|
||
RETURN
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISFILTERED ( Dim_DataSource )
|
||
&& "Retail" IN VALUES ( Dim_DataSource[SOURCENAME] ), R
|
||
)
|
||
displayFolder: OLD\Others
|
||
lineageTag: 714215a0-557a-41fc-9200-f7df233e3cff
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.5.1.1.Text' = ```
|
||
|
||
VAR R = "由于取数口径及数据打通后的产品属性差异,本报告中AIA与AIA Dasboard数据可能存在一定差异
|
||
AIA数据口径为两年共有且自23年起月度连续有数的目标机构"
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
ISFILTERED(Dim_DataSource) && "AIA" IN VALUES(Dim_DataSource[SOURCENAME]),R
|
||
)
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 8bf8b5e2-89b9-4754-95fb-4ac0c654184c
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.KPI.Total' = CALCULATE([External.Sales.KPI],ALLSELECTED())
|
||
displayFolder: OLD\过渡性KPI
|
||
lineageTag: 91bb2f76-a85b-49c0-b9bd-8faaecfd06be
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.SalesContr%.KPI' =
|
||
|
||
DIVIDE([External.Sales.KPI],[External.Sales.KPI.Total])
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\MS%
|
||
lineageTag: 3b656b0c-7dbe-43cb-95df-c5127e4bf713
|
||
|
||
measure 'External.MKTPack.Count' = COUNTROWS(Fact_Sales)
|
||
displayFolder: OLD\中间KPI
|
||
lineageTag: 3c7a3625-6f01-46df-8b24-d071a8978411
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'ACCESS_SALES_GEO TEST' = ```
|
||
/*
|
||
VAR GEO = SUMMARIZECOLUMNS(Dim_Geo[AUDIT_SOURCE])
|
||
VAR KCD = "KJVN332" --CUSTOMDATA()
|
||
VAR ACCESS = IF(SELECTEDVALUE(CONFIG_REPORT[REPORT]) = "AIA",
|
||
VAR AUDIT_AIA = CALCULATETABLE(VALUES(dm_auth_aia_sales_geo[AUDIT_SOURCE]), dm_auth_aia_sales_geo[KCODE] = KCD)
|
||
RETURN GEO IN AUDIT_AIA,
|
||
|
||
VAR AUDIT_MA = SELECTCOLUMNS(
|
||
FILTER(
|
||
DM_AUTH_SALES_GEO,DM_AUTH_SALES_GEO[KCODE]= KCD),
|
||
"AUDIT_SOURCE",
|
||
DM_AUTH_SALES_GEO[AUDIT_SOURCE])
|
||
RETURN GEO IN AUDIT_MA)
|
||
RETURN ACCESS
|
||
*/
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 0fbb83f5-4f57-45da-9cf2-cd2cf8e15cfc
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Fix_Is_AIA.MID.MID' =
|
||
|
||
SELECTEDVALUE(Dim_DataSource[SOURCENAME]) = "AIA" ||ISFILTERED(Dim_IsTarget_AIASpecial[IS_TARGET_HP])
|
||
--用于中间KPI的MTH.MID度量值的逻辑修改--
|
||
displayFolder: OLD\Others
|
||
lineageTag: e2f1d6ed-1b94-4a94-ab3c-f38342e158b9
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Trend.KPI.Sales.H' = ```
|
||
//按指定字段排序的销售金额趋势
|
||
IF(ISFILTERED(Dim_Corp),
|
||
IF([Trend_Is_In_DateRange.H]>=0,
|
||
CALCULATE(
|
||
[External.Sales.KPI],
|
||
REMOVEFILTERS(Dim_Calendar),
|
||
REMOVEFILTERS(Dim_Calendar_Alt),
|
||
TREATAS(VALUES(Dim_Calendar_Alt[YYYYMM]),Dim_Calendar[YYYYMM]),
|
||
MQY[Period] = "MTH"
|
||
//DIM_GEO[province_name]="National"
|
||
)
|
||
)
|
||
,
|
||
IF([External.Sales.KPI]<>BLANK() && [External.Rank.KPI]<=[Top Value],
|
||
IF([Trend_Is_In_DateRange.H]>=0,
|
||
CALCULATE(
|
||
[External.Sales.KPI],
|
||
REMOVEFILTERS(Dim_Calendar),
|
||
REMOVEFILTERS(Dim_Calendar_Alt),
|
||
TREATAS(VALUES(Dim_Calendar_Alt[YYYYMM]),Dim_Calendar[YYYYMM]),
|
||
MQY[Period] = "MTH"
|
||
//DIM_GEO[province_name]="National"
|
||
)
|
||
)
|
||
)
|
||
)
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 834779b7-3032-41ad-89b8-32331c5b91b4
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Trend.KPI.Sales.H.ALLCORP' = CALCULATE([External.Trend.KPI.Sales.H], REMOVEFILTERS(Dim_Corp))
|
||
formatString: #,0
|
||
displayFolder: OLD\Others
|
||
lineageTag: 4c848188-d167-4df4-9fa0-855431b97d0c
|
||
|
||
measure 'External.Sales.KPI.Trend.H2.2' = ```
|
||
|
||
IF([External.Sales.KPI2.1]<>BLANK() && [External.Rank.KPI2.1]<=[Top Value] && [External.Rank.KPI2.1]<>BLANK(),
|
||
IF([Trend_Is_In_DateRange.H]>=0,
|
||
// IF(
|
||
CALCULATE(
|
||
[External.Trend.KPI2.2_2]
|
||
,
|
||
REMOVEFILTERS(Dim_Calendar),
|
||
REMOVEFILTERS(Dim_Calendar_Alt),
|
||
TREATAS(VALUES(Dim_Calendar_Alt[YYYYMM]),Dim_Calendar[YYYYMM])
|
||
// ,
|
||
// MQY[Period] = "MTH"
|
||
)
|
||
// = -1,BLANK(),[External.Trend.KPI2.2_2]
|
||
// )
|
||
)
|
||
)
|
||
```
|
||
displayFolder: OLD\特定视觉对象使用KPI2.2
|
||
lineageTag: 9b0c7c85-92ed-48d7-b508-b4c0636b5052
|
||
|
||
formatStringDefinition = SWITCH([IMSRankedBy.Value], "MS%", "#,0.0%", "GR%", "#,0.0%", "#,#")
|
||
|
||
measure 'External.4.1.Text.THC' = ```
|
||
|
||
VAR R = "THC省份数据导出"
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
ISFILTERED(Dim_DataSource) && "THC" IN VALUES(Dim_DataSource[SOURCENAME]),R
|
||
)
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 8ef9bb47-a2ba-4562-b34f-4356341141cb
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.4.1.Text_thc' = ```
|
||
|
||
// VAR R = "Retail渠道直取数据导出"
|
||
VAR T = "2025年THC仅有全国数据,THC省份历史数据请至Free Report中查看"
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
ISFILTERED(Dim_DataSource) && "THC" IN VALUES(Dim_DataSource[SOURCENAME]),T
|
||
// ISFILTERED(Dim_DataSource) && "Retail" IN VALUES(Dim_DataSource[SOURCENAME]),R
|
||
)
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 13c03444-e192-4ce0-8817-3f91e1dd7b80
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Warning.Text_THC' =
|
||
|
||
IF(
|
||
NOT(ISEMPTY(INTERSECT({15,16,17,18,19,24,25,26,27,28}, VALUES('Measures_THC'[Measures Order])))) && ISEMPTY(INTERSECT({212}, VALUES('Fields.Rows'[Fields Order]))) && NOT(ISFILTERED(Dim_Market[MARKET]))&& NOT(ISFILTERED(Dim_BrandDefaultMKT)),
|
||
"⚠️计算Molecule/Class相关KPI请选择对应的市场。"
|
||
)
|
||
displayFolder: OLD\Others
|
||
lineageTag: 5c3424c3-49d0-43a9-a33e-520719c99e1a
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.LY.KPI2.1_2' = ```
|
||
|
||
VAR H = MAX(Dim_Calendar[HALF_NUM])
|
||
VAR YM = CALCULATE(DISTINCTCOUNT(Dim_Calendar[YYYYMM]),ALL(Dim_Calendar),Dim_Calendar[HALF_NUM] = 1,Dim_Calendar[YYYYMM] <= MAX(Dim_Calendar[YYYYMM]),Dim_Calendar[YEAR] = MAX(Dim_Calendar[YEAR]))
|
||
VAR DC = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
RETURN
|
||
IF([External.Sales.KPI2.1]<>BLANK() && [External.Rank.KPI2.1]<=[Top Value] && [External.Rank.KPI2.1]<>BLANK(),
|
||
IF([Trend_Is_In_DateRange.H]>=0,
|
||
CALCULATE(
|
||
SWITCH(TRUE(),
|
||
DC IN{"CHPA","EC"},
|
||
CALCULATE([External.Sales.KPI2.1]/6, SAMEPERIODLASTYEAR(Dim_Calendar[DATE]))
|
||
,
|
||
DC IN{"County","Retail","CHC","THC"},
|
||
CALCULATE([External.Sales.KPI2.1]/2, SAMEPERIODLASTYEAR(Dim_Calendar[DATE]))
|
||
)
|
||
// ,
|
||
// REMOVEFILTERS(Dim_Calendar),
|
||
// REMOVEFILTERS(Dim_Calendar_Alt),
|
||
// TREATAS(VALUES(Dim_Calendar_Alt[YYYYMM]),Dim_Calendar[YYYYMM])
|
||
// ,
|
||
// MQY[Period] = "MTH"
|
||
)
|
||
)
|
||
)
|
||
```
|
||
displayFolder: OLD\特定视觉对象使用KPI2.1
|
||
lineageTag: b40300a1-cb88-48bf-ad70-89479679a3fe
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.KPI2.1_2' = ```
|
||
|
||
VAR H = MAX(Dim_Calendar[HALF_NUM])
|
||
VAR YM = CALCULATE(DISTINCTCOUNT(Dim_Calendar[YYYYMM]),ALL(Dim_Calendar),Dim_Calendar[HALF_NUM] = 1,Dim_Calendar[YYYYMM] <= MAX(Dim_Calendar[YYYYMM]),Dim_Calendar[YEAR] = MAX(Dim_Calendar[YEAR]))
|
||
VAR DC = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
RETURN
|
||
IF([External.Sales.KPI2.1]<>BLANK() && [External.Rank.KPI2.1]<=[Top Value] && [External.Rank.KPI2.1]<>BLANK(),
|
||
IF([Trend_Is_In_DateRange.H]>=0,
|
||
CALCULATE(
|
||
SWITCH(TRUE(),
|
||
DC IN{"CHPA","EC"},
|
||
CALCULATE(AVERAGEX(VALUES(Dim_Calendar[YYYYMM]),[External.Sales.KPI2.1])),
|
||
|
||
DC IN{"County","Retail","CHC","THC"},
|
||
CALCULATE(AVERAGEX(VALUES(Dim_Calendar[YYYYMM]),[External.Sales.KPI2.1]))
|
||
// DIVIDE([External.Sales.KPI2.1],1)
|
||
)
|
||
|
||
// ,
|
||
// REMOVEFILTERS(Dim_Calendar),
|
||
// REMOVEFILTERS(Dim_Calendar_Alt),
|
||
// TREATAS(VALUES(Dim_Calendar_Alt[YYYYMM]),Dim_Calendar[YYYYMM])
|
||
// ,
|
||
// MQY[Period] = "MTH"
|
||
)
|
||
)
|
||
)
|
||
```
|
||
displayFolder: OLD\特定视觉对象使用KPI2.1
|
||
lineageTag: fba2b10d-ffaa-4e56-9e8b-5e8f44bfb004
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Trend.KPI2.2_2' = ```
|
||
|
||
IF([External.Sales.KPI2.1] <> BLANK(),
|
||
SWITCH([IMSRankedBy.Value],
|
||
"GR%", [External.Gr%.KPI2.1_2]
|
||
,
|
||
"GRVal", [External.GRSales.KPI2.1],
|
||
"MS%", [External.MS%.KPI2.1],
|
||
"ΔMS%", [External.△MS%.KPI2.1],
|
||
//else
|
||
[External.Sales.KPI2.1]
|
||
))
|
||
```
|
||
displayFolder: OLD\特定视觉对象使用KPI2.2
|
||
lineageTag: b1368484-48df-4093-a1be-17e6a10b7571
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Gr%.KPI2.1_2' =
|
||
|
||
VAR CV = [External.Sales.KPI2.1_2]
|
||
VAR PV = [External.Sales.LY.KPI2.1_2]
|
||
RETURN
|
||
IF(PV <> BLANK(),DIVIDE(CV-PV,PV))
|
||
formatString: 0.00%;-0.00%;0.00%
|
||
displayFolder: OLD\特定视觉对象使用KPI2.1
|
||
lineageTag: 5439492c-1e50-4ea7-a9ac-1b6753a43149
|
||
|
||
measure 'RetailTotal.Gr%.KPI_2' = ```
|
||
|
||
VAR DS = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
VAR CY =
|
||
SWITCH(TRUE(),
|
||
DS IN{"CHPA","EC"},
|
||
CALCULATE(AVERAGEX(VALUES(Dim_Calendar[YYYYMM]),[RetailTotal.Sales.KPI])),
|
||
|
||
DS IN{"County","Retail","CHC","THC"},
|
||
CALCULATE(AVERAGEX(VALUES(Dim_Calendar[YYYYMM]),[RetailTotal.Sales.KPI])))
|
||
VAR LY =
|
||
SWITCH(TRUE(),
|
||
DS IN{"CHPA","EC"},
|
||
CALCULATE([RetailTotal.Sales.KPI]/6, SAMEPERIODLASTYEAR(Dim_Calendar[DATE]))
|
||
,
|
||
DS IN{"County","Retail","CHC","THC"},
|
||
CALCULATE([RetailTotal.Sales.KPI]/2, SAMEPERIODLASTYEAR(Dim_Calendar[DATE]))
|
||
)
|
||
|
||
RETURN
|
||
DIVIDE(CY-LY,LY)
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
// IF(
|
||
// DIVIDE(
|
||
// CALCULATE(AVERAGEX(VALUES(Dim_Calendar[YYYYMM]),[RetailTotal.Sales.KPI])),
|
||
// CALCULATE([RetailTotal.Sales.KPI]/6,SAMEPERIODLASTYEAR(Dim_Calendar[DATE])))-1
|
||
// =-1,BLANK(),
|
||
// DIVIDE(
|
||
// CALCULATE(AVERAGEX(VALUES(Dim_Calendar[YYYYMM]),[RetailTotal.Sales.KPI])),
|
||
// CALCULATE([RetailTotal.Sales.KPI]/6,SAMEPERIODLASTYEAR(Dim_Calendar[DATE])))-1
|
||
// ))
|
||
```
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\特定视觉对象使用KPI2.1
|
||
lineageTag: 405d67c5-41ee-4501-87f8-de9547aa4723
|
||
|
||
measure 'ReportURL.MA' = CALCULATE(SELECTEDVALUE(Config_ReportURL[URL]),Config_ReportURL[ReportName]="MA")
|
||
displayFolder: OLD
|
||
lineageTag: b3a4b8fe-6b70-4577-9046-40de20c23c22
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure Max_THC_Date2 = "THC全国 (Q): " & CALCULATE(MAX(Fact_Sales[YYYYMM]),Dim_DataSource[DATA_SOURCE] = "THC(Quarterly)",ALL())
|
||
displayFolder: OLD\Others
|
||
lineageTag: 0dcacce7-9f52-4bff-b78e-d0499e3fdbe2
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Base.CountingUnit' =
|
||
|
||
IF(ISCROSSFILTERED(Dim_Market) ,
|
||
SUMX(
|
||
Fact_Sales,
|
||
Fact_Sales[CONUTING_UNIT] * [External.SelectCountingUnitMKTRatio] // * [External.SelectRegionMKTRatio]
|
||
),
|
||
SUMX(
|
||
Fact_Sales,
|
||
Fact_Sales[CONUTING_UNIT]
|
||
))
|
||
displayFolder: OLD\弃用
|
||
lineageTag: 14589f07-6acc-4b2c-889a-d010e095e914
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Base.CountingUnit.LY' =
|
||
|
||
IF(ISCROSSFILTERED(Dim_Market) ,
|
||
SUMX(
|
||
Fact_Sales,
|
||
Fact_Sales[CONUTING_UNIT_LY] * [External.SelectCountingUnitMKTRatio] // * [External.SelectRegionMKTRatio]
|
||
),
|
||
SUMX(
|
||
Fact_Sales,
|
||
Fact_Sales[CONUTING_UNIT_LY]
|
||
))
|
||
displayFolder: OLD\弃用
|
||
lineageTag: f5d6e065-702d-4834-b032-87ea738c6b4c
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Base.PDOT' =
|
||
|
||
IF(ISCROSSFILTERED(Dim_Market) ,
|
||
SUMX(
|
||
Fact_Sales,
|
||
Fact_Sales[CONUTING_UNIT] * [External.SelectPDOTMKTRatio] // * [External.SelectRegionMKTRatio]
|
||
),
|
||
SUMX(
|
||
Fact_Sales,
|
||
Fact_Sales[CONUTING_UNIT]
|
||
))
|
||
displayFolder: OLD\弃用
|
||
lineageTag: 83d1003c-71a7-4e7b-935a-baa8fec53e07
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Base.PDOT.LY' =
|
||
|
||
IF(ISCROSSFILTERED(Dim_Market) ,
|
||
SUMX(
|
||
Fact_Sales,
|
||
Fact_Sales[CONUTING_UNIT_LY] * [External.SelectPDOTMKTRatio] // * [External.SelectRegionMKTRatio]
|
||
),
|
||
SUMX(
|
||
Fact_Sales,
|
||
Fact_Sales[CONUTING_UNIT_LY]
|
||
))
|
||
displayFolder: OLD\弃用
|
||
lineageTag: 6965a622-01e7-4df1-ac70-a631deb194f6
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Base.Prescription' =
|
||
|
||
SUMX(
|
||
Fact_Sales,
|
||
Fact_Sales[PRESCRIPTION]
|
||
)
|
||
displayFolder: OLD\弃用
|
||
lineageTag: 0de7743c-2e8e-485c-bfd6-31e881c275af
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Base.Prescription.LY' =
|
||
|
||
SUMX(
|
||
Fact_Sales,
|
||
Fact_Sales[PRESCRIPTION_LY]
|
||
)
|
||
displayFolder: OLD\弃用
|
||
lineageTag: 8b8f3bfe-68f2-4b7e-bc6d-8e31fa1c6efc
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Base.Unit' =
|
||
|
||
IF(ISCROSSFILTERED(Dim_Market) ,
|
||
SUMX(
|
||
Fact_Sales,
|
||
Fact_Sales[SALES_UNIT_CAL] * [External.SelectUnitMKTRatio] // * [External.SelectRegionMKTRatio]
|
||
),
|
||
SUMX(
|
||
Fact_Sales,
|
||
Fact_Sales[SALES_UNIT_CAL]
|
||
))
|
||
displayFolder: OLD\弃用
|
||
lineageTag: b2c0f54e-b6ff-41b0-a9bd-b7139c12e5f9
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Base.Unit.LY' =
|
||
|
||
IF(ISCROSSFILTERED(Dim_Market) ,
|
||
SUMX(
|
||
Fact_Sales,
|
||
Fact_Sales[SALES_UNIT_CAL_LY] * [External.SelectUnitMKTRatio] // * [External.SelectRegionMKTRatio]
|
||
),
|
||
SUMX(
|
||
Fact_Sales,
|
||
Fact_Sales[SALES_UNIT_CAL_LY]
|
||
))
|
||
displayFolder: OLD\弃用
|
||
lineageTag: 4bb59010-6f9f-4aab-b7ed-1f36a6b013ef
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Base.VALUE' =
|
||
|
||
IF( ISCROSSFILTERED(Dim_Market),
|
||
SUMX(
|
||
Fact_Sales,
|
||
Fact_Sales[SALES_VALUE_CAL] * [External.SelectValueMKTRatio] // * [External.SelectRegionMKTRatio]
|
||
),
|
||
SUMX(
|
||
Fact_Sales,
|
||
Fact_Sales[SALES_VALUE_CAL]
|
||
))
|
||
displayFolder: OLD\弃用
|
||
lineageTag: a4e6815b-8e12-4207-8ae7-683eba57d2e3
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Base.VALUE.LY' =
|
||
|
||
IF(ISCROSSFILTERED(Dim_Market) ,
|
||
SUMX(
|
||
Fact_Sales,
|
||
Fact_Sales[SALES_VALUE_CAL_LY] * [External.SelectValueMKTRatio] // * [External.SelectRegionMKTRatio]
|
||
),
|
||
SUMX(
|
||
Fact_Sales,
|
||
Fact_Sales[SALES_VALUE_CAL_LY]
|
||
))
|
||
displayFolder: OLD\弃用
|
||
lineageTag: 5bd6c19a-f337-4970-8f95-074110506b1b
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Exteranl.WarningCHPA' =
|
||
|
||
var _c1 = CALCULATE(NOT ISEMPTY(Dim_DataSource) , KEEPFILTERS(Dim_DataSource[SOURCENAME] = "chpa"))
|
||
var _c2 = CALCULATE(NOT ISEMPTY(Dim_Calendar) , KEEPFILTERS(Dim_Calendar[YEAR] = 2019),ALLEXCEPT(Dim_Calendar,Dim_Calendar[YEAR]))
|
||
RETURN
|
||
IF(_c1&&_c2,"CHPA仅提供滚动60个月的数据")
|
||
displayFolder: OLD\Others
|
||
lineageTag: 5efdf552-5b5e-49ee-b6e6-50e91598bf3a
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Filter.Crosschannel5_2' =
|
||
|
||
ABS (
|
||
MAX ( 'Fields_CrossChannel5.2'[Fields_CrossChannel5.2 Order] )
|
||
- IF ( "county" IN ALLSELECTED ( Dim_DataSource[SOURCENAME] ), 1, -1 )
|
||
)
|
||
displayFolder: OLD\Others
|
||
lineageTag: 01527fba-9279-479a-a3a6-87fbbf4c69a7
|
||
|
||
measure 'External.Rank.KPI.Corp_EN' = ```
|
||
|
||
IF([External.Sales.KPI]<>BLANK(),
|
||
CALCULATE(RANK(DENSE, ALL(Dim_PackInfo[CORP_DES]), ORDERBY([External.Sales.KPI], DESC)),
|
||
REMOVEFILTERS(Dim_Corp[CORP_TYPE]),REMOVEFILTERS(Dim_PackInfo[CORP_TYPE])
|
||
)
|
||
)
|
||
|
||
|
||
```
|
||
formatString: #,0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: a0f429f2-beef-4071-91ae-7cb1f286a9eb
|
||
|
||
measure 'External.Rank.KPI.Corp2.1_EN' = ```
|
||
|
||
IF([External.Sales.KPI2.1]<>BLANK(),
|
||
CALCULATE(RANK(DENSE, ALL(Dim_Corp[CORP_DES]), ORDERBY([External.Sales.KPI2.1], DESC)),
|
||
REMOVEFILTERS(Dim_Corp[CORP_TYPE])
|
||
)
|
||
)
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: bb2f611c-1a57-45c0-839a-1d243875edc7
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Rank.KPI.ProdCorpMol_EN' = ```
|
||
|
||
VAR T = CALCULATETABLE(SUMMARIZE(Fact_Sales,Dim_PackInfo[CORP_DES],Dim_PackInfo[PROD_DES],Dim_PackInfo[CMPS_DES],Dim_PackInfo[PROD_COD],Dim_PackInfo[CMPS_COD]),ALL())
|
||
RETURN
|
||
IF([External.Sales.KPI]<>BLANK(),
|
||
RANK(DENSE, T, ORDERBY([External.Sales.KPI], DESC))
|
||
)
|
||
|
||
```
|
||
formatString: #,0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: 8b9bc7a2-3e12-428d-bb5b-a9aff46eed74
|
||
|
||
measure show_filters_EN = ```
|
||
|
||
VAR t_ =
|
||
{(IF (
|
||
ISFILTERED(MQY[Period]),
|
||
VAR ___x = "Period::"& [time sel] &" | "
|
||
RETURN ___x
|
||
),1)
|
||
,(IF (
|
||
ISFILTERED(Dim_Unit[DW]),
|
||
VAR ___x = "Unit::"& CONCATENATEX(VALUES(Dim_Unit[DW]),[DW],",") &" | "
|
||
RETURN ___x
|
||
),1)
|
||
,(IF (
|
||
ISFILTERED(Dim_Market[Market]),
|
||
VAR ___x = "Market:"& CONCATENATEX(VALUES(Dim_Market[Market]),[Market],",") &" | "
|
||
RETURN ___x
|
||
),1)
|
||
,(IF (
|
||
ISFILTERED(Dim_BrandDefaultMKT),
|
||
VAR ___x = "DefaultMarket:"& CONCATENATEX(VALUES(Dim_BrandDefaultMKT[MARKET]),[MARKET],",") &" | "
|
||
RETURN ___x
|
||
),1)
|
||
,(IF (
|
||
ISFILTERED('Dim_MarketTA'[TA]),
|
||
VAR ___x = "TA: "& CONCATENATEX(VALUES('Dim_MarketTA'[TA]),[TA],",") &" | "
|
||
RETURN ___x
|
||
),2)
|
||
,(IF (
|
||
ISFILTERED(Dim_Class[CLASS]),
|
||
VAR ___x = "Class: "& CONCATENATEX(VALUES(Dim_Class[CLASS]),[CLASS],",") &" | "
|
||
RETURN ___x
|
||
),2)
|
||
,(IF (
|
||
ISFILTERED(Dim_PackInfo[GENE_ORIG_DESC]),
|
||
VAR ___x = "Generics:"& CONCATENATEX(VALUES(Dim_PackInfo[GENE_ORIG_DESC]),[GENE_ORIG_DESC],",") &" | "
|
||
RETURN ___x
|
||
),3)
|
||
,(IF (
|
||
ISFILTERED(Dim_BrandMKT[VBP]),
|
||
VAR ___x = "is VBP:"& CONCATENATEX(VALUES(Dim_BrandMKT[VBP]),[VBP],",") &" | "
|
||
RETURN ___x
|
||
),4)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[PROD_DES]),
|
||
VAR ___x = "Brand:"& CONCATENATEX(VALUES('Dim_PackInfo'[PROD_DES]),[PROD_DES],",") &" | "
|
||
RETURN ___x
|
||
),5)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[MOLECULE_CODE_DESC]),
|
||
VAR ___x = "Molecule:"& CONCATENATEX(VALUES('Dim_PackInfo'[MOLECULE_CODE_DESC]),[MOLECULE_CODE_DESC],",") &" | "
|
||
RETURN ___x
|
||
),7)
|
||
,(IF (
|
||
ISFILTERED('Dim_Corp'[CORP_CODE_DESC]),
|
||
VAR ___x = "Corp: "& CONCATENATEX(VALUES('Dim_Corp'[CORP_CODE_DESC]),[CORP_CODE_DESC],",") &" | "
|
||
RETURN ___x
|
||
),9)
|
||
,(IF (
|
||
ISFILTERED('Dim_Corp'[CORP_TYPE]),
|
||
VAR ___x = "CorpType: "& CONCATENATEX(VALUES('Dim_Corp'[CORP_TYPE]),[CORP_TYPE],",") &" | "
|
||
RETURN ___x
|
||
),10)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[PROD_PACK]),
|
||
VAR ___x = "Pack:"& CONCATENATEX(VALUES('Dim_PackInfo'[PROD_PACK]),[PROD_PACK],",") &" | "
|
||
RETURN ___x
|
||
),11)
|
||
,(IF (
|
||
ISFILTERED('Dim_GeoGroup'[PROVINCE_GROUP]),
|
||
VAR ___x = "ProvinceGroup:"& CONCATENATEX(VALUES('Dim_GeoGroup'[PROVINCE_GROUP]),[PROVINCE_GROUP],",") &" | "
|
||
RETURN ___x
|
||
),12)
|
||
,(IF (
|
||
ISFILTERED('Dim_Geo'[PROVINCE_C]),
|
||
VAR ___x = "Province:"& CONCATENATEX(VALUES('Dim_Geo'[PROVINCE_C]),[PROVINCE_C],",") &" | "
|
||
RETURN ___x
|
||
),12)
|
||
,(IF (
|
||
ISFILTERED('Dim_Geo'[CITY_C]),
|
||
VAR ___x = "City:"& CONCATENATEX(VALUES('Dim_Geo'[CITY_C]),[CITY_C],",") &" | "
|
||
RETURN ___x
|
||
),13)
|
||
,(IF (
|
||
ISFILTERED('Dim_Geo'[AZ_CITY_TIER]),
|
||
VAR ___x = "CityTier:"& CONCATENATEX(VALUES('Dim_Geo'[AZ_CITY_TIER]),[AZ_CITY_TIER],",") &" | "
|
||
RETURN ___x
|
||
),14)
|
||
,(IF (
|
||
ISFILTERED('Dim_Org'[RC_CODE_DESC]),
|
||
VAR ___x = "RC:"& CONCATENATEX(VALUES('Dim_Org'[RC_CODE_DESC]),[RC_CODE_DESC],",") &" | "
|
||
RETURN ___x
|
||
),17)
|
||
,(IF (
|
||
ISFILTERED('Dim_Org'[REGION_CODE_DESC]),
|
||
VAR ___x = "Region:"& CONCATENATEX(VALUES('Dim_Org'[REGION_CODE_DESC]),[REGION_CODE_DESC],",") &" | "
|
||
RETURN ___x
|
||
),18)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[ATC1_CODE_DESC]),
|
||
VAR ___x = "ATC1:"& CONCATENATEX(VALUES('Dim_PackInfo'[ATC1_CODE_DESC]),[ATC1_CODE_DESC],",") &" | "
|
||
RETURN ___x
|
||
),19)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[ATC2_CODE_DESC]),
|
||
VAR ___x = "ATC2:"& CONCATENATEX(VALUES('Dim_PackInfo'[ATC2_CODE_DESC]),[ATC2_CODE_DESC],",") &" | "
|
||
RETURN ___x
|
||
),20)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[ATC3_CODE_DESC]),
|
||
VAR ___x = "ATC3:"& CONCATENATEX(VALUES('Dim_PackInfo'[ATC3_CODE_DESC]),[ATC3_CODE_DESC],",") &" | "
|
||
RETURN ___x
|
||
),21)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[ATC4_CODE_DESC]),
|
||
VAR ___x = "ATC4:"& CONCATENATEX(VALUES('Dim_PackInfo'[ATC4_CODE_DESC]),[ATC4_CODE_DESC],",") &" | "
|
||
RETURN ___x
|
||
),22)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[APP1_COD_DES_C]),
|
||
VAR ___x = "NFC1:"& CONCATENATEX(VALUES('Dim_PackInfo'[APP1_COD_DES_C]),[APP1_COD_DES_C],",") &" | "
|
||
RETURN ___x
|
||
),23)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[APP2_COD_DES_C]),
|
||
VAR ___x = "NFC2:"& CONCATENATEX(VALUES('Dim_PackInfo'[APP2_COD_DES_C]),[APP2_COD_DES_C],",") &" | "
|
||
RETURN ___x
|
||
),24)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[APP3_COD_DES_C]),
|
||
VAR ___x = "NFC3:"& CONCATENATEX(VALUES('Dim_PackInfo'[APP3_COD_DES_C]),[APP3_COD_DES_C],",") &" | "
|
||
RETURN ___x
|
||
),25)
|
||
|
||
}
|
||
RETURN CONCATENATEX( t_ , [Value1] , "" )
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 8c59f9cd-51b9-49d1-ba7f-bc56f3f685a9
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure show_filters2_EN = ```
|
||
|
||
VAR t_ =
|
||
{(IF (
|
||
ISFILTERED(MQY[Period]),
|
||
VAR ___x = "Period: "& [time sel] &"
|
||
"
|
||
RETURN ___x
|
||
),1)
|
||
,(IF (
|
||
ISFILTERED(Dim_Unit[DW]),
|
||
VAR ___x = "Unit: "& CONCATENATEX(VALUES(Dim_Unit[DW]),[DW],",") &"
|
||
"
|
||
RETURN ___x
|
||
),2)
|
||
,(IF (
|
||
ISFILTERED(Dim_Market[Market]),
|
||
VAR ___x = "
|
||
Market:"& CONCATENATEX(VALUES(Dim_Market[Market]),[Market],",") &"
|
||
"
|
||
RETURN ___x
|
||
),3)
|
||
|
||
,(IF (
|
||
ISFILTERED(Dim_BrandDefaultMKT),
|
||
VAR ___x = "
|
||
DefaultMarket:"& CONCATENATEX(VALUES(Dim_BrandDefaultMKT[MARKET]),[MARKET],",") &"
|
||
"
|
||
RETURN ___x
|
||
),4)
|
||
,(IF (
|
||
ISFILTERED('Dim_MarketTA'[TA]),
|
||
VAR ___x = "
|
||
TA: "& CONCATENATEX(VALUES('Dim_MarketTA'[TA]),[TA],",") &"
|
||
"
|
||
RETURN ___x
|
||
),5)
|
||
,(IF (
|
||
ISFILTERED(Dim_Class[CLASS]),
|
||
VAR ___x = "
|
||
Class: "& CONCATENATEX(VALUES(Dim_Class[CLASS]),[CLASS],",") &"
|
||
"
|
||
RETURN ___x
|
||
),6)
|
||
,(IF (
|
||
ISFILTERED(Dim_PackInfo[GENE_ORIG_DESC]),
|
||
VAR ___x = "Generics:"& CONCATENATEX(VALUES(Dim_PackInfo[GENE_ORIG_DESC]),[GENE_ORIG_DESC],",") &"
|
||
"
|
||
RETURN ___x
|
||
),7)
|
||
,(IF (
|
||
ISFILTERED(Dim_BrandMKT[VBP]),
|
||
VAR ___x = "is VBP:"& CONCATENATEX(VALUES(Dim_BrandMKT[VBP]),[VBP],",") &"
|
||
"
|
||
RETURN ___x
|
||
),8)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[PROD_DES]),
|
||
VAR ___x = "Brand:"& CONCATENATEX(VALUES('Dim_PackInfo'[PROD_DES]),[PROD_DES],",") &"
|
||
"
|
||
RETURN ___x
|
||
),9)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[MOLECULE_CODE_DESC]),
|
||
VAR ___x = "Molecule:"& CONCATENATEX(VALUES('Dim_PackInfo'[MOLECULE_CODE_DESC]),[MOLECULE_CODE_DESC],",") &"
|
||
"
|
||
RETURN ___x
|
||
),10)
|
||
,(IF (
|
||
ISFILTERED('Dim_Corp'[CORP_CODE_DESC]),
|
||
VAR ___x = "Corp: "& CONCATENATEX(VALUES('Dim_Corp'[CORP_CODE_DESC]),[CORP_CODE_DESC],",") &"
|
||
"
|
||
RETURN ___x
|
||
),11)
|
||
,(IF (
|
||
ISFILTERED('Dim_Corp'[CORP_TYPE]),
|
||
VAR ___x = "CorpType: "& CONCATENATEX(VALUES('Dim_Corp'[CORP_TYPE]),[CORP_TYPE],",") &"
|
||
"
|
||
RETURN ___x
|
||
),12)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[PROD_PACK]),
|
||
VAR ___x = "Pack:"& CONCATENATEX(VALUES('Dim_PackInfo'[PROD_PACK]),[PROD_PACK],",") &"
|
||
"
|
||
RETURN ___x
|
||
),13)
|
||
,(IF (
|
||
ISFILTERED('Dim_GeoGroup'[PROVINCE_GROUP]),
|
||
VAR ___x = "ProvinceGroup:"& CONCATENATEX(VALUES('Dim_GeoGroup'[PROVINCE_GROUP]),[PROVINCE_GROUP],",") &"
|
||
"
|
||
RETURN ___x
|
||
),14)
|
||
,(IF (
|
||
ISFILTERED('Dim_Geo'[PROVINCE_C]),
|
||
VAR ___x = "Province:"& CONCATENATEX(VALUES('Dim_Geo'[PROVINCE_C]),[PROVINCE_C],",") &"
|
||
"
|
||
RETURN ___x
|
||
),14)
|
||
,(IF (
|
||
ISFILTERED('Dim_Geo'[CITY_C]),
|
||
VAR ___x = "City:"& CONCATENATEX(VALUES('Dim_Geo'[CITY_C]),[CITY_C],",") &"
|
||
"
|
||
RETURN ___x
|
||
),15)
|
||
,(IF (
|
||
ISFILTERED('Dim_Geo'[AZ_CITY_TIER]),
|
||
VAR ___x = "CityTier:"& CONCATENATEX(VALUES('Dim_Geo'[AZ_CITY_TIER]),[AZ_CITY_TIER],",") &"
|
||
"
|
||
RETURN ___x
|
||
),16)
|
||
,(IF (
|
||
ISFILTERED('Dim_Org'[RC_CODE_DESC]),
|
||
VAR ___x = "RC:"& CONCATENATEX(VALUES('Dim_Org'[RC_CODE_DESC]),[RC_CODE_DESC],",") &"
|
||
"
|
||
RETURN ___x
|
||
),17)
|
||
,(IF (
|
||
ISFILTERED('Dim_Org'[REGION_CODE_DESC]),
|
||
VAR ___x = "Region:"& CONCATENATEX(VALUES('Dim_Org'[REGION_CODE_DESC]),[REGION_CODE_DESC],",") &"
|
||
"
|
||
RETURN ___x
|
||
),18)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[ATC1_CODE_DESC]),
|
||
VAR ___x = "ATC1:"& CONCATENATEX(VALUES('Dim_PackInfo'[ATC1_CODE_DESC]),[ATC1_CODE_DESC],",") &"
|
||
"
|
||
RETURN ___x
|
||
),19)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[ATC2_CODE_DESC]),
|
||
VAR ___x = "ATC2:"& CONCATENATEX(VALUES('Dim_PackInfo'[ATC2_CODE_DESC]),[ATC2_CODE_DESC],",") &"
|
||
"
|
||
RETURN ___x
|
||
),20)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[ATC3_CODE_DESC]),
|
||
VAR ___x = "ATC3:"& CONCATENATEX(VALUES('Dim_PackInfo'[ATC3_CODE_DESC]),[ATC3_CODE_DESC],",") &"
|
||
"
|
||
RETURN ___x
|
||
),21)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[ATC4_CODE_DESC]),
|
||
VAR ___x = "ATC4:"& CONCATENATEX(VALUES('Dim_PackInfo'[ATC4_CODE_DESC]),[ATC4_CODE_DESC],",") &"
|
||
"
|
||
RETURN ___x
|
||
),22)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[APP1_COD_DES_C]),
|
||
VAR ___x = "NFC1:"& CONCATENATEX(VALUES('Dim_PackInfo'[APP1_COD_DES_C]),[APP1_COD_DES_C],",") &"
|
||
"
|
||
RETURN ___x
|
||
),23)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[APP2_COD_DES_C]),
|
||
VAR ___x = "NFC2:"& CONCATENATEX(VALUES('Dim_PackInfo'[APP2_COD_DES_C]),[APP2_COD_DES_C],",") &"
|
||
"
|
||
RETURN ___x
|
||
),24)
|
||
,(IF (
|
||
ISFILTERED('Dim_PackInfo'[APP3_COD_DES_C]),
|
||
VAR ___x = "NFC3:"& CONCATENATEX(VALUES('Dim_PackInfo'[APP3_COD_DES_C]),[APP3_COD_DES_C],",") &"
|
||
"
|
||
RETURN ___x
|
||
),25)
|
||
|
||
}
|
||
RETURN CONCATENATEX( t_ , [Value1] , "" )
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 00fe9d55-7a3b-450a-a8e8-46f9057d74e4
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Rank.KPI.Combo' =
|
||
|
||
SWITCH(TRUE(),
|
||
ISINSCOPE(Dim_PackInfo[MOLECULE_CODE_DESC]), [External.Rank.KPI.MolENCN],
|
||
ISINSCOPE(Dim_PackInfo[PACK_DES]), [External.Rank.KPI.ProdPackCorp],
|
||
ISINSCOPE(Dim_PackInfo[PROD_DES]), [External.Rank.KPI.ProdCorpMol_EN],
|
||
ISINSCOPE(Dim_PackInfo[PROD_DES_C]), [External.Rank.KPI.ProdCorpMol],
|
||
ISINSCOPE(Dim_PackInfo[CMPS_DES]), [External.Rank.KPI.CMPS_EN],
|
||
ISINSCOPE(Dim_PackInfo[CMPS_DES_C]), [External.Rank.KPI.CMPS],
|
||
ISINSCOPE(Dim_Class[Class]), [External.Rank.KPI.Class],
|
||
ISINSCOPE(Dim_PackInfo[CORP_DES]), [External.Rank.KPI.Corp_EN],
|
||
ISINSCOPE(Dim_PackInfo[CORP_DES_C]), [External.Rank.KPI.Corp],
|
||
BLANK()
|
||
)
|
||
formatString: 0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: d6f94619-f5c0-4c7e-9a18-3ae7ff595598
|
||
|
||
measure 'External.Rank.KPI.Corp' = ```
|
||
|
||
IF([External.Sales.KPI]<>BLANK(),
|
||
CALCULATE(RANK(DENSE, ALL(Dim_PackInfo[CORP_DES_C]), ORDERBY([External.Sales.KPI], DESC)),
|
||
REMOVEFILTERS(Dim_Corp[CORP_TYPE]),REMOVEFILTERS(Dim_PackInfo[CORP_TYPE])
|
||
)
|
||
)
|
||
|
||
|
||
```
|
||
formatString: #,0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: 8ed5fcf8-a5da-4608-99ad-bdee2dfb1663
|
||
|
||
measure 'External.Rank.KPI.ProdCorpMol' = ```
|
||
|
||
VAR T = CALCULATETABLE(SUMMARIZE(Fact_Sales,Dim_PackInfo[CORP_DES_C],Dim_PackInfo[PROD_DES_C],Dim_PackInfo[CMPS_DES_C],Dim_PackInfo[CMPS_COD]),ALL())
|
||
RETURN
|
||
IF([External.Sales.KPI]<>BLANK(),
|
||
RANK(DENSE, T, ORDERBY([External.Sales.KPI], DESC))
|
||
)
|
||
|
||
```
|
||
formatString: #,0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: 6f261657-57fc-4d20-b0e1-2308e2185978
|
||
|
||
measure 'External.Time.Text' =
|
||
VAR A = "季度数据,请选择3/6/9/12月份代表Q1/Q2/Q3/Q4,请勿选择MTH"
|
||
RETURN
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISFILTERED ( Dim_DataSource )
|
||
&& "Quarterly" IN VALUES ( Dim_DataSource[DATA_TYPE] )
|
||
&& ( NOT "Retail" IN VALUES ( Dim_DataSource[SOURCENAME] ) ), A
|
||
)
|
||
displayFolder: OLD\Others
|
||
lineageTag: 00f9abf4-12bb-4046-be83-59751684c132
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Time.Text.Free' =
|
||
VAR A = "季度数据,请选择3/6/9/12月份代表Q1/Q2/Q3/Q4,请勿选择MTH"
|
||
RETURN
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISFILTERED ( Dim_DataSource )
|
||
&& "Quarterly" IN VALUES ( Dim_DataSource[DATA_TYPE] )
|
||
&& ( NOT "Retail" IN VALUES ( Dim_DataSource[SOURCENAME] ) ), A
|
||
)
|
||
displayFolder: OLD\Others
|
||
lineageTag: f42c3db3-7852-4a58-8f97-896df99dd911
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Time.Text.EN' =
|
||
VAR A =
|
||
"For quarterly data, please select 3/6/9/12 to represent Q1/Q2/Q3/Q4, do not select MTH"
|
||
RETURN
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISFILTERED ( Dim_DataSource )
|
||
&& "Quarterly" IN VALUES ( Dim_DataSource[DATA_TYPE] )
|
||
&& ( NOT "Retail" IN VALUES ( Dim_DataSource[SOURCENAME] ) ), A
|
||
)
|
||
displayFolder: OLD\Others
|
||
lineageTag: 0499284a-1f72-4804-86ee-c813f44b22c7
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.2.3.Text.EN' = ```
|
||
|
||
VAR R = "Contains product data for AZ retail related markets only"
|
||
VAR E = "Contains AZ EC related market product data only."
|
||
VAR _W = "When Select Class, please filter Market first"
|
||
VAR _IF = (NOT ISFILTERED(Dim_Market[MARKET])) && SELECTEDVALUE('Fields.Rows'[Fields Order]) =213
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
ISFILTERED(Dim_DataSource) && "EC" IN VALUES(Dim_DataSource[SOURCENAME]),IF(_IF,_W&E,E),
|
||
ISFILTERED(Dim_DataSource) && "Retail" IN VALUES(Dim_DataSource[SOURCENAME]),IF(_IF,_W&R,R),
|
||
IF(_IF,_W)
|
||
)
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 6a156501-1f8b-44c8-ba31-2d76acb19e51
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Warning.TextGeo.EN' = ```
|
||
|
||
VAR A =
|
||
IF(
|
||
NOT(ISEMPTY(INTERSECT({14,15,16,17,20,21}, VALUES('MarketGeo Val'[val 个订单])))) && NOT(ISFILTERED(Dim_Market[MARKET]))&& NOT(ISFILTERED(Dim_BrandDefaultMKT)),
|
||
"⚠️To calculate Molecule/Class related KPIs please select the corresponding market."
|
||
)
|
||
RETURN A
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 86a2cc1e-e413-40bb-a55c-413d613dc2c5
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.3.1.Text.EN' = ```
|
||
|
||
VAR R = "THC 2024 Purchase Semi-Annual Data, please select [202406 YTD], do not select QTD."
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
ISFILTERED(Dim_DataSource) && "THC" IN VALUES(Dim_DataSource[SOURCENAME]),R
|
||
)
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: 332fdce3-6aa8-4e05-816d-aaeeb3a13360
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Warning.TextTop.EN' =
|
||
|
||
IF(SELECTEDVALUE(Fields_Leader_EN[Fields_Leader_EN (groups)]) IN {"Top Class","Top Molecule"},
|
||
IF(
|
||
NOT(ISFILTERED(Dim_Market[MARKET]))&&NOT(ISFILTERED(Dim_BrandDefaultMKT)),
|
||
"⚠️To calculate Molecule/Class related KPIs please select the corresponding market."
|
||
))
|
||
displayFolder: OLD\Others
|
||
lineageTag: 3d122170-ab5b-4d6d-a9a1-c50e987952d1
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.CHPA.Text.EN' = ```
|
||
|
||
VAR C = "CHPA city-level data is under verification and temporarily unavailable to users. National data remains accessible."
|
||
RETURN
|
||
SWITCH ( TRUE (),"CHPA" IN VALUES ( Dim_DataSource[SOURCENAME] ), c )
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: c7a9f42b-06f0-494e-859b-43a4eab0490f
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.CHPA.Text' = ```
|
||
|
||
VAR C= "因CHPA新版城市数据仍在核查中,因此暂时关闭城市数据,CHPA全国数据仍可正常使用"
|
||
RETURN
|
||
SWITCH(TRUE()
|
||
,"CHPA" IN VALUES(Dim_DataSource[SOURCENAME]),c)
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: f37736dc-be92-429a-ae47-4af9440e5a95
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.CHPA.Text.Color' = ```
|
||
|
||
VAR C= "RGBA(255,255,0, 1)"
|
||
VAR T= "RGBA(0,0, 0, 0)"
|
||
RETURN
|
||
SWITCH(TRUE()
|
||
,"CHPA" IN VALUES(Dim_DataSource[SOURCENAME]),c,T)
|
||
```
|
||
displayFolder: OLD\Others
|
||
lineageTag: c8e26b09-b661-4727-8553-55666f54d09f
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'EC.incremental.Top1BrandName.EN' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(MAX(Fact_EC[STR_KPI_VAL_EN]),
|
||
Fact_EC[KPI_NAME] = "incremental_brand",
|
||
Fact_EC[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar ))
|
||
displayFolder: OLD\2.1Top
|
||
lineageTag: f571441b-bea5-43f6-a4a1-e164c9066f8c
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'EC.Value.Top1BrandName.EN' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(MAX(Fact_EC[STR_KPI_VAL_EN]),
|
||
Fact_EC[KPI_NAME] = "top1_brand_val",
|
||
Fact_EC[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar ))
|
||
displayFolder: OLD\2.1Top
|
||
lineageTag: c7ae084c-f27b-413c-90d4-627229bc678c
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Value.Top1BrandName.EN' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(MAX(Fact_Retail[STR_KPI_VAL_EN]),
|
||
Fact_Retail[KPI_NAME] = "top1_brand_val",
|
||
Fact_Retail[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar ))
|
||
displayFolder: OLD\2.1Top
|
||
lineageTag: c73178b4-ca63-41d0-9ebf-9ac6c5464e10
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.incremental.Top1BrandName.EN' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(MAX(Fact_Retail[STR_KPI_VAL_EN]),
|
||
Fact_Retail[KPI_NAME] = "top1_incremental_brand",
|
||
Fact_Retail[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar )
|
||
)
|
||
displayFolder: OLD\2.1Top
|
||
lineageTag: 08e05fac-8ed0-4c8e-a9a8-d9e1835303db
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.incremental.Top2BrandName.EN' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(MAX(Fact_Retail[STR_KPI_VAL_EN]),
|
||
Fact_Retail[KPI_NAME] = "top2_incremental_brand",
|
||
Fact_Retail[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar )
|
||
)
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: e36c9534-6e87-47ef-983a-780b3a44a797
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'EC.incremental.Top2BrandName.EN' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(MAX(Fact_EC[STR_KPI_VAL_EN]),
|
||
Fact_EC[KPI_NAME] = "incrementa2_brand",
|
||
Fact_EC[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar ))
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 3d0c7f57-f095-49c6-a529-5cf02732d5ad
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Retail.Value.Top2BrandName.EN' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(MAX(Fact_Retail[STR_KPI_VAL_EN]),
|
||
Fact_Retail[KPI_NAME] = "top2_brand_val",
|
||
Fact_Retail[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar ))
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: ec16737d-cd5f-4940-a56b-cc6ef34e1a41
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'EC.Value.Top2BrandName.EN' =
|
||
|
||
VAR YM = MAX(Dim_Calendar[YYYYMM])
|
||
RETURN
|
||
CALCULATE(MAX(Fact_EC[STR_KPI_VAL_EN]),
|
||
Fact_EC[KPI_NAME] = "top2_brand_val",
|
||
Fact_EC[YYYYMM] = YM,
|
||
REMOVEFILTERS ( Dim_Calendar ))
|
||
displayFolder: OLD\直取KPI
|
||
lineageTag: 51bc0545-1502-4082-af78-6bbba704b388
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.KPI.Top1PlayerName.EN' = ```
|
||
|
||
VAR DS = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
VAR DS1 = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||
VAR BRANDMKT_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 CV = [External.Sales.KPI.Market]
|
||
VAR R = IF(CV <> BLANK(), CALCULATE([External.MS%.TopNPlayerName.EN], 'TopN'[TopN]=1))
|
||
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
DS = "Retail" && BRANDMKT_FLAG = 1,R,
|
||
DS = "Retail",BLANK(),
|
||
R)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:排第一名的公司+产品
|
||
------KPI公式:根据公司+产品的MS%倒序排,取第一个
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
```
|
||
displayFolder: OLD\Top\EN
|
||
lineageTag: c7f65e6e-9114-4c9f-a221-132a2e04ee3a
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.TopNPlayerName.EN' =
|
||
|
||
VAR T =
|
||
CALCULATETABLE(
|
||
INDEX([TopN.Value],
|
||
ADDCOLUMNS(SUMMARIZE(FACT_Sales, Dim_PackInfo[PROD_CORP_EN]), "@VAL", [External.Sales.KPI]), ORDERBY([@VAL], DESC)
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_PACK] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] ),
|
||
REMOVEFILTERS( Dim_PackInfo[PROD_CORP_C])
|
||
)
|
||
RETURN MAXX(T, [PROD_CORP_EN] )
|
||
displayFolder: OLD\Top\EN
|
||
lineageTag: d5b48ff8-35a4-4956-9dab-1c94fd87af55
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.△MS%.KPI.Top1PlayerName.EN' = ```
|
||
|
||
VAR DS = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
VAR DS1 = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||
VAR BRANDMKT_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 CV = [External.Sales.KPI.Market]
|
||
VAR R = IF(CV <> BLANK(), CALCULATE([External.△MS%.TopNPlayerName.EN], 'TopN'[TopN]=1))
|
||
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
DS = "Retail" && BRANDMKT_FLAG = 1,R,
|
||
DS = "Retail",BLANK(),
|
||
R)
|
||
|
||
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI公式:根据公司+产品的△MS%倒序排,取最大的一个△MS%对应的公司+产品
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
----------------------------------------------------------------------------
|
||
```
|
||
displayFolder: OLD\Top\EN
|
||
lineageTag: 3a326697-025f-4f0d-8fe2-37ab6d2ecdd6
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.△MS%.TopNPlayerName.EN' = ```
|
||
|
||
VAR T =
|
||
CALCULATETABLE(
|
||
INDEX([TopN.Value],
|
||
ADDCOLUMNS(SUMMARIZE(FACT_Sales, Dim_PackInfo[PROD_CORP_EN]), "@VAL", [External.△MS%.KPI]), ORDERBY([@VAL], DESC)
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_PACK] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] ),
|
||
REMOVEFILTERS( Dim_PackInfo[PROD_CORP_C])
|
||
)
|
||
RETURN MAXX(T, [PROD_CORP_EN] )
|
||
```
|
||
displayFolder: OLD\Top\EN
|
||
lineageTag: 95ef242b-7da4-44d9-9746-1cc00d5dcb89
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.KPI.Top1CompetitorName.EN' = ```
|
||
|
||
VAR DS = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
VAR DS1 = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||
VAR BRANDMKT_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 CV = [External.Sales.KPI.Market]
|
||
VAR R = IF(CV <> BLANK(), CALCULATE([External.MS%.TopNCompetitorName.EN], 'TopN'[TopN]=1))
|
||
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
DS = "Retail" && BRANDMKT_FLAG = 1,R,
|
||
DS = "Retail",BLANK(),
|
||
R)
|
||
```
|
||
displayFolder: OLD\Top\EN
|
||
lineageTag: a848e43a-9345-4f60-ac90-6e7fe2c76fcf
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.TopNCompetitorName.EN' = CALCULATE([External.MS%.TopNPlayerName.EN], Dim_PackInfo[CORP_DES]<>"ASTRAZENECA")
|
||
displayFolder: OLD\Top\EN
|
||
lineageTag: ee2089c3-1d47-483b-9e4b-cd16ede94a24
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.△MS%.KPI.Top1CompetitorName.EN' = ```
|
||
|
||
VAR DS = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
VAR DS1 = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||
VAR BRANDMKT_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 CV = [External.Sales.KPI.Market]
|
||
VAR R = IF(CV <> BLANK(), CALCULATE([External.△MS%.TopNCompetitorName.EN], 'TopN'[TopN]=1))
|
||
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
DS = "Retail" && BRANDMKT_FLAG = 1,R,
|
||
DS = "Retail",BLANK(),
|
||
R)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:AZ产品对应核心竞品的△MS%
|
||
------KPI公式:排除az之后,根据公司+产品的△MS%倒序排,取最大的一个△MS%对应的公司+产品
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
------修改时间:2024.5.30
|
||
------修改内容:根据业务要求,只有用户选择了market,才显示topclass kpi
|
||
----------------------------------------------------------------------------
|
||
```
|
||
displayFolder: OLD\Top\EN
|
||
lineageTag: c82a0c93-90a3-4dfc-a077-7724873a584b
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.△MS%.TopNCompetitorName.EN' = CALCULATE([External.△MS%.TopNPlayerName.EN], Dim_PackInfo[CORP_DES]<>"ASTRAZENECA")
|
||
displayFolder: OLD\Top\EN
|
||
lineageTag: 8f4f6f08-3f35-45d6-80d1-758c0abb393e
|
||
|
||
measure 'External.△MS%.KPI.Top1Competitor' = ```
|
||
|
||
VAR DS = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
VAR DS1 = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||
VAR BRANDMKT_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 CV = [External.Sales.KPI.Market]
|
||
VAR R = IF(CV <> BLANK(), CALCULATE([External.△MS%.TopNCompetitor], 'TopN'[TopN]=1))
|
||
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
DS = "Retail" && BRANDMKT_FLAG = 1,R,
|
||
DS = "Retail",BLANK(),
|
||
R)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:AZ产品对应核心竞品的△MS%
|
||
------KPI公式:排除az之后,根据公司+产品的△MS%倒序排,取最大的一个△MS%
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
------修改时间:2024.5.30
|
||
------修改内容:根据业务要求,只有用户选择了market,才显示topclass kpi
|
||
----------------------------------------------------------------------------
|
||
```
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Top
|
||
lineageTag: 4734760f-5edb-4419-9cf4-e8ac530b9245
|
||
|
||
measure 'External.△MS%.KPI.Top1CompetitorName' = ```
|
||
|
||
VAR DS = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
VAR DS1 = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||
VAR BRANDMKT_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 CV = [External.Sales.KPI.Market]
|
||
VAR R = IF(CV <> BLANK(), CALCULATE([External.△MS%.TopNCompetitorName], 'TopN'[TopN]=1))
|
||
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
DS = "Retail" && BRANDMKT_FLAG = 1,R,
|
||
DS = "Retail",BLANK(),
|
||
R)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:AZ产品对应核心竞品的△MS%
|
||
------KPI公式:排除az之后,根据公司+产品的△MS%倒序排,取最大的一个△MS%对应的公司+产品
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
------修改时间:2024.5.30
|
||
------修改内容:根据业务要求,只有用户选择了market,才显示topclass kpi
|
||
----------------------------------------------------------------------------
|
||
```
|
||
displayFolder: OLD\Top
|
||
lineageTag: 25a29dc8-fb3f-4d22-afc6-4d95d6b4f67c
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.△MS%.KPI.Top1Mol' = ```
|
||
|
||
VAR DS = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
VAR DS1 = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||
VAR BRANDMKT_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 R = CALCULATE([External.△MS%.TopNMol], 'TopN'[TopN]=1)
|
||
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
DS = "Retail" && BRANDMKT_FLAG = 1,R,
|
||
DS = "Retail",BLANK(),
|
||
R)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:市场中分子式对应的△MS%值
|
||
------KPI公式:根据分子式的△MS%倒序排,取最大的一个△MS%
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
------修改时间:2024.5.30
|
||
------修改内容:根据业务要求,只有用户选择了market,才显示topmol kpi
|
||
----------------------------------------------------------------------------
|
||
```
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Top
|
||
lineageTag: 9e6dbd47-ac72-4d09-b741-bfe4c830f34e
|
||
|
||
measure 'External.△MS%.KPI.Top1MolName' = ```
|
||
|
||
VAR DS = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
VAR DS1 = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||
VAR BRANDMKT_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 R = CALCULATE([External.△MS%.TopNMolName], 'TopN'[TopN]=1)
|
||
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
DS = "Retail" && BRANDMKT_FLAG = 1,R,
|
||
DS = "Retail",BLANK(),
|
||
R)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:市场中△MS%值最大的分子式名称
|
||
------KPI公式:根据分子式的△MS%倒序排,取最大的一个△MS%对应的分子式名称
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
------修改时间:2024.5.30
|
||
------修改内容:根据业务要求,只有用户选择了market,才显示topmol kpi
|
||
----------------------------------------------------------------------------
|
||
```
|
||
displayFolder: OLD\Top
|
||
lineageTag: ef8af5cf-e1b7-4f60-a0a5-1605885a0f45
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.△MS%.KPI.Top1Player' = ```
|
||
|
||
VAR DS = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
VAR DS1 = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||
VAR BRANDMKT_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 CV = [External.Sales.KPI.Market]
|
||
VAR R = IF(CV <> BLANK(), CALCULATE([External.△MS%.TopNPlayer], 'TopN'[TopN]=1))
|
||
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
DS = "Retail" && BRANDMKT_FLAG = 1,R,
|
||
DS = "Retail",BLANK(),
|
||
R)
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI公式:根据公司+产品的△MS%倒序排,取最大的一个△MS%
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
----------------------------------------------------------------------------
|
||
```
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Top
|
||
lineageTag: e15129c0-0503-44af-8e57-ea93a94e0f1c
|
||
|
||
measure 'External.△MS%.KPI.Top1PlayerName' = ```
|
||
|
||
VAR DS = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
VAR DS1 = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||
VAR BRANDMKT_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 CV = [External.Sales.KPI.Market]
|
||
VAR R = IF(CV <> BLANK(), CALCULATE([External.△MS%.TopNPlayerName], 'TopN'[TopN]=1))
|
||
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
DS = "Retail" && BRANDMKT_FLAG = 1,R,
|
||
DS = "Retail",BLANK(),
|
||
R)
|
||
|
||
|
||
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI公式:根据公司+产品的△MS%倒序排,取最大的一个△MS%对应的公司+产品
|
||
------备注:
|
||
------创建时间:2024.5.15
|
||
----------------------------------------------------------------------------
|
||
```
|
||
displayFolder: OLD\Top
|
||
lineageTag: 56281915-5565-401e-8377-77b9e2c07056
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.△MS%.TopNClass' =
|
||
|
||
VAR CV = [External.Sales.KPI.Market]
|
||
VAR T =
|
||
CALCULATETABLE (
|
||
INDEX (
|
||
[TopN.Value],
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( Dim_Class, Dim_Class[CLASS] ),
|
||
"@VAL", [External.△MS%.KPI]
|
||
),
|
||
ORDERBY ( calculate( [External.△MS%.KPI] ,'Fact_Sales'[Is_SpecialFlag]=0), DESC )
|
||
),
|
||
REMOVEFILTERS ( Dim_PackInfo ),
|
||
REMOVEFILTERS ( Dim_Class ),
|
||
REMOVEFILTERS ( Dim_Corp )
|
||
)
|
||
RETURN
|
||
IF ( CV <> BLANK (), MAXX ( T, [@VAL] ) )
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Top
|
||
lineageTag: a4488a81-d21b-498a-b718-aaec2138c9fb
|
||
|
||
measure 'External.△MS%.TopNClassName' =
|
||
|
||
VAR CV = [External.Sales.KPI.Market]
|
||
VAR T =
|
||
CALCULATETABLE (
|
||
INDEX (
|
||
[TopN.Value],
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( Dim_Class, Dim_Class[CLASS] ),
|
||
"@VAL",calculate( [External.△MS%.KPI] ,'Fact_Sales'[Is_SpecialFlag]=0)
|
||
),
|
||
ORDERBY ( [@VAL], DESC )
|
||
),
|
||
REMOVEFILTERS ( Dim_PackInfo ),
|
||
REMOVEFILTERS ( Dim_Class ),
|
||
REMOVEFILTERS ( Dim_Corp )
|
||
)
|
||
RETURN
|
||
IF ( CV <> BLANK (), MAXX ( T, [CLASS] ) )
|
||
displayFolder: OLD\Top
|
||
lineageTag: 5a7b7612-6b13-4696-9ae4-d9d71d853989
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.△MS%.TopNCompetitor' =
|
||
CALCULATE (
|
||
[External.△MS%.TopNPlayer],
|
||
Dim_PackInfo[CORP_DES] <> "ASTRAZENECA"
|
||
)
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Top
|
||
lineageTag: b7a9fcda-087d-4ecd-b81f-a28896d4fb30
|
||
|
||
measure 'External.△MS%.TopNCompetitorName' =
|
||
CALCULATE (
|
||
[External.△MS%.TopNPlayerName],
|
||
Dim_PackInfo[CORP_DES] <> "ASTRAZENECA"
|
||
)
|
||
displayFolder: OLD\Top
|
||
lineageTag: 2af6b6f3-c614-445c-b8f6-4709fe2971eb
|
||
|
||
measure 'External.△MS%.TopNMol' =
|
||
|
||
VAR CV = [External.Sales.KPI.Market]
|
||
VAR T =
|
||
CALCULATETABLE (
|
||
INDEX (
|
||
[TopN.Value],
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( FACT_Sales, Dim_PackInfo[CMPS_DES] ),
|
||
"@VAL", calculate( [External.△MS%.KPI] ,'Fact_Sales'[Is_SpecialFlag]=0)
|
||
),
|
||
ORDERBY ( [@VAL], DESC )
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_PACK] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] )
|
||
)
|
||
RETURN
|
||
IF ( CV <> BLANK (), MAXX ( T, [@VAL] ) )
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Top
|
||
lineageTag: f29a644a-99a9-4bfe-ab6b-c7bf1340ad9f
|
||
|
||
measure 'External.△MS%.TopNMolName' =
|
||
|
||
VAR CV = [External.Sales.KPI.Market]
|
||
VAR T =
|
||
CALCULATETABLE (
|
||
INDEX (
|
||
[TopN.Value],
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( FACT_Sales, Dim_PackInfo[CMPS_DES] ),
|
||
"@VAL", [External.△MS%.KPI]
|
||
),
|
||
ORDERBY ( calculate( [External.△MS%.KPI] ,'Fact_Sales'[Is_SpecialFlag]=0), DESC )
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_PACK] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] )
|
||
)
|
||
RETURN
|
||
IF ( CV <> BLANK (), MAXX ( T, [CMPS_DES] ) )
|
||
displayFolder: OLD\Top
|
||
lineageTag: 7b23ca5a-b9cd-475c-936d-fe86e53a03f6
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.△MS%.TopNPlayer' =
|
||
|
||
VAR T =
|
||
CALCULATETABLE (
|
||
INDEX (
|
||
[TopN.Value],
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( FACT_Sales, Dim_PackInfo[PROD_CORP_C] ),
|
||
"@VAL", [External.△MS%.KPI]
|
||
),
|
||
ORDERBY ( calculate( [External.△MS%.KPI] ,'Fact_Sales'[Is_SpecialFlag]=0), DESC )
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_PACK] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP_C] )
|
||
)
|
||
RETURN
|
||
MAXX ( T, [@VAL] )
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Top
|
||
lineageTag: 275cc46f-f95a-46a6-9dcc-90ccad224440
|
||
|
||
measure 'External.△MS%.TopNPlayerName' =
|
||
|
||
VAR T =
|
||
CALCULATETABLE (
|
||
INDEX (
|
||
[TopN.Value],
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( FACT_Sales, Dim_PackInfo[PROD_CORP_C] ),
|
||
"@VAL", calculate( [External.△MS%.KPI] ,'Fact_Sales'[Is_SpecialFlag]=0)
|
||
),
|
||
ORDERBY ( [@VAL], DESC )
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_PACK] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP_C] )
|
||
)
|
||
RETURN
|
||
MAXX ( T, [PROD_CORP_C] )
|
||
displayFolder: OLD\Top
|
||
lineageTag: 871cc924-adee-44d5-be5f-e1e1949d3609
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.1.1.Text' =
|
||
VAR A = { "THC 14省数据,仅包含CV、DM、RE三个治疗领域", "" }
|
||
VAR B = { "CHC渠道仅包含CV+DM+GI+RE", "" }
|
||
VAR R =
|
||
{
|
||
"Retail渠道",
|
||
"DM = NIAD Mkt",
|
||
"CV = HTN Mkt + Statin Mkt(incl FDC)",
|
||
"RE = inhaled maintenance market + anti-leukotrienes (only NFC: ABC) + Budesonide Mkt + theophylline",
|
||
"GI = PPI Oral Mkt"
|
||
}
|
||
VAR E = {
|
||
"EC渠道",
|
||
"DM = NIAD Mkt",
|
||
"CV = HTN Mkt + Statin Mkt(incl FDC)",
|
||
"RE = inhaled maintenance market + anti-leukotrienes (only NFC: ABC) + Budesonide Mkt + theophylline",
|
||
"GI = PPI Oral Mkt"
|
||
}
|
||
VAR C = { "" }
|
||
RETURN
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISFILTERED ( Dim_DataSource )
|
||
&& "EC" IN VALUES ( Dim_DataSource[SOURCENAME] ),
|
||
CONCATENATEX ( E, [Value], "
|
||
" ),
|
||
ISFILTERED ( Dim_DataSource )
|
||
&& "THC" IN VALUES ( Dim_DataSource[SOURCENAME] ),
|
||
CONCATENATEX ( A, [Value], "
|
||
" ),
|
||
ISFILTERED ( Dim_DataSource )
|
||
&& "CHC" IN VALUES ( Dim_DataSource[SOURCENAME] ),
|
||
CONCATENATEX ( B, [Value], "
|
||
" ),
|
||
ISFILTERED ( Dim_DataSource )
|
||
&& "Retail" IN VALUES ( Dim_DataSource[SOURCENAME] ),
|
||
CONCATENATEX ( R, [Value], "
|
||
" ),
|
||
ISFILTERED ( Dim_DataSource )
|
||
&& "CHPA" IN VALUES ( Dim_DataSource[SOURCENAME] ),
|
||
CONCATENATEX ( C, [Value], "
|
||
" ),
|
||
ISFILTERED ( Dim_DataSource )
|
||
&& "county" IN VALUES ( Dim_DataSource[SOURCENAME] ),
|
||
CONCATENATEX ( C, [Value], "
|
||
" )
|
||
)
|
||
displayFolder: OLD\Others
|
||
lineageTag: a681d2dd-4454-4876-8368-073463d25b0c
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.KPI.Top1Class' = ```
|
||
|
||
VAR DS = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
VAR DS1 = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||
VAR BRANDMKT_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 R = CALCULATE([External.MS%.TopNClass], 'TopN'[TopN]=1)
|
||
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
DS = "Retail" && BRANDMKT_FLAG = 1,R,
|
||
DS = "Retail",BLANK(),
|
||
R)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:排第一名的Class
|
||
------KPI公式:根据Class的MS%倒序排,取第一个
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
```
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Top
|
||
lineageTag: 78daefc0-1578-4381-853c-5dbeab69f129
|
||
|
||
measure 'External.MS%.KPI.Top1ClassName' = ```
|
||
|
||
VAR DS = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
VAR DS1 = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||
VAR BRANDMKT_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 R = CALCULATE([External.MS%.TopNClassName], 'TopN'[TopN]=1)
|
||
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
DS = "Retail" && BRANDMKT_FLAG = 1,R,
|
||
DS = "Retail",BLANK(),
|
||
R)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:排第一名的Class
|
||
------KPI公式:根据Class的MS%倒序排,取第一个
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
```
|
||
displayFolder: OLD\Top
|
||
lineageTag: 65c2ba10-3c51-4469-8544-f9a313f01836
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.KPI.Top1Competitor' = ```
|
||
|
||
VAR DS = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
VAR DS1 = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||
VAR BRANDMKT_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 CV = [External.Sales.KPI.Market]
|
||
VAR R = IF(CV <> BLANK(), CALCULATE([External.MS%.TopNCompetitor], 'TopN'[TopN]=1))
|
||
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
DS = "Retail" && BRANDMKT_FLAG = 1,R,
|
||
DS = "Retail",BLANK(),
|
||
R)
|
||
```
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Top
|
||
lineageTag: 20ac4bc9-5390-407c-9a08-3da006cdd934
|
||
|
||
measure 'External.MS%.KPI.Top1CompetitorName' = ```
|
||
|
||
VAR DS = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
VAR DS1 = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||
VAR BRANDMKT_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 CV = [External.Sales.KPI.Market]
|
||
VAR R = IF(CV <> BLANK(), CALCULATE([External.MS%.TopNCompetitorName], 'TopN'[TopN]=1))
|
||
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
DS = "Retail" && BRANDMKT_FLAG = 1,R,
|
||
DS = "Retail",BLANK(),
|
||
R)
|
||
```
|
||
displayFolder: OLD\Top
|
||
lineageTag: d75b0018-1a0a-4d0f-b788-ca779641805f
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.KPI.Top1Mol' = ```
|
||
|
||
VAR DS = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
VAR DS1 = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||
VAR BRANDMKT_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 R = CALCULATE([External.MS%.TopNMol], 'TopN'[TopN]=1)
|
||
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
DS = "Retail" && BRANDMKT_FLAG = 1,R,
|
||
DS = "Retail",BLANK(),
|
||
R)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:排第一名的分子式
|
||
------KPI公式:根据分子式的MS%倒序排,取第一个
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
```
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Top
|
||
lineageTag: d8082e9e-cabb-4854-b1ac-407c11e594a5
|
||
|
||
measure 'External.MS%.KPI.Top1MolName' = ```
|
||
|
||
VAR DS = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
VAR DS1 = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||
VAR BRANDMKT_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 R = CALCULATE([External.MS%.TopNMolName], 'TopN'[TopN]=1)
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
DS = "Retail" && BRANDMKT_FLAG = 1,R,
|
||
DS = "Retail",BLANK(),
|
||
R)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:排第一名的分子式
|
||
------KPI公式:根据分子式的MS%倒序排,取第一个
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
```
|
||
displayFolder: OLD\Top
|
||
lineageTag: ce955e93-3e82-47af-a8d6-bbe9a98bf5e9
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.KPI.Top1Player' = ```
|
||
|
||
VAR DS = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
VAR DS1 = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||
VAR BRANDMKT_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 CV = [External.Sales.KPI.Market]
|
||
VAR R = IF(CV <> BLANK(), CALCULATE([External.MS%.TopNPlayer], 'TopN'[TopN]=1))
|
||
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
DS = "Retail" && BRANDMKT_FLAG = 1,R,
|
||
DS = "Retail",BLANK(),
|
||
R)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:排第一名的公司+产品
|
||
------KPI公式:根据公司+产品的MS%倒序排,取第一个
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
```
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Top
|
||
lineageTag: 46492cc4-3102-48b5-b846-fe94d5bf0624
|
||
|
||
measure 'External.MS%.KPI.Top1PlayerName' = ```
|
||
|
||
VAR DS = SELECTEDVALUE(Dim_DataSource[SOURCENAME])
|
||
VAR DS1 = SELECTEDVALUE(Dim_DataSource[DATA_SOURCE])
|
||
VAR BRANDMKT_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 CV = [External.Sales.KPI.Market]
|
||
VAR R = IF(CV <> BLANK(), CALCULATE([External.MS%.TopNPlayerName], 'TopN'[TopN]=1))
|
||
|
||
RETURN
|
||
SWITCH(TRUE(),
|
||
DS = "Retail" && BRANDMKT_FLAG = 1,R,
|
||
DS = "Retail",BLANK(),
|
||
R)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:排第一名的公司+产品
|
||
------KPI公式:根据公司+产品的MS%倒序排,取第一个
|
||
------备注:
|
||
------创建时间:2024.6.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
```
|
||
displayFolder: OLD\Top
|
||
lineageTag: 3d20914d-7b26-42f8-8e23-de307297d827
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.TopNClass' =
|
||
|
||
VAR CV = [External.Sales.KPI.Market]
|
||
VAR T =
|
||
CALCULATETABLE (
|
||
INDEX (
|
||
[TopN.Value],
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( Dim_Class, Dim_Class[CLASS] ),
|
||
"@VAL", [External.MS%.KPI]
|
||
),
|
||
ORDERBY ( calculate( [External.MS%.KPI] ,'Fact_Sales'[Is_SpecialFlag]=0), DESC )
|
||
),
|
||
REMOVEFILTERS ( Dim_PackInfo ),
|
||
REMOVEFILTERS ( Dim_Class ),
|
||
REMOVEFILTERS ( Dim_Corp )
|
||
)
|
||
RETURN
|
||
IF ( CV <> BLANK (), MAXX ( T, [@VAL] ) )
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Top
|
||
lineageTag: a812b5a9-8ffd-411e-9874-2cca1d25e06b
|
||
|
||
measure 'External.MS%.TopNClassName' =
|
||
|
||
VAR CV = [External.Sales.KPI.Market]
|
||
VAR T =
|
||
CALCULATETABLE (
|
||
INDEX (
|
||
[TopN.Value],
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( Dim_Class, Dim_Class[CLASS] ),
|
||
"@VAL", calculate( [External.MS%.KPI] ,'Fact_Sales'[Is_SpecialFlag]=0)
|
||
),
|
||
ORDERBY ( [@VAL], DESC )
|
||
),
|
||
REMOVEFILTERS ( Dim_PackInfo ),
|
||
REMOVEFILTERS ( Dim_Class[CLASS] ),
|
||
REMOVEFILTERS ( Dim_Corp )
|
||
)
|
||
RETURN
|
||
IF ( CV <> BLANK (), MAXX ( T, [CLASS] ) )
|
||
displayFolder: OLD\Top
|
||
lineageTag: f258dea1-e446-48dc-9a60-197d8a6d763c
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.TopNMol' =
|
||
|
||
VAR CV = [External.Sales.KPI.Market3.1]
|
||
VAR T =
|
||
CALCULATETABLE (
|
||
INDEX (
|
||
[TopN.Value],
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( FACT_Sales, Dim_PackInfo[CMPS_DES] ),
|
||
"@VAL", [External.MS%.KPI]
|
||
),
|
||
ORDERBY ( calculate( [External.MS%.KPI] ,'Fact_Sales'[Is_SpecialFlag]=0), DESC )
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_PACK] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] )
|
||
)
|
||
RETURN
|
||
IF ( CV <> BLANK (), MAXX ( T, [@VAL] ) )
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Top
|
||
lineageTag: b65efcdb-bafa-40e1-8bac-c29effad46b1
|
||
|
||
measure 'External.MS%.TopNMolName' =
|
||
|
||
VAR CV = [External.Sales.KPI.Market]
|
||
VAR T =
|
||
CALCULATETABLE (
|
||
INDEX (
|
||
[TopN.Value],
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( FACT_Sales, Dim_PackInfo[CMPS_DES] ),
|
||
"@VAL", calculate( [External.MS%.KPI] ,'Fact_Sales'[Is_SpecialFlag]=0)
|
||
),
|
||
ORDERBY ( [@VAL], DESC )
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_PACK] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] )
|
||
)
|
||
RETURN
|
||
IF ( CV <> BLANK (), MAXX ( T, [CMPS_DES] ) )
|
||
displayFolder: OLD\Top
|
||
lineageTag: a93eced7-044d-450e-9a3f-dc5e0938290a
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.TopNPlayer' =
|
||
|
||
VAR T =
|
||
CALCULATETABLE (
|
||
INDEX (
|
||
[TopN.Value],
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( FACT_Sales, Dim_PackInfo[PROD_CORP_C] ),
|
||
"@VAL", [External.MS%.KPI]
|
||
),
|
||
ORDERBY ( calculate( [External.MS%.KPI] ,'Fact_Sales'[Is_SpecialFlag]=0), DESC )
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_PACK] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP_C] )
|
||
)
|
||
RETURN
|
||
MAXX ( T, [@VAL] )
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: OLD\Top
|
||
lineageTag: 9503382b-0cf9-4e3b-8e6c-9378e76ac5fb
|
||
|
||
measure 'External.MS%.TopNPlayerName' =
|
||
|
||
VAR T =
|
||
CALCULATETABLE (
|
||
INDEX (
|
||
[TopN.Value],
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( FACT_Sales, Dim_PackInfo[PROD_CORP_C] ),
|
||
"@VAL", calculate( [External.Sales.KPI] ,'Fact_Sales'[Is_SpecialFlag]=0)
|
||
),
|
||
ORDERBY ( [@VAL], DESC )
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES_C] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_DES] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_PACK] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP] ),
|
||
REMOVEFILTERS ( Dim_PackInfo[PROD_CORP_C] )
|
||
)
|
||
RETURN
|
||
MAXX ( T, [PROD_CORP_C] )
|
||
displayFolder: OLD\Top
|
||
lineageTag: 63eca099-63e9-42ce-8845-5932c0c5b6f9
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'MergedData.Sales.KPI.Filter' =
|
||
|
||
CALCULATE (
|
||
[External.Sales.MTH],
|
||
'AIA_Merge_Data'[mergedata_5_2] = "AIA_MERGE_DATA"
|
||
)
|
||
displayFolder: OLD\External Sales
|
||
lineageTag: f0f1c463-88fb-41da-951b-8411981a8c8b
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'MergedData.Sales.KPI.Filter.NMarket' =
|
||
|
||
CALCULATE (
|
||
[External.Sales.MTH],
|
||
'AIA_Merge_Data'[mergedata_5_2] = "AIA_MERGE_DATA"
|
||
)
|
||
displayFolder: OLD\External Sales
|
||
lineageTag: 004b7fa7-0419-4f5b-83f2-7c170e14b705
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.MTH5.1.1' =
|
||
CALCULATE (
|
||
[Retail.Sales.MTH],
|
||
Fact_Retail[PACK_CODE] = "",
|
||
Fact_Retail[CORP_COD] <> "",
|
||
Fact_Retail[DTP_FLAG] = 1,
|
||
KEEPFILTERS ( TREATAS ( VALUES ( Dim_Corp[CORP_COD] ), Fact_Retail[CORP_COD] ) ),
|
||
ALL ( Dim_PackInfo ),
|
||
ALL ( Dim_MarketTA )
|
||
)
|
||
+ CALCULATE (
|
||
[External.Sales.MTH.MID],
|
||
KEEPFILTERS ( Fact_Sales[DATA_SOURCE] = "IQVIA-CHPA(Monthly)" )
|
||
)
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1\过渡性KPI
|
||
lineageTag: 10f204ef-cdb8-4098-9cbd-f4a2e54528c7
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.GRSales.KPI5.1' =
|
||
|
||
VAR CV = [External.Sales.KPI5.1]
|
||
VAR PV = [External.Sales.LY.KPI5.1]
|
||
RETURN
|
||
IF(CV <> BLANK(),CV-PV)
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1\过渡性KPI
|
||
lineageTag: 4e7876d3-7fc4-420f-bc09-696859bb2b83
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.MS%.LY.KPI5.1' = DIVIDE([External.Sales.LY.KPI5.1],[External.Sales.LY.KPI.Market5.1])
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1\过渡性KPI
|
||
lineageTag: 2c8249cf-98b8-4c3a-8d2c-93304ba49f2c
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Rank.KPI.Corp5.1' = ```
|
||
|
||
IF([External.Sales.KPI5.1]<>BLANK(),
|
||
CALCULATE(RANK(DENSE, ALLSELECTED(Dim_Corp[CORP_DES_C]), ORDERBY([External.Sales.KPI5.1], DESC)),
|
||
REMOVEFILTERS(Dim_Corp[CORP_TYPE])
|
||
)
|
||
)
|
||
```
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1\过渡性KPI
|
||
lineageTag: 86a5d022-15c9-485d-9fab-d6ff49ea2cec
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.AIA_OTHERS.5.1' =
|
||
IF (
|
||
ISINSCOPE ( 'Dim_Corp'[CORP_DES_C] ),
|
||
BLANK (),
|
||
SWITCH (
|
||
TRUE (),
|
||
//选择Dim_Geo || Dim_Org 维度字段筛选
|
||
(
|
||
ISFILTERED ( Dim_Geo ) || ISFILTERED ( Dim_Org )
|
||
)
|
||
&& ( ISFILTERED ( Dim_Market )|| ISFILTERED ( Dim_BrandDefaultMKT )|| ISFILTERED( DIM_MARKETTA)),
|
||
CALCULATE (
|
||
[External.Sales.MTH.MID],
|
||
KEEPFILTERS ( Fact_Sales[MERGEDATA_FLAG_MKT] = "AIA" ),
|
||
KEEPFILTERS ( Fact_Sales[Is_SpecialFlag] = 1 )
|
||
),
|
||
//如果没有选择 market则为空
|
||
//未选择Dim_Geo || Dim_Org 维度字段筛选
|
||
BLANK ()
|
||
)
|
||
)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:chenliping
|
||
------邮箱:
|
||
------KPI名字:External.Sales.MTH5.1
|
||
------KPI公式:
|
||
------创建时间:2025.8.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1\过渡性KPI
|
||
lineageTag: 283f4fbb-aa52-47e9-80f2-51293ac2fb6a
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.AIA_OTHERS.LY.5.1' =
|
||
IF (
|
||
ISINSCOPE ( 'Dim_Corp'[CORP_DES_C] ),
|
||
BLANK (),
|
||
SWITCH (
|
||
TRUE (),
|
||
//选择Dim_Geo || Dim_Org 维度字段筛选
|
||
(
|
||
ISFILTERED ( Dim_Geo ) || ISFILTERED ( Dim_Org )
|
||
)
|
||
&& ( ISFILTERED ( Dim_Market )||ISFILTERED ( Dim_BrandDefaultMKT )|| ISFILTERED( DIM_MARKETTA) ),
|
||
CALCULATE (
|
||
[External.Sales.MTH.MID],
|
||
KEEPFILTERS ( Fact_Sales[MERGEDATA_FLAG_MKT] = "AIA" ),
|
||
KEEPFILTERS ( Fact_Sales[Is_SpecialFlag] = 1 )
|
||
),
|
||
//如果没有选择 market则为空
|
||
//未选择Dim_Geo || Dim_Org 维度字段筛选
|
||
BLANK ()
|
||
)
|
||
)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:chenliping
|
||
------邮箱:
|
||
------KPI名字:External.Sales.MTH5.1
|
||
------KPI公式:
|
||
------创建时间:2025.8.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1\过渡性KPI
|
||
lineageTag: 0e424761-955b-4956-9901-1069c90e8fc1
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.KPI.Market5.1' = ```
|
||
|
||
CALCULATE (
|
||
[External.Sales.KPI5.1],
|
||
ALL ( Dim_PackInfo ),
|
||
ALL ( Dim_Corp ),
|
||
ALL ( Dim_Class )
|
||
)
|
||
```
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1\过渡性KPI
|
||
lineageTag: 70adc0c3-1481-4cb5-b9c4-96c1c22204a3
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.LY.KPI.Market5.1' =
|
||
CALCULATE (
|
||
[External.Sales.LY.mth5.1],
|
||
ALL ( Dim_PackInfo ),
|
||
ALL ( Dim_Corp ),
|
||
ALL ( Dim_Class )
|
||
)
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1\过渡性KPI
|
||
lineageTag: f0c9f861-68db-4b83-bcd4-962bb04cb380
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.LY.KPI5.1' =
|
||
CALCULATE (
|
||
[External.Sales.LY.MTH5.1],
|
||
KEEPFILTERS ( Fact_Sales[Is_SpecialFlag] = 0 )
|
||
) + [External.Sales.AIA_OTHERS.LY.5.1]
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1\过渡性KPI
|
||
lineageTag: 3a806256-a223-4dd2-b900-4284210ce384
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.LY.MTH5.1' = ```
|
||
|
||
VAR DW =
|
||
SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
|
||
VAR MKT =
|
||
SELECTEDVALUE ( Dim_Market[MARKET] )
|
||
VAR _is_filter_org =
|
||
(
|
||
ISFILTERED ( Dim_Org[RC_CODE_DESC] ) || ISFILTERED ( Dim_Org[REGION_CODE_DESC] )
|
||
|| ISFILTERED ( Dim_Geo[MERGED_DATA_CITY_C] )
|
||
|| ISFILTERED ( Dim_Geo[PROVINCE_C] )
|
||
|| ISFILTERED ( Dim_Org[rsd_kcode] )
|
||
|| ISFILTERED (Dim_Org[rsm_kcode] )
|
||
)
|
||
VAR _is_filter_mkt =
|
||
(
|
||
ISFILTERED ( Dim_Market[MARKET] )
|
||
|| ISFILTERED ( Dim_BrandDefaultMKT[BRAND_NAME] )
|
||
|| ISFILTERED ( Dim_BrandDefaultMKT[MARKET] )
|
||
|| ISFILTERED ( Dim_MarketTA[TA] )
|
||
)
|
||
VAR _result =
|
||
SWITCH (
|
||
TRUE (),
|
||
//选择Dim_Geo || Dim_Org 维度字段筛选
|
||
_is_filter_org && NOT _is_filter_mkt, BLANK (),
|
||
//选择Dim_Geo || Dim_Org 维度字段筛选 EGFR TKI市场 包含AIA
|
||
_is_filter_org && _is_filter_mkt,
|
||
CALCULATE (
|
||
[External.Sales.LY.MTH.MID],
|
||
AIA_Merged_Data_opt[AIA_Merged_Data_5_1] = "AIA_Merged_Data_opt"
|
||
),
|
||
//选择Dim_Geo || Dim_Org 维度字段筛选 EGFR TKI市场DTP无省份完整明细数据,因此公司排名仅为CHPA/AIA拼数结果
|
||
/*_is_filter_org
|
||
&& _is_filter_mkt
|
||
&& MKT = "EGFR TKI Market",
|
||
CALCULATE (
|
||
[External.Sales.LY.MTH.MID],
|
||
TREATAS ( { "CHPA", "AIA" }, Fact_Sales[MERGEDATA_FLAG_MKT] )
|
||
),
|
||
*/
|
||
//未选择Dim_Geo || Dim_Org 维度字段筛选 不筛选market为空
|
||
NOT ( _is_filter_org ) && [IsMerge]
|
||
&& NOT ( _is_filter_mkt ), BLANK (),
|
||
//筛选了TA,没有筛选market,直取 DTP & CHPA
|
||
NOT ( _is_filter_org ) && [IsMerge]
|
||
&& ISFILTERED ( Dim_Corp )
|
||
&& SELECTEDVALUE ( Dim_MarketTA[TA] ) = "ONCO"
|
||
&& NOT ISFILTERED ( Dim_PackInfo ) && NOT ISFILTERED ( Dim_Market[MARKET] ),
|
||
VAR _r = [External.Sales.ly.MTH5.1.1]
|
||
RETURN
|
||
IF(
|
||
HASONEVALUE ( Dim_Corp[CORP_DES_C] ),
|
||
IF (
|
||
CALCULATE (
|
||
RANK (
|
||
DENSE,
|
||
ALLSELECTED ( Dim_Corp[CORP_DES_C] ),
|
||
ORDERBY ( [External.Sales.MTH5.1.1], DESC )
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp[CORP_TYPE] )
|
||
) <= 10,
|
||
_r,
|
||
BLANK ()
|
||
),
|
||
_r
|
||
),
|
||
//DTP/非DTP市场
|
||
NOT ( _is_filter_org ) && [IsMerge], CALCULATE ( [External.Sales.LY.MTH.MID], Fact_Sales[MERGEDATA_FLAG_CHPA_DTP] = 1 ),
|
||
//未选择地理且不选择拼接数据直取CHPA
|
||
CALCULATE (
|
||
[External.Sales.LY.MTH.MID],
|
||
KEEPFILTERS ( Fact_Sales[DATA_SOURCE] = "IQVIA-CHPA(Monthly)" )
|
||
)
|
||
)
|
||
RETURN IF(ISBLANK([External.Sales.MTH5.1]),BLANK(),_result)
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:chenliping
|
||
------邮箱:
|
||
------KPI名字:External.Sales.LY.MTH5.1
|
||
------KPI公式:
|
||
------创建时间:2025.8.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
```
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1\过渡性KPI
|
||
lineageTag: e6fc0afe-3e6e-4be7-974e-a140c945f15c
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.LY.MTH5.1.1' =
|
||
CALCULATE (
|
||
[Retail.Sales.LY.MTH],
|
||
Fact_Retail[PACK_CODE] = "",
|
||
Fact_Retail[CORP_COD] <> "",
|
||
Fact_Retail[DTP_FLAG] = 1,
|
||
KEEPFILTERS ( TREATAS ( VALUES ( Dim_Corp[CORP_COD] ), Fact_Retail[CORP_COD] ) ),
|
||
ALL ( Dim_PackInfo ),
|
||
ALL ( Dim_MarketTA )
|
||
)
|
||
+ CALCULATE (
|
||
[External.Sales.ly.MTH.MID],
|
||
KEEPFILTERS ( Fact_Sales[DATA_SOURCE] = "IQVIA-CHPA(Monthly)" )
|
||
)
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1\过渡性KPI
|
||
lineageTag: 1d4e3506-9ce5-4d96-a99f-1856cf6f45c6
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.MTH5.1' = ```
|
||
|
||
VAR DW =
|
||
SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
|
||
VAR MKT =
|
||
SELECTEDVALUE ( Dim_Market[MARKET] )
|
||
VAR _is_filter_org =
|
||
(
|
||
ISFILTERED ( Dim_Org[RC_CODE_DESC] ) || ISFILTERED ( Dim_Org[REGION_CODE_DESC] )
|
||
|| ISFILTERED ( Dim_Geo[MERGED_DATA_CITY_C] )
|
||
|| ISFILTERED ( Dim_Geo[PROVINCE_C] )
|
||
|| ISFILTERED ( Dim_Org[rsd_kcode] )
|
||
|| ISFILTERED (Dim_Org[rsm_kcode] )
|
||
)
|
||
VAR _is_filter_mkt =
|
||
(
|
||
ISFILTERED ( Dim_Market[MARKET] )
|
||
|| ISFILTERED ( Dim_BrandDefaultMKT[BRAND_NAME] )
|
||
|| ISFILTERED ( Dim_BrandDefaultMKT[MARKET] )
|
||
|| ISFILTERED ( Dim_MarketTA[TA] )
|
||
)
|
||
RETURN
|
||
SWITCH (
|
||
TRUE (),
|
||
//选择Dim_Geo || Dim_Org 维度字段筛选
|
||
_is_filter_org && NOT _is_filter_mkt, BLANK (),
|
||
//选择Dim_Geo || Dim_Org 维度字段筛选 EGFR TKI市场 包含AIA
|
||
_is_filter_org && _is_filter_mkt,
|
||
CALCULATE (
|
||
[External.Sales.MTH.MID],
|
||
AIA_Merged_Data_opt[AIA_Merged_Data_5_1] = "AIA_Merged_Data_opt"
|
||
),
|
||
//选择Dim_Geo || Dim_Org 维度字段筛选 EGFR TKI市场DTP无省份完整明细数据,因此公司排名仅为CHPA/AIA拼数结果
|
||
/*_is_filter_org
|
||
&& _is_filter_mkt
|
||
&& MKT = "EGFR TKI Market",
|
||
CALCULATE (
|
||
[External.Sales.MTH.MID],
|
||
TREATAS ( { "CHPA", "AIA" }, Fact_Sales[MERGEDATA_FLAG_MKT] )
|
||
),
|
||
*/
|
||
//未选择Dim_Geo || Dim_Org 维度字段筛选 不筛选market为空
|
||
NOT ( _is_filter_org ) && [IsMerge]
|
||
&& NOT ( _is_filter_mkt ), BLANK (),
|
||
//筛选了TA,没有筛选market,直取 DTP & CHPA
|
||
NOT ( _is_filter_org ) && [IsMerge]
|
||
&& ISFILTERED ( Dim_Corp )
|
||
&& SELECTEDVALUE ( Dim_MarketTA[TA] ) = "ONCO"
|
||
&& NOT ISFILTERED ( Dim_PackInfo ) && NOT ISFILTERED ( Dim_Market[MARKET] ),
|
||
VAR _r = [External.Sales.MTH5.1.1]
|
||
RETURN
|
||
IF(
|
||
HASONEVALUE ( Dim_Corp[CORP_DES_C] ),
|
||
IF (
|
||
CALCULATE (
|
||
RANK (
|
||
DENSE,
|
||
ALLSELECTED ( Dim_Corp[CORP_DES_C] ),
|
||
ORDERBY ( [External.Sales.MTH5.1.1], DESC )
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp[CORP_TYPE] )
|
||
) <= 10,
|
||
_r,
|
||
BLANK ()
|
||
),
|
||
_r
|
||
),
|
||
//DTP/非DTP市场
|
||
NOT ( _is_filter_org ) && [IsMerge], CALCULATE ( [External.Sales.MTH.MID], Fact_Sales[MERGEDATA_FLAG_CHPA_DTP] = 1 ),
|
||
//未选择地理且不选择拼接数据直取CHPA
|
||
CALCULATE (
|
||
[External.Sales.MTH.MID],
|
||
KEEPFILTERS ( Fact_Sales[DATA_SOURCE] = "IQVIA-CHPA(Monthly)" )
|
||
)
|
||
)
|
||
```
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1\过渡性KPI
|
||
lineageTag: 6f7c31ef-a1e8-42c8-8e9a-6dd58939f2aa
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.△MS%.KPI5.1' = ```
|
||
|
||
VAR CV = [External.MS%.KPI5.1]
|
||
VAR PV = [External.MS%.LY.KPI5.1]
|
||
RETURN
|
||
IF(PV <> BLANK (),
|
||
CV - PV)
|
||
|
||
```
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1
|
||
lineageTag: d6d1f0d4-c496-4060-b55e-0c68e4b6f4ee
|
||
|
||
measure 'External.EI.KPI5.1' =
|
||
|
||
DIVIDE (
|
||
DIVIDE ( [External.Sales.KPI5.1], [External.Sales.LY.KPI5.1] ),
|
||
DIVIDE ( [External.Sales.KPI.Market5.1], [External.Sales.LY.KPI.Market5.1] )
|
||
) * 100//)
|
||
formatString: 0
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1
|
||
lineageTag: 6ddcfe84-9024-4f0a-9c57-9ea0e6fb70c1
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Gr%.KPI5.1' =
|
||
|
||
VAR CV = [External.Sales.KPI5.1]
|
||
VAR PV = [External.Sales.LY.KPI5.1]
|
||
RETURN
|
||
IF(PV <> BLANK(),DIVIDE(CV-PV,PV))
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1
|
||
lineageTag: 82692fbd-e613-4297-a222-eb7fb04683ea
|
||
|
||
measure 'External.MS%.KPI5.1' = DIVIDE([External.Sales.KPI5.1],[External.Sales.KPI.Market5.1])
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1
|
||
lineageTag: 293af5ba-17c6-49fb-aeb8-d501eb9fec55
|
||
|
||
measure 'External.Rank.KPI5.1' = ```
|
||
|
||
VAR DS = SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||
VAR DW = SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
|
||
VAR R =
|
||
IF (
|
||
[External.Sales.KPI5.1] <> BLANK(),
|
||
SWITCH (
|
||
TRUE (),
|
||
ISINSCOPE(Dim_Corp[CORP_DES_C]), [External.Rank.KPI.Corp5.1],
|
||
BLANK()
|
||
)
|
||
)
|
||
RETURN
|
||
R
|
||
---------------------------------KPI描述------------------------------------
|
||
------创建者:chenliping
|
||
------邮箱:
|
||
------KPI名字:External.Rank.KPI5.1
|
||
------KPI公式:
|
||
------创建时间:2025.8.15
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------
|
||
```
|
||
formatString: 0
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1
|
||
lineageTag: af313d5b-1bdc-4019-a10c-6ff33fa05116
|
||
|
||
measure 'External.RQGR%.KPI5.1' =
|
||
|
||
VAR CV = CALCULATE([External.Sales.KPI5.1], MQY[Period]="QTDAvg")
|
||
VAR PV = CALCULATE(CALCULATE([External.Sales.KPI5.1], PREVIOUSQUARTER(ENDOFQUARTER(Dim_Calendar[Date]))), MQY[Period]="QTDAvg")
|
||
RETURN IF([External.Sales.KPI5.1]<> BLANK(), DIVIDE(CV-PV,PV))
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1
|
||
lineageTag: 30254eb2-f905-49a3-983b-c01f4abfde45
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.KPI5.1' =
|
||
CALCULATE (
|
||
[External.Sales.MTH5.1],
|
||
KEEPFILTERS ( Fact_Sales[Is_SpecialFlag] = 0 )
|
||
) + [External.Sales.AIA_OTHERS.5.1]
|
||
formatString: #,0
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1
|
||
lineageTag: c78e7331-c801-4423-85e8-0c77c7ca8903
|
||
|
||
measure 'Sales_GRTOP1_BrandGR%5.1' = ```
|
||
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
FILTER(
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( Fact_Sales, Dim_PackInfo[PROD_VBP], Dim_PackInfo[CORP_DES_C] ),
|
||
"@GR", [External.Gr%.KPI5.1],
|
||
"@GRVal", [External.GRSales.KPI5.1]
|
||
),[@GRVal] > 0),
|
||
ORDERBY ( [@GRVal], DESC )
|
||
)
|
||
var R =
|
||
SWITCH (
|
||
TRUE (),
|
||
//选择Dim_Geo || Dim_RC 维度字段筛选
|
||
ISFILTERED ( Dim_Geo )
|
||
|| ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
MAXX ( T, [@GR] ),
|
||
Fact_Sales[MERGEDATA_FLAG] <> "normal"
|
||
),
|
||
//未选择Dim_Geo || Dim_RC 维度字段筛选,选择TA是ONCO+公司时的金额
|
||
(NOT ISFILTERED ( Dim_Geo )
|
||
|| NOT ISFILTERED ( Dim_Org ))
|
||
&& SELECTEDVALUE ( Dim_MarketTA[TA] ) = "ONCO",blank(),
|
||
MAXX ( T, [@GR] )
|
||
)
|
||
RETURN
|
||
IF([External.Sales.KPI5.1] <> BLANK(),R)
|
||
```
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1
|
||
lineageTag: dc2e348f-cc7a-4ab2-bbb5-066055573523
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Sales_GRTOP1_BrandName5.1' = ```
|
||
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
FILTER(
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( Fact_Sales, Dim_PackInfo[PROD_VBP], Dim_PackInfo[CORP_DES_C] ),
|
||
"@GRVal", [External.GRSales.KPI5.1]
|
||
),[@GRVal] > 0),
|
||
ORDERBY ( [@GRVal], DESC )
|
||
)
|
||
var R =
|
||
SWITCH (
|
||
TRUE (),
|
||
//选择Dim_Geo || Dim_RC 维度字段筛选
|
||
ISFILTERED ( Dim_Geo )
|
||
|| ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
MAXX ( T, [PROD_VBP] ),
|
||
Fact_Sales[MERGEDATA_FLAG] <> "normal"
|
||
),
|
||
//未选择Dim_Geo || Dim_RC 维度字段筛选,选择TA是ONCO+公司时的金额
|
||
(NOT ISFILTERED ( Dim_Geo )
|
||
|| NOT ISFILTERED ( Dim_Org ))
|
||
&& SELECTEDVALUE ( Dim_MarketTA[TA] ) = "ONCO",blank(),
|
||
MAXX ( T, [PROD_VBP] )
|
||
)
|
||
RETURN
|
||
IF([External.Sales.KPI5.1] <> BLANK(),R)
|
||
```
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1
|
||
lineageTag: 2eba282e-a6de-40a7-8052-1da1e72e03df
|
||
|
||
measure 'Sales_GRTOP1_BrandSales5.1' =
|
||
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( Fact_Sales, Dim_PackInfo[PROD_VBP], Dim_PackInfo[CORP_DES_C] ),
|
||
"@VAL", [External.Sales.KPI5.1],
|
||
"@GRVal", [External.GRSales.KPI5.1]
|
||
),
|
||
[@GRVal] > 0
|
||
),
|
||
ORDERBY ( [@GRVal], DESC )
|
||
)
|
||
RETURN
|
||
IF (
|
||
( NOT ISFILTERED ( Dim_Geo ) || NOT ISFILTERED ( Dim_Org ) )
|
||
&& SELECTEDVALUE ( Dim_MarketTA[TA] ) = "ONCO",
|
||
BLANK (),
|
||
MAXX ( T, [@VAL] )
|
||
)
|
||
formatString: #,0
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1
|
||
lineageTag: f216776f-00e7-4f60-b36b-96bfcf6ded2d
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Sales_GRTOP2_BrandGR%5.1' = ```
|
||
|
||
VAR T =
|
||
INDEX (
|
||
2,
|
||
FILTER(
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( Fact_Sales, Dim_PackInfo[PROD_VBP], Dim_PackInfo[CORP_DES_C] ),
|
||
"@GR", [External.Gr%.KPI5.1],
|
||
"@GRVal", [External.GRSales.KPI5.1]
|
||
),[@GRVal] > 0),
|
||
ORDERBY ( [@GRVal], DESC )
|
||
)
|
||
var R =
|
||
SWITCH (
|
||
TRUE (),
|
||
//选择Dim_Geo || Dim_Org 维度字段筛选
|
||
ISFILTERED ( Dim_Geo )
|
||
|| ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
MAXX ( T, [@GR] ),
|
||
Fact_Sales[MERGEDATA_FLAG] <> "normal"
|
||
),
|
||
//未选择Dim_Geo || Dim_Org 维度字段筛选,选择TA是ONCO+公司时的金额
|
||
(NOT ISFILTERED ( Dim_Geo )
|
||
|| NOT ISFILTERED ( Dim_Org ))
|
||
&& SELECTEDVALUE ( Dim_MarketTA[TA] ) = "ONCO",BLANK(),
|
||
MAXX ( T, [@GR] )
|
||
)
|
||
RETURN
|
||
IF([External.Sales.KPI5.1] <> BLANK(),R)
|
||
```
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1
|
||
lineageTag: ac6476c4-a458-439d-8585-26eb117bf8a7
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Sales_GRTOP2_BrandName5.1' = ```
|
||
|
||
VAR T =
|
||
INDEX (
|
||
2,
|
||
FILTER(
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( Fact_Sales, Dim_PackInfo[PROD_VBP], Dim_PackInfo[CORP_DES_C] ),
|
||
"@GRVal", [External.GRSales.KPI5.1]
|
||
),[@GRVal] > 0),
|
||
ORDERBY ( [@GRVal], DESC )
|
||
)
|
||
var R =
|
||
SWITCH (
|
||
TRUE (),
|
||
//选择Dim_Geo || Dim_Org 维度字段筛选
|
||
ISFILTERED ( Dim_Geo )
|
||
|| ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
MAXX ( T, [PROD_VBP] ),
|
||
Fact_Sales[MERGEDATA_FLAG] <> "normal"
|
||
),
|
||
//未选择Dim_Geo || Dim_Org 维度字段筛选,选择TA是ONCO+公司时的金额
|
||
(NOT ISFILTERED ( Dim_Geo )
|
||
|| NOT ISFILTERED ( Dim_Org ))
|
||
&& SELECTEDVALUE ( Dim_MarketTA[TA] ) = "ONCO",BLANK(),
|
||
MAXX ( T, [PROD_VBP] )
|
||
)
|
||
RETURN
|
||
IF([External.Sales.KPI5.1] <> BLANK(),R)
|
||
```
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1
|
||
lineageTag: ae6eaa7f-f3da-43d0-ad60-407563c52c65
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Sales_GRTOP2_BrandSales5.1' =
|
||
|
||
VAR T =
|
||
INDEX (
|
||
2,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( Fact_Sales, Dim_PackInfo[PROD_VBP], Dim_PackInfo[CORP_DES_C] ),
|
||
"@VAL", [External.Sales.KPI5.1],
|
||
"@GRVal", [External.GRSales.KPI5.1]
|
||
),
|
||
[@GRVal] > 0
|
||
),
|
||
ORDERBY ( [@GRVal], DESC )
|
||
)
|
||
RETURN
|
||
IF (
|
||
( NOT ISFILTERED ( Dim_Geo ) || NOT ISFILTERED ( Dim_Org ) )
|
||
&& SELECTEDVALUE ( Dim_MarketTA[TA] ) = "ONCO",
|
||
BLANK (),
|
||
MAXX ( T, [@VAL] )
|
||
)
|
||
formatString: #,0
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1
|
||
lineageTag: ec518e50-81f8-48bc-be09-c2ce453f5a00
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Sales_MSTOP1_BrandGR%5.1' = ```
|
||
|
||
VAR DW = SELECTEDVALUE(Dim_Unit[DW_TYPE])
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
FILTER(
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( Fact_Sales, Dim_PackInfo[PROD_VBP], Dim_PackInfo[CORP_DES_C] ),
|
||
"@VAL", [External.Sales.KPI5.1],
|
||
"@GR", [External.Gr%.KPI5.1]
|
||
),[@VAL] <> BLANK()),
|
||
ORDERBY ( [@VAL], DESC )
|
||
)
|
||
var R =
|
||
SWITCH (
|
||
TRUE (),
|
||
//选择Dim_Geo || Dim_Org 维度字段筛选
|
||
ISFILTERED ( Dim_Geo )
|
||
|| ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
MAXX ( T, [@GR] ),
|
||
Fact_Sales[MERGEDATA_FLAG] <> "normal"
|
||
),
|
||
//未选择Dim_Geo || Dim_Org 维度字段筛选,选择TA是ONCO+公司时的金额
|
||
(NOT ISFILTERED ( Dim_Geo )
|
||
|| NOT ISFILTERED ( Dim_Org ))
|
||
&& SELECTEDVALUE ( Dim_MarketTA[TA] ) = "ONCO",blank(),
|
||
MAXX ( T, [@GR] )
|
||
)
|
||
RETURN
|
||
IF([External.Sales.KPI5.1] <> BLANK(),R)
|
||
```
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1
|
||
lineageTag: c9725b54-23bc-492c-9b55-c13c54fdbfdf
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Sales_MSTOP1_BrandName5.1' = ```
|
||
|
||
VAR DW = SELECTEDVALUE(Dim_Unit[DW_TYPE])
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
FILTER(
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( Fact_Sales, Dim_PackInfo[PROD_VBP], Dim_PackInfo[CORP_DES_C] ),
|
||
"@VAL", [External.Sales.KPI5.1]
|
||
),[@VAL] <> BLANK()),
|
||
ORDERBY ( [@VAL], DESC )
|
||
)
|
||
var R =
|
||
SWITCH (
|
||
TRUE (),
|
||
//选择Dim_Geo || Dim_Org 维度字段筛选
|
||
ISFILTERED ( Dim_Geo )
|
||
|| ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
MAXX ( T, [PROD_VBP] ),
|
||
Fact_Sales[MERGEDATA_FLAG] <> "normal"
|
||
),
|
||
//未选择Dim_Geo || Dim_Org 维度字段筛选,选择TA是ONCO+公司时的金额
|
||
(NOT ISFILTERED ( Dim_Geo )
|
||
|| NOT ISFILTERED ( Dim_Org ))
|
||
&& SELECTEDVALUE ( Dim_MarketTA[TA] ) = "ONCO",blank(),
|
||
MAXX ( T, [PROD_VBP] )
|
||
)
|
||
RETURN
|
||
IF([External.Sales.KPI5.1] <> BLANK(),R)
|
||
```
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1
|
||
lineageTag: 82208b34-0875-431e-9125-89d707c914f4
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Sales_MSTOP1_BrandSales5.1' =
|
||
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( Fact_Sales, Dim_PackInfo[PROD_VBP], Dim_PackInfo[CORP_DES_C] ),
|
||
"@VAL", [External.Sales.KPI5.1]
|
||
),
|
||
[@VAL] <> BLANK ()
|
||
),
|
||
ORDERBY ( [@VAL], DESC )
|
||
)
|
||
RETURN
|
||
IF (
|
||
( NOT ISFILTERED ( Dim_Geo ) || NOT ISFILTERED ( Dim_Org ) )
|
||
&& SELECTEDVALUE ( Dim_MarketTA[TA] ) = "ONCO",
|
||
BLANK (),
|
||
MAXX ( T, [@VAL] )
|
||
)
|
||
formatString: #,0
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1
|
||
lineageTag: 3cc86d71-7e7f-462b-8ab7-5638a19ca6f9
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Sales_MSTOP2_BrandGR%5.1' = ```
|
||
|
||
VAR DW = SELECTEDVALUE(Dim_Unit[DW_TYPE])
|
||
VAR T =
|
||
INDEX (
|
||
2,
|
||
FILTER(
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( Fact_Sales, Dim_PackInfo[PROD_VBP], Dim_PackInfo[CORP_DES_C] ),
|
||
"@VAL", [External.Sales.KPI5.1],
|
||
"@GR", [External.Gr%.KPI5.1]
|
||
),[@VAL] <> BLANK()),
|
||
ORDERBY ( [@VAL], DESC )
|
||
)
|
||
var R =
|
||
SWITCH (
|
||
TRUE (),
|
||
//选择Dim_Geo || Dim_Org 维度字段筛选
|
||
ISFILTERED ( Dim_Geo )
|
||
|| ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
MAXX ( T, [@GR] ),
|
||
Fact_Sales[MERGEDATA_FLAG] <> "normal"
|
||
),
|
||
//未选择Dim_Geo || Dim_Org 维度字段筛选,选择TA是ONCO+公司时的金额
|
||
(NOT ISFILTERED ( Dim_Geo )
|
||
|| NOT ISFILTERED ( Dim_Org ))
|
||
&& SELECTEDVALUE ( Dim_MarketTA[TA] ) = "ONCO",BLANK(),
|
||
MAXX ( T, [@GR] )
|
||
)
|
||
RETURN
|
||
IF([External.Sales.KPI5.1] <> BLANK(),R)
|
||
```
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1
|
||
lineageTag: f39c3778-f131-4637-913f-2f387a3c8df9
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Sales_MSTOP2_BrandName5.1' = ```
|
||
|
||
VAR DW = SELECTEDVALUE(Dim_Unit[DW_TYPE])
|
||
VAR T =
|
||
INDEX (
|
||
2,
|
||
FILTER(
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( Fact_Sales, Dim_PackInfo[PROD_VBP], Dim_PackInfo[CORP_DES_C] ),
|
||
"@VAL", [External.Sales.KPI5.1]
|
||
),[@VAL] <> BLANK()),
|
||
ORDERBY ( [@VAL], DESC )
|
||
)
|
||
var R =
|
||
SWITCH (
|
||
TRUE (),
|
||
//选择Dim_Geo || Dim_Org 维度字段筛选
|
||
ISFILTERED ( Dim_Geo )
|
||
|| ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
MAXX ( T, [PROD_VBP] ),
|
||
Fact_Sales[MERGEDATA_FLAG] <> "normal"
|
||
),
|
||
//未选择Dim_Geo || Dim_Org 维度字段筛选,选择TA是ONCO+公司时的金额
|
||
(NOT ISFILTERED ( Dim_Geo )
|
||
|| NOT ISFILTERED ( Dim_Org ))
|
||
&& SELECTEDVALUE ( Dim_MarketTA[TA] ) = "ONCO",BLANK(),
|
||
MAXX ( T, [PROD_VBP] )
|
||
)
|
||
RETURN
|
||
IF([External.Sales.KPI5.1] <> BLANK(),R)
|
||
```
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1
|
||
lineageTag: 266abf4a-6304-4459-9fe7-15a563b7b982
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Sales_MSTOP2_BrandSales5.1' =
|
||
|
||
VAR T =
|
||
INDEX (
|
||
2,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( Fact_Sales, Dim_PackInfo[PROD_VBP], Dim_PackInfo[CORP_DES_C] ),
|
||
"@VAL", [External.Sales.KPI5.1]
|
||
),
|
||
[@VAL] <> BLANK ()
|
||
),
|
||
ORDERBY ( [@VAL], DESC )
|
||
)
|
||
RETURN
|
||
IF (
|
||
( NOT ISFILTERED ( Dim_Geo ) || NOT ISFILTERED ( Dim_Org ) )
|
||
&& SELECTEDVALUE ( Dim_MarketTA[TA] ) = "ONCO",
|
||
BLANK (),
|
||
MAXX ( T, [@VAL] )
|
||
)
|
||
formatString: #,0
|
||
displayFolder: OLD\特定视觉对象使用KPI AIA5.1
|
||
lineageTag: 4eddf66f-d0e0-4290-86fc-24bce8c4c60a
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.LY.KPI.Market' =
|
||
VAR PV = [External.Sales.LY.KPI]
|
||
VAR CV = [External.MKTPack.Count]
|
||
VAR T =
|
||
SWITCH (
|
||
TRUE ( )
|
||
, ISFILTERED ( AIA_Merge_Data[mergedata_5_2] ),
|
||
SUMX (
|
||
VALUES ( Dim_MergeDataSource[DATA_SOURCE] ),
|
||
CALCULATE (
|
||
[External.Sales.LY.KPI.Market.MID]
|
||
, ALL ( Dim_PackInfo )
|
||
, ALL ( Dim_Corp )
|
||
, ALL ( Dim_Class )
|
||
, ALL ( Dim_KeyCompetitor )
|
||
, ALL ( AIA_AdvanceAnalysis_Key_Competitor )
|
||
)
|
||
)
|
||
, CALCULATE (
|
||
[External.Sales.LY.KPI.Market.MID]
|
||
, ALL ( Dim_PackInfo )
|
||
, ALL ( Dim_Corp )
|
||
, ALL ( Dim_Class )
|
||
, ALL ( Dim_KeyCompetitor )
|
||
, ALL ( AIA_AdvanceAnalysis_Key_Competitor )--for AIA 3.1
|
||
)
|
||
)
|
||
RETURN
|
||
SWITCH (
|
||
TRUE ( )
|
||
, ISFILTERED ( Dim_CoreDept ) || ISFILTERED ( Dim_Dept )
|
||
|| ISFILTERED ( Dim_HP_Level )
|
||
|| ISFILTERED ( Dim_Reimburse )
|
||
|| ISFILTERED ( Dim_PrescriptionSource ),
|
||
IF ( PV <> BLANK ( ), T )
|
||
, IF ( CV <> BLANK ( ), T )
|
||
)
|
||
formatString: #,0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: 6eca57f4-97e9-4e91-b403-2a2e1fd052cc
|
||
|
||
measure Sales_GRTOP1_BrandGR% =
|
||
VAR DS = [00.SOURCENAME]
|
||
VAR DW = SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
|
||
VAR DT = SELECTEDVALUE ( MQY[Period] )
|
||
--常规处理逻辑
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_VBP],
|
||
Dim_PackInfo[CORP_DES_C],
|
||
Dim_PackInfo[CMPS_COD]
|
||
),
|
||
"@GR", [External.Gr%.KPI2.1],
|
||
"@GRVal", [External.GRSales.KPI2.1]
|
||
),
|
||
[@GRVal] > 0
|
||
),
|
||
ORDERBY ( [@GRVal], DESC )
|
||
)
|
||
VAR R =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
//Retail
|
||
DS = "Retail" && DW = "Value" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org )
|
||
&& NOT ISFILTERED ( Dim_Geo ),
|
||
IF (
|
||
ISINSCOPE ( Dim_Corp[CORP_DES_C] ),
|
||
CALCULATE (
|
||
[00.DirectRetail.top_crop.top1_incremental_gr],
|
||
TREATAS (
|
||
VALUES ( Dim_Corp[CORP_COD] ),
|
||
Fact_Direct_Retail_rx_top_corp[corp_cod]
|
||
),
|
||
KEEPFILTERS (
|
||
FILTER (
|
||
ALL ( Fact_Direct_Retail_rx_top_corp[corp_cod] ),
|
||
NOT ISBLANK ( Fact_Direct_Retail_rx_top_corp[corp_cod] )
|
||
)
|
||
)
|
||
),
|
||
CALCULATE (
|
||
[00.DirectRetail.top_crop.top1_incremental_gr],
|
||
KEEPFILTERS (
|
||
Fact_Direct_Retail_rx_top_corp[corporation]
|
||
= "Total Rx Market"
|
||
)
|
||
)
|
||
),
|
||
-----------------------------------EC---------------------------------------
|
||
--选择公司的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,total行数据
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方"
|
||
),
|
||
--选择公司,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N"
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择TA时的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择非YTD
|
||
DS = "EC" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
--选择非YTD
|
||
DS = "Retail" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
MAXX ( T, [@GR] )
|
||
)
|
||
RETURN
|
||
IF ( [External.Sales.KPI2.1] <> BLANK ( ), R )
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: 00Base\02_2.1\06Top
|
||
lineageTag: ebff3870-84b2-4351-af09-94fa9c59cb0c
|
||
|
||
measure 'Sales_GRTOP1_BrandGR%.EN' =
|
||
VAR DS = SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||
VAR DW = SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
|
||
VAR DT = SELECTEDVALUE ( MQY[Period] )
|
||
--常规处理逻辑
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_VBP],
|
||
Dim_PackInfo[CORP_DES_C],
|
||
Dim_PackInfo[PROD_COD],
|
||
Dim_PackInfo[CMPS_COD]
|
||
),
|
||
"@GR", [External.Gr%.KPI2.1],
|
||
"@GRVal", [External.GRSales.KPI2.1]
|
||
),
|
||
[@GRVal] > 0
|
||
),
|
||
ORDERBY ( [@GRVal], DESC )
|
||
)
|
||
VAR R =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
//Retail
|
||
DS = "Retail" && DW = "Value" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org )
|
||
&& NOT ISFILTERED ( Dim_Geo ),
|
||
IF (
|
||
ISINSCOPE ( Dim_Corp[CORP_DES] ),
|
||
CALCULATE (
|
||
[00.DirectRetail.top_crop.top1_incremental_gr],
|
||
TREATAS (
|
||
VALUES ( Dim_Corp[CORP_COD] ),
|
||
Fact_Direct_Retail_rx_top_corp[corp_cod]
|
||
),
|
||
KEEPFILTERS (
|
||
FILTER (
|
||
ALL ( Fact_Direct_Retail_rx_top_corp[corp_cod] ),
|
||
NOT ISBLANK ( Fact_Direct_Retail_rx_top_corp[corp_cod] )
|
||
)
|
||
)
|
||
),
|
||
CALCULATE (
|
||
[00.DirectRetail.top_crop.top1_incremental_gr],
|
||
KEEPFILTERS (
|
||
Fact_Direct_Retail_rx_top_corp[corporation]
|
||
= "Total Rx Market"
|
||
)
|
||
)
|
||
),
|
||
-----------------------------------EC---------------------------------------
|
||
--选择公司的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,total行数据
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方"
|
||
),
|
||
--选择公司,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N"
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择TA时的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择非YTD
|
||
DS = "EC" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
--选择非YTD
|
||
DS = "Retail" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
MAXX ( T, [@GR] )
|
||
)
|
||
RETURN
|
||
IF ( [External.Sales.KPI2.1] <> BLANK ( ), R )
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: 00Base\02_2.1\06Top
|
||
lineageTag: 6a5712e8-d55c-4a82-b7b5-4d8c51087d84
|
||
|
||
measure Sales_GRTOP1_BrandName =
|
||
VAR DS = SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||
VAR DW = SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
|
||
VAR DT = SELECTEDVALUE ( MQY[Period] ) --常规处理逻辑
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_VBP],
|
||
Dim_PackInfo[CORP_DES_C],
|
||
Dim_PackInfo[CMPS_COD]
|
||
),
|
||
"@GRVal", [External.GRSales.KPI2.1]
|
||
),
|
||
[@GRVal] > 0
|
||
),
|
||
ORDERBY ( [@GRVal], DESC )
|
||
)
|
||
VAR R =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
//Retail
|
||
DS = "Retail" && DW = "Value" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org )
|
||
&& NOT ISFILTERED ( Dim_Geo ),
|
||
IF (
|
||
ISINSCOPE ( Dim_Corp[CORP_DES_C] ),
|
||
CALCULATE (
|
||
MAX ( Fact_Direct_Retail_rx_top_corp[top1_incremental_brand] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Corp[CORP_COD] ),
|
||
Fact_Direct_Retail_rx_top_corp[corp_cod]
|
||
),
|
||
KEEPFILTERS (
|
||
FILTER (
|
||
ALL ( Fact_Direct_Retail_rx_top_corp[corp_cod] ),
|
||
NOT ISBLANK ( Fact_Direct_Retail_rx_top_corp[corp_cod] )
|
||
)
|
||
)
|
||
),
|
||
CALCULATE (
|
||
MAX ( Fact_Direct_Retail_rx_top_corp[top1_incremental_brand] ),
|
||
KEEPFILTERS (
|
||
Fact_Direct_Retail_rx_top_corp[corporation]
|
||
= "Total Rx Market"
|
||
)
|
||
)
|
||
),
|
||
-----------------------------------EC---------------------------------------
|
||
--选择公司的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,total行数据
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方"
|
||
),
|
||
--选择公司,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "N"
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "Y"
|
||
),
|
||
--选择TA时的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择非YTD
|
||
DS = "EC" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
--选择非YTD
|
||
DS = "Retail" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
MAXX ( T, Dim_PackInfo[PROD_VBP] )
|
||
)
|
||
RETURN
|
||
IF ( [External.Sales.KPI2.1] <> BLANK ( ), R )
|
||
displayFolder: 00Base\02_2.1\06Top
|
||
lineageTag: 9c134f87-7828-4f3a-9882-c56144a4a104
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Sales_GRTOP1_BrandName.EN' =
|
||
VAR DS = SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||
VAR DW = SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
|
||
VAR DT = SELECTEDVALUE ( MQY[Period] ) --常规处理逻辑
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_VBP_EN],
|
||
Dim_PackInfo[CORP_DES],
|
||
Dim_PackInfo[PROD_COD],
|
||
Dim_PackInfo[CMPS_COD]
|
||
),
|
||
"@GRVal", [External.GRSales.KPI2.1]
|
||
),
|
||
[@GRVal] > 0
|
||
),
|
||
ORDERBY ( [@GRVal], DESC )
|
||
)
|
||
VAR R =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
//Retail
|
||
DS = "Retail" && DW = "Value" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org )
|
||
&& NOT ISFILTERED ( Dim_Geo ),
|
||
IF (
|
||
ISINSCOPE ( Dim_Corp[CORP_DES] ),
|
||
CALCULATE (
|
||
MAX ( Fact_Direct_Retail_rx_top_corp[top1_incremental_brand_en] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Corp[CORP_COD] ),
|
||
Fact_Direct_Retail_rx_top_corp[corp_cod]
|
||
),
|
||
KEEPFILTERS (
|
||
FILTER (
|
||
ALL ( Fact_Direct_Retail_rx_top_corp[corp_cod] ),
|
||
NOT ISBLANK ( Fact_Direct_Retail_rx_top_corp[corp_cod] )
|
||
)
|
||
)
|
||
),
|
||
CALCULATE (
|
||
MAX ( Fact_Direct_Retail_rx_top_corp[top1_incremental_brand_en] ),
|
||
KEEPFILTERS (
|
||
Fact_Direct_Retail_rx_top_corp[corporation] = "Total Rx Market"
|
||
)
|
||
)
|
||
),
|
||
-----------------------------------EC---------------------------------------
|
||
--选择公司的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,total行数据
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方"
|
||
),
|
||
--选择公司,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "N"
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "Y"
|
||
),
|
||
--选择TA时的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName.EN],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName.EN],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName.EN],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName.EN],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName.EN],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName.EN],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top1BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择非YTD
|
||
DS = "EC" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
--选择非YTD
|
||
DS = "Retail" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
MAXX ( T, Dim_PackInfo[PROD_VBP_EN] )
|
||
)
|
||
RETURN
|
||
IF ( [External.Sales.KPI2.1] <> BLANK ( ), R )
|
||
displayFolder: 00Base\02_2.1\06Top
|
||
lineageTag: 9fa68034-dcb4-4b71-ad5e-8162c5e31bc2
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure Sales_GRTOP1_BrandSales =
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_VBP],
|
||
Dim_PackInfo[CORP_DES_C],
|
||
Dim_PackInfo[CMPS_COD]
|
||
),
|
||
"@VAL", [External.Sales.KPI2.1],
|
||
"@GRVal", [External.GRSales.KPI2.1]
|
||
),
|
||
[@GRVal] > 0
|
||
),
|
||
ORDERBY ( [@GRVal], DESC )
|
||
)
|
||
VAR SN = SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||
VAR R =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
SN = "Retail" && ISFILTERED ( Dim_Market[MARKET] ),
|
||
MAXX ( T, [@VAL] ),
|
||
SN = "Retail" && ISFILTERED ( Dim_BrandDefaultMKT ),
|
||
MAXX ( T, [@VAL] ),
|
||
SN = "Retail", BLANK ( ),
|
||
SN = "EC" && ISFILTERED ( Dim_Market[MARKET] ),
|
||
MAXX ( T, [@VAL] ),
|
||
SN = "EC" && ISFILTERED ( Dim_BrandDefaultMKT ),
|
||
MAXX ( T, [@VAL] ),
|
||
SN = "EC", BLANK ( ),
|
||
MAXX ( T, [@VAL] )
|
||
)
|
||
RETURN
|
||
R
|
||
//IF ( [External.Sales.KPI2.1] <> BLANK (), R )
|
||
formatString: #,0
|
||
displayFolder: 00Base\02_2.1\06Top
|
||
lineageTag: f61d3c8d-26f8-40b7-abe1-5ae2da3538c8
|
||
|
||
measure Sales_GRTOP2_BrandGR% =
|
||
VAR DS = SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||
VAR DW = SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
|
||
VAR DT = SELECTEDVALUE ( MQY[Period] )
|
||
--常规处理逻辑
|
||
VAR T =
|
||
INDEX (
|
||
2,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_VBP],
|
||
Dim_PackInfo[CORP_DES_C],
|
||
Dim_PackInfo[CMPS_COD]
|
||
),
|
||
"@GR", [External.Gr%.KPI2.1],
|
||
"@GRVal", [External.GRSales.KPI2.1]
|
||
),
|
||
[@GRVal] > 0
|
||
),
|
||
ORDERBY ( [@GRVal], DESC )
|
||
)
|
||
VAR R =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
//Retail
|
||
DS = "Retail" && DW = "Value" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org )
|
||
&& NOT ISFILTERED ( Dim_Geo ),
|
||
IF (
|
||
ISINSCOPE ( Dim_Corp[CORP_DES_C] ),
|
||
CALCULATE (
|
||
[00.DirectRetail.top_crop.top2_incremental_gr],
|
||
TREATAS (
|
||
VALUES ( Dim_Corp[CORP_COD] ),
|
||
Fact_Direct_Retail_rx_top_corp[corp_cod]
|
||
),
|
||
KEEPFILTERS (
|
||
FILTER (
|
||
ALL ( Fact_Direct_Retail_rx_top_corp[corp_cod] ),
|
||
NOT ISBLANK ( Fact_Direct_Retail_rx_top_corp[corp_cod] )
|
||
)
|
||
)
|
||
),
|
||
CALCULATE (
|
||
[00.DirectRetail.top_crop.top2_incremental_gr],
|
||
KEEPFILTERS (
|
||
Fact_Direct_Retail_rx_top_corp[corporation] = "Total Rx Market"
|
||
)
|
||
)
|
||
),
|
||
-----------------------------------EC---------------------------------------
|
||
--选择公司的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,total行数据
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方"
|
||
),
|
||
--选择公司,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N"
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择TA时的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择非YTD
|
||
DS = "EC" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
--选择非YTD
|
||
DS = "Retail" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
MAXX ( T, [@GR] )
|
||
)
|
||
RETURN
|
||
IF ( [External.Sales.KPI2.1] <> BLANK ( ), R )
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: 00Base\02_2.1\06Top
|
||
lineageTag: 55378525-f152-4fdc-aa4c-0aacaa2548e6
|
||
|
||
measure 'Sales_GRTOP2_BrandGR%.EN' =
|
||
VAR DS = SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||
VAR DW = SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
|
||
VAR DT = SELECTEDVALUE ( MQY[Period] )
|
||
--常规处理逻辑
|
||
VAR T =
|
||
INDEX (
|
||
2,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_VBP],
|
||
Dim_PackInfo[CORP_DES_C],
|
||
Dim_PackInfo[PROD_COD],
|
||
Dim_PackInfo[CMPS_COD]
|
||
),
|
||
"@GR", [External.Gr%.KPI2.1],
|
||
"@GRVal", [External.GRSales.KPI2.1]
|
||
),
|
||
[@GRVal] > 0
|
||
),
|
||
ORDERBY ( [@GRVal], DESC )
|
||
)
|
||
VAR R =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
//Retail
|
||
DS = "Retail" && DW = "Value" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org )
|
||
&& NOT ISFILTERED ( Dim_Geo ),
|
||
IF (
|
||
ISINSCOPE ( Dim_Corp[CORP_DES] ),
|
||
CALCULATE (
|
||
[00.DirectRetail.top_crop.top2_incremental_gr],
|
||
TREATAS (
|
||
VALUES ( Dim_Corp[CORP_COD] ),
|
||
Fact_Direct_Retail_rx_top_corp[corp_cod]
|
||
),
|
||
KEEPFILTERS (
|
||
FILTER (
|
||
ALL ( Fact_Direct_Retail_rx_top_corp[corp_cod] ),
|
||
NOT ISBLANK ( Fact_Direct_Retail_rx_top_corp[corp_cod] )
|
||
)
|
||
)
|
||
),
|
||
CALCULATE (
|
||
[00.DirectRetail.top_crop.top2_incremental_gr],
|
||
KEEPFILTERS (
|
||
Fact_Direct_Retail_rx_top_corp[corporation] = "Total Rx Market"
|
||
)
|
||
)
|
||
),
|
||
-----------------------------------EC---------------------------------------
|
||
--选择公司的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,total行数据
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方"
|
||
),
|
||
--选择公司,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N"
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择TA时的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incrementalGr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择非YTD
|
||
DS = "EC" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
--选择非YTD
|
||
DS = "Retail" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
MAXX ( T, [@GR] )
|
||
)
|
||
RETURN
|
||
IF ( [External.Sales.KPI2.1] <> BLANK ( ), R )
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: 00Base\02_2.1\06Top
|
||
lineageTag: e15745b0-92c8-4b2e-9c85-2d80dcee7d52
|
||
|
||
measure Sales_GRTOP2_BrandName =
|
||
VAR DS = SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||
VAR DW = SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
|
||
VAR DT = SELECTEDVALUE ( MQY[Period] ) --常规处理逻辑
|
||
VAR T =
|
||
INDEX (
|
||
2,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_VBP],
|
||
Dim_PackInfo[CORP_DES_C],
|
||
Dim_PackInfo[CMPS_COD]
|
||
),
|
||
"@GRVal", [External.GRSales.KPI2.1]
|
||
),
|
||
[@GRVal] > 0
|
||
),
|
||
ORDERBY ( [@GRVal], DESC )
|
||
)
|
||
VAR R =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
//Retail
|
||
DS = "Retail" && DW = "Value" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org )
|
||
&& NOT ISFILTERED ( Dim_Geo ),
|
||
IF (
|
||
ISINSCOPE ( Dim_Corp[CORP_DES_C] ),
|
||
CALCULATE (
|
||
MAX ( Fact_Direct_Retail_rx_top_corp[top2_incremental_brand] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Corp[CORP_COD] ),
|
||
Fact_Direct_Retail_rx_top_corp[corp_cod]
|
||
),
|
||
KEEPFILTERS (
|
||
FILTER (
|
||
ALL ( Fact_Direct_Retail_rx_top_corp[corp_cod] ),
|
||
NOT ISBLANK ( Fact_Direct_Retail_rx_top_corp[corp_cod] )
|
||
)
|
||
)
|
||
),
|
||
CALCULATE (
|
||
MAX ( Fact_Direct_Retail_rx_top_corp[top2_incremental_brand] ),
|
||
KEEPFILTERS (
|
||
Fact_Direct_Retail_rx_top_corp[corporation] = "Total Rx Market"
|
||
)
|
||
)
|
||
),
|
||
-----------------------------------EC---------------------------------------
|
||
--选择公司的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,total行数据
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方"
|
||
),
|
||
--选择公司,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "N"
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择TA时的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择非YTD
|
||
DS = "EC" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
--选择非YTD
|
||
DS = "Retail" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
MAXX ( T, Dim_PackInfo[PROD_VBP] )
|
||
)
|
||
RETURN
|
||
IF ( [External.Sales.KPI2.1] <> BLANK ( ), R )
|
||
displayFolder: 00Base\02_2.1\06Top
|
||
lineageTag: a7b2bafc-acc0-411a-b41d-1d3a39c12129
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Sales_GRTOP2_BrandName.EN' =
|
||
VAR DS = SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||
VAR DW = SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
|
||
VAR DT = SELECTEDVALUE ( MQY[Period] ) --常规处理逻辑
|
||
VAR T =
|
||
INDEX (
|
||
2,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_VBP_EN],
|
||
Dim_PackInfo[CORP_DES],
|
||
Dim_PackInfo[PROD_COD],
|
||
Dim_PackInfo[CMPS_COD]
|
||
),
|
||
"@GRVal", [External.GRSales.KPI2.1]
|
||
),
|
||
[@GRVal] > 0
|
||
),
|
||
ORDERBY ( [@GRVal], DESC )
|
||
)
|
||
VAR R =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
//Retail
|
||
DS = "Retail" && DW = "Value" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org )
|
||
&& NOT ISFILTERED ( Dim_Geo ),
|
||
IF (
|
||
ISINSCOPE ( Dim_Corp[CORP_DES] ),
|
||
CALCULATE (
|
||
MAX ( Fact_Direct_Retail_rx_top_corp[top2_incremental_brand_en] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Corp[CORP_COD] ),
|
||
Fact_Direct_Retail_rx_top_corp[corp_cod]
|
||
),
|
||
KEEPFILTERS (
|
||
FILTER (
|
||
ALL ( Fact_Direct_Retail_rx_top_corp[corp_cod] ),
|
||
NOT ISBLANK ( Fact_Direct_Retail_rx_top_corp[corp_cod] )
|
||
)
|
||
)
|
||
),
|
||
CALCULATE (
|
||
MAX ( Fact_Direct_Retail_rx_top_corp[top2_incremental_brand_en] ),
|
||
KEEPFILTERS (
|
||
Fact_Direct_Retail_rx_top_corp[corporation] = "Total Rx Market"
|
||
)
|
||
)
|
||
),
|
||
-----------------------------------EC---------------------------------------
|
||
--选择公司的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,total行数据
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方"
|
||
),
|
||
--选择公司,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "N"
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择TA时的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName.EN],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName.EN],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName.EN],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName.EN],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName.EN],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName.EN],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.incremental.Top2BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择非YTD
|
||
DS = "EC" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
--选择非YTD
|
||
DS = "Retail" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
MAXX ( T, Dim_PackInfo[PROD_VBP_EN] )
|
||
)
|
||
RETURN
|
||
IF ( [External.Sales.KPI2.1] <> BLANK ( ), R )
|
||
displayFolder: 00Base\02_2.1\06Top
|
||
lineageTag: 75e4c819-ac5e-4828-bb4b-89cc450befbe
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure Sales_GRTOP2_BrandSales =
|
||
VAR T =
|
||
INDEX (
|
||
2,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_VBP],
|
||
Dim_PackInfo[CORP_DES_C],
|
||
Dim_PackInfo[CMPS_COD]
|
||
),
|
||
"@Val", [External.Sales.KPI2.1],
|
||
"@GRVal", [External.GRSales.KPI2.1]
|
||
),
|
||
[@GRVal] > 0
|
||
),
|
||
ORDERBY ( [@GRVal], DESC )
|
||
)
|
||
VAR SN = SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||
VAR R =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
SN = "Retail" && ISFILTERED ( Dim_Market[MARKET] ),
|
||
MAXX ( T, [@Val] ),
|
||
SN = "Retail" && ISFILTERED ( Dim_BrandDefaultMKT ),
|
||
MAXX ( T, [@Val] ),
|
||
SN = "Retail", BLANK ( ),
|
||
SN = "EC" && ISFILTERED ( Dim_Market[MARKET] ),
|
||
MAXX ( T, [@Val] ),
|
||
SN = "EC" && ISFILTERED ( Dim_BrandDefaultMKT ),
|
||
MAXX ( T, [@Val] ),
|
||
SN = "EC", BLANK ( ),
|
||
MAXX ( T, [@Val] )
|
||
)
|
||
RETURN
|
||
R
|
||
//IF ( [External.Sales.KPI2.1] <> BLANK (), R )
|
||
displayFolder: 00Base\02_2.1\06Top
|
||
lineageTag: 3f2a38e9-ca87-478f-8ff0-4103ce6226cd
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure Sales_MSTOP1_BrandGR% =
|
||
VAR DS = SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||
VAR DW = SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
|
||
VAR DT = SELECTEDVALUE ( MQY[Period] ) --常规处理逻辑
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_VBP],
|
||
Dim_PackInfo[CORP_DES_C],
|
||
Dim_PackInfo[CMPS_COD]
|
||
),
|
||
"@VAL", [External.Sales.KPI2.1],
|
||
"@GR", [External.Gr%.KPI2.1]
|
||
),
|
||
[@VAL] <> BLANK ( )
|
||
),
|
||
ORDERBY ( [@VAL], DESC )
|
||
)
|
||
VAR R =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
//Retail
|
||
DS = "Retail" && DW = "Value" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org )
|
||
&& NOT ISFILTERED ( Dim_Geo ),
|
||
IF (
|
||
ISINSCOPE ( Dim_Corp[CORP_DES_C] ),
|
||
CALCULATE (
|
||
[00.DirectRetail.top_crop.top1_brand_gr],
|
||
TREATAS (
|
||
VALUES ( Dim_Corp[CORP_COD] ),
|
||
Fact_Direct_Retail_rx_top_corp[corp_cod]
|
||
),
|
||
KEEPFILTERS (
|
||
FILTER (
|
||
ALL ( Fact_Direct_Retail_rx_top_corp[corp_cod] ),
|
||
NOT ISBLANK ( Fact_Direct_Retail_rx_top_corp[corp_cod] )
|
||
)
|
||
)
|
||
),
|
||
CALCULATE (
|
||
[00.DirectRetail.top_crop.top1_brand_gr],
|
||
KEEPFILTERS (
|
||
Fact_Direct_Retail_rx_top_corp[corporation]
|
||
= "Total Rx Market"
|
||
)
|
||
)
|
||
),
|
||
-----------------------------------EC---------------------------------------
|
||
--选择公司的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,total行数据
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方"
|
||
),
|
||
--选择公司,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE ( [EC.Gr%.Top1Brand], Fact_EC[TOTAL_FLAG] = "N" ),
|
||
--选择公司,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择TA时的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择非YTD
|
||
DS = "EC" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
--选择非YTD
|
||
DS = "Retail" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
MAXX ( T, [@GR] )
|
||
)
|
||
RETURN
|
||
IF ( [External.Sales.KPI2.1] <> BLANK ( ), R )
|
||
formatString: 0.0%;-0.0%;0.0%
|
||
displayFolder: 00Base\02_2.1\06Top
|
||
lineageTag: 5ba4e816-f895-4e3f-8edc-e7f4f60fce11
|
||
|
||
measure 'Sales_MSTOP1_BrandGR%.EN' =
|
||
VAR DS = SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||
VAR DW = SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
|
||
VAR DT = SELECTEDVALUE ( MQY[Period] ) --常规处理逻辑
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_VBP],
|
||
Dim_PackInfo[CORP_DES_C],
|
||
Dim_PackInfo[PROD_COD],
|
||
Dim_PackInfo[CMPS_COD]
|
||
),
|
||
"@VAL", [External.Sales.KPI2.1],
|
||
"@GR", [External.Gr%.KPI2.1]
|
||
),
|
||
[@VAL] <> BLANK ( )
|
||
),
|
||
ORDERBY ( [@VAL], DESC )
|
||
)
|
||
VAR R =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
//Retail
|
||
DS = "Retail" && DW = "Value" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org )
|
||
&& NOT ISFILTERED ( Dim_Geo ),
|
||
IF (
|
||
ISINSCOPE ( Dim_Corp[CORP_DES] ),
|
||
CALCULATE (
|
||
[00.DirectRetail.top_crop.top1_brand_gr],
|
||
TREATAS (
|
||
VALUES ( Dim_Corp[CORP_COD] ),
|
||
Fact_Direct_Retail_rx_top_corp[corp_cod]
|
||
),
|
||
KEEPFILTERS (
|
||
FILTER (
|
||
ALL ( Fact_Direct_Retail_rx_top_corp[corp_cod] ),
|
||
NOT ISBLANK ( Fact_Direct_Retail_rx_top_corp[corp_cod] )
|
||
)
|
||
)
|
||
),
|
||
CALCULATE (
|
||
[00.DirectRetail.top_crop.top1_brand_gr],
|
||
KEEPFILTERS (
|
||
Fact_Direct_Retail_rx_top_corp[corporation] = "Total Rx Market"
|
||
)
|
||
)
|
||
),
|
||
-----------------------------------EC---------------------------------------
|
||
--选择公司的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,total行数据
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方"
|
||
),
|
||
--选择公司,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE ( [EC.Gr%.Top1Brand], Fact_EC[TOTAL_FLAG] = "N" ),
|
||
--选择公司,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择TA时的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top1Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择非YTD
|
||
DS = "EC" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
--选择非YTD
|
||
DS = "Retail" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
MAXX ( T, [@GR] )
|
||
)
|
||
RETURN
|
||
IF ( [External.Sales.KPI2.1] <> BLANK ( ), R )
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: 00Base\02_2.1\06Top
|
||
lineageTag: 547529d8-cff0-4979-928f-b57f2432a35b
|
||
|
||
measure Sales_MSTOP1_BrandName =
|
||
VAR DS = SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||
VAR DW = SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
|
||
VAR DT = SELECTEDVALUE ( MQY[Period] ) --常规处理逻辑
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_VBP],
|
||
Dim_PackInfo[CORP_DES_C],
|
||
Dim_PackInfo[CMPS_COD]
|
||
),
|
||
"@VAL", [External.Sales.KPI2.1]
|
||
),
|
||
[@VAL] <> BLANK ( )
|
||
),
|
||
ORDERBY ( [@VAL], DESC )
|
||
)
|
||
VAR R =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
//Retail
|
||
DS = "Retail" && DW = "Value" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org )
|
||
&& NOT ISFILTERED ( Dim_Geo ),
|
||
IF (
|
||
ISINSCOPE ( Dim_Corp[CORP_DES_C] ),
|
||
CALCULATE (
|
||
MAX ( Fact_Direct_Retail_rx_top_corp[top1_brand_val] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Corp[CORP_COD] ),
|
||
Fact_Direct_Retail_rx_top_corp[corp_cod]
|
||
),
|
||
KEEPFILTERS (
|
||
FILTER (
|
||
ALL ( Fact_Direct_Retail_rx_top_corp[corp_cod] ),
|
||
NOT ISBLANK ( Fact_Direct_Retail_rx_top_corp[corp_cod] )
|
||
)
|
||
)
|
||
),
|
||
CALCULATE (
|
||
MAX ( Fact_Direct_Retail_rx_top_corp[top1_brand_val] ),
|
||
KEEPFILTERS (
|
||
Fact_Direct_Retail_rx_top_corp[corporation] = "Total Rx Market"
|
||
)
|
||
)
|
||
),
|
||
-----------------------------------EC---------------------------------------
|
||
--选择公司的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,total行数据
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方"
|
||
),
|
||
--选择公司,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "N"
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "Y"
|
||
),
|
||
--选择TA时的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择非YTD
|
||
DS = "EC" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
--选择非YTD
|
||
DS = "Retail" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
MAXX ( T, Dim_PackInfo[PROD_VBP] )
|
||
)
|
||
RETURN
|
||
IF ( [External.Sales.KPI2.1] <> BLANK ( ), R )
|
||
displayFolder: 00Base\02_2.1\06Top
|
||
lineageTag: c8cd2f43-e0ae-42df-99df-31d43956ed77
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Sales_MSTOP1_BrandName.EN' =
|
||
VAR DS = SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||
VAR DW = SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
|
||
VAR DT = SELECTEDVALUE ( MQY[Period] ) --常规处理逻辑
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_VBP_EN],
|
||
Dim_PackInfo[CORP_DES],
|
||
Dim_PackInfo[PROD_COD],
|
||
Dim_PackInfo[CMPS_COD]
|
||
),
|
||
"@VAL", [External.Sales.KPI2.1]
|
||
),
|
||
[@VAL] <> BLANK ( )
|
||
),
|
||
ORDERBY ( [@VAL], DESC )
|
||
)
|
||
VAR R =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
//Retail
|
||
DS = "Retail" && DW = "Value" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org )
|
||
&& NOT ISFILTERED ( Dim_Geo ),
|
||
IF (
|
||
ISINSCOPE ( Dim_Corp[CORP_DES] ),
|
||
CALCULATE (
|
||
MAX ( Fact_Direct_Retail_rx_top_corp[top1_brand_val_en] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Corp[CORP_COD] ),
|
||
Fact_Direct_Retail_rx_top_corp[corp_cod]
|
||
),
|
||
KEEPFILTERS (
|
||
FILTER (
|
||
ALL ( Fact_Direct_Retail_rx_top_corp[corp_cod] ),
|
||
NOT ISBLANK ( Fact_Direct_Retail_rx_top_corp[corp_cod] )
|
||
)
|
||
)
|
||
),
|
||
CALCULATE (
|
||
MAX ( Fact_Direct_Retail_rx_top_corp[top1_brand_val_en] ),
|
||
KEEPFILTERS (
|
||
Fact_Direct_Retail_rx_top_corp[corporation]
|
||
= "Total Rx Market"
|
||
)
|
||
)
|
||
),
|
||
-----------------------------------EC---------------------------------------
|
||
--选择公司的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,total行数据
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方"
|
||
),
|
||
--选择公司,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "N"
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "Y"
|
||
),
|
||
--选择TA时的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName.EN],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName.EN],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName.EN],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName.EN],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName.EN],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName.EN],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top1BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择非YTD
|
||
DS = "EC" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
--选择非YTD
|
||
DS = "Retail" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
MAXX ( T, Dim_PackInfo[PROD_VBP_EN] )
|
||
)
|
||
RETURN
|
||
IF ( [External.Sales.KPI2.1] <> BLANK ( ), R )
|
||
displayFolder: 00Base\02_2.1\06Top
|
||
lineageTag: 037a5aa9-50f8-4bac-8ff6-871328b61f2c
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure Sales_MSTOP1_BrandSales =
|
||
VAR T =
|
||
INDEX (
|
||
1,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_VBP],
|
||
Dim_PackInfo[CORP_DES_C],
|
||
Dim_PackInfo[CMPS_COD]
|
||
),
|
||
"@VAL", [External.Sales.KPI2.1]
|
||
),
|
||
[@VAL] <> BLANK ( )
|
||
),
|
||
ORDERBY ( [@VAL], DESC )
|
||
)
|
||
VAR SN = SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||
VAR R =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
SN = "Retail" && ISFILTERED ( Dim_Market[MARKET] ),
|
||
MAXX ( T, [@VAL] ),
|
||
SN = "Retail" && ISFILTERED ( Dim_BrandDefaultMKT ),
|
||
MAXX ( T, [@VAL] ),
|
||
SN = "Retail", BLANK ( ),
|
||
SN = "EC" && ISFILTERED ( Dim_Market[MARKET] ),
|
||
MAXX ( T, [@VAL] ),
|
||
SN = "EC" && ISFILTERED ( Dim_BrandDefaultMKT ),
|
||
MAXX ( T, [@VAL] ),
|
||
SN = "EC", BLANK ( ),
|
||
MAXX ( T, [@VAL] )
|
||
)
|
||
RETURN
|
||
R
|
||
//IF ( [External.Sales.KPI2.1] <> BLANK (), R )
|
||
formatString: #,0
|
||
displayFolder: 00Base\02_2.1\06Top
|
||
lineageTag: 34015b5e-766f-4782-8b70-e76257be750e
|
||
|
||
measure Sales_MSTOP2_BrandGR% =
|
||
VAR DS = SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||
VAR DW = SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
|
||
VAR DT = SELECTEDVALUE ( MQY[Period] ) --常规处理逻辑
|
||
VAR T =
|
||
INDEX (
|
||
2,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_VBP],
|
||
Dim_PackInfo[CORP_DES_C],
|
||
Dim_PackInfo[CMPS_COD]
|
||
),
|
||
"@VAL", [External.Sales.KPI2.1],
|
||
"@GR", [External.Gr%.KPI2.1]
|
||
),
|
||
[@VAL] <> BLANK ( )
|
||
),
|
||
ORDERBY ( [@VAL], DESC )
|
||
)
|
||
VAR R =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
//Retail
|
||
DS = "Retail" && DW = "Value" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org )
|
||
&& NOT ISFILTERED ( Dim_Geo ),
|
||
IF (
|
||
ISINSCOPE ( Dim_Corp[CORP_DES_C] ),
|
||
CALCULATE (
|
||
[00.DirectRetail.top_crop.top2_brand_gr],
|
||
TREATAS (
|
||
VALUES ( Dim_Corp[CORP_COD] ),
|
||
Fact_Direct_Retail_rx_top_corp[corp_cod]
|
||
),
|
||
KEEPFILTERS (
|
||
FILTER (
|
||
ALL ( Fact_Direct_Retail_rx_top_corp[corp_cod] ),
|
||
NOT ISBLANK ( Fact_Direct_Retail_rx_top_corp[corp_cod] )
|
||
)
|
||
)
|
||
),
|
||
CALCULATE (
|
||
[00.DirectRetail.top_crop.top2_brand_gr],
|
||
KEEPFILTERS (
|
||
Fact_Direct_Retail_rx_top_corp[corporation]
|
||
= "Total Rx Market"
|
||
)
|
||
)
|
||
),
|
||
-----------------------------------EC---------------------------------------
|
||
--选择公司的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,total行数据
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方"
|
||
),
|
||
--选择公司,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE ( [EC.Gr%.Top2Brand], Fact_EC[TOTAL_FLAG] = "N" ),
|
||
--选择公司,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择TA时的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择非YTD
|
||
DS = "EC" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
--选择非YTD
|
||
DS = "Retail" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
MAXX ( T, [@GR] )
|
||
)
|
||
RETURN
|
||
IF ( [External.Sales.KPI2.1] <> BLANK ( ), R )
|
||
formatString: #,##0.0 %
|
||
displayFolder: 00Base\02_2.1\06Top
|
||
lineageTag: 69c3bbd7-87dc-43e3-8a69-94e1b2891ce9
|
||
|
||
measure 'Sales_MSTOP2_BrandGR%.EN' =
|
||
VAR DS = SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||
VAR DW = SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
|
||
VAR DT = SELECTEDVALUE ( MQY[Period] ) --常规处理逻辑
|
||
VAR T =
|
||
INDEX (
|
||
2,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_VBP],
|
||
Dim_PackInfo[CORP_DES_C],
|
||
Dim_PackInfo[PROD_COD],
|
||
Dim_PackInfo[CMPS_COD]
|
||
),
|
||
"@VAL", [External.Sales.KPI2.1],
|
||
"@GR", [External.Gr%.KPI2.1]
|
||
),
|
||
[@VAL] <> BLANK ( )
|
||
),
|
||
ORDERBY ( [@VAL], DESC )
|
||
)
|
||
VAR R =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
//Retail
|
||
DS = "Retail" && DW = "Value" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org )
|
||
&& NOT ISFILTERED ( Dim_Geo ),
|
||
IF (
|
||
ISINSCOPE ( Dim_Corp[CORP_DES] ),
|
||
CALCULATE (
|
||
[00.DirectRetail.top_crop.top2_brand_gr],
|
||
TREATAS (
|
||
VALUES ( Dim_Corp[CORP_COD] ),
|
||
Fact_Direct_Retail_rx_top_corp[corp_cod]
|
||
),
|
||
KEEPFILTERS (
|
||
FILTER (
|
||
ALL ( Fact_Direct_Retail_rx_top_corp[corp_cod] ),
|
||
NOT ISBLANK ( Fact_Direct_Retail_rx_top_corp[corp_cod] )
|
||
)
|
||
)
|
||
),
|
||
CALCULATE (
|
||
[00.DirectRetail.top_crop.top2_brand_gr],
|
||
KEEPFILTERS (
|
||
Fact_Direct_Retail_rx_top_corp[corporation]
|
||
= "Total Rx Market"
|
||
)
|
||
)
|
||
),
|
||
-----------------------------------EC---------------------------------------
|
||
--选择公司的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,total行数据
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方"
|
||
),
|
||
--选择公司,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE ( [EC.Gr%.Top2Brand], Fact_EC[TOTAL_FLAG] = "N" ),
|
||
--选择公司,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择TA时的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Gr%.Top2Brand],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择非YTD
|
||
DS = "EC" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
--选择非YTD
|
||
DS = "Retail" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
MAXX ( T, [@GR] )
|
||
)
|
||
RETURN
|
||
IF ( [External.Sales.KPI2.1] <> BLANK ( ), R )
|
||
formatString: #,0.0%;-#,0.0%;#,0.0%
|
||
displayFolder: 00Base\02_2.1\06Top
|
||
lineageTag: eddff247-30f6-4459-bba0-98537081345a
|
||
|
||
measure Sales_MSTOP2_BrandName =
|
||
VAR DS = SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||
VAR DW = SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
|
||
VAR DT = SELECTEDVALUE ( MQY[Period] ) --常规处理逻辑
|
||
VAR T =
|
||
INDEX (
|
||
2,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_VBP],
|
||
Dim_PackInfo[CORP_DES_C],
|
||
Dim_PackInfo[CMPS_COD]
|
||
),
|
||
"@VAL", [External.Sales.KPI2.1]
|
||
),
|
||
[@VAL] <> BLANK ( )
|
||
),
|
||
ORDERBY ( [@VAL], DESC )
|
||
)
|
||
VAR R =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
//Retail
|
||
DS = "Retail" && DW = "Value" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org )
|
||
&& NOT ISFILTERED ( Dim_Geo ),
|
||
IF (
|
||
ISINSCOPE ( Dim_Corp[CORP_DES_C] ),
|
||
CALCULATE (
|
||
MAX ( Fact_Direct_Retail_rx_top_corp[top2_brand_val] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Corp[CORP_COD] ),
|
||
Fact_Direct_Retail_rx_top_corp[corp_cod]
|
||
),
|
||
KEEPFILTERS (
|
||
FILTER (
|
||
ALL ( Fact_Direct_Retail_rx_top_corp[corp_cod] ),
|
||
NOT ISBLANK ( Fact_Direct_Retail_rx_top_corp[corp_cod] )
|
||
)
|
||
)
|
||
),
|
||
CALCULATE (
|
||
MAX ( Fact_Direct_Retail_rx_top_corp[top2_brand_val] ),
|
||
KEEPFILTERS (
|
||
Fact_Direct_Retail_rx_top_corp[corporation]
|
||
= "Total Rx Market"
|
||
)
|
||
)
|
||
),
|
||
-----------------------------------EC---------------------------------------
|
||
--选择公司的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,total行数据
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方"
|
||
),
|
||
--选择公司,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "N"
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "Y"
|
||
),
|
||
--选择TA时的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES_C] )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择非YTD
|
||
DS = "EC" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
--选择非YTD
|
||
DS = "Retail" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
MAXX ( T, Dim_PackInfo[PROD_VBP] )
|
||
)
|
||
RETURN
|
||
IF ( [External.Sales.KPI2.1] <> BLANK ( ), R )
|
||
displayFolder: 00Base\02_2.1\06Top
|
||
lineageTag: 733c6b45-867c-425e-bd30-2e4095648589
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Sales_MSTOP2_BrandName.EN' =
|
||
VAR DS = SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||
VAR DW = SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
|
||
VAR DT = SELECTEDVALUE ( MQY[Period] ) --常规处理逻辑
|
||
VAR T =
|
||
INDEX (
|
||
2,
|
||
FILTER (
|
||
ADDCOLUMNS (
|
||
SUMMARIZE (
|
||
Fact_Sales,
|
||
Dim_PackInfo[PROD_VBP_EN],
|
||
Dim_PackInfo[CORP_DES],
|
||
Dim_PackInfo[PROD_COD],
|
||
Dim_PackInfo[CMPS_COD]
|
||
),
|
||
"@VAL", [External.Sales.KPI2.1]
|
||
),
|
||
[@VAL] <> BLANK ( )
|
||
),
|
||
ORDERBY ( [@VAL], DESC )
|
||
)
|
||
VAR R =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
//Retail
|
||
DS = "Retail" && DW = "Value" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org )
|
||
&& NOT ISFILTERED ( Dim_Geo ),
|
||
IF (
|
||
ISINSCOPE ( Dim_Corp[CORP_DES] ),
|
||
CALCULATE (
|
||
MAX ( Fact_Direct_Retail_rx_top_corp[top2_brand_val_en] ),
|
||
TREATAS (
|
||
VALUES ( Dim_Corp[CORP_COD] ),
|
||
Fact_Direct_Retail_rx_top_corp[corp_cod]
|
||
),
|
||
KEEPFILTERS (
|
||
FILTER (
|
||
ALL ( Fact_Direct_Retail_rx_top_corp[corp_cod] ),
|
||
NOT ISBLANK ( Fact_Direct_Retail_rx_top_corp[corp_cod] )
|
||
)
|
||
)
|
||
),
|
||
CALCULATE (
|
||
MAX ( Fact_Direct_Retail_rx_top_corp[top2_brand_val_en] ),
|
||
KEEPFILTERS (
|
||
Fact_Direct_Retail_rx_top_corp[corporation]
|
||
= "Total Rx Market"
|
||
)
|
||
)
|
||
),
|
||
-----------------------------------EC---------------------------------------
|
||
--选择公司的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,total行数据
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[STORE_TYPE] = "自营+三方"
|
||
),
|
||
--选择公司,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)"
|
||
),
|
||
--选择公司,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "N"
|
||
),
|
||
--选择公司,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "Y"
|
||
),
|
||
--选择TA时的排名
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName.EN],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName.EN],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName.EN],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_StoreType )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName.EN],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName.EN],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& NOT ISFILTERED ( Dim_Platform )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName.EN],
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISINSCOPE ( Dim_Corp[CORP_DES] )
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "N",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
)
|
||
),
|
||
--选择ta,选择Platform维度,选择storetype维度,total行
|
||
DS = "EC" && DW = "Value" && DT = "YTD"
|
||
&& ISFILTERED ( Dim_MarketTA )
|
||
&& NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
CALCULATE (
|
||
[EC.Value.Top2BrandName.EN],
|
||
Fact_EC[TOTAL_FLAG] = "Y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
ALL ( Dim_Corp )
|
||
),
|
||
--选择非YTD
|
||
DS = "EC" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
--选择非YTD
|
||
DS = "Retail" && DT <> "YTD" && NOT ISFILTERED ( Dim_Market )
|
||
&& NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
&& NOT ISFILTERED ( Dim_PackInfo )
|
||
&& NOT ISFILTERED ( Dim_GeoGroup )
|
||
&& NOT ISFILTERED ( Dim_Org ),
|
||
BLANK ( ),
|
||
MAXX ( T, Dim_PackInfo[PROD_VBP_EN] )
|
||
)
|
||
RETURN
|
||
IF ( [External.Sales.KPI2.1] <> BLANK ( ), R )
|
||
displayFolder: 00Base\02_2.1\06Top
|
||
lineageTag: a23b63ca-62e4-40dc-8481-d7e0ef2565ca
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure Sales_MSTOP2_BrandSales =
|
||
|
||
VAR T =
|
||
INDEX (
|
||
2,
|
||
FILTER(
|
||
ADDCOLUMNS (
|
||
SUMMARIZE ( Fact_Sales, Dim_PackInfo[PROD_VBP], Dim_PackInfo[CORP_DES_C],Dim_PackInfo[CMPS_COD] ),
|
||
"@VAL", [External.Sales.KPI2.1]
|
||
),[@VAL] <> BLANK()),
|
||
ORDERBY ( [@VAL], DESC )
|
||
)
|
||
VAR SN =
|
||
SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||
VAR R =
|
||
SWITCH (
|
||
TRUE (),
|
||
SN = "Retail"
|
||
&& ISFILTERED ( Dim_Market[MARKET] ), MAXX ( T, [@VAL] ),
|
||
SN = "Retail"
|
||
&& ISFILTERED ( Dim_BrandDefaultMKT ), MAXX ( T, [@VAL] ),
|
||
SN = "Retail", BLANK (),
|
||
SN = "EC"
|
||
&& ISFILTERED ( Dim_Market[MARKET] ), MAXX ( T, [@VAL] ),
|
||
SN = "EC"
|
||
&& ISFILTERED ( Dim_BrandDefaultMKT ), MAXX ( T, [@VAL] ),
|
||
SN = "EC", BLANK (),
|
||
MAXX ( T, [@VAL] )
|
||
)
|
||
RETURN R
|
||
//IF ( [External.Sales.KPI2.1] <> BLANK (), R )
|
||
formatString: #,0
|
||
displayFolder: 00Base\02_2.1\06Top
|
||
lineageTag: 05025f38-e82f-4cc1-af76-2b3f6d40a5a7
|
||
|
||
measure 'External.Rank.KPI.Class' =
|
||
IF (
|
||
[External.Sales.KPI] <> BLANK ( ),
|
||
CALCULATE (
|
||
RANK (
|
||
DENSE,
|
||
ALL ( Dim_Class[CLASS] ),
|
||
ORDERBY ( [External.Sales.KPI], DESC )
|
||
),
|
||
ALLSELECTED ( Dim_Corp )
|
||
)
|
||
)
|
||
formatString: #,0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: 07afa1ad-c3c4-44fd-b854-e331c66fb190
|
||
|
||
measure 'External.Rank.KPI.CMPS' =
|
||
IF (
|
||
[External.Sales.KPI] <> BLANK ( ),
|
||
CALCULATE (
|
||
RANK (
|
||
DENSE,
|
||
ALL ( Dim_PackInfo[CMPS_DES_C] ),
|
||
ORDERBY ( [External.Sales.KPI], DESC )
|
||
),
|
||
ALLSELECTED ( Dim_Corp )
|
||
)
|
||
)
|
||
formatString: 0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: ef09c136-1dcf-41c5-8960-346189e1efd4
|
||
|
||
measure 'External.Rank.KPI.CMPS_EN' = ```
|
||
|
||
IF([External.Sales.KPI]<>BLANK(),
|
||
CALCULATE(RANK(DENSE, ALL(Dim_PackInfo[CMPS_DES],Dim_PackInfo[CMPS_COD]), ORDERBY([External.Sales.KPI], DESC)),
|
||
ALLSELECTED(Dim_Corp)
|
||
)
|
||
)
|
||
```
|
||
formatString: 0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: 19d63372-5e43-4eae-8e13-4d93af803dee
|
||
|
||
measure 'External.Rank.KPI.Pack' = ```
|
||
|
||
IF([External.Sales.KPI]<>BLANK(),
|
||
CALCULATE(RANK(DENSE, ALL(Dim_PackInfo), ORDERBY([External.Sales.KPI], DESC)),
|
||
ALLSELECTED(Dim_Corp)
|
||
)
|
||
)
|
||
// IF([External.Sales]<>BLANK(),
|
||
// CALCULATE(
|
||
// SWITCH([IMSRankedBy.Value],
|
||
// "GRVal", RANK(DENSE, ALL(DM_TD_EXTERNAL_PACKINFO), ORDERBY([External.GRSales.KPI], DESC)),
|
||
// "GR%", RANK(DENSE, ALL(DM_TD_EXTERNAL_PACKINFO), ORDERBY([External.Gr%.KPI], DESC)),
|
||
// "MS%", RANK(DENSE, ALL(DM_TD_EXTERNAL_PACKINFO), ORDERBY([External.MS%.KPI], DESC)),
|
||
// RANK(DENSE, ALL(DM_TD_EXTERNAL_PACKINFO), ORDERBY([External.Sales.KPI], DESC))
|
||
// ),
|
||
// ALL(DM_TD_EXTERNAL_CORP), REMOVEFILTERS(DM_TD_EXTERNAL_PACKINFO[MNFL_DES])
|
||
// )
|
||
// )
|
||
```
|
||
formatString: #,0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: 15e5ef9f-db62-4f0a-827a-6f78c5ff3934
|
||
|
||
measure 'External.Rank.KPI.PackDesc' = ```
|
||
|
||
IF([External.Sales.KPI]<>BLANK(),
|
||
CALCULATE(RANK(DENSE, ALL(Dim_PackInfo[PACK_DES]), ORDERBY([External.Sales.KPI], DESC)),
|
||
ALLSELECTED(Dim_Corp)
|
||
)
|
||
)
|
||
```
|
||
formatString: 0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: e0c06e96-021b-4f78-8fd1-b1c8a1c7d362
|
||
|
||
measure 'External.Rank.KPI.Prod' = ```
|
||
|
||
IF([External.Sales.KPI]<>BLANK(),
|
||
CALCULATE(RANK(DENSE, ALL(Dim_PackInfo[PROD_DES_C]), ORDERBY([External.Sales.KPI], DESC)),
|
||
ALLSELECTED(Dim_Corp),ALL(Dim_PackInfo[CMPS_DES])
|
||
)
|
||
)
|
||
// IF([External.Sales]<>BLANK(),
|
||
// CALCULATE(
|
||
// SWITCH([IMSRankedBy.Value],
|
||
// "GRVal", RANK(DENSE, ALL(DM_TD_EXTERNAL_PACKINFO[PROD_DES]), ORDERBY([External.GRSales.KPI], DESC)),
|
||
// "GR%", RANK(DENSE, ALL(DM_TD_EXTERNAL_PACKINFO[PROD_DES]), ORDERBY([External.Gr%.KPI], DESC)),
|
||
// "MS%", RANK(DENSE, ALL(DM_TD_EXTERNAL_PACKINFO[PROD_DES]), ORDERBY([External.MS%.KPI], DESC)),
|
||
// //else
|
||
// RANK(DENSE, ALL(DM_TD_EXTERNAL_PACKINFO[PROD_DES]), ORDERBY([External.Sales.KPI], DESC))
|
||
// ),
|
||
// ALL(DM_TD_EXTERNAL_CORP),ALL(DM_TD_EXTERNAL_PACKINFO[CMPS_DES]), REMOVEFILTERS(DM_TD_EXTERNAL_PACKINFO[MNFL_DES])
|
||
// )
|
||
// )
|
||
```
|
||
formatString: #,0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: a7447d8a-893a-49b0-b54d-36a66b320b17
|
||
|
||
measure 'External.Rank.KPI.Prod.PS' = ```
|
||
|
||
IF([External.Sales.KPI]<>BLANK(),
|
||
CALCULATE(RANK(DENSE, ALL(Dim_PackInfo[PROD_DES_C_S]), ORDERBY([External.Sales.KPI], DESC)),
|
||
ALLSELECTED(Dim_Corp),ALL(Dim_PackInfo[CMPS_DES])
|
||
)
|
||
)
|
||
```
|
||
displayFolder: OLD\Rank
|
||
lineageTag: 92bbfe82-ddbb-48d9-a203-5a2c8aa1cabb
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Rank.KPI.Prod_EN' = ```
|
||
|
||
IF([External.Sales.KPI]<>BLANK(),
|
||
CALCULATE(RANK(DENSE, ALL(Dim_PackInfo[PROD_DES]), ORDERBY([External.Sales.KPI], DESC)),
|
||
ALLSELECTED(Dim_Corp),ALL(Dim_PackInfo[CMPS_DES])
|
||
)
|
||
)
|
||
// IF([External.Sales]<>BLANK(),
|
||
// CALCULATE(
|
||
// SWITCH([IMSRankedBy.Value],
|
||
// "GRVal", RANK(DENSE, ALL(DM_TD_EXTERNAL_PACKINFO[PROD_DES]), ORDERBY([External.GRSales.KPI], DESC)),
|
||
// "GR%", RANK(DENSE, ALL(DM_TD_EXTERNAL_PACKINFO[PROD_DES]), ORDERBY([External.Gr%.KPI], DESC)),
|
||
// "MS%", RANK(DENSE, ALL(DM_TD_EXTERNAL_PACKINFO[PROD_DES]), ORDERBY([External.MS%.KPI], DESC)),
|
||
// //else
|
||
// RANK(DENSE, ALL(DM_TD_EXTERNAL_PACKINFO[PROD_DES]), ORDERBY([External.Sales.KPI], DESC))
|
||
// ),
|
||
// ALL(DM_TD_EXTERNAL_CORP),ALL(DM_TD_EXTERNAL_PACKINFO[CMPS_DES]), REMOVEFILTERS(DM_TD_EXTERNAL_PACKINFO[MNFL_DES])
|
||
// )
|
||
// )
|
||
```
|
||
formatString: #,0
|
||
displayFolder: OLD\Rank
|
||
lineageTag: 4a26b6a7-f62b-4c7c-9732-44f2edd90481
|
||
|
||
measure 'External.Rank.KPI.Prod_EN.PS' = ```
|
||
|
||
IF([External.Sales.KPI]<>BLANK(),
|
||
CALCULATE(RANK(DENSE, ALL(Dim_PackInfo[PROD_DES_S]), ORDERBY([External.Sales.KPI], DESC)),
|
||
ALLSELECTED(Dim_Corp),ALL(Dim_PackInfo[CMPS_DES])
|
||
)
|
||
)
|
||
```
|
||
displayFolder: OLD\Rank
|
||
lineageTag: 1c2cf3aa-673d-4b8e-9b0b-3a645555ab13
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Rank.KPI2.1' = ```
|
||
|
||
VAR DS = SELECTEDVALUE ( Dim_DataSource[SOURCENAME] )
|
||
VAR DW = SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
|
||
VAR R =
|
||
IF (
|
||
[External.Sales.KPI2.1] <> BLANK(),
|
||
SWITCH (
|
||
TRUE (),
|
||
--选择公司的排名
|
||
// DS = "Retail" && DW = "Value"
|
||
// && ISINSCOPE(Dim_Corp[CORP_DES_C])
|
||
// && NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
// && NOT ISFILTERED ( Dim_Market )
|
||
// && NOT ISFILTERED ( Dim_MarketTA )
|
||
// && NOT ISFILTERED ( Dim_PackInfo )
|
||
// && NOT ISFILTERED ( Dim_Geo ) && NOT ISFILTERED ( Dim_Org ), CALCULATE ( [Retail.Rank.Top.All] ),
|
||
// --选择TA时的排名
|
||
// DS = "Retail" && DW = "Value"
|
||
// && ISINSCOPE(Dim_Corp[CORP_DES_C])
|
||
// && ISFILTERED ( Dim_MarketTA[TA] ) && NOT ISFILTERED ( Dim_Market[MARKET] )
|
||
// && NOT ISFILTERED ( Dim_PackInfo )
|
||
// && NOT ISFILTERED ( Dim_Geo ) && NOT ISFILTERED ( Dim_Org ), CALCULATE ( [Retail.Rank.Top.TA] ),
|
||
|
||
// DS = "EC" && DW = "Value"
|
||
// && ISINSCOPE(Dim_Corp[CORP_DES_C]) && NOT ISFILTERED(Dim_Platform)
|
||
// && NOT ISFILTERED(Dim_StoreType) && NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
// && NOT ISFILTERED ( Dim_Market )
|
||
// && NOT ISFILTERED ( Dim_MarketTA ) && NOT ISFILTERED ( Dim_PackInfo )
|
||
// && NOT ISFILTERED ( Dim_Geo ) && NOT ISFILTERED ( Dim_Org ),
|
||
// CALCULATE ( [EC.Rank.Top.All],
|
||
// Fact_EC[store_type] = "自营+三方" ,
|
||
// Fact_EC[platform] = "B2C全平台(京东+天猫)"),
|
||
// DS = "EC" && DW = "Value"
|
||
// && ISINSCOPE(Dim_Corp[CORP_DES_C]) && NOT ISFILTERED(Dim_StoreType)
|
||
// && NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
// && NOT ISFILTERED ( Dim_Market )
|
||
// && NOT ISFILTERED ( Dim_MarketTA ) && NOT ISFILTERED ( Dim_PackInfo )
|
||
// && NOT ISFILTERED ( Dim_Geo ) && NOT ISFILTERED ( Dim_Org ),
|
||
// CALCULATE ( [EC.Rank.Top.All],Fact_EC[store_type] = "自营+三方" ),
|
||
// DS = "EC" && DW = "Value"
|
||
// && ISINSCOPE(Dim_Corp[CORP_DES_C]) && NOT ISFILTERED(Dim_Platform)
|
||
// && NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
// && NOT ISFILTERED ( Dim_Market )
|
||
// && NOT ISFILTERED ( Dim_MarketTA ) && NOT ISFILTERED ( Dim_PackInfo )
|
||
// && NOT ISFILTERED ( Dim_Geo ) && NOT ISFILTERED ( Dim_Org ),
|
||
// CALCULATE([EC.Rank.Top.All],Fact_EC[platform] = "B2C全平台(京东+天猫)" ),
|
||
// DS = "EC" && DW = "Value"
|
||
// && ISINSCOPE(Dim_Corp[CORP_DES_C])
|
||
// && NOT ISFILTERED ( Dim_BrandDefaultMKT )
|
||
// && NOT ISFILTERED ( Dim_Market )
|
||
// && NOT ISFILTERED ( Dim_MarketTA ) && NOT ISFILTERED ( Dim_PackInfo )
|
||
// && NOT ISFILTERED ( Dim_Geo ) && NOT ISFILTERED ( Dim_Org ),
|
||
// [EC.Rank.Top.All],
|
||
// --选择TA时的排名
|
||
// DS = "EC" && DW = "Value"
|
||
// && ISINSCOPE(Dim_Corp[CORP_DES_C]) && NOT ISFILTERED(Dim_Platform)
|
||
// && NOT ISFILTERED(Dim_StoreType)
|
||
// && ISFILTERED ( Dim_MarketTA[TA] ) && NOT ISFILTERED ( Dim_Market[MARKET] )
|
||
// && NOT ISFILTERED ( Dim_PackInfo )
|
||
// && NOT ISFILTERED ( Dim_Geo ) && NOT ISFILTERED ( Dim_Org ),
|
||
// CALCULATE ( [EC.Rank.Top.TA],
|
||
// Fact_EC[store_type] = "自营+三方" ,
|
||
// Fact_EC[platform] = "B2C全平台(京东+天猫)" ),
|
||
// DS = "EC" && DW = "Value"
|
||
// && ISINSCOPE(Dim_Corp[CORP_DES_C]) && NOT ISFILTERED(Dim_StoreType)
|
||
// && ISFILTERED ( Dim_MarketTA[TA] ) && NOT ISFILTERED ( Dim_Market[MARKET] )
|
||
// && NOT ISFILTERED ( Dim_PackInfo )
|
||
// && NOT ISFILTERED ( Dim_Geo ) && NOT ISFILTERED ( Dim_Org ),
|
||
// CALCULATE ( [EC.Rank.Top.TA],Fact_EC[store_type] = "自营+三方" ),
|
||
// DS = "EC" && DW = "Value"
|
||
// && ISINSCOPE(Dim_Corp[CORP_DES_C]) && NOT ISFILTERED(Dim_Platform)
|
||
// && ISFILTERED ( Dim_MarketTA[TA] ) && NOT ISFILTERED ( Dim_Market[MARKET] )
|
||
// && NOT ISFILTERED ( Dim_PackInfo )
|
||
// && NOT ISFILTERED ( Dim_Geo ) && NOT ISFILTERED ( Dim_Org ),
|
||
// CALCULATE( [EC.Rank.Top.TA],Fact_EC[platform] = "B2C全平台(京东+天猫)" ),
|
||
// DS = "EC" && DW = "Value"
|
||
// && ISINSCOPE(Dim_Corp[CORP_DES_C])
|
||
// && ISFILTERED ( Dim_MarketTA[TA] ) && NOT ISFILTERED ( Dim_Market[MARKET] )
|
||
// && NOT ISFILTERED ( Dim_PackInfo )
|
||
// && NOT ISFILTERED ( Dim_Geo ) && NOT ISFILTERED ( Dim_Org ),
|
||
// [EC.Rank.Top.TA],
|
||
|
||
ISINSCOPE(Dim_PackInfo[PACK_DES]), [External.Rank.KPI.PackDesc],
|
||
ISINSCOPE(Dim_PackInfo[PROD_DES_C]), [External.Rank.KPI.Prod],
|
||
ISINSCOPE(Dim_PackInfo[PROD_DES_C_S]), [External.Rank.KPI.Prod.PS],
|
||
ISINSCOPE(Dim_PackInfo[PROD_DES]), [External.Rank.KPI.Prod_EN],
|
||
ISINSCOPE(Dim_PackInfo[PROD_DES_S]), [External.Rank.KPI.Prod_EN.PS],
|
||
ISINSCOPE(Dim_PackInfo[CMPS_DES_C]), [External.Rank.KPI.CMPS],
|
||
ISINSCOPE(Dim_PackInfo[CMPS_DES]), [External.Rank.KPI.CMPS_EN],
|
||
ISINSCOPE(Dim_Class[Class]), [External.Rank.KPI.Class],
|
||
ISINSCOPE(Dim_Corp[CORP_DES_C]), [External.Rank.KPI.Corp2.1],
|
||
ISINSCOPE(Dim_Corp[CORP_DES]), [External.Rank.KPI.Corp2.1_EN],
|
||
BLANK()
|
||
)
|
||
)
|
||
RETURN
|
||
R
|
||
/*---------------------------------KPI描述------------------------------------
|
||
------创建者:zhouxin
|
||
------邮箱:kmls393@astrazeneca.net
|
||
------KPI名字:去年同期CountingUnit
|
||
------KPI公式:1、若外部渠道是Retail,且单位是Value,选择了公司,没有选择ta或pack,用all rank kpi;
|
||
2、若外部渠道是Retail,且单位是Value,选择了公司,没有选择ta,但选择了pack,用packall rank kpi;
|
||
3、若外部渠道是Retail,且单位是Value,选择了公司,没有选择pack,但选择了ta,用ta rank kpi;
|
||
4、若外部渠道是Retail,且单位是Value,选择了公司、pack、ta,用tapack rank kpi;
|
||
5、若外部渠道是Retail,且单位不是Value,为空;
|
||
6、若字段涉及倒分子式,用分子式排名;
|
||
7、若字段用到了pack英文名称,用pack排名;
|
||
8、若字段用到了产品英文名称,用产品排名;
|
||
9、若字段用到了分子式英文名称,用分子式排名;
|
||
10、若字段用到了class英文名称,用class排名;
|
||
11、若字段用到了公司英文名称,用公司排名。
|
||
------备注:用户特定的视觉对象2.1
|
||
------创建时间:2024.6.10
|
||
------修改时间:
|
||
------修改内容:
|
||
----------------------------------------------------------------------------*/
|
||
```
|
||
formatString: #,##0
|
||
displayFolder: OLD\特定视觉对象使用KPI2.1
|
||
lineageTag: 91c36b4c-b754-499f-870a-857b608c7d78
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.4.1.Text.Retail.NIAD.Text' =
|
||
VAR R = "NIAD市场月度明细(仅Retail/EC)"
|
||
VAR EC = "NIAD市场月度明细(仅Retail/EC)"
|
||
RETURN
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISFILTERED ( Dim_DataSource )
|
||
&& "Retail" IN VALUES ( Dim_DataSource[SOURCENAME] ), R,
|
||
ISFILTERED ( Dim_DataSource )
|
||
&& "EC" IN VALUES ( Dim_DataSource[SOURCENAME] ), EC
|
||
)
|
||
displayFolder: OLD\Others
|
||
lineageTag: 9f400ffb-5d48-45c5-a53c-73611ee4d846
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.4.1.Text.Retail.NIAD.PageName' =
|
||
VAR R = "Free Report NIAD"
|
||
RETURN
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISFILTERED ( Dim_DataSource )
|
||
&& CALCULATE (
|
||
NOT ISEMPTY ( Dim_DataSource ),
|
||
TREATAS ( { "retail", "ec" }, Dim_DataSource[SOURCENAME] )
|
||
), R
|
||
)
|
||
displayFolder: OLD\Others
|
||
lineageTag: 73cd0584-0734-4ae5-ad4c-7c8c67c6b9a8
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure Max_DTP_Date = "DTP (M): " & CALCULATE(MAX(Fact_Sales[YYYYMM]),Dim_DataSource[DATA_SOURCE] = "DTP(Quarterly)",ALL())
|
||
displayFolder: OLD\Others
|
||
lineageTag: f0f2c92d-43f7-46b6-b460-9a7478ab3dca
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.Sales.KPI.Filter.NIAD' =
|
||
CALCULATE (
|
||
COUNTROWS ( Fact_Sales_NIAD ),
|
||
ALL ( Dim_Calendar )
|
||
)
|
||
displayFolder: OLD\External Sales
|
||
lineageTag: 8ee22998-c622-49e4-9a1c-837ff049a43a
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'Geo.3.2.City.BackColor' =
|
||
SWITCH (
|
||
SELECTEDVALUE ( Dim_DataSource[SOURCENAME] ),
|
||
"CHPA", "#FFFFFF",
|
||
"#E6E6E6"
|
||
)
|
||
displayFolder: OLD\Others
|
||
lineageTag: 75772df1-f1f8-4c0c-8545-49c91590a52a
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure CITY_Name =
|
||
|
||
SWITCH(SELECTEDVALUE(Dim_DataSource[SOURCENAME]),
|
||
"CHPA",BLANK (),
|
||
"City"
|
||
)
|
||
displayFolder: OLD\Others
|
||
lineageTag: dd7d1db9-9ee8-4601-8ce0-c1bc253a9ec7
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'ForAI.Top1.ΔShareInClass.Value' =
|
||
IF(
|
||
AND (
|
||
ISFILTERED ( Dim_Market ) || ISFILTERED ( Dim_BrandDefaultMKT ),
|
||
NOT ISBLANK ( [External.Sales.KPI] )
|
||
),
|
||
MAXX(
|
||
TOPN(
|
||
1,
|
||
ADDCOLUMNS(
|
||
CALCULATETABLE(
|
||
VALUES( Dim_PackInfo[PROD_DES_C] ),
|
||
KEEPFILTERS( Dim_PackInfo[CORP_COD] <> "a5z" )
|
||
),
|
||
"@v", [External.△MS%.KPI.Class]
|
||
),
|
||
[@v], DESC
|
||
),
|
||
[@v]
|
||
)
|
||
)
|
||
formatString: #,##0.0 %
|
||
displayFolder: OLD\ForAI
|
||
lineageTag: e8e65ec3-1b90-42a7-9288-f0076af6803f
|
||
|
||
measure 'ForAI.Top1.ΔMS%.Brand.Value' =
|
||
IF(
|
||
AND (
|
||
ISFILTERED ( Dim_Market ) || ISFILTERED ( Dim_BrandDefaultMKT ),
|
||
NOT ISBLANK ( [External.Sales.KPI] )
|
||
),
|
||
MAXX(
|
||
TOPN(
|
||
1,
|
||
ADDCOLUMNS(
|
||
CALCULATETABLE(
|
||
VALUES( Dim_PackInfo[PROD_DES_C] ),
|
||
KEEPFILTERS( Dim_PackInfo[CORP_COD] <> "a5z" )
|
||
),
|
||
"@v", [External.△MS%.KPI],
|
||
"@result",[External.MS%.KPI]
|
||
),
|
||
[@v], DESC
|
||
),
|
||
[@result]
|
||
)
|
||
)
|
||
formatString: #,##0.0 %
|
||
displayFolder: OLD\ForAI
|
||
lineageTag: 8e83e22b-47d4-4d7c-aa2b-d6ba63dd5123
|
||
|
||
measure 'ForAI.Top1.ΔMS%.Brand.Name' =
|
||
IF (
|
||
AND (
|
||
ISFILTERED ( Dim_Market ) || ISFILTERED ( Dim_BrandDefaultMKT ),
|
||
NOT ISBLANK ( [External.Sales.KPI] )
|
||
),
|
||
MAXX (
|
||
TOPN (
|
||
1,
|
||
ADDCOLUMNS (
|
||
CALCULATETABLE (
|
||
VALUES ( Dim_PackInfo[PROD_DES_C] ),
|
||
KEEPFILTERS ( Dim_PackInfo[CORP_COD] <> "a5z" )
|
||
),
|
||
"@v", [External.△MS%.KPI]
|
||
),
|
||
[@v], DESC
|
||
),
|
||
Dim_PackInfo[PROD_DES_C]
|
||
)
|
||
)
|
||
displayFolder: OLD\ForAI
|
||
lineageTag: 263e94e7-7dad-4db8-8345-a48916c081dc
|
||
|
||
measure 'ForAI.Top1.ShareInClass.Value' =
|
||
IF(
|
||
AND (
|
||
ISFILTERED ( Dim_Market ) || ISFILTERED ( Dim_BrandDefaultMKT ),
|
||
NOT ISBLANK ( [External.Sales.KPI] )
|
||
),
|
||
MAXX(
|
||
TOPN(
|
||
1,
|
||
ADDCOLUMNS(
|
||
CALCULATETABLE(
|
||
VALUES( Dim_PackInfo[PROD_DES_C] ),
|
||
KEEPFILTERS( Dim_PackInfo[CORP_COD] <> "a5z" )
|
||
),
|
||
"@v", [External.△MS%.KPI.Class],
|
||
"@result",[External.MS%.KPI.Class]
|
||
),
|
||
[@v], DESC
|
||
),
|
||
[@result]
|
||
)
|
||
)
|
||
formatString: #,##0.0 %
|
||
displayFolder: OLD\ForAI
|
||
lineageTag: 91b1a10d-4c36-433a-a28d-097eaf36b4b3
|
||
|
||
measure 'ForAI.Top1.ShareInClass.Name' =
|
||
IF (
|
||
AND (
|
||
ISFILTERED ( Dim_Market ) || ISFILTERED ( Dim_BrandDefaultMKT ),
|
||
NOT ISBLANK ( [External.Sales.KPI] )
|
||
),
|
||
MAXX (
|
||
TOPN (
|
||
1,
|
||
ADDCOLUMNS (
|
||
CALCULATETABLE (
|
||
VALUES ( Dim_PackInfo[PROD_DES_C] ),
|
||
KEEPFILTERS ( Dim_PackInfo[CORP_COD] <> "a5z" )
|
||
),
|
||
"@v", [External.△MS%.KPI.Class]
|
||
),
|
||
[@v], DESC
|
||
),
|
||
Dim_PackInfo[PROD_DES_C]
|
||
)
|
||
)
|
||
displayFolder: OLD\ForAI
|
||
lineageTag: 85f35fbe-59ed-438c-8965-3d8be5e47345
|
||
|
||
measure 'ForAI.R3MvsLastR3M.ΔMS%' = ```
|
||
VAR _cm_ym = MAX ( Dim_Calendar[DATE] )
|
||
VAR _r3m_ym =
|
||
CALCULATE (
|
||
MAX ( Dim_Calendar[DATE] ),
|
||
DATEADD ( Dim_Calendar[DATE], -3, MONTH )
|
||
)
|
||
VAR _cm_value =
|
||
CALCULATE (
|
||
[External.MS%.KPI],
|
||
DATESINPERIOD ( Dim_Calendar[DATE], _cm_ym, -3, MONTH )
|
||
)
|
||
VAR _r3m_value =
|
||
CALCULATE (
|
||
[External.MS%.KPI],
|
||
DATESINPERIOD ( Dim_Calendar[DATE], _r3m_ym, -3, MONTH )
|
||
)
|
||
RETURN
|
||
_cm_value - _r3m_value
|
||
|
||
```
|
||
formatString: #,##0.0 %
|
||
displayFolder: OLD\ForAI
|
||
lineageTag: 64b0726d-b05e-4636-81f3-0199cabb7266
|
||
|
||
measure 'ForAI.R3MvsLastR3M.GR%' = ```
|
||
VAR _cm_ym = MAX ( Dim_Calendar[DATE] )
|
||
VAR _r3m_ym =
|
||
CALCULATE (
|
||
MAX ( Dim_Calendar[DATE] ),
|
||
DATEADD ( Dim_Calendar[DATE], -3, MONTH )
|
||
)
|
||
VAR _cm_value =
|
||
CALCULATE (
|
||
[External.Sales.KPI],
|
||
DATESINPERIOD ( Dim_Calendar[DATE], _cm_ym, -3, MONTH )
|
||
)
|
||
VAR _r3m_value =
|
||
CALCULATE (
|
||
[External.Sales.KPI],
|
||
DATESINPERIOD ( Dim_Calendar[DATE], _r3m_ym, -3, MONTH )
|
||
)
|
||
RETURN
|
||
DIVIDE ( _cm_value - _r3m_value, _r3m_value )
|
||
|
||
```
|
||
formatString: #,##0.0 %
|
||
displayFolder: OLD\ForAI
|
||
lineageTag: 9e1680d6-b515-41d2-bad3-db7709f3c981
|
||
|
||
measure 'ForAI.R3M.MS%' =
|
||
CALCULATE (
|
||
[External.MS%.KPI],
|
||
DATESINPERIOD (
|
||
Dim_Calendar[DATE],
|
||
MAX ( Dim_Calendar[DATE] ),
|
||
-3,
|
||
MONTH
|
||
)
|
||
)
|
||
formatString: #,##0.0 %
|
||
displayFolder: OLD\ForAI
|
||
lineageTag: efbd4c1e-eb14-46e7-bb94-b7d9b2d0f732
|
||
|
||
measure 'ForAI.MS%.Rank' =
|
||
VAR _brand =
|
||
RANK (
|
||
DENSE, CALCULATETABLE (
|
||
ALLSELECTED ( Dim_PackInfo[PROD_DES_C] )
|
||
),
|
||
ORDERBY ( [External.MS%.KPI], DESC ),
|
||
LAST
|
||
)
|
||
VAR _brand_en =
|
||
RANK (
|
||
DENSE, CALCULATETABLE (
|
||
ALLSELECTED ( Dim_PackInfo[PROD_DES] )
|
||
),
|
||
ORDERBY ( [External.MS%.KPI], DESC ),
|
||
LAST
|
||
)
|
||
VAR _geo =
|
||
RANK (
|
||
DENSE,
|
||
ALLSELECTED ( Dim_Geo[PROVINCE_C] ),
|
||
ORDERBY ( [External.MS%.KPI], DESC ),
|
||
LAST
|
||
)
|
||
VAR _inst =
|
||
RANK (
|
||
DENSE,
|
||
ALLSELECTED ( Dim_Institution[INST_NAME] ),
|
||
ORDERBY ( [External.MS%.KPI], DESC ),
|
||
LAST
|
||
)
|
||
RETURN
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISINSCOPE ( Dim_PackInfo[PROD_DES_C] ), _brand,
|
||
ISINSCOPE ( Dim_PackInfo[PROD_DES] ), _brand_en,
|
||
ISINSCOPE ( Dim_Geo[PROVINCE_C] ), _geo,
|
||
ISINSCOPE ( Dim_Institution[INST_NAME] ), _inst,
|
||
ISINSCOPE ( Dim_Institution[INST_CODE] ), _inst,
|
||
BLANK ( )
|
||
)
|
||
formatString: #,##0
|
||
displayFolder: OLD\ForAI
|
||
lineageTag: 887b315c-86d8-4a54-a3b7-090c8fe76ff9
|
||
|
||
measure 'External.ClassShare.Δ.LY.Value' =
|
||
VAR _sumtable =
|
||
TOPN(
|
||
1,
|
||
ADDCOLUMNS(
|
||
CALCULATETABLE(
|
||
VALUES( Dim_Class[CLASS] ),
|
||
TREATAS(
|
||
VALUES( FACT_SALES[MARKET] ),
|
||
Dim_Class[MARKET]
|
||
),
|
||
ALLSELECTED( Dim_Class[CLASS] )
|
||
),
|
||
"@delatclass",
|
||
CALCULATE(
|
||
[External.ClassShare] - [External.ClassShare.LY]
|
||
)
|
||
),
|
||
[@delatclass], DESC
|
||
)
|
||
RETURN
|
||
IF(
|
||
ISBLANK( [External.Sales.KPI.Market] )
|
||
|| NOT ( ISFILTERED( Dim_Market ) || ISFILTERED( Dim_BrandDefaultMKT ) ),
|
||
BLANK( ),
|
||
CONCATENATEX( _sumtable, FORMAT( [@delatclass], "#0.0%" ), )
|
||
)
|
||
displayFolder: OLD\ForAI
|
||
lineageTag: 1af10f94-ddbf-45a8-8b79-a6d018ba8305
|
||
|
||
measure 'External.ClassShare.Δ.LY.Name' =
|
||
VAR _sumtable =
|
||
TOPN(
|
||
1,
|
||
ADDCOLUMNS(
|
||
CALCULATETABLE(
|
||
VALUES( Dim_Class[CLASS] ),
|
||
TREATAS(
|
||
VALUES( FACT_SALES[MARKET] ),
|
||
Dim_Class[MARKET]
|
||
),
|
||
ALLSELECTED( Dim_Class[CLASS] )
|
||
),
|
||
"@delatclass",
|
||
CALCULATE(
|
||
[External.ClassShare] - [External.ClassShare.LY]
|
||
)
|
||
),
|
||
[@delatclass], DESC
|
||
)
|
||
RETURN
|
||
IF(
|
||
ISBLANK( [External.Sales.KPI.Market] )
|
||
|| NOT ( ISFILTERED( Dim_Market ) || ISFILTERED( Dim_BrandDefaultMKT ) ),
|
||
BLANK( ),
|
||
CONCATENATEX( _sumtable, Dim_Class[CLASS], )
|
||
)
|
||
displayFolder: OLD\ForAI
|
||
lineageTag: fd57a855-6a2a-4c5d-93f8-b774ae62d8f5
|
||
|
||
measure 'External.ClassShare.Δ.LQ.Value' =
|
||
VAR _sumtable =
|
||
TOPN(
|
||
1,
|
||
ADDCOLUMNS(
|
||
CALCULATETABLE(
|
||
VALUES( Dim_Class[CLASS] ),
|
||
TREATAS(
|
||
VALUES( FACT_SALES[MARKET] ),
|
||
Dim_Class[MARKET]
|
||
),
|
||
ALLSELECTED( Dim_Class[CLASS] )
|
||
),
|
||
"@delatclass",
|
||
CALCULATE(
|
||
[External.ClassShare] - [External.ClassShare.LastQ]
|
||
)
|
||
),
|
||
[@delatclass], DESC
|
||
)
|
||
RETURN
|
||
IF(
|
||
ISBLANK( [External.Sales.KPI.Market] )
|
||
|| NOT ( ISFILTERED( Dim_Market ) || ISFILTERED( Dim_BrandDefaultMKT ) ),
|
||
BLANK( ),
|
||
CONCATENATEX( _sumtable, FORMAT( [@delatclass], "#0.0%" ), )
|
||
)
|
||
displayFolder: OLD\ForAI
|
||
lineageTag: a9ac55de-0fa6-4a3a-ba26-ad91238c1fea
|
||
|
||
measure 'External.ClassShare.Δ.LQ.Name' =
|
||
VAR _sumtable =
|
||
TOPN(
|
||
1,
|
||
ADDCOLUMNS(
|
||
CALCULATETABLE(
|
||
VALUES( Dim_Class[CLASS] ),
|
||
TREATAS(
|
||
VALUES( FACT_SALES[MARKET] ),
|
||
Dim_Class[MARKET]
|
||
),
|
||
ALLSELECTED( Dim_Class[CLASS] )
|
||
),
|
||
"@delatclass",
|
||
CALCULATE(
|
||
[External.ClassShare] - [External.ClassShare.LastQ]
|
||
)
|
||
),
|
||
[@delatclass], DESC
|
||
)
|
||
RETURN
|
||
IF(
|
||
ISBLANK( [External.Sales.KPI.Market] )
|
||
|| NOT ( ISFILTERED( Dim_Market ) || ISFILTERED( Dim_BrandDefaultMKT ) ),
|
||
BLANK( ),
|
||
CONCATENATEX( _sumtable, Dim_Class[CLASS], )
|
||
)
|
||
displayFolder: OLD\ForAI
|
||
lineageTag: 0e83c3f9-1c82-42e2-ac70-458ea9b70cff
|
||
|
||
measure 'External.ClassShare.Δ.LHY.Value' =
|
||
VAR _sumtable =
|
||
TOPN (
|
||
1,
|
||
ADDCOLUMNS (
|
||
CALCULATETABLE (
|
||
VALUES ( Dim_Class[CLASS] ),
|
||
TREATAS (
|
||
VALUES ( FACT_SALES[MARKET] ),
|
||
Dim_Class[MARKET]
|
||
),
|
||
ALLSELECTED ( Dim_Class[CLASS] )
|
||
),
|
||
"@delatclass",
|
||
CALCULATE (
|
||
[External.ClassShare] - [External.ClassShare.LHY]
|
||
)
|
||
),
|
||
[@delatclass], DESC
|
||
)
|
||
RETURN
|
||
IF (
|
||
ISBLANK ( [External.Sales.KPI.Market] )
|
||
|| NOT ( ISFILTERED ( Dim_Market ) || ISFILTERED ( Dim_BrandDefaultMKT ) ),
|
||
BLANK ( ),
|
||
CONCATENATEX ( _sumtable, FORMAT ( [@delatclass], "#0.0%" ), )
|
||
)
|
||
displayFolder: OLD\ForAI
|
||
lineageTag: 67e26417-07fa-4136-aaca-868b932b6788
|
||
|
||
measure 'External.ClassShare.Δ.LHY.Name' =
|
||
VAR _sumtable =
|
||
TOPN(
|
||
1,
|
||
ADDCOLUMNS(
|
||
CALCULATETABLE(
|
||
VALUES( Dim_Class[CLASS] ),
|
||
TREATAS(
|
||
VALUES( FACT_SALES[MARKET] ),
|
||
Dim_Class[MARKET]
|
||
),
|
||
ALLSELECTED( Dim_Class[CLASS] )
|
||
),
|
||
"@delatclass",
|
||
CALCULATE(
|
||
[External.ClassShare] - [External.ClassShare.LHY]
|
||
)
|
||
),
|
||
[@delatclass], DESC
|
||
)
|
||
RETURN
|
||
IF(
|
||
ISBLANK( [External.Sales.KPI.Market] )
|
||
|| NOT ( ISFILTERED( Dim_Market ) || ISFILTERED( Dim_BrandDefaultMKT ) ),
|
||
BLANK( ),
|
||
CONCATENATEX( _sumtable, Dim_Class[CLASS], )
|
||
)
|
||
displayFolder: OLD\ForAI
|
||
lineageTag: e2db3e60-0c3e-4da4-a565-0b832321d5da
|
||
|
||
measure 'External.ClassShare.Δ.FQ.Value' =
|
||
VAR _sumtable =
|
||
TOPN(
|
||
1,
|
||
ADDCOLUMNS(
|
||
CALCULATETABLE(
|
||
VALUES( Dim_Class[CLASS] ),
|
||
TREATAS(
|
||
VALUES( FACT_SALES[MARKET] ),
|
||
Dim_Class[MARKET]
|
||
),
|
||
ALLSELECTED( Dim_Class[CLASS] )
|
||
),
|
||
"@delatclass",
|
||
CALCULATE(
|
||
[External.ClassShare] - [External.ClassShare.FirstQ]
|
||
)
|
||
),
|
||
[@delatclass], DESC
|
||
)
|
||
RETURN
|
||
IF(
|
||
ISBLANK( [External.Sales.KPI.Market] )
|
||
|| NOT ( ISFILTERED( Dim_Market ) || ISFILTERED( Dim_BrandDefaultMKT ) ),
|
||
BLANK( ),
|
||
CONCATENATEX( _sumtable, FORMAT( [@delatclass], "#0.0%" ), )
|
||
)
|
||
displayFolder: OLD\ForAI
|
||
lineageTag: bbb840db-b923-415d-937d-440a7101152d
|
||
|
||
measure 'External.ClassShare.Δ.FQ.Name' =
|
||
VAR _sumtable =
|
||
TOPN(
|
||
1,
|
||
ADDCOLUMNS(
|
||
CALCULATETABLE(
|
||
VALUES( Dim_Class[CLASS] ),
|
||
TREATAS(
|
||
VALUES( FACT_SALES[MARKET] ),
|
||
Dim_Class[MARKET]
|
||
),
|
||
ALLSELECTED( Dim_Class[CLASS] )
|
||
),
|
||
"@delatclass",
|
||
CALCULATE(
|
||
[External.ClassShare] - [External.ClassShare.FirstQ]
|
||
)
|
||
),
|
||
[@delatclass], DESC
|
||
)
|
||
RETURN
|
||
IF(
|
||
ISBLANK( [External.Sales.KPI.Market] )
|
||
|| NOT ( ISFILTERED( Dim_Market ) || ISFILTERED( Dim_BrandDefaultMKT ) ),
|
||
BLANK( ),
|
||
CONCATENATEX( _sumtable, Dim_Class[CLASS], )
|
||
)
|
||
displayFolder: OLD\ForAI
|
||
lineageTag: 84667098-e49c-4583-8147-073b8cd05ea4
|
||
|
||
measure 'External.ClassShare.LY' =
|
||
//CALCULATE(
|
||
DIVIDE (
|
||
[External.Sales.LY.KPI.Class],
|
||
[External.Sales.LY.KPI.Market]
|
||
)
|
||
//,
|
||
// MQY[Period] = "QTD"
|
||
//)
|
||
displayFolder: OLD\ForAI
|
||
lineageTag: c787db6f-8283-43d8-b584-9e794e050e3f
|
||
|
||
measure 'External.ClassShare.LHY' =
|
||
CALCULATE(
|
||
DIVIDE(
|
||
[External.Sales.KPI.Class],
|
||
[External.Sales.KPI.Market]
|
||
),
|
||
MQY[Period] = "Previous_HTD"
|
||
)
|
||
displayFolder: OLD\ForAI
|
||
lineageTag: a55de55f-077f-4804-88a6-5c1e5fae3a63
|
||
|
||
measure 'External.ClassShare.LastQ' =
|
||
CALCULATE(
|
||
DIVIDE(
|
||
[External.Sales.KPI.Class],
|
||
[External.Sales.KPI.Market]
|
||
),
|
||
MQY[Period] = "Previous_QTD"
|
||
)
|
||
displayFolder: OLD\ForAI
|
||
lineageTag: 307c81d9-53c9-47dd-98c2-84b13bd47aad
|
||
|
||
measure 'External.ClassShare.FirstQ' =
|
||
CALCULATE(
|
||
DIVIDE(
|
||
[External.Sales.KPI.Class],
|
||
[External.Sales.KPI.Market]
|
||
),
|
||
MQY[Period] = "First_QTD"
|
||
)
|
||
displayFolder: OLD\ForAI
|
||
lineageTag: 763fff03-1656-4ff9-b5ce-0172cc4869fa
|
||
|
||
measure 'External.ClassShare' =
|
||
//CALCULATE(
|
||
DIVIDE (
|
||
[External.Sales.KPI.Class],
|
||
[External.Sales.KPI.Market]
|
||
)
|
||
//,
|
||
//MQY[Period] = "QTD"
|
||
//)
|
||
displayFolder: OLD\ForAI
|
||
lineageTag: 542d74b2-82c6-4eb4-883a-1e9a81b1d103
|
||
|
||
measure 'External.4.1.Text.Retail.Direct.PageName' =
|
||
VAR R = "RetailDirect Export"
|
||
RETURN
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISFILTERED ( Dim_DataSource )
|
||
&& CALCULATE (
|
||
NOT ISEMPTY ( Dim_DataSource ),
|
||
TREATAS ( { "retail" }, Dim_DataSource[SOURCENAME] )
|
||
), R
|
||
)
|
||
displayFolder: OLD\Others
|
||
lineageTag: 0dde360b-d0c6-41b4-b036-e7164ec7006c
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure 'External.4.1.Text.Retail.Dierct.Text' =
|
||
VAR R = "Retail直取导出"
|
||
RETURN
|
||
SWITCH (
|
||
TRUE ( ),
|
||
ISFILTERED ( Dim_DataSource )
|
||
&& "Retail" IN VALUES ( Dim_DataSource[SOURCENAME] ), R
|
||
)
|
||
displayFolder: OLD\Others
|
||
lineageTag: cce50489-93fc-4699-8e6a-ba6e1e35a87f
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure '00.DirectRetail.national_corp_rank' =
|
||
IF (
|
||
ISFILTERED ( Dim_Corp ),
|
||
CALCULATE (
|
||
SUM ( Fact_Direct_Retail_national_corp_rank[sales_amount] ),
|
||
KEEPFILTERS (
|
||
Fact_Direct_Retail_national_corp_rank[corp_desc]
|
||
<> "全国 Rx(化学药+生物制品)"
|
||
),
|
||
KEEPFILTERS (
|
||
Fact_Direct_Retail_national_corp_rank[corp_desc]
|
||
<> "阿斯利康-去除非零售推广产品"
|
||
),
|
||
KEEPFILTERS (
|
||
Fact_Direct_Retail_national_corp_rank[ta] = "Retail Total"
|
||
)
|
||
),
|
||
CALCULATE (
|
||
SUM ( Fact_Direct_Retail_national_corp_rank[sales_amount] ),
|
||
KEEPFILTERS (
|
||
Fact_Direct_Retail_national_corp_rank[corp_desc]
|
||
= "全国 Rx(化学药+生物制品)"
|
||
)
|
||
)
|
||
)
|
||
displayFolder: 00Base\02_2.1\00
|
||
lineageTag: 106c22d3-de8c-4f01-a9ea-d960ab3f7a3c
|
||
|
||
measure '00.DirectRetail.national_corp_rank.LY' =
|
||
IF (
|
||
ISFILTERED ( Dim_Corp ),
|
||
CALCULATE (
|
||
SUM (
|
||
Fact_Direct_Retail_national_corp_rank[sales_amount_ly]
|
||
),
|
||
KEEPFILTERS (
|
||
Fact_Direct_Retail_national_corp_rank[corp_desc]
|
||
<> "全国 Rx(化学药+生物制品)"
|
||
),
|
||
KEEPFILTERS (
|
||
Fact_Direct_Retail_national_corp_rank[corp_desc]
|
||
<> "阿斯利康-去除非零售推广产品"
|
||
),
|
||
KEEPFILTERS (
|
||
Fact_Direct_Retail_national_corp_rank[ta] = "Retail Total"
|
||
)
|
||
),
|
||
CALCULATE (
|
||
SUM (
|
||
Fact_Direct_Retail_national_corp_rank[sales_amount_ly]
|
||
),
|
||
KEEPFILTERS (
|
||
Fact_Direct_Retail_national_corp_rank[corp_desc]
|
||
= "全国 Rx(化学药+生物制品)"
|
||
)
|
||
)
|
||
)
|
||
displayFolder: 00Base\02_2.1\00
|
||
lineageTag: d0123eb2-7894-4039-aa5f-972a1605f25d
|
||
|
||
measure '03.EC.Direct.Total2.1' =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
NOT ISFILTERED ( Dim_Platform ) && NOT ISFILTERED ( Dim_StoreType ),
|
||
CALCULATE (
|
||
[EC.Sales.MTH],
|
||
Fact_EC[TA] = "",
|
||
Fact_EC[TOTAL_FLAG] = "y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Fact_EC[CORP_COD] ),
|
||
KEEPFILTERS ( Fact_EC[CORP_COD] = "" )
|
||
),
|
||
NOT ISFILTERED ( Dim_Platform ),
|
||
CALCULATE (
|
||
[EC.Sales.MTH],
|
||
Fact_EC[TA] = "",
|
||
Fact_EC[TOTAL_FLAG] = "y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Fact_EC[CORP_COD] ),
|
||
KEEPFILTERS ( Fact_EC[CORP_COD] = "" )
|
||
),
|
||
NOT ISFILTERED ( Dim_StoreType ),
|
||
CALCULATE (
|
||
[EC.Sales.MTH],
|
||
Fact_EC[TA] = "",
|
||
Fact_EC[TOTAL_FLAG] = "y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Fact_EC[CORP_COD] ),
|
||
KEEPFILTERS ( Fact_EC[CORP_COD] = "" )
|
||
),
|
||
CALCULATE (
|
||
[EC.Sales.MTH],
|
||
Fact_EC[TOTAL_FLAG] = "y",
|
||
Fact_EC[TA] = "",
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Fact_EC[CORP_COD] ),
|
||
KEEPFILTERS ( Fact_EC[CORP_COD] = "" )
|
||
)
|
||
)
|
||
displayFolder: 00Base\02_2.1\03
|
||
lineageTag: a9c22ee1-7a2d-4e32-8172-b96f465ba30d
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure '03.EC.Direct.Total2.1.TA' =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
--选择其他TA+公司时的金额
|
||
NOT ISFILTERED ( Dim_Platform ) && NOT ISFILTERED ( Dim_StoreType ),
|
||
CALCULATE (
|
||
[EC.Sales.MTH],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
//ALL(Dim_PackInfo),
|
||
Fact_EC[TOTAL_FLAG] = "y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Fact_EC[CORP_COD] ),
|
||
KEEPFILTERS ( Fact_EC[CORP_COD] = "" )
|
||
),
|
||
NOT ISFILTERED ( Dim_Platform ),
|
||
CALCULATE (
|
||
[EC.Sales.MTH],
|
||
Fact_EC[TOTAL_FLAG] = "y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
//ALL(Dim_PackInfo),
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Fact_EC[CORP_COD] ),
|
||
KEEPFILTERS ( Fact_EC[CORP_COD] = "" )
|
||
),
|
||
NOT ISFILTERED ( Dim_StoreType ),
|
||
CALCULATE (
|
||
[EC.Sales.MTH],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "y",
|
||
//ALL(Dim_PackInfo),
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Fact_EC[CORP_COD] ),
|
||
KEEPFILTERS ( Fact_EC[CORP_COD] = "" )
|
||
),
|
||
CALCULATE (
|
||
[EC.Sales.MTH],
|
||
Fact_EC[TOTAL_FLAG] = "y",
|
||
//ALL(Dim_PackInfo),
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Fact_EC[CORP_COD] ),
|
||
KEEPFILTERS ( Fact_EC[CORP_COD] = "" )
|
||
)
|
||
)
|
||
displayFolder: 00Base\02_2.1\03
|
||
lineageTag: d58e1777-8ba9-43b8-8f12-93b166de00cf
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure '03.EC.Direct.Total2.1.LY' =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
NOT ISFILTERED ( Dim_Platform ) && NOT ISFILTERED ( Dim_StoreType ),
|
||
CALCULATE (
|
||
[EC.Sales.LY.MTH],
|
||
Fact_EC[TA] = "",
|
||
Fact_EC[TOTAL_FLAG] = "y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Fact_EC[CORP_COD] ),
|
||
KEEPFILTERS ( Fact_EC[CORP_COD] = "" )
|
||
),
|
||
NOT ISFILTERED ( Dim_Platform ),
|
||
CALCULATE (
|
||
[EC.Sales.LY.MTH],
|
||
Fact_EC[TA] = "",
|
||
Fact_EC[TOTAL_FLAG] = "y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Fact_EC[CORP_COD] ),
|
||
KEEPFILTERS ( Fact_EC[CORP_COD] = "" )
|
||
),
|
||
NOT ISFILTERED ( Dim_StoreType ),
|
||
CALCULATE (
|
||
[EC.Sales.LY.MTH],
|
||
Fact_EC[TA] = "",
|
||
Fact_EC[TOTAL_FLAG] = "y",
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Fact_EC[CORP_COD] ),
|
||
KEEPFILTERS ( Fact_EC[CORP_COD] = "" )
|
||
),
|
||
CALCULATE (
|
||
[EC.Sales.LY.MTH],
|
||
Fact_EC[TOTAL_FLAG] = "y",
|
||
Fact_EC[TA] = "",
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Fact_EC[CORP_COD] ),
|
||
KEEPFILTERS ( Fact_EC[CORP_COD] = "" )
|
||
)
|
||
)
|
||
displayFolder: 00Base\02_2.1\03
|
||
lineageTag: 28b01aec-add1-4ca2-bdaf-734964a67fee
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
measure '03.EC.Direct.Total2.1.TA.LY' =
|
||
SWITCH (
|
||
TRUE ( ),
|
||
--选择其他TA+公司时的金额
|
||
NOT ISFILTERED ( Dim_Platform ) && NOT ISFILTERED ( Dim_StoreType ),
|
||
CALCULATE (
|
||
[EC.Sales.LY.MTH],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
//ALL(Dim_PackInfo),
|
||
Fact_EC[TOTAL_FLAG] = "y",
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Fact_EC[CORP_COD] ),
|
||
KEEPFILTERS ( Fact_EC[CORP_COD] = "" )
|
||
),
|
||
NOT ISFILTERED ( Dim_Platform ),
|
||
CALCULATE (
|
||
[EC.Sales.LY.MTH],
|
||
Fact_EC[TOTAL_FLAG] = "y",
|
||
Fact_EC[PLATFORM] = "B2C全平台(京东+天猫)",
|
||
//ALL(Dim_PackInfo),
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Fact_EC[CORP_COD] ),
|
||
KEEPFILTERS ( Fact_EC[CORP_COD] = "" )
|
||
),
|
||
NOT ISFILTERED ( Dim_StoreType ),
|
||
CALCULATE (
|
||
[EC.Sales.LY.MTH],
|
||
Fact_EC[STORE_TYPE] = "自营+三方",
|
||
Fact_EC[TOTAL_FLAG] = "y",
|
||
//ALL(Dim_PackInfo),
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Fact_EC[CORP_COD] ),
|
||
KEEPFILTERS ( Fact_EC[CORP_COD] = "" )
|
||
),
|
||
CALCULATE (
|
||
[EC.Sales.LY.MTH],
|
||
Fact_EC[TOTAL_FLAG] = "y",
|
||
//ALL(Dim_PackInfo),
|
||
TREATAS (
|
||
VALUES ( Dim_MarketTA[TA_SOURCE] ),
|
||
Fact_EC[TA_SOURCE]
|
||
),
|
||
REMOVEFILTERS ( Dim_Corp ),
|
||
REMOVEFILTERS ( Fact_EC[CORP_COD] ),
|
||
KEEPFILTERS ( Fact_EC[CORP_COD] = "" )
|
||
)
|
||
)
|
||
displayFolder: 00Base\02_2.1\03
|
||
lineageTag: 01a7cac3-a263-4625-ae48-252e633f2327
|
||
|
||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||
|
||
column CreatedBy
|
||
lineageTag: 74ce729e-edbc-46d1-8445-3279ab9bf147
|
||
summarizeBy: none
|
||
isNameInferred
|
||
sourceColumn: [CreatedBy]
|
||
|
||
annotation SummarizationSetBy = Automatic
|
||
|
||
column Value
|
||
lineageTag: 71357a7c-44fa-47be-87e6-7f4d190509ef
|
||
summarizeBy: none
|
||
isNameInferred
|
||
sourceColumn: [Value]
|
||
|
||
annotation SummarizationSetBy = Automatic
|
||
|
||
partition Measure = calculated
|
||
mode: import
|
||
source =
|
||
DATATABLE("CreatedBy",STRING,
|
||
"Value",STRING,{{"xin.zhou8@astrazeneca.com"," "}})
|
||
|
||
annotation PBI_Id = 3471078ee69e438fadba62f521c307a1
|
||
|
||
annotation TabularEditor_TableGroup = 00_MeasureTable
|
||
|