Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Villanuev
Constraint Violating Yak Guru
478 Posts |
Posted - 2013-11-11 : 22:11:28
|
Hi,I have an SSSRS report that i need to count a column Location Category. Need to display the result out side the table. see below my statement. The result set display is 1 even i dont have any data on this column except an space or blank.LOcation category-------------------PB-L1-01PB-L1-01PB-L1-01PB-L1-01Blank spaceBlank Space--This give me 2, remove the PB-L1-01, this give me 1 using below statement.=CountDistinct(IIF(Fields!LOCATIONCATEGORY.Value <> "",1,0),"DETAIL_DS") |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-11-12 : 01:57:53
|
it should be=CountDistinct(IIF(Fields!LOCATIONCATEGORY.Value <> "",Fields!LOCATIONCATEGORY.Value,Nothing),"DETAIL_DS")------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
Villanuev
Constraint Violating Yak Guru
478 Posts |
Posted - 2013-11-12 : 20:49:23
|
Hi Visakh, thanks for the reply.Under Catetory--Dataaset, Item---DETAIL_DS, then under Values, this is the contents,,First(Fields!LOCATIONCATEGORY.Value, "DETAIL_DS")Try this based on your suggestion but i got an error. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-11-13 : 07:51:11
|
Catetory--Dataaset, Item---DETAIL_DSthats not what code you posted designatesas per that dataset name is DETAIL_DS------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|
|
|