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.

 All Forums
 SQL Server 2005 Forums
 Analysis Server and Reporting Services (2005)
 Show blank instead of Zero of Expression field

Author  Topic 

vicky0382
Starting Member

3 Posts

Posted - 2009-06-01 : 10:00:17
I Want to Show blank instead of Zero value of Expression field.

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2009-06-01 : 10:01:57
select case exp when 0 then '' else exp end as col1 from table


Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-06-01 : 11:26:25
quote:
Originally posted by senthil_nagore

select case exp when 0 then '' else exp end as col1 from table


Senthil.C
------------------------------------------------------
[Microsoft][ODBC SQL Server Driver]Operation canceled


If exp is of INT datatype, still you will get 0 as output

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Annakonda
Starting Member

17 Posts

Posted - 2009-07-10 : 09:07:56
[[/quote]
If exp is of INT datatype, still you will get 0 as output

[/quote]
Then solution could be to make the font color conditionally dependent on the cell value.
Smth. like If (value=0 then "Transparent" else "Black") in the cell properties.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-07-10 : 09:22:10

Well. Is there any property like "suppress zero values"?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

Annakonda
Starting Member

17 Posts

Posted - 2009-07-10 : 09:31:51
quote:
Originally posted by madhivanan


Well. Is there any property like "suppress zero values"?



I was looking for it many times and couldn't find. Perhaps it doesn't seem possible because not always zero cell means zero line. You can't suppress a line with zero's if there is at least 1 non-zero value. Am I wrong?
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-07-11 : 01:43:08
quote:
Originally posted by Annakonda

quote:
Originally posted by madhivanan


Well. Is there any property like "suppress zero values"?



I was looking for it many times and couldn't find. Perhaps it doesn't seem possible because not always zero cell means zero line. You can't suppress a line with zero's if there is at least 1 non-zero value. Am I wrong?


I meant to supress a field only

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-07-12 : 04:17:03
quote:
Originally posted by Annakonda

quote:
Originally posted by madhivanan


Well. Is there any property like "suppress zero values"?



I was looking for it many times and couldn't find. Perhaps it doesn't seem possible because not always zero cell means zero line. You can't suppress a line with zero's if there is at least 1 non-zero value. Am I wrong?


you can change color based on zero value. just give expression for font color property as
=IIF(Me.Value=0,"Red","Black")
Go to Top of Page

Satyajeet
Starting Member

1 Post

Posted - 2009-09-02 : 04:38:08
case convert(varchar(10),<expression>) when '0' then '' else convert(varchar(10),<expression>) end
Go to Top of Page

rohitkumar
Constraint Violating Yak Guru

472 Posts

Posted - 2009-09-02 : 09:32:51
why cant you use format to do it, use this in field format

#,##0.00;-#,##0.00
Go to Top of Page

the_justin
Starting Member

19 Posts

Posted - 2009-09-03 : 21:30:28
i have the same requirement, and i change the font color to white (since my background color is white) if value is 0
Go to Top of Page

rohitkumar
Constraint Violating Yak Guru

472 Posts

Posted - 2009-09-08 : 11:08:22
and what do you do while exporting the report to an excel file?
Go to Top of Page

aweisser
Starting Member

1 Post

Posted - 2011-06-21 : 23:29:13
quote:
Originally posted by rohitkumar

why cant you use format to do it, use this in field format

#,##0.00;-#,##0.00



I've used:
#;-#;

for hiding integers when they're 0.

See [url]http://msdn.microsoft.com/en-us/library/0c899ak8.aspx#SectionSeparator[/url]
Go to Top of Page
   

- Advertisement -