chore: update report visuals, semantic model definitions, and cleanup legacy queries

This commit is contained in:
2026-05-14 10:11:41 +08:00
parent 7118b73c5b
commit 84ae943bdb
50 changed files with 1949 additions and 902 deletions

View File

@@ -3667,6 +3667,18 @@ table Measure
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描述------------------------------------
@@ -3838,6 +3850,18 @@ table Measure
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
@@ -4002,7 +4026,7 @@ table Measure
annotation PBI_FormatHint = {"isGeneralNumber":true}
measure 'External.Sales.KPI.Market2.1' = ```
measure 'External.Sales.KPI.Market2.1' =
VAR DS = [00.SOURCENAME]
VAR DW_TYPE = SELECTEDVALUE ( Dim_Unit[DW_TYPE] )
VAR _DW = SELECTEDVALUE ( Dim_Unit[DW] )
@@ -4010,14 +4034,26 @@ table Measure
SWITCH (
TRUE ( ),
//Retail
DS = "Retail" && DW_TYPE = "Value"
&& NOT ISFILTERED ( Dim_Market )
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 ),
@@ -4038,13 +4074,12 @@ table Measure
------修改时间:
------修改内容:
----------------------------------------------------------------------------
```
displayFolder: 00Base\02_2.1\04
lineageTag: 6eefa808-4f5e-440e-be8b-9be762eaea64
annotation PBI_FormatHint = {"isGeneralNumber":true}
measure 'External.Sales.LY.KPI.Market2.1' = ```
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] )
@@ -4052,14 +4087,26 @@ table Measure
SWITCH (
TRUE ( ),
//Retail
DS = "Retail" && DW_TYPE = "Value"
&& NOT ISFILTERED ( Dim_Market )
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 ),
@@ -4080,7 +4127,6 @@ table Measure
------修改时间:
------修改内容:
----------------------------------------------------------------------------
```
displayFolder: 00Base\02_2.1\04
lineageTag: e2fab734-0f98-4ebe-9c9b-1c1f39796178
@@ -6367,28 +6413,20 @@ table Measure
lineageTag: 0802fe57-c045-454a-b7e7-43c00140fdcf
measure 'EC.Value.MTH' =
// VAR YM = MAX(Dim_Calendar[YYYYMM])
// RETURN
CALCULATE(SUM(Fact_EC[KPI_VAL]),
Fact_EC[KPI_NAME] = "top_corp_sales"
// Fact_EC[YYYYMM] = YM,
// REMOVEFILTERS ( Dim_Calendar )
)
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' =
// VAR YM = MAX(Dim_Calendar[YYYYMM])
// RETURN
CALCULATE(SUM(Fact_EC[KPI_VAL_LY]),
Fact_EC[KPI_NAME] = "top_corp_sales"
// Fact_EC[YYYYMM] = YM,
// REMOVEFILTERS ( Dim_Calendar )
)
CALCULATE (
SUM ( Fact_EC[KPI_VAL_LY] ),
Fact_EC[KPI_NAME] = "top_corp_sales"
)
displayFolder: OLD\直取KPI
lineageTag: 38455814-4547-4d2c-8f5c-39e1d0648b9f
@@ -9697,29 +9735,53 @@ table Measure
annotation PBI_FormatHint = {"isGeneralNumber":true}
measure 'External.1.1.Text' = ```
VAR A = {"THC 14省数据仅包含CV、DM、RE三个治疗领域",""}
measure 'External.1.1.Text' =
VAR A = { "THC 14省数据仅包含CV、DM、RE三个治疗领域", "" }
VAR B = { "CHC渠道仅包含CV+DM+GI+RE", "" }
VAR R = {"Retail渠道", "DM=NIAD", "CV不含中成药及PCSK9","GI=GI Oral(OTC+Rx)",""}
VAR E = {"EC渠道", "DM=NIAD","CV不含中成药及PCSK9","GI=GI Oral (OTC+Rx)"}
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],"
")
)
```
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
@@ -17715,6 +17777,9 @@ table Measure
KEEPFILTERS (
Fact_Direct_Retail_national_corp_rank[corp_desc]
<> "阿斯利康-去除非零售推广产品"
),
KEEPFILTERS (
Fact_Direct_Retail_national_corp_rank[ta] = "Retail Total"
)
),
CALCULATE (
@@ -17732,7 +17797,9 @@ table Measure
IF (
ISFILTERED ( Dim_Corp ),
CALCULATE (
SUM ( Fact_Direct_Retail_national_corp_rank[sales_amount_ly] ),
SUM (
Fact_Direct_Retail_national_corp_rank[sales_amount_ly]
),
KEEPFILTERS (
Fact_Direct_Retail_national_corp_rank[corp_desc]
<> "全国 Rx(化学药+生物制品)"
@@ -17740,10 +17807,15 @@ table Measure
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] ),
SUM (
Fact_Direct_Retail_national_corp_rank[sales_amount_ly]
),
KEEPFILTERS (
Fact_Direct_Retail_national_corp_rank[corp_desc]
= "全国 Rx(化学药+生物制品)"
@@ -17753,6 +17825,232 @@ table Measure
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