initial
This commit is contained in:
@@ -0,0 +1,285 @@
|
||||
table Fact_EC
|
||||
lineageTag: 845c7880-4309-4f68-9837-f045b8e7e97c
|
||||
|
||||
column CORP_COD
|
||||
dataType: string
|
||||
lineageTag: a668db12-20d8-4ee0-acf4-954f55754018
|
||||
summarizeBy: none
|
||||
sourceColumn: CORP_COD
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column TA
|
||||
dataType: string
|
||||
lineageTag: c446a3d5-c86c-42ab-b846-dff572432b1b
|
||||
summarizeBy: none
|
||||
sourceColumn: TA
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column YYYYMM
|
||||
dataType: string
|
||||
lineageTag: 093599b9-6967-4d6c-a319-294ff8eb0070
|
||||
summarizeBy: none
|
||||
sourceColumn: YYYYMM
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column YTD
|
||||
dataType: string
|
||||
lineageTag: 2c55e9cc-d334-4ef4-ae22-5d7a0a15593e
|
||||
summarizeBy: none
|
||||
sourceColumn: YTD
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column KPI_NAME
|
||||
dataType: string
|
||||
lineageTag: 5698b3af-64b4-4130-8933-a20f3c6ac9ff
|
||||
summarizeBy: none
|
||||
sourceColumn: KPI_NAME
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column TOTAL_FLAG
|
||||
dataType: string
|
||||
lineageTag: 5ab7419a-e061-4ea5-84dd-43ea5fc4c047
|
||||
summarizeBy: none
|
||||
sourceColumn: TOTAL_FLAG
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column PLATFORM
|
||||
dataType: string
|
||||
lineageTag: f1465c8f-6ac2-41c9-8e22-96fdfbec2935
|
||||
summarizeBy: none
|
||||
sourceColumn: PLATFORM
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column STORE_TYPE
|
||||
dataType: string
|
||||
lineageTag: d69ee30c-840f-4753-bc30-218c575ae182
|
||||
summarizeBy: none
|
||||
sourceColumn: STORE_TYPE
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column DATA_SOURCE
|
||||
dataType: string
|
||||
lineageTag: 30c569e8-4a0e-481b-b6ae-fa94a67593b1
|
||||
summarizeBy: none
|
||||
sourceColumn: DATA_SOURCE
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column KPI_VAL
|
||||
dataType: double
|
||||
lineageTag: b38ccc93-7b2e-493c-8fbc-badf92dcb262
|
||||
summarizeBy: sum
|
||||
sourceColumn: KPI_VAL
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||||
|
||||
column KPI_VAL_LY
|
||||
dataType: double
|
||||
lineageTag: f59043a2-46c8-4d66-93a0-b7e17a651d7e
|
||||
summarizeBy: sum
|
||||
sourceColumn: KPI_VAL_LY
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
annotation PBI_FormatHint = {"isGeneralNumber":true}
|
||||
|
||||
column STR_KPI_VAL
|
||||
dataType: string
|
||||
lineageTag: df1eabdb-354c-4935-b4d9-6c64874ebf61
|
||||
summarizeBy: none
|
||||
sourceColumn: STR_KPI_VAL
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column STR_KPI_VAL_LY
|
||||
dataType: string
|
||||
lineageTag: 0591fffe-ac34-4b14-8eba-7e8d6946aac7
|
||||
summarizeBy: none
|
||||
sourceColumn: STR_KPI_VAL_LY
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column STR_KPI_VOL
|
||||
dataType: string
|
||||
lineageTag: c70b8cdb-745a-422c-bda6-1a808077c53f
|
||||
summarizeBy: none
|
||||
sourceColumn: STR_KPI_VOL
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column STR_KPI_VOL_LY
|
||||
dataType: string
|
||||
lineageTag: 49d96ac3-3828-46e0-b08c-f00212216cb0
|
||||
summarizeBy: none
|
||||
sourceColumn: STR_KPI_VOL_LY
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column DATE_KEY = DATE(LEFT([YYYYMM],4),RIGHT([YYYYMM],2),"01")
|
||||
formatString: General Date
|
||||
lineageTag: 63cb9e80-65f4-49ad-80b3-0dfdb19ff3ac
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column TA_SOURCE = [TA] & [DATA_SOURCE]
|
||||
lineageTag: b6494bc2-4c68-4da1-a58d-a656c6f0483b
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column REGION_TYPE = ""
|
||||
lineageTag: 5fd8a497-e498-4d2f-a4a7-2b03fce76abb
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column AUDIT_KEY = [GEO_KEY] & [DATA_SOURCE] & [REGION_TYPE]
|
||||
lineageTag: 6c252322-0d28-40e2-bf37-3c8ca69e3d02
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column GEO_KEY
|
||||
dataType: string
|
||||
lineageTag: a9632880-7e34-4349-885e-3b8623458cd7
|
||||
summarizeBy: none
|
||||
sourceColumn: GEO_KEY
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column AUDIT_SOURCE = [GEO_KEY] & [DATA_SOURCE]
|
||||
lineageTag: 5ba66bfe-bcdc-4ac4-87fd-755e026f4099
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column PLATFORM_TYPE_SOURCE = [PLATFORM] & [DATA_SOURCE]
|
||||
lineageTag: a58d88e6-fdcd-49c7-8ec6-d412a742ab79
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column STORE_TYPE_SOURCE = [STORE_TYPE] & [DATA_SOURCE]
|
||||
lineageTag: b302af70-386c-4eb5-9659-473aa617fcb1
|
||||
summarizeBy: none
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
column STR_KPI_VAL_EN
|
||||
dataType: string
|
||||
lineageTag: 720cc047-d6ea-439f-b64b-92d94f192236
|
||||
summarizeBy: none
|
||||
sourceColumn: STR_KPI_VAL_EN
|
||||
|
||||
annotation SummarizationSetBy = Automatic
|
||||
|
||||
partition Fact_EC = m
|
||||
mode: import
|
||||
queryGroup: OLD\非首页直取KPI
|
||||
source = ```
|
||||
let
|
||||
Source =
|
||||
Value.NativeQuery(
|
||||
Databricks.Catalogs(
|
||||
ServerAddress, HttpPath, [
|
||||
Catalog = CatalogName,
|
||||
Database = null,
|
||||
EnableAutomaticProxyDiscovery = null,EnableQueryResultDownload="0"
|
||||
]
|
||||
){
|
||||
[Name = CatalogName, Kind = "Database"]
|
||||
}[Data],
|
||||
"
|
||||
with dm_zk_ec_sales_kpi as (
|
||||
SELECT
|
||||
A.CORP_COD,
|
||||
TA,
|
||||
YYYYMM,
|
||||
YTD,
|
||||
GEO_KEY,
|
||||
KPI_NAME,
|
||||
TOTAL_FLAG,
|
||||
PLATFORM,
|
||||
STORE_TYPE,
|
||||
'EC(Monthly)' DATA_SOURCE,
|
||||
SUM(KPI_VAL) KPI_VAL,
|
||||
SUM(KPI_VAL_LY) KPI_VAL_LY,
|
||||
MAX(STR_KPI_VAL) STR_KPI_VAL,
|
||||
MAX(STR_KPI_VAL_LY) STR_KPI_VAL_LY,
|
||||
MAX(STR_KPI_VOL) STR_KPI_VOL,
|
||||
MAX(STR_KPI_VOL_LY) STR_KPI_VOL_LY
|
||||
FROM
|
||||
dm.dm_zk_ec_sales_kpi A
|
||||
GROUP BY
|
||||
A.CORP_COD,
|
||||
TA,
|
||||
YYYYMM,
|
||||
YTD,
|
||||
GEO_KEY,
|
||||
KPI_NAME,
|
||||
TOTAL_FLAG,
|
||||
PLATFORM,
|
||||
STORE_TYPE
|
||||
)
|
||||
,dim_pack AS (
|
||||
SELECT
|
||||
DISTINCT PROD_DES,
|
||||
PROD_DES_C
|
||||
FROM
|
||||
DM.DM_TD_EXTERNAL_PACKINFO --where DATA_SOURCE = 'Retail(Quarterly)'
|
||||
)
|
||||
|
||||
SELECT
|
||||
A.CORP_COD,
|
||||
TA,
|
||||
YYYYMM,
|
||||
YTD,
|
||||
GEO_KEY,
|
||||
KPI_NAME,
|
||||
TOTAL_FLAG,
|
||||
PLATFORM,
|
||||
STORE_TYPE,
|
||||
DATA_SOURCE,
|
||||
KPI_VAL,
|
||||
KPI_VAL_LY,
|
||||
STR_KPI_VAL,
|
||||
STR_KPI_VAL_LY,
|
||||
STR_KPI_VOL,
|
||||
STR_KPI_VOL_LY,
|
||||
case
|
||||
when KPI_NAME NOT in ('incremental_brand', 'top1_brand_val','incrementa2_brand','top2_brand_val') then null
|
||||
when ( SELECT MAX(PROD_DES) from dim_pack B where B.PROD_DES_C = A.STR_KPI_VAL ) is null then A.STR_KPI_VAL
|
||||
ELSE ( SELECT MAX(PROD_DES) from dim_pack B where B.PROD_DES_C = A.STR_KPI_VAL )
|
||||
end as STR_KPI_VAL_EN_1
|
||||
from
|
||||
dm_zk_ec_sales_kpi A
|
||||
"
|
||||
& UsingLimit,
|
||||
null,
|
||||
[
|
||||
EnableFolding = true
|
||||
]
|
||||
),
|
||||
#"Renamed Columns" = Table.RenameColumns(Source,{{"STR_KPI_VAL_EN_1", "STR_KPI_VAL_EN"}}),
|
||||
#"Filtered Rows" = Table.SelectRows(#"Renamed Columns", each [YYYYMM] <> null and [YYYYMM] <> "")
|
||||
in
|
||||
#"Filtered Rows"
|
||||
```
|
||||
|
||||
annotation PBI_ResultType = Table
|
||||
|
||||
annotation PBI_NavigationStepName = Navigation
|
||||
|
||||
annotation TabularEditor_TableGroup = 05_FactTable
|
||||
|
||||
Reference in New Issue
Block a user