yhdata_laeU7hh2
2022-9-9 10:20:36
发布在问答
【数据处理】
计算环比的时候速度慢,有无优化方案?
核心品类占比:
if(param['日期维度']=='2') then
//YTD
sum( if(col['年月' <=param['日期'
and col['年份' == year(param['日期') and col['战略品类']=='核心品类')
then col['NSR' end)
/
sum( if(col['年月' <=param['日期'
and col['年份' == year(param['日期') )
then col['NSR' end)
//MTD
else
sum(
if(col['年月' ==param['日期'and col['战略品类']=='核心品类' )
then col['NSR' end )
/
sum(
if(col['年月' ==param['日期' )
then col['NSR' end )
end
////////////////////////////////////////////////////////////////////////////
上月核心占比:
if(param['日期维度']=='2') then
//YTD
sum( if(col['年月' <=dateAdd( param['日期' ,'month',-1)
and col['战略品类']=='核心品类'
and col['年份' == year(param['日期')) then col['NSR' end)
/
sum( if(col['年月' <=dateAdd( param['日期' ,'month',-1 )
and col['年份' == year(param['日期')) then col['NSR' end)
//MTD
else
sum(if(col['年月' ==dateAdd( param['日期' ,'month',-1) )
and col['战略品类']=='核心品类'
then col['NSR' end)
/
sum(if(col['年月' ==dateAdd( param['日期' ,'month',-1) )
then col['NSR' end)
end
/////////////////////////////////////////////////////////////
核心占比环比:
col['核心品类']- col['上月核心']
|
免责声明:本文不代表本站立场,且不构成任何建议,请谨慎对待。
版权声明:作者保留权利,不代表本站立场。