Files
MarketAnalysis-Rebuild/External All Channel.SemanticModel/definition/tables/Dim_Platform.tmdl
2026-04-15 10:36:20 +08:00

90 lines
2.2 KiB
Plaintext

table Dim_Platform
lineageTag: 09722c28-8ac3-4435-8ecd-280f532dc58f
column PLATFORM_TYPE
dataType: string
lineageTag: 687c6978-e9d4-41c1-8fd7-c2780a381d65
summarizeBy: none
sourceColumn: PLATFORM_TYPE
annotation SummarizationSetBy = Automatic
column DATA_SOURCE
dataType: string
lineageTag: d3465f97-2b24-4fa1-8e1d-63315621dc49
summarizeBy: none
sourceColumn: DATA_SOURCE
annotation SummarizationSetBy = Automatic
column PLATFORM
dataType: string
lineageTag: 172cc61d-f669-4c4b-bee7-058ad5526aba
summarizeBy: none
sourceColumn: PLATFORM
annotation SummarizationSetBy = Automatic
column PLATFORM_TYPE_SOURCE = [PLATFORM_TYPE] & [DATA_SOURCE]
lineageTag: ddf3b915-ce38-4381-87ef-afc3967ca14f
summarizeBy: none
annotation SummarizationSetBy = Automatic
column PLATFORM_EN = SWITCH([PLATFORM],"京东", "JD", "天猫", "Tmall")
lineageTag: 6c380f91-7840-406e-bb90-3c72029fb864
summarizeBy: none
annotation SummarizationSetBy = Automatic
partition Dim_Platform = m
mode: import
queryGroup: Dim
source = ```
let
Source =
Value.NativeQuery(
Databricks.Catalogs(
ServerAddress, HttpPath, [
Catalog = CatalogName,
Database = null,
EnableAutomaticProxyDiscovery = null,EnableQueryResultDownload="0"
]
){
[Name = CatalogName, Kind = "Database"]
}[Data],
"
SELECT /*+ BROADCAST(B) */
A.DATA_SOURCE,
B.PLATFORM,
CASE
WHEN A.DATA_SOURCE = 'EC(Monthly)' THEN B.PLATFORM
ELSE ''
END AS PLATFORM_TYPE
FROM (
SELECT DISTINCT DATA_SOURCE
FROM DM.dm_tf_ext_unionall_sales
WHERE YYYYMM >= (year(current_date()) - 3) * 100 + 1 -- 过滤下推,减少扫描行数
) A
CROSS JOIN (
SELECT DISTINCT PLATFORM_TYPE AS PLATFORM
FROM DM.dm_tf_ext_unionall_sales
WHERE PLATFORM_TYPE <> ''
) B"
& UsingLimit,
null,
[
EnableFolding = true
]
)
in
Source
```
annotation PBI_ResultType = Table
annotation PBI_NavigationStepName = Navigation
annotation TabularEditor_TableGroup = 04_DimTable