initial
This commit is contained in:
@@ -0,0 +1,138 @@
|
||||
table Dim_Class
|
||||
lineageTag: 5c9e5bd8-bf81-4518-85df-5ca516d61579
|
||||
|
||||
column CLASS
|
||||
dataType: string
|
||||
lineageTag: e9d468f0-e287-44df-9653-c1386fd9c679
|
||||
summarizeBy: none
|
||||
sourceColumn: CLASS
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column DATA_SOURCE
|
||||
dataType: string
|
||||
lineageTag: 01aa8f62-31ef-4a96-a9e6-3cf8b67d614d
|
||||
summarizeBy: none
|
||||
sourceColumn: DATA_SOURCE
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column CLASS_RN
|
||||
dataType: int64
|
||||
formatString: 0
|
||||
lineageTag: a626486b-2a89-4dd2-a496-254ed0597b98
|
||||
summarizeBy: sum
|
||||
sourceColumn: CLASS_RN
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column CLASS_SOURCE = [MARKET] & [CLASS] & [DATA_SOURCE]
|
||||
lineageTag: dd285249-6792-46a7-bfc1-8155f901672c
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column MARKET
|
||||
dataType: string
|
||||
lineageTag: 07163740-aaea-4591-9668-7b6628348d25
|
||||
summarizeBy: none
|
||||
sourceColumn: MARKET
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
partition Dim_Class = 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],
|
||||
"SELECT DISTINCT MARKET,
|
||||
CASE
|
||||
WHEN NVL(A.CLASS, '') = ''
|
||||
OR A.CLASS = 'Others' THEN '-'
|
||||
ELSE UPPER(A.CLASS)
|
||||
END CLASS,
|
||||
A.DATA_SOURCE,
|
||||
NVL(PN.RN, 99) CLASS_RN
|
||||
FROM
|
||||
DM.DM_TD_EXTERNAL_MARKET_PACK_MAPPING A
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
CLASS,
|
||||
row_number() OVER(
|
||||
PARTITION BY 1
|
||||
ORDER BY
|
||||
(
|
||||
CASE
|
||||
WHEN CLASS = '-' THEN 0
|
||||
ELSE SALES_VALUE_CAL
|
||||
END
|
||||
) DESC
|
||||
) RN
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
UPPER(
|
||||
CASE
|
||||
WHEN NVL(CLASS, '') = ''
|
||||
OR CLASS = 'Others' THEN '-'
|
||||
ELSE UPPER(CLASS)
|
||||
END
|
||||
) CLASS,
|
||||
SUM(B.SALES_VALUE_CAL) SALES_VALUE_CAL
|
||||
FROM
|
||||
DM.DM_TD_EXTERNAL_MARKET_PACK_MAPPING A
|
||||
INNER JOIN DM.DM_TF_EXTERNAL_SALES B ON A.PACK_COD = B.PACK_COD
|
||||
AND A.DATA_SOURCE = B.DATA_SOURCE
|
||||
and a.new_code = b.new_code
|
||||
WHERE
|
||||
B.YYYYMM >= (
|
||||
SELECT
|
||||
LEFT(MAX(YYYYMM), 4) * 100 + 1
|
||||
FROM
|
||||
DM.DM_TF_EXTERNAL_SALES
|
||||
WHERE
|
||||
DATA_SOURCE = 'IQVIA-CHPA(Monthly)'
|
||||
)
|
||||
AND B.DATA_SOURCE = 'IQVIA-CHPA(Monthly)'
|
||||
GROUP BY
|
||||
CASE
|
||||
WHEN NVL(CLASS, '') = ''
|
||||
OR CLASS = 'Others' THEN '-'
|
||||
ELSE UPPER(CLASS)
|
||||
END
|
||||
) T
|
||||
) PN ON UPPER(
|
||||
CASE
|
||||
WHEN NVL(A.CLASS, '') = ''
|
||||
OR A.CLASS = 'Others' THEN '-'
|
||||
ELSE UPPER(A.CLASS)
|
||||
END
|
||||
) = PN.CLASS
|
||||
"
|
||||
& UsingLimit,
|
||||
null,
|
||||
[
|
||||
EnableFolding = true
|
||||
]
|
||||
)
|
||||
in
|
||||
Source
|
||||
```
|
||||
|
||||
annotation PBI_ResultType = Exception
|
||||
|
||||
annotation PBI_NavigationStepName = Navigation
|
||||
|
||||
annotation TabularEditor_TableGroup = 04_DimTable
|
||||
|
||||
Reference in New Issue
Block a user