报表查看器中的CountDistinct [英] CountDistinct in report viewer

查看:78
本文介绍了报表查看器中的CountDistinct的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

我这里有一个案例:


在我的表格中,我想显示以"B"开头的字母的数据计数.
我的示例表达式是这样的:

Hi!

I have a case here:


In my table I want to display the count of my data with letter that starts with "B".
my sample expression is this:

=CountDistinct(IIF(Left(Fields!Letter.Value,1) = "B",Fields!letter.Value,0))



问题是我所有的价值观都被计算在内.结果应该是:
字母B = 2
没有字母B = 1
但在我的情况下,字母B的那些显示3个计数.


请帮忙.
谢谢:)



The problem is all of my values are counted. the result should be:
with letter B = 2
without letter B = 1
but in my case 3 counts are displayed for those with letter B.


please help.
thanks :)

[edit: codeblock styling added]

推荐答案

= Sum(IIF(Left(Fields!Letter.Value,1)="B",1,0))
=Sum(IIF(Left(Fields!Letter.Value, 1) = "B", 1, 0))


这篇关于报表查看器中的CountDistinct的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆