在一个参数问题上过滤具有不同日期的多个视图
Filter multiple views with different dates on one parameter issue
我有两个指标:rep_id
、user_id
我有三个维度:rep_onboard_date
、user_application_date
、user_enrollment_date
我创建了一个名为 "Launch Date" 的参数,它是一个等于 1/1/2018 的日期。请注意,我有几年前的数据。
我有以下三种看法:
1) 列 = month(rep_onboard_date)
, 行=cntd(rep_id)
2) 列 = month(user_application_date)
, 行=cntd(user_id)
3) 列 = month(user_enrollment_date)
, 行=cntd(user_id)
我想在仪表板上创建一个过滤器 - 过滤所有 "Launch Date" 和 post "Launch Date".
我尝试根据 http://kb.tableau.com/articles/howto/creating-a-filter-for-start-and-end-dates-parameters 创建三个计算字段,所以我创建了:
Onboard_Date = [rep_onboard_date]>=[发布日期]
Application_Date = [user_application_date]>=[发布日期]
Enrollment_Date = [user_enrollment_date]>=[发布日期]
但是我只能添加一个或另一个(或两者)作为过滤器——这不是我要找的。
请注意,使用 "or" 语句将这些添加到一个过滤器中是行不通的,因为当设置 filter=True 时,我仍然会在启动日期之前获得数据。
非常感谢任何帮助!
我的建议是添加一个过滤器并将这些过滤条件添加为计算字段中的 if 语句,这将类似于从数据库中获取数据后在 tableau 中进行处理,而不是直接在数据库上工作。
以防万一,如果您想应用为过滤器,则取 3 张纸并单独应用过滤器,然后在仪表板中合并这些纸。
编辑---------------------------------------- ----------------------
创建 3 个计算字段:
第一个计算字段:
if [rep_onboard_date]>=[parameter.Launch Date]
then table.field
第 2 个计算字段
if [user_application_date]>=[parameter.Launch Date]
then table.field
第三个计算字段
if [user_enrollment_date]>=[parameter.Launch Date]
then table.field
一个条件是启动日期应该是参数然后使用启动日期创建一个带有参数的计算字段 select true 通过放置在过滤器上:
table.launch date> parameter.launch date
我有两个指标:rep_id
、user_id
我有三个维度:rep_onboard_date
、user_application_date
、user_enrollment_date
我创建了一个名为 "Launch Date" 的参数,它是一个等于 1/1/2018 的日期。请注意,我有几年前的数据。
我有以下三种看法:
1) 列 = month(rep_onboard_date)
, 行=cntd(rep_id)
2) 列 = month(user_application_date)
, 行=cntd(user_id)
3) 列 = month(user_enrollment_date)
, 行=cntd(user_id)
我想在仪表板上创建一个过滤器 - 过滤所有 "Launch Date" 和 post "Launch Date".
我尝试根据 http://kb.tableau.com/articles/howto/creating-a-filter-for-start-and-end-dates-parameters 创建三个计算字段,所以我创建了:
Onboard_Date = [rep_onboard_date]>=[发布日期]
Application_Date = [user_application_date]>=[发布日期]
Enrollment_Date = [user_enrollment_date]>=[发布日期]
但是我只能添加一个或另一个(或两者)作为过滤器——这不是我要找的。
请注意,使用 "or" 语句将这些添加到一个过滤器中是行不通的,因为当设置 filter=True 时,我仍然会在启动日期之前获得数据。
非常感谢任何帮助!
我的建议是添加一个过滤器并将这些过滤条件添加为计算字段中的 if 语句,这将类似于从数据库中获取数据后在 tableau 中进行处理,而不是直接在数据库上工作。
以防万一,如果您想应用为过滤器,则取 3 张纸并单独应用过滤器,然后在仪表板中合并这些纸。
编辑---------------------------------------- ----------------------
创建 3 个计算字段:
第一个计算字段:
if [rep_onboard_date]>=[parameter.Launch Date]
then table.field
第 2 个计算字段
if [user_application_date]>=[parameter.Launch Date]
then table.field
第三个计算字段
if [user_enrollment_date]>=[parameter.Launch Date]
then table.field
一个条件是启动日期应该是参数然后使用启动日期创建一个带有参数的计算字段 select true 通过放置在过滤器上:
table.launch date> parameter.launch date