[英]Ssrs reports Windows 2008
I'm fairly new to SQL and I have been issued my first report to build. 我对SQL还是很陌生,已经发布了我的第一个报告以进行构建。 I have written an SQL query to give me a set of results that I would like to publish in a report.
我编写了一个SQL查询,以提供一组要在报告中发布的结果。
I have unioned about 20 small queries all containing the correct amount of columns. 我联合了大约20个包含正确数量列的小查询。 One column is a misc column with about 15 different descriptions in (this is what I want to count).
一栏是杂项栏,其中包含约15种不同的描述(这是我要数的)。
I have uploaded my data set and now want to be able to choose a cell in my report to bring back a certain description. 我已经上传了数据集,现在希望能够在报告中选择一个单元格以带回一定的描述。
At the minute I'm using 在我使用的那一刻
=count(fields!misc.values)
and it's giving me the whole count, about 200. 总共有200个。
I would like to know if there is any kind of "where clause" (filter) which I can use to state which description results I want to bring back. 我想知道是否可以使用某种“ where子句”(过滤器)来声明要返回的描述结果。
You can use am expression to count the misc.value
you need. 您可以使用am表达式来计算所需的
misc.value
。 It will work like a count using a where clause: 使用where子句将像计数一样工作:
=Sum(iif(Fields!misc.Value ="Some description",1,0))
Example: 例:
For count the FSMethod with MethodOne
as value I used this expression: 为了计算以
MethodOne
作为值的FSMethod,我使用了以下表达式:
=Sum(iif(Fields!FSMethod.Value ="MethodOne",1,0))
Note the expression sums by 1
if the FSMethod.Value
is MethodOne
. 请注意,如果
FSMethod.Value
为MethodOne
则表达式的总和为1
。
For count the rows with FSMethod column with MethodTwo
value. 用于计数具有
MethodTwo
值的FSMethod列的行。
=Sum(iif(Fields!FSMethod.Value ="MethodTwo",1,0))
Let me know if this can help you. 让我知道这是否可以帮助您。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.