如何为ssrs 2008中的组过滤器动态分配值(How to assign a value dynamically for a group filter in ssrs 2008)

编程入门 行业动态 更新时间:2024-10-27 04:34:53
如何为ssrs 2008中的组过滤器动态分配值(How to assign a value dynamically for a group filter in ssrs 2008)

我有一张关于SSRS 2008的表格,如:

[QuarterCount] GROUP Volume [Group] [sum(Volume)]

QuarterCount的语法如下:-Q,如果当前月份是1月到3月,则为1,如果当前月份是4月到7月,则为2,依此类推。

“Volume”列按QuarterCount有一个组,此列组有一个过滤器,如:

所以基本上这个专栏将显示属于本季度和去年同一季度的信息。 这个表运行得很好,但我需要做的是使这里的值动态化。 我的意思是,我不应该手动输入值,报告应该根据今天的日期来理解它。 所以我需要这样的东西:

=YEAR(Now()) & "-Q" & IF(MONTH(Now())>0 and MONTH(Now()) <= 3 then "1") IF(MONTH(Now())>3 and MONTH(Now()) <= 6 then "2") IF(MONTH(Now())>6 and MONTH(Now()) <= 9 then "3") IF(MONTH(Now())>9 and MONTH(Now()) <= 12 then "4")

我找不到提供它的正确方法。 任何帮助,我真的很感激。 谢谢!

I have a table on SSRS 2008 like:

[QuarterCount] GROUP Volume [Group] [sum(Volume)]

QuarterCount is a syntax like: -Q, where is 1 if the current month is January to March, 2 if the current month is April to July and so on.

The "Volume" column has a group, by QuarterCount, and this column group has a filter like:

So basically this column will show the info belonging to this quarter and the same quarter last year. This table is working well like that, but what I need to do is to make the values here dynamic. I mean, I should not enter the values manually, the report should understand it based on today's date. So I need something like that:

=YEAR(Now()) & "-Q" & IF(MONTH(Now())>0 and MONTH(Now()) <= 3 then "1") IF(MONTH(Now())>3 and MONTH(Now()) <= 6 then "2") IF(MONTH(Now())>6 and MONTH(Now()) <= 9 then "3") IF(MONTH(Now())>9 and MONTH(Now()) <= 12 then "4")

I could not find the correct way to provide it. Any help I would really appreciate. Thanks!

最满意答案

尝试使用此表达式:

=Split(YEAR(Now()) & "-Q" & Switch(MONTH(Now())<=3,1, MONTH(Now())<=6,2, MONTH(Now())<=9,3, MONTH(Now())<=12,4 ) & "," & YEAR(Now())-1 & "-Q" & Switch(MONTH(Now())<=3,1, MONTH(Now())<=6,2, MONTH(Now())<=9,3, MONTH(Now())<=12,4 ),",")

如果这有帮助,请告诉我。

Try using this expression:

=Split(YEAR(Now()) & "-Q" & Switch(MONTH(Now())<=3,1, MONTH(Now())<=6,2, MONTH(Now())<=9,3, MONTH(Now())<=12,4 ) & "," & YEAR(Now())-1 & "-Q" & Switch(MONTH(Now())<=3,1, MONTH(Now())<=6,2, MONTH(Now())<=9,3, MONTH(Now())<=12,4 ),",")

Let me know if this helps.

更多推荐

本文发布于:2023-07-16 03:59:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1123446.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:过滤器   何为   动态分配   ssrs   filter

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!