tableau 筛选后计算
Objectives:
目标:
Background:
背景:
The problem is that it is sometimes necessary to compare data from the current business day to the prior business day. The existing “yesterday” filter works if the business operates seven days a week or if the report is generated Tuesday through Friday. However, if the report is generated on Monday and the business did not have any data from the weekend, then no data is returned in the report.
问题在于,有时有必要比较当前工作日和前一个工作日的数据。 如果企业每周运行7天,或者如果报表是从星期二到星期五生成的,则现有的“昨天”过滤器将起作用。 但是,如果报表是在星期一生成的,而企业在周末没有任何数据,则报表中不会返回任何数据。
To work around this issue, it is necessary to create some calculated fields to figure out the current business day and the previous business day. After finding those dates, it is necessary to filter the data based on the prior business day.
要变通解决此问题,有必要创建一些计算的字段来计算当前工作日和上一个工作日。 找到这些日期之后,有必要根据前一个工作日过滤数据。
Logic:
逻辑: