这样去定义就可以了



111.rar
left($$$,4)+if(right($$$,2)*1>=10,"Q4",if(right($$$,2)*1>=7,"Q3",if(right($$$,2)*1>=4,"Q2","Q1"
)))
concat(DATE_FORMAT(red.delivery_date,'%Y'),if(DATE_FORMAT(red.delivery_date,'%m')*1>=10,"Q4",if(DATE_FORMAT(red.delivery_date,'%m')*1>=7,"Q3",if(DATE_FORMAT(red.delivery_date,'%m')*1>=4,"Q2","Q1")))) as 季度