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 )