Tableau - 来自每日数据的每周平均值 [英] Tableau - weekly average from daily data
本文介绍了Tableau - 来自每日数据的每周平均值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用 Tableau 8.1.
每日数据如下:
Using Tableau 8.1.
Daily data like this:
Date Sales
1-1-14 $5
1-2-14 $2
...
6-15-14 $15
当然可以汇总到几周
Week 1 $15
Week 2 $12
Week 3 $10
Week 4 $13
等
我想获得每个月的每周平均值
像这样:
I would like to get the weekly average of each month
So like this:
Weekly Average
Month 1 (weekly average of the weekly total sales) ($15+$12+$10+13)/4 = 12.5
Month 2
Month 3
有意义吗?如果您简单地在表格中输入平均值",它会给出每周(或每月)的平均每日价值- 我不想那样.我想要每月每周总计的平均值.
Does that make sense? If ou simply put "average" in the tableau table, it gives the average daily value PER WEEK (or month) < - I don't want that. I want the average of the weekly totals per month.
推荐答案
其实很简单.创建这些计算
Quite simple, actually. Create these calculations
Unique Weeks = COUNTD(DATEPART('week',[Date]))
Weekly Average = sum([Sales])/[Unique Weeks]
然后只需报告周平均值 x 月(或季度或年等)
(注意:有些星期有 <7 天).
Then simply report Weekly Average x Month (or Quarter or Year, etc.)
(Note: Some weeks have < 7 days).
这篇关于Tableau - 来自每日数据的每周平均值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文