Tableau api 表-如何将过去12个月的值求和
在Tableau中,我有一张表格,表格如下: 行:得分 列:MYmonth、sumgood、sumbad 这是我使用时的信息:201811月Tableau api 表-如何将过去12个月的值求和,tableau-api,Tableau Api,在Tableau中,我有一张表格,表格如下: 行:得分 列:MYmonth、sumgood、sumbad 这是我使用时的信息:201811月 201611 201612 ... 201801 ... 201811 TOTAL Score Good Bad Good Bad Good Bad ... Good Bad 1 3 0 7 3 6 3 2 1 2 5 1
201611 201612 ... 201801 ... 201811 TOTAL
Score Good Bad Good Bad Good Bad ... Good Bad
1 3 0 7 3 6 3 2 1
2 5 1 1 1 1 1 4 4
3 10 3 2 1 0 3 3 3
我想使用带有“月”列的筛选器,当我筛选月=201811时,按分数显示从201611到201711最后12个月的总计列中坏列和好列的总计
Filter: 201811
Formula: sum(Good) and sum(Bad) since '201611' to '201711'
我想试试DATEDIFF'month',[好],今天试试这个:
If DATEDIFF("month",TODAY(),[Your Date Field],"Sunday") <= -12
then [Your Date Field] else null end
然后将其用作日期列。星期日应该是你认为一周中的第一天。我不确定您的日期字段的名称,因此我将其命名为[您的日期字段]谢谢您的帮助。