使用下拉菜单的Spotfire数据限制

问题描述 投票:0回答:1

我有一个带有两个下拉列表的spotfire仪表板,一个用于Day,一个用于Month,我想用它来限制可视化的数据。

enter image description here

我需要能够同时使用这两个过滤器。我目前有一个用于执行此操作的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以继续评估case语句超过第一个true,或者另一种编写数据限制表达式的方式,该表达式将根据两个下拉列表限制数据。

我不知所措,任何帮助将不胜感激。

expression spotfire tibco
1个回答
1
投票

你可以尝试嵌套案件吗?也许就像这个未经测试的表达:

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
© www.soinside.com 2019 - 2024. All rights reserved.