使用下拉菜单限制 Spotfire 数据
Spotfire Data Limiting using Dropdowns
我有一个带有两个下拉列表的 spotfire 仪表板,一个用于日,一个用于月,我想用它来限制可视化的数据。
我需要能够同时使用两个过滤器。我目前写了一个 case 语句来执行此操作,但是 case 语句在默认情况下会在表达式达到 true 语句时停止计算表达式。
例如下面,我在顶部有 MonthSelector 的语句,它不会继续评估 DaySelector。
case
when "${MonthSelector}"="all" then [Month] <> ''
when "${MonthSelector}"<>"all" then [Month] = "${MonthSelector}"
when "${DaySelector}"="all" then [Week_Day] <> ''
when "${DaySelector}"="WeekDay" then [Week_Day] <> 'Saturday' and [Week_Day] <> 'Sunday'
when "${DaySelector}"="WeekEnd" then [Week_Day] = 'Saturday' OR [Week_Day] = 'Sunday'
when "${DaySelector}"<>"WeekEnd" AND "${DaySelector}"<>"WeekDay" AND "${DaySelector}"<>"all" then [Week_Day] = "${DaySelector}"
else false end case
我需要帮助以某种方式让 spotfire 继续评估超过第一个 true 的 case 语句,或者以另一种方式编写数据限制表达式,该表达式将基于两个下拉列表限制数据。
我很茫然,任何帮助将不胜感激。
你能尝试嵌套案例吗?也许喜欢这个未经测试的表达:
case
when "${MonthSelector}"="all" then case
when "${DaySelector}"="all" then [Week_Day] <> '' and [Month] <> ''
when "${DaySelector}"="WeekDay" then [Week_Day] <> 'Saturday' and [Week_Day] <> 'Sunday' and [Month] <> ''
when "${DaySelector}"="WeekEnd" then [Week_Day] = 'Saturday' OR [Week_Day] = 'Sunday' and [Month] <> ''
when "${DaySelector}"<>"WeekEnd" AND "${DaySelector}"<>"WeekDay" AND "${DaySelector}"<>"all" then [Week_Day] = "${DaySelector}" and [Month] <> ''
else false
end
when "${MonthSelector}"<>"all" then case
when "${DaySelector}"="all" then [Week_Day] <> '' and [Month] = "${MonthSelector}"
when "${DaySelector}"="WeekDay" then [Week_Day] <> 'Saturday' and [Week_Day] <> 'Sunday' and [Month] = "${MonthSelector}"
when "${DaySelector}"="WeekEnd" then [Week_Day] = 'Saturday' OR [Week_Day] = 'Sunday' and [Month] = "${MonthSelector}"
when "${DaySelector}"<>"WeekEnd" AND "${DaySelector}"<>"WeekDay" AND "${DaySelector}"<>"all" then [Week_Day] = "${DaySelector}" and [Month] = "${MonthSelector}"
else false
end
else false
end
我有一个带有两个下拉列表的 spotfire 仪表板,一个用于日,一个用于月,我想用它来限制可视化的数据。
我需要能够同时使用两个过滤器。我目前写了一个 case 语句来执行此操作,但是 case 语句在默认情况下会在表达式达到 true 语句时停止计算表达式。
例如下面,我在顶部有 MonthSelector 的语句,它不会继续评估 DaySelector。
case
when "${MonthSelector}"="all" then [Month] <> ''
when "${MonthSelector}"<>"all" then [Month] = "${MonthSelector}"
when "${DaySelector}"="all" then [Week_Day] <> ''
when "${DaySelector}"="WeekDay" then [Week_Day] <> 'Saturday' and [Week_Day] <> 'Sunday'
when "${DaySelector}"="WeekEnd" then [Week_Day] = 'Saturday' OR [Week_Day] = 'Sunday'
when "${DaySelector}"<>"WeekEnd" AND "${DaySelector}"<>"WeekDay" AND "${DaySelector}"<>"all" then [Week_Day] = "${DaySelector}"
else false end case
我需要帮助以某种方式让 spotfire 继续评估超过第一个 true 的 case 语句,或者以另一种方式编写数据限制表达式,该表达式将基于两个下拉列表限制数据。
我很茫然,任何帮助将不胜感激。
你能尝试嵌套案例吗?也许喜欢这个未经测试的表达:
case
when "${MonthSelector}"="all" then case
when "${DaySelector}"="all" then [Week_Day] <> '' and [Month] <> ''
when "${DaySelector}"="WeekDay" then [Week_Day] <> 'Saturday' and [Week_Day] <> 'Sunday' and [Month] <> ''
when "${DaySelector}"="WeekEnd" then [Week_Day] = 'Saturday' OR [Week_Day] = 'Sunday' and [Month] <> ''
when "${DaySelector}"<>"WeekEnd" AND "${DaySelector}"<>"WeekDay" AND "${DaySelector}"<>"all" then [Week_Day] = "${DaySelector}" and [Month] <> ''
else false
end
when "${MonthSelector}"<>"all" then case
when "${DaySelector}"="all" then [Week_Day] <> '' and [Month] = "${MonthSelector}"
when "${DaySelector}"="WeekDay" then [Week_Day] <> 'Saturday' and [Week_Day] <> 'Sunday' and [Month] = "${MonthSelector}"
when "${DaySelector}"="WeekEnd" then [Week_Day] = 'Saturday' OR [Week_Day] = 'Sunday' and [Month] = "${MonthSelector}"
when "${DaySelector}"<>"WeekEnd" AND "${DaySelector}"<>"WeekDay" AND "${DaySelector}"<>"all" then [Week_Day] = "${DaySelector}" and [Month] = "${MonthSelector}"
else false
end
else false
end