case when [指标名] in ('开课收入','开课人次') then
sum([本期分子])
when [指标名] in ('开课量') then
count(distinct [本期分子])
else 0 end
最后结果显示count(distinct [本期分子]) 这里实际上并没有去重,我想知道这个代码哪里有问题?
我做了检验,删掉了distinct 显示数据无变化,
单独把这行摘出来改成count(distinct [本期分子], if([指标名]='开课量',TRUE , NULL))
也没有变化。
求指导解决,感谢~