Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Analysis Server and Reporting Services (2012)
 Exclude the blank value total in grand total?
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Aged Yak Warrior

524 Posts

Posted - 08/22/2014 :  03:05:11  Show Profile  Reply with Quote
Hi All,

how to exclude the blank values total in grand total.

for example i have two attribites coming for hierarchy like below.

Blank --> 10
Current date --> 20

if the values are like above when drag them into browser grand total is displaying as 30 which is correct. but my requirement is to hide the blank value in browser and should show the only valid values (current date).this i can achive by setting the Hirarchy member property.

after hiding it now my final result is showing like below.

Current date --> 20
Grnad Total --> 30 (which should be 20).

Can some one guide me how to exclude the blank values sum in grand toatal.

Many Thanks in advance!!

James K
Flowing Fount of Yak Knowledge

3873 Posts

Posted - 08/22/2014 :  13:59:17  Show Profile  Reply with Quote
Depends on how you are calculating the grand total now. Assuming you have an expression somewhere in query which is like:
SUM(SomeColumn) as GrandTotal
You would change that to
SUM(CASE WHEN YourColumnThatHasBlanks = '' THEN 0 ELSE SomeColumn END) as GrandTotal
This only a template for you to do what you need to do. Whether you check for empty strings ('') or NULL, or something else depends on your data type and data stored in blank rows for that column.
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.04 seconds. Powered By: Snitz Forums 2000