This commit is contained in:
2026-03-29 14:24:01 +08:00
commit 3e0ef9086b
4321 changed files with 3174841 additions and 0 deletions

View File

@@ -0,0 +1,226 @@
table AIA_Merge_Data
lineageTag: 707667ad-59ab-4dcd-b72c-c8b7f04c3e2c
calculationGroup
precedence: 8
calculationItem AIA_MergeData_WithBlank = IF( NOT ( ISFILTERED(Dim_Market[MARKET]) || ISFILTERED( Dim_BrandDefaultMKT[MARKET])), BLANK(),SELECTEDMEASURE())
calculationItem AIA_MERGE_DATA_5_2 =
VAR _isfilter =
CALCULATE (
NOT ISEMPTY ( Fields_Merged_Data ),
TREATAS ( { 5, 3 }, Fields_Merged_Data[Value5] )
)
VAR _isfilter_city =
ISFILTERED ( Dim_Geo[CITY_C] )
|| ISFILTERED ( Dim_Geo[MERGED_DATA_CITY_C] )
|| CALCULATE (
NOT ISEMPTY ( Fields_Merged_Data ),
KEEPFILTERS (
TREATAS (
{ 313, 314 },
Fields_Merged_Data[Fields_Merged_Data Order]
)
)
)
VAR _egfr_tj =
IF (
HASONEVALUE ( Dim_Market[MARKET] ),
IF (
VALUES ( Dim_Market[MARKET] ) = "EGFR TKI MARKET"
&& SELECTEDVALUE ( Dim_Geo[PROVINCE_C] ) = "天津",
TRUE ( )
)
)
RETURN
SWITCH (
TRUE ( ),
( ISFILTERED ( Dim_Market ) || ISFILTERED ( Dim_BrandDefaultMKT )
|| ISFILTERED ( Dim_MarketTA[TA] ) )
&& _egfr_tj,
// 选了 EGFR TKI MARKET
SWITCH (
TRUE ( ),
// 筛选city dtp不参与计算
( OR ( ISFILTERED ( Dim_Org ), ISFILTERED ( Dim_Geo ) )
|| _isfilter )
&& AND (
NOT ISFILTERED ( Dim_Market ),
SELECTEDVALUE ( Dim_MarketTA[TA] ) = "onco"
)
&& [IsMerge]
&& _isfilter_city,
CALCULATE (
SELECTEDMEASURE ( ),
KEEPFILTERS ( Dim_MergeDataSource[DATA_SOURCE] <> "DTP" ),
USERELATIONSHIP ( Dim_MergeDataSource[DATA_SOURCE], Fact_Sales[MERGEDATA_FLAG_MKT] ),
Fact_Sales[MERGEDATA_FLAG_DTP_NOROC] = 1,
KEEPFILTERS ( Fact_Sales[MERGED_DATA_DTP_OTHERS] <> "2" ),
KEEPFILTERS ( Fact_Sales[DTP_FLAG] <> 1 ) // 筛选city dtp不参与计算
,
KEEPFILTERS ( Fact_Sales[EGFR_FLAG] = 0 )
),
// 不筛选city dtp参与计算
( OR ( ISFILTERED ( Dim_Org ), ISFILTERED ( Dim_Geo ) )
|| _isfilter )
&& AND (
NOT ISFILTERED ( Dim_Market ),
SELECTEDVALUE ( Dim_MarketTA[TA] ) = "onco"
)
&& [IsMerge],
CALCULATE (
SELECTEDMEASURE ( ),
KEEPFILTERS ( Dim_MergeDataSource[DATA_SOURCE] <> "DTP" ),
USERELATIONSHIP ( Dim_MergeDataSource[DATA_SOURCE], Fact_Sales[MERGEDATA_FLAG_MKT] ),
Fact_Sales[MERGEDATA_FLAG_DTP_NOROC] = 1,
KEEPFILTERS ( Fact_Sales[MERGED_DATA_DTP_OTHERS] <> "2" ) // ,KEEPFILTERS( Fact_Sales[DTP_FLAG] <>1 )
,
KEEPFILTERS ( Fact_Sales[EGFR_FLAG] = 0 )
),
// 筛选city dtp不参与计算
( ISFILTERED ( Dim_Org ) || ISFILTERED ( Dim_Geo ) || _isfilter )
&& _isfilter_city,
CALCULATE (
SELECTEDMEASURE ( ),
USERELATIONSHIP ( Dim_MergeDataSource[DATA_SOURCE], Fact_Sales[MERGEDATA_FLAG_MKT] ),
Fact_Sales[MERGEDATA_FLAG_DTP_NOROC] = 1,
KEEPFILTERS ( Fact_Sales[MERGED_DATA_DTP_OTHERS] <> "2" ),
KEEPFILTERS ( Fact_Sales[DTP_FLAG] <> 1 ) // 筛选city dtp不参与计算
,
KEEPFILTERS ( Fact_Sales[EGFR_FLAG] = 0 )
),
// 不筛选city dtp参与计算
( ISFILTERED ( Dim_Org ) || ISFILTERED ( Dim_Geo ) || _isfilter ),
CALCULATE (
SELECTEDMEASURE ( ),
USERELATIONSHIP ( Dim_MergeDataSource[DATA_SOURCE], Fact_Sales[MERGEDATA_FLAG_MKT] ),
Fact_Sales[MERGEDATA_FLAG_DTP_NOROC] = 1,
KEEPFILTERS ( Fact_Sales[MERGED_DATA_DTP_OTHERS] <> "2" ),
KEEPFILTERS ( Fact_Sales[EGFR_FLAG] = 0 )
),
// 筛选city dtp不参与计算
_isfilter_city,
CALCULATE (
SELECTEDMEASURE ( ),
USERELATIONSHIP ( Dim_MergeDataSource[DATA_SOURCE], Fact_Sales[MERGEDATA_FLAG_CHAP_DTP_NOAIA] ),
KEEPFILTERS ( Fact_Sales[MERGED_DATA_DTP_OTHERS] <> "2" ),
KEEPFILTERS ( Fact_Sales[DTP_FLAG] <> 1 ) // 筛选city dtp不参与计算
,
KEEPFILTERS ( Fact_Sales[EGFR_FLAG] = 0 )
),
// 不筛选city dtp参与计算
CALCULATE (
SELECTEDMEASURE ( ),
USERELATIONSHIP ( Dim_MergeDataSource[DATA_SOURCE], Fact_Sales[MERGEDATA_FLAG_CHAP_DTP_NOAIA] ),
KEEPFILTERS ( Fact_Sales[MERGED_DATA_DTP_OTHERS] <> "2" ),
KEEPFILTERS ( Fact_Sales[EGFR_FLAG] = 0 )
)
),
ISFILTERED ( Dim_Market ) || ISFILTERED ( Dim_BrandDefaultMKT )
|| ISFILTERED ( Dim_MarketTA[TA] ),
CALCULATE (
SWITCH (
TRUE ( ),
// 筛选city dtp不参与计算
( OR ( ISFILTERED ( Dim_Org ), ISFILTERED ( Dim_Geo ) )
|| _isfilter )
&& AND (
NOT ISFILTERED ( Dim_Market ),
SELECTEDVALUE ( Dim_MarketTA[TA] ) = "onco"
)
&& [IsMerge]
&& _isfilter_city,
CALCULATE (
SELECTEDMEASURE ( ),
KEEPFILTERS ( Dim_MergeDataSource[DATA_SOURCE] <> "DTP" ),
USERELATIONSHIP ( Dim_MergeDataSource[DATA_SOURCE], Fact_Sales[MERGEDATA_FLAG_MKT] ),
Fact_Sales[MERGEDATA_FLAG_DTP_NOROC] = 1,
KEEPFILTERS ( Fact_Sales[MERGED_DATA_DTP_OTHERS] <> "2" ),
KEEPFILTERS ( Fact_Sales[DTP_FLAG] <> 1 ) // 筛选city dtp不参与计算
),
// 不筛选city dtp参与计算
( OR ( ISFILTERED ( Dim_Org ), ISFILTERED ( Dim_Geo ) )
|| _isfilter )
&& AND (
NOT ISFILTERED ( Dim_Market ),
SELECTEDVALUE ( Dim_MarketTA[TA] ) = "onco"
)
&& [IsMerge],
CALCULATE (
SELECTEDMEASURE ( ),
KEEPFILTERS ( Dim_MergeDataSource[DATA_SOURCE] <> "DTP" ),
USERELATIONSHIP ( Dim_MergeDataSource[DATA_SOURCE], Fact_Sales[MERGEDATA_FLAG_MKT] ),
Fact_Sales[MERGEDATA_FLAG_DTP_NOROC] = 1,
KEEPFILTERS ( Fact_Sales[MERGED_DATA_DTP_OTHERS] <> "2" ) // ,KEEPFILTERS( Fact_Sales[DTP_FLAG] <>1 )
),
// 筛选city dtp不参与计算
( ISFILTERED ( Dim_Org ) || ISFILTERED ( Dim_Geo ) || _isfilter )
&& _isfilter_city,
CALCULATE (
SELECTEDMEASURE ( ),
USERELATIONSHIP ( Dim_MergeDataSource[DATA_SOURCE], Fact_Sales[MERGEDATA_FLAG_MKT] ),
Fact_Sales[MERGEDATA_FLAG_DTP_NOROC] = 1,
KEEPFILTERS ( Fact_Sales[MERGED_DATA_DTP_OTHERS] <> "2" ),
KEEPFILTERS ( Fact_Sales[DTP_FLAG] <> 1 ) // 筛选city dtp不参与计算
),
// 不筛选city dtp参与计算
( ISFILTERED ( Dim_Org ) || ISFILTERED ( Dim_Geo ) || _isfilter ),
CALCULATE (
SELECTEDMEASURE ( ),
USERELATIONSHIP ( Dim_MergeDataSource[DATA_SOURCE], Fact_Sales[MERGEDATA_FLAG_MKT] ),
Fact_Sales[MERGEDATA_FLAG_DTP_NOROC] = 1,
KEEPFILTERS ( Fact_Sales[MERGED_DATA_DTP_OTHERS] <> "2" )
),
// 筛选city dtp不参与计算
_isfilter_city,
CALCULATE (
SELECTEDMEASURE ( ),
USERELATIONSHIP ( Dim_MergeDataSource[DATA_SOURCE], Fact_Sales[MERGEDATA_FLAG_CHAP_DTP_NOAIA] ),
KEEPFILTERS ( Fact_Sales[MERGED_DATA_DTP_OTHERS] <> "2" ),
KEEPFILTERS ( Fact_Sales[DTP_FLAG] <> 1 ) // 筛选city dtp不参与计算
),
// 不筛选city dtp参与计算
CALCULATE (
SELECTEDMEASURE ( ),
USERELATIONSHIP ( Dim_MergeDataSource[DATA_SOURCE], Fact_Sales[MERGEDATA_FLAG_CHAP_DTP_NOAIA] ),
KEEPFILTERS ( Fact_Sales[MERGED_DATA_DTP_OTHERS] <> "2" )
)
),
KEEPFILTERS (
Dim_Market[MKT_SOURCE] <> "Amivantamab MarketDTP(Quarterly)"
),
KEEPFILTERS (
NOT Dim_Market[MARKET] IN
{
"RE Market",
"Respules Market",
"RE Market (Global)",
"RE Extended Market",
"Pulmicort VBP Benchmark Market",
"TCM Market"
}
)
)
)
column mergedata_5_2
dataType: string
lineageTag: ecc49b49-ac91-4771-b6c5-8d73a0e7def4
summarizeBy: none
sourceColumn: Name
sortByColumn: Ordinal
annotation SummarizationSetBy = Automatic
column Ordinal
dataType: int64
formatString: 0
lineageTag: 5e3db0d8-34b0-4c87-87ee-ad91439771b3
summarizeBy: sum
sourceColumn: Ordinal
annotation SummarizationSetBy = Automatic
annotation TabularEditor_TableGroup = 02_CalGroup