我有一张关于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.
更多推荐
发布评论