如何在画面上制作额外的过滤器
how to make additional filters on tableau
这是这个问题的下一部分。
我有一个table这样的
order_id | user_id | createdAt | transaction_amount
order_id为交易id,user_id为用户,createdAt为日期,transaction_amount为每个id订单的交易。
之前的问题,我想根据参数找出符合我条件的用户(感谢@Anil的解答)
这个计算字段是基于@Anil的解决方案
{Fixed [User Id]: sum(
if [Created At]<=[END_DATE] then 1 else 0 end)}>=2
AND
{FIXED [User Id]: sum(
IF [Created At]<=[END_DATE] AND
[Created At] >= [START_DATE] THEN 1 ELSE 0 END)}>=1
这是我想要的用户条件,并有如下解决方案:
1. the users are doing transaction before last date in range ('2020-01-31') and atleast doing more than 1 transaction
2. and the users are at least doing 1 transaction in date range ('2020-01-01' until '2020-01-31')
所以这是符合这个条件的用户的例子
您看到用户符合此条件,因为 user_id 5615 有 2 笔交易在范围内和超出范围日期,并且它符合条件,
问题是,条件只是找出符合条件的user_id,但是如何添加过滤器,所以我可以过滤范围内的交易用户,所以user_id 5615只统计范围内的交易(2020年1月9日),不统计2017年9月21日的交易
最后我根据这个网站找到了答案https://kb.tableau.com/articles/howto/creating-a-filter-for-start-and-end-dates-parameters
所以我用这个计算字段
[Created At] >= [START_DATE] AND [Created At] <= [END_DATE]
并转换为 true,这样只会显示范围内匹配的所选内容
这是这个问题的下一部分。
我有一个table这样的
order_id | user_id | createdAt | transaction_amount
order_id为交易id,user_id为用户,createdAt为日期,transaction_amount为每个id订单的交易。
之前的问题,我想根据参数找出符合我条件的用户(感谢@Anil的解答)
这个计算字段是基于@Anil的解决方案
{Fixed [User Id]: sum(
if [Created At]<=[END_DATE] then 1 else 0 end)}>=2
AND
{FIXED [User Id]: sum(
IF [Created At]<=[END_DATE] AND
[Created At] >= [START_DATE] THEN 1 ELSE 0 END)}>=1
这是我想要的用户条件,并有如下解决方案:
1. the users are doing transaction before last date in range ('2020-01-31') and atleast doing more than 1 transaction
2. and the users are at least doing 1 transaction in date range ('2020-01-01' until '2020-01-31')
所以这是符合这个条件的用户的例子
您看到用户符合此条件,因为 user_id 5615 有 2 笔交易在范围内和超出范围日期,并且它符合条件,
问题是,条件只是找出符合条件的user_id,但是如何添加过滤器,所以我可以过滤范围内的交易用户,所以user_id 5615只统计范围内的交易(2020年1月9日),不统计2017年9月21日的交易
最后我根据这个网站找到了答案https://kb.tableau.com/articles/howto/creating-a-filter-for-start-and-end-dates-parameters
所以我用这个计算字段
[Created At] >= [START_DATE] AND [Created At] <= [END_DATE]
并转换为 true,这样只会显示范围内匹配的所选内容