20260513_dingban
This commit is contained in:
@@ -89,6 +89,117 @@ SET PACK_COD = if( PACK_COD REGEXP '^[0-9]',right(concat('000000000000',PACK_COD
|
|||||||
|
|
||||||
-- COMMAND ----------
|
-- COMMAND ----------
|
||||||
|
|
||||||
|
INSERT OVERWRITE TABLE dwd.DWD_gnd_ext_retail_tblmarket (
|
||||||
|
market_no,
|
||||||
|
market,
|
||||||
|
bu,
|
||||||
|
atc1_code,
|
||||||
|
atc2_code,
|
||||||
|
atc3_code,
|
||||||
|
atc4_code,
|
||||||
|
nfc1_code,
|
||||||
|
nfc2_code,
|
||||||
|
nfc3_code,
|
||||||
|
pack_code,
|
||||||
|
pack_desc,
|
||||||
|
strength,
|
||||||
|
product_code,
|
||||||
|
product_desc,
|
||||||
|
molecule_code,
|
||||||
|
molecule_desc,
|
||||||
|
not_in_flag,
|
||||||
|
extend_market,
|
||||||
|
extend_market_ratio,
|
||||||
|
corporation_code,
|
||||||
|
corporation_desc,
|
||||||
|
manufacturer_code,
|
||||||
|
manufacturer_desc
|
||||||
|
)
|
||||||
|
select distinct
|
||||||
|
market_no,
|
||||||
|
market,
|
||||||
|
bu,
|
||||||
|
atc1_code,
|
||||||
|
atc2_code,
|
||||||
|
atc3_code,
|
||||||
|
atc4_code,
|
||||||
|
nfc1_code,
|
||||||
|
nfc2_code,
|
||||||
|
nfc3_code,
|
||||||
|
pack_code,
|
||||||
|
pack_desc,
|
||||||
|
strength,
|
||||||
|
product_code,
|
||||||
|
product_desc,
|
||||||
|
molecule_code,
|
||||||
|
molecule_desc,
|
||||||
|
not_in_flag,
|
||||||
|
extend_market,
|
||||||
|
extend_market_ratio,
|
||||||
|
corporation_code,
|
||||||
|
corporation_desc,
|
||||||
|
manufacturer_code,
|
||||||
|
manufacturer_desc
|
||||||
|
from
|
||||||
|
dwd.dwd_gnd_retail_tblmarket_bymonth;
|
||||||
|
|
||||||
|
|
||||||
|
INSERT OVERWRITE TABLE DWD.dwd_gnd_dtp_tblmarket (
|
||||||
|
market_no,
|
||||||
|
market,
|
||||||
|
bu,
|
||||||
|
atc1_code,
|
||||||
|
atc2_code,
|
||||||
|
atc3_code,
|
||||||
|
atc4_code,
|
||||||
|
nfc1_code,
|
||||||
|
nfc2_code,
|
||||||
|
nfc3_code,
|
||||||
|
pack_code,
|
||||||
|
pack_desc,
|
||||||
|
strength,
|
||||||
|
product_code,
|
||||||
|
product_desc,
|
||||||
|
molecule_code,
|
||||||
|
molecule_desc,
|
||||||
|
not_in_flag,
|
||||||
|
extend_market,
|
||||||
|
extend_market_ratio,
|
||||||
|
corporation_code,
|
||||||
|
corporation_desc,
|
||||||
|
manufacturer_code,
|
||||||
|
manufacturer_desc
|
||||||
|
)
|
||||||
|
select distinct
|
||||||
|
market_no,
|
||||||
|
market,
|
||||||
|
bu,
|
||||||
|
atc1_code,
|
||||||
|
atc2_code,
|
||||||
|
atc3_code,
|
||||||
|
atc4_code,
|
||||||
|
nfc1_code,
|
||||||
|
nfc2_code,
|
||||||
|
nfc3_code,
|
||||||
|
pack_code,
|
||||||
|
pack_desc,
|
||||||
|
strength,
|
||||||
|
product_code,
|
||||||
|
product_desc,
|
||||||
|
molecule_code,
|
||||||
|
molecule_desc,
|
||||||
|
not_in_flag,
|
||||||
|
extend_market,
|
||||||
|
extend_market_ratio,
|
||||||
|
corporation_code,
|
||||||
|
corporation_desc,
|
||||||
|
manufacturer_code,
|
||||||
|
manufacturer_desc
|
||||||
|
from
|
||||||
|
dwd.dwd_gnd_dtp_tblmarket_bymonth;
|
||||||
|
|
||||||
|
-- COMMAND ----------
|
||||||
|
|
||||||
update DWD.dwd_gnd_tblmarket_bymonth
|
update DWD.dwd_gnd_tblmarket_bymonth
|
||||||
set starttime = '200001'
|
set starttime = '200001'
|
||||||
where starttime is null or starttime='' or starttime='All';
|
where starttime is null or starttime='' or starttime='All';
|
||||||
|
|||||||
@@ -477,12 +477,12 @@
|
|||||||
"byteLimit": 2048000,
|
"byteLimit": 2048000,
|
||||||
"rowLimit": 10000
|
"rowLimit": 10000
|
||||||
},
|
},
|
||||||
"finishTime": 1778478993866,
|
"finishTime": 1778655803909,
|
||||||
"inputWidgets": {},
|
"inputWidgets": {},
|
||||||
"nuid": "85453796-9385-4a5a-bf20-6bfd459580ae",
|
"nuid": "85453796-9385-4a5a-bf20-6bfd459580ae",
|
||||||
"showTitle": false,
|
"showTitle": false,
|
||||||
"startTime": 1778478991550,
|
"startTime": 1778655745740,
|
||||||
"submitTime": 1778478972052,
|
"submitTime": 1778655744617,
|
||||||
"tableResultSettingsMap": {},
|
"tableResultSettingsMap": {},
|
||||||
"title": ""
|
"title": ""
|
||||||
}
|
}
|
||||||
@@ -494,7 +494,7 @@
|
|||||||
"select\n",
|
"select\n",
|
||||||
"iqvia_lineno,iqvia_pack_code,prod_cod,iqvia_notes,new_pack_flag,is_exists_chpa,product_id,prescription_nature,medicine_type,zk_medicine_tier1,zk_medicine_tier2,zk_medicine_tier3,zk_medicine_tier4,common_name,dosage_form,user_type,category_name,product_name,brand_name,zk_manu_des,zk_corp_des,zk_pack_des,counting_unit_a,dosage_unit_a,unit_a,app1_cod,app1_des,app1_des_c,app2_cod,app2_des,app2_des_c,app3_cod,app3_des,app3_des_c,atc1_cod,atc1_des,atc1_des_c,atc2_cod,atc2_des,atc2_des_c,atc3_cod,atc3_des,atc3_des_c,atc4_cod,atc4_des,atc4_des_c,bio_desc,cmps_cod,cmps_des,cmps_des_c,corp_cod,corp_des,corp_des_c,edl_desc,eth_otc_desc,gene_orig_desc,gqce_desc,manu_cod,manu_des,manu_des_c,mnfl_cod,mnfl_des,nrdl_desc,pack_des,stgh_des,pack_lch,paed_desc,prod_des,prod_des_c,tcm_desc,vbp_desc,unit,counting_unit,dosage_unit,NRDL_ENTRY_DATE,t2.Market,t2.bu,nvl(t2.extend_market_ratio,1) as extend_market_ratio,is_az\n",
|
"iqvia_lineno,iqvia_pack_code,prod_cod,iqvia_notes,new_pack_flag,is_exists_chpa,product_id,prescription_nature,medicine_type,zk_medicine_tier1,zk_medicine_tier2,zk_medicine_tier3,zk_medicine_tier4,common_name,dosage_form,user_type,category_name,product_name,brand_name,zk_manu_des,zk_corp_des,zk_pack_des,counting_unit_a,dosage_unit_a,unit_a,app1_cod,app1_des,app1_des_c,app2_cod,app2_des,app2_des_c,app3_cod,app3_des,app3_des_c,atc1_cod,atc1_des,atc1_des_c,atc2_cod,atc2_des,atc2_des_c,atc3_cod,atc3_des,atc3_des_c,atc4_cod,atc4_des,atc4_des_c,bio_desc,cmps_cod,cmps_des,cmps_des_c,corp_cod,corp_des,corp_des_c,edl_desc,eth_otc_desc,gene_orig_desc,gqce_desc,manu_cod,manu_des,manu_des_c,mnfl_cod,mnfl_des,nrdl_desc,pack_des,stgh_des,pack_lch,paed_desc,prod_des,prod_des_c,tcm_desc,vbp_desc,unit,counting_unit,dosage_unit,NRDL_ENTRY_DATE,t2.Market,t2.bu,nvl(t2.extend_market_ratio,1) as extend_market_ratio,is_az\n",
|
||||||
"from tmp.tmp_ec_temp_market t1\n",
|
"from tmp.tmp_ec_temp_market t1\n",
|
||||||
"left join (select Market,BU,Extend_Market,Extend_Market_Ratio from dwd.dwd_gnd_ec_retail_tblmarket_rule where Extend_Market is not null )t2\n",
|
"left join (select Market,BU,Extend_Market,MAX(Extend_Market_Ratio) from DWD.dwd_gnd_ec_tblmarket_bymonth where Extend_Market is not null group by 1,2)t2\n",
|
||||||
"on t1.Market = t2.Extend_Market\n",
|
"on t1.Market = t2.Extend_Market\n",
|
||||||
"where t2.Market is not null"
|
"where t2.Market is not null"
|
||||||
]
|
]
|
||||||
@@ -2336,10 +2336,7 @@
|
|||||||
"cell_type": "markdown",
|
"cell_type": "markdown",
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"application/vnd.databricks.v1+cell": {
|
"application/vnd.databricks.v1+cell": {
|
||||||
"cellMetadata": {
|
"cellMetadata": {},
|
||||||
"byteLimit": 2048000,
|
|
||||||
"rowLimit": 10000
|
|
||||||
},
|
|
||||||
"inputWidgets": {},
|
"inputWidgets": {},
|
||||||
"nuid": "dc2bbed1-223b-4610-a55f-334e63050e68",
|
"nuid": "dc2bbed1-223b-4610-a55f-334e63050e68",
|
||||||
"showTitle": false,
|
"showTitle": false,
|
||||||
|
|||||||
@@ -478,7 +478,8 @@ FROM
|
|||||||
|
|
||||||
-- COMMAND ----------
|
-- COMMAND ----------
|
||||||
|
|
||||||
-- delete from dm.DM_TF_EXT_UNIONALL_SALES_MAPPING where DATA_SOURCE IN ( 'AIA(Monthly)')--'Retail(Quarterly)','EC(Monthly)'
|
-- DBTITLE 1,测试代码
|
||||||
|
-- delete from dm.DM_TF_EXT_UNIONALL_SALES_MAPPING where DATA_SOURCE IN ( 'CHC(Quarterly)','THC(Quarterly)','Retail(Quarterly)')--'Retail(Quarterly)','EC(Monthly)'
|
||||||
|
|
||||||
-- COMMAND ----------
|
-- COMMAND ----------
|
||||||
|
|
||||||
@@ -536,5 +537,5 @@ SELECT
|
|||||||
FROM
|
FROM
|
||||||
DM_TF_EXT_UNIONALL_SALES_MAPPING
|
DM_TF_EXT_UNIONALL_SALES_MAPPING
|
||||||
|
|
||||||
-- WHERE DATA_SOURCE IN ( 'AIA(Monthly)')--'',
|
-- WHERE DATA_SOURCE IN ( 'CHC(Quarterly)','THC(Quarterly)','Retail(Quarterly)')--'',
|
||||||
-- AND yyyymm>=202501
|
-- AND yyyymm>=202501
|
||||||
|
|||||||
Reference in New Issue
Block a user