-- Databricks notebook source
desc dm.dm_tf_ext_aia_sales

-- COMMAND ----------

select DATA_SOURCE,DTP_FLAG from dm.DM_TF_EXTERANL_SALES_MERGED_DATA_DTP_OTHERS_bymonth
group by DATA_SOURCE,DTP_FLAG

-- COMMAND ----------

select DTP_FLAG,DATA_SOURCE from DM.DM_TF_EXT_RETAIL_DTP_SALES group by DTP_FLAG,DATA_SOURCE
-- order by DATA_SOURCE

-- COMMAND ----------

select DATA_SOURCE,DTP_FLAG from DM.DM_TF_EXT_UNIONALL_SALES group by DATA_SOURCE,DTP_FLAG
order by DATA_SOURCE,DTP_FLAG

-- COMMAND ----------

select DATA_SOURCE,DTP_FLAG,count(*) from DM.dm_tf_ext_unionall_sales_mapping 
group BY DATA_SOURCE,DTP_FLAG
ORDER BY DATA_SOURCE,DTP_FLAG


-- COMMAND ----------

select * from DM.DM_TF_EXT_UNIONALL_SALES_MAPPING 
limit 4

-- COMMAND ----------

select AUDIT_CODE from DM.DM_TF_EXT_CHPA_SALES group by AUDIT_CODE
-- limit 5

-- COMMAND ----------

select * from DM.DM_TD_EXT_CHPA_PACK2MARKET
limit 5
