initial
This commit is contained in:
@@ -0,0 +1,209 @@
|
||||
table Dim_Market
|
||||
lineageTag: e93174e2-bfca-4d29-bee7-23d72512e194
|
||||
|
||||
column MARKET
|
||||
dataType: string
|
||||
lineageTag: c4b7fc72-7699-4b46-8f69-6e02c3e60a34
|
||||
summarizeBy: none
|
||||
sourceColumn: MARKET
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column DATA_SOURCE
|
||||
dataType: string
|
||||
lineageTag: 9fa25815-cb00-4aed-a575-004f8eb364ca
|
||||
summarizeBy: none
|
||||
sourceColumn: DATA_SOURCE
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column MKT_SOURCE = [MARKET] & [DATA_SOURCE]
|
||||
lineageTag: e349104c-04dc-4a09-817a-9a7e1fde69c4
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column MARKET_DESC
|
||||
dataType: string
|
||||
lineageTag: 744a9e83-2d15-4141-abfc-1710b4eeb2f9
|
||||
summarizeBy: none
|
||||
sourceColumn: MARKET_DESC
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column TA
|
||||
dataType: string
|
||||
lineageTag: a506b979-b8e3-4a1f-9626-b0d4dd9f68d3
|
||||
summarizeBy: none
|
||||
sourceColumn: TA
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column PRD_FLAG
|
||||
dataType: int64
|
||||
formatString: 0
|
||||
lineageTag: 0086fea7-593d-4594-aaaa-25f46deff9b7
|
||||
summarizeBy: sum
|
||||
sourceColumn: PRD_FLAG
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column MKT_FLAG
|
||||
dataType: int64
|
||||
formatString: 0
|
||||
lineageTag: 7363e8b1-577c-4e33-85fb-433d3e497d9b
|
||||
summarizeBy: sum
|
||||
sourceColumn: MKT_FLAG
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column IS_HIDDEN_COUNTY
|
||||
dataType: int64
|
||||
formatString: 0
|
||||
lineageTag: f991248d-5cae-4b11-8178-7d460f1fa073
|
||||
summarizeBy: sum
|
||||
sourceColumn: IS_HIDDEN_COUNTY
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column MERGED_DATA_MARKET
|
||||
dataType: int64
|
||||
formatString: 0
|
||||
lineageTag: 461a059a-38d1-40b1-a812-ea37f7eb7f42
|
||||
summarizeBy: sum
|
||||
sourceColumn: MERGED_DATA_MARKET
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
partition Dim_Market = m
|
||||
mode: import
|
||||
queryGroup: OLD\非首页
|
||||
source = ```
|
||||
let
|
||||
Source =
|
||||
Value.NativeQuery(
|
||||
Databricks.Catalogs(
|
||||
ServerAddress, HttpPath, [
|
||||
Catalog = CatalogName,
|
||||
Database = null,
|
||||
EnableAutomaticProxyDiscovery = null,EnableQueryResultDownload="0"
|
||||
]
|
||||
){
|
||||
[Name = CatalogName, Kind = "Database"]
|
||||
}[Data],
|
||||
"
|
||||
WITH COUNTY_MARKET as (
|
||||
select
|
||||
MARKET,
|
||||
TA_MAP
|
||||
from
|
||||
dm.dm_td_external_market_ta
|
||||
WHERE
|
||||
TA_MAP in ('ONCO', 'RARE')
|
||||
GROUP BY
|
||||
1,
|
||||
2
|
||||
),
|
||||
MERGED_DATA AS (
|
||||
select
|
||||
t1.market
|
||||
from
|
||||
(
|
||||
select
|
||||
MARKET
|
||||
from
|
||||
DM.DM_TD_EXTERNAL_MARKET
|
||||
where
|
||||
DATA_SOURCE = 'AIA(Monthly)'
|
||||
group by
|
||||
1
|
||||
) t1
|
||||
inner join (
|
||||
select
|
||||
MARKET
|
||||
from
|
||||
DM.DM_TD_EXTERNAL_MARKET
|
||||
where
|
||||
DATA_SOURCE = 'IQVIA-CHPA(Monthly)'
|
||||
group by
|
||||
1
|
||||
) t2
|
||||
on t1.market = t2.market
|
||||
)
|
||||
SELECT
|
||||
A.MARKET,
|
||||
A.DATA_SOURCE,
|
||||
A.MARKET_DESC,
|
||||
A.AZ_RELATED TA,
|
||||
INT(A.PRD_FLAG) PRD_FLAG,
|
||||
CASE
|
||||
-------------Retail
|
||||
WHEN
|
||||
A.DATA_SOURCE = 'Retail(Quarterly)'
|
||||
AND A.MARKET IN (
|
||||
'Inhaled Extended Market',
|
||||
'NIAD (Non-Insulin Anti-Diabetic) Market',
|
||||
'Rosuvastatin Market',
|
||||
'BUDESONIDE Market',
|
||||
'EGFR TKI Market',
|
||||
'Anti-HER2 Market',
|
||||
'Anti-HER2 mBC Market',
|
||||
'Fasenra Market',
|
||||
'Severe Asthma',
|
||||
'DAPA Market'
|
||||
)
|
||||
THEN
|
||||
1
|
||||
-------------DTP
|
||||
WHEN
|
||||
A.DATA_SOURCE = 'DTP(Quarterly)'
|
||||
AND A.MARKET IN (
|
||||
'Anti-HER2 Market',
|
||||
'Anti-HER2 mBC Market',
|
||||
'Fasenra/Tezspire Related Market',
|
||||
'Severe Asthma',
|
||||
'Tezspire CRSwNP Market',
|
||||
'CRSwNP Market',
|
||||
'PAM Market'
|
||||
)
|
||||
THEN
|
||||
1
|
||||
WHEN
|
||||
A.DATA_SOURCE = 'Retail(Quarterly)'
|
||||
AND A.MARKET IN ('Respules Market', 'HTN Market')
|
||||
THEN
|
||||
2
|
||||
ELSE 0
|
||||
END MKT_FLAG,
|
||||
CASE
|
||||
WHEN B.TA_MAP = 'RARE' THEN 1
|
||||
WHEN B.TA_MAP = 'ONCO' THEN 2
|
||||
ELSE 0
|
||||
END AS IS_HIDDEN_COUNTY,
|
||||
CASE
|
||||
WHEN C.MARKET IS NOT NULL THEN 1
|
||||
ELSE 0
|
||||
END AS MERGED_DATA_MARKET
|
||||
FROM
|
||||
DM.dm_td_ext_unionall_market A
|
||||
LEFT JOIN COUNTY_MARKET B
|
||||
ON A.MARKET = B.MARKET
|
||||
LEFT JOIN MERGED_DATA C
|
||||
ON A.MARKET = C.MARKET
|
||||
"
|
||||
& UsingLimit,
|
||||
null,
|
||||
[
|
||||
EnableFolding = true
|
||||
]
|
||||
)
|
||||
in
|
||||
Source
|
||||
```
|
||||
|
||||
annotation PBI_ResultType = Table
|
||||
|
||||
annotation PBI_NavigationStepName = Navigation
|
||||
|
||||
annotation TabularEditor_TableGroup = 04_DimTable
|
||||
|
||||
Reference in New Issue
Block a user