简体   繁体   English

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

[英]Spotfire Data Limiting using Dropdowns

I have a spotfire dashboard with two dropdown lists, one for Day and one for Month, that I want to use to limit the data of visualizations. 我有一个Spotfire仪表板,其中有两个下拉列表,一个用于天,一个用于月,我希望使用它们来限制可视化数据。

在此处输入图片说明

I need to be able to use both filters at the same time. 我需要能够同时使用两个过滤器。 I currently have a case statement written out to do this however case statements by default stop evaluating expressions when they reach a true statement. 我目前写出了一个case语句来执行此操作,但是默认情况下,case语句在达到真值时会停止计算表达式。
For example below, I have the statements for the MonthSelector on top, it does not continue to evaluate past that to the DaySelector. 例如,在下面的示例中,我将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

I need assistance in either somehow getting spotfire to continue evaluating the case statement past the first true, or another way of writing a data limiting expression that will limit data based on both dropdowns. 我需要以某种方式使Spotfire继续评估超出第一个true的case语句的方法,或者以另一种方式编写基于两个下拉列表限制数据的数据限制表达式的方法,需要我的帮助。

I am at a loss, any help will be appreciated. 我很茫然,任何帮助将不胜感激。

Can you try nesting the cases? 您可以尝试嵌套案例吗? Maybe like this untested expression: 也许像这个未经测试的表达式:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM