sql("PRODUCTSTAGE_impala","select sum(product_numbers_kpcs) over(partition by rdp_code,solution_source_id,version_num) from tianma_bi.dws_profit_result_sys
where 1=1"+ if(len($RDP_NO)=0,""," and rdp_code in ('"+ $RDP_NO +"')") + if(len($VERSION)=0,""," and version_num in ('"+ $VERSION +"')")
+ if(len($SCHEMA)=0,""," and solution_source_id in ('"+ $SCHEMA +"')") + "and sales_currency='CNY'",1,1)