QlikView 列表框问题

发布于 2025-01-08 07:35:46 字数 883 浏览 1 评论 0原文

我想要一个显示以下内容的列表框: YYYY: WeekNumber - Date

Date 部分使用广播日历(从星期日开始,因此 2012 年的第一周实际上是星期一 12/26/2011代码>)。

这需要有条件:

  • 如果选择的年份是当前年份,则仅显示最新的“broadcastMonday”,在本例中为第 9 周 (2/20/2012)。然后一路回溯到上一年到 2011 年的第 1 周,实际上是 12/27/2010

  • 如果所选年份小于当前年份,则仅显示该年份的全部内容加上上一年的所有内容。

对于显示正确的信息,列表框的以下表达式对我来说工作得很好,但是当我单击列表中的某个项目时,它不会选择它:

=If([Year]=year(ReloadTime()),if(left(BroadcastPeriod2,4)>=[Prior Year]
and BroadcastWeekStart2<ReloadTime(),(left(BroadcastPeriod2,4) & ' : ' & 
BroadCastWeek2 & '-' & date(BroadcastWeekStart2)),),if(left(BroadcastPeriod2,4)>=
[Prior Year] and left(BroadcastPeriod2,4)<=([Year]),left(BroadcastPeriod2,4) & ' : '
& BroadCastWeek2 & '-' & date(BroadcastWeekStart2),)) 

I want to have a list box that shows the following:
YYYY: WeekNumber - Date

The Date part is using a Broadcast Calendar (starts on Sundays, so week 1 of 2012 is actually Monday 12/26/2011).

This needs to be conditional:

  • If the year selected is the current year, only show through the latest "broadcastMonday" which in this case is Week 9 (2/20/2012). Then go back all the way through the prior year to week 1 of 2011, which is actually 12/27/2010.

  • If the year selected is less than the current year, only show all of that year plus all of the prior year.

The following expression for the List Box is working just fine for me with respect to displaying the right information, but when I click an item in the list it doesn't select it:

=If([Year]=year(ReloadTime()),if(left(BroadcastPeriod2,4)>=[Prior Year]
and BroadcastWeekStart2<ReloadTime(),(left(BroadcastPeriod2,4) & ' : ' & 
BroadCastWeek2 & '-' & date(BroadcastWeekStart2)),),if(left(BroadcastPeriod2,4)>=
[Prior Year] and left(BroadcastPeriod2,4)<=([Year]),left(BroadcastPeriod2,4) & ' : '
& BroadCastWeek2 & '-' & date(BroadcastWeekStart2),)) 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

流年里的时光 2025-01-15 07:35:46

我认为答案是要么在加载中执行(连接字段),要么使用表格而不是输入框。

I think the answer is to either do it in the load (concatenating the fields) or to use a table instead of the input box.

浅浅 2025-01-15 07:35:46

我会尝试计算加载脚本中列表框的值。我在比较集合分析中的 StartMonth 值时遇到了困难,可以通过在加载时预先计算值来解决这个问题。

Qlikview 有条件聚合中做了类似的事情

I would try to calculate the value for the listbox in the loadscript. I had trouble comparing StartMonth values in set analysis and could come around this by pre-calculating the values at load time.

Did something similar in Qlikview aggration with conditions

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文