我正在尝试制作一个显示上传数量的计算字段。我们的 SQL 程序员为我写了这个,因为他不知道 Tableau 的语法:
select cast([date] as DATE) as [date], count(1) as number into #uploads
from files f with(nolock)
inner join files fr with(nolock) on fr.idl=f.id
where f.[id_user_from] is null and f.[id_file_from] is null
group by cast([date] as DATE)
select * from #uploads
order by [date]
这显示按日期分组的上传数量。我想做的是创建一个计算字段,该字段将显示与应用过滤器并使用 CNT(date) 显示上传次数相同的结果。
任何帮助将不胜感激!