.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Wrong Grand Total value

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :Sql Server

Hi Guys,

I have the following MDX Script gives me a wrong Grand Total Values.




AS ([Measures].[DC] , [RowType].[Row Type Key].&[6]),



= "#,##0;-#,##0",

View Complete Post

More Related Resource Links

IIF works on calcd member but grand total is wrong


Hi.  I'm working on a conditional piece of mdx that started looking like what you see way below.  The idea is to modify this measure's behavior based on which dimension was chosen without nesting scope statements.  The detail and date hierarchy level numbers look good on Date A but the grand total is 0 when I dice on Date A.  I suspect what was posted at


explains why this happens but the solution given there applies to a different class of problem (I think). 

Can someone help to explain how grand totals etc can be aggregated properly for calc'd measures? I tried multiplying [Whatever Orig] by 1 and even put the calc'd member in a different measure group to no avail.  I also used a raw assignment prior to the calculate that kind of looked like [measures].[Whatever Orig] = IIF(ROOT([Date A]),0,...) ; but that didnt work either.  Eventually there will be more scope statements.


Show grand total running total in GridView Footer

In many scenarios we need to display Running total as well as Grand total in GridView footer. In this post i will try to explain in an easy way that how we can display running total & Grand total in a GridView footer combindly. To explain this solution using an example here i use a sales order report. The report contains all sales order amount in a tabular way. I will use a GridView to display sales order amount and use GridView footer to display Running total & Grand total. Let we have a customer table with id and name column plus an orders table with OrderID,CustomerID,OrderDate & Amount. Now our goal is to show all customers order with amount as well as page wise running total & grand total. Note that running total is necessary when you enable paging in a GridView where as Grand total is always you can consider.

Excel 2003 pivot table - parent showing grand total than the sum of its children

All, In Excel 2003, I have a product hierarchy, for simplistic sake lets say it goes A > B > C > model nbr.  I have filtered on model nbr 1.  I have the product hierarchy in my pivot table and unit cnt as the measure. Starting at level A in the hierarchy I am showing a total unit of 12000, if I drill down to B it still shows 12000, if I drill down to C it shows 100 and if I drill down to model nbr it shows me model nbr 1 with a unit cnt of 100. So my question is why are my parents not filtering the model nbr, it is taking the total for ALL records that have level A as their parent regardless of the model nbr? This does NOT happen in Excel 2007 or when I browse my cube in SSAS.

Tablix - Grand Total not match up

I'm having a problem in my grand totals when using tablix. You can notice that grand totals are not totalling up. Name Code Total  Items No of Users Total  Due % Due Total Completed % Completed Company Units # of Units Health System 00 447,041 5,163 35,422 8% 411,597 92% Test A CEU 2218.75 Test B CEU 4305.5 Test C Hours 22121 Test D ct Hours 15.8 Test E CEU 18.75 Hospitals 01 47,952 511 2,099 4% 45,853 96% Test A CEU 34.25 Test B CEU 136 Test C Hours 1823.25 Non-Health 9999 9,643 658 2,064 21% 7,579 79% Test C CEU 11.5 Test D CEU 17.75 Test E Hours 478 Trainings Test 34 9 22 65% 12 35%     0 Grand Total:    2,408,024 29,331 189,621 8% 2,218,293 92%              

Showing Total and grand total in rdlc

Hi All, I have RDLC report. My Detail report is bringing the data group by the criteria selected. For example I select the criteria Age. so all data with age 11 comes up, then all data with age 12 comes up.Till here I am able to do with stored proc but now what I want is, Say there are 4 rows with age 11,  I want total at the bottom of row to show 4. Then say there are 6 rows with age 12 , At the bottom of 12 age show Total 6. Then Grand total = 10 (4+6 ). How do I achieve this. Any Idea..I want something like (This one sorted by Contact Relationship) Child's Name Age Contact Name Contact Relationship    Agency Date Received Phil Drummond 16 Paul Berryman Family Member DCF 5/22/2008 Lawrence Higgins 1 Fredrick Pleasant Family Member DPH 7/12/2008 Paul Cote 9 Kittie Hawkins Family Member DCF 7/14/2008 Devlin Harris 11 Cheri Glasser Family Member DYS 9/19/2008         Total:  4 Robert Sherman 12 Ron Smith Social Worker DYS 5/3/2008 Brian Montgomery 5 Deice Drumgold Social Worker DYS 6/30/2008 Peter Zimmerman 16 Dale Everson Social Worker DCF 8/21/2008 Sean Johnson 17 Glen Mondale Social Worker DTA 9/17/2008         Total:  4 Roger Donoghue 17 Jesse Venture Unknown DYS 6/30/2008 Kevin Draper 14 Gary Forester Unknown DYS 8/27/2008       &nbs

TopCount dynamic named set + "Others" and "Grand Total"


After going through all available posts, unfortunately I could not find a solution for my problem. I have to create a dynamic named set of with TopCount in a cube that will be accessed with excel 2007. This how the outcome should look like:

Brand_A        $50.00

Brand_Z        $40.00

Brand_B        $10.00

Others           $200.00

Grand Total   $300.00


This is the MDX I used which gives me the top 3 but not the "Others" and the "Grand Total." Just to keep it simple I used top 3 Brands.



Now I am stuck here. After reviewing many posts it seems that Excel 2007 has some issues with handling sets. I found two possible solutions from Raymond-Lee which I think may work.

Solution 1 - Use a named query in dsv

Solution 2 - create a dummy "Others"

Here is the post: http://social.msdn.microsoft.com/Forums/en-US/sqlanalys

disable the sub/grand total column in calculated memebers


Is it possible to disable the sub/grand total column in calculated memebers programmatically. I don't want to display the sub/grand totals in pivot table? I know I can manually disable the sub/ grand totals in pivot table.



calculated member grand total e subtotal problem



I have a cube where I added a  calculated member to extract the last non null value of a measure. This is the script

Create Member CurrentCube.[Measures].[Trascinamento] as


([Data Rif].[Calendario].prevmember,[Measures].[Trascinamento]),


FORMAT_STRING = "Currency", VISIBLE = 1 ,


when viewing the aggregate data in a hierarchy, calculated totals and subtotals are accurate only if all the children of a member are zero at a certain date, and if either has a value, the original total is not zero, and thus is also used in calculated member.


hierarchy |          importo       | trascinamento

100-----10|     null                  |         10000
      ----20 |     null            &nb

Can I display "Grand Total" at the left of a Pivot table?


I have an end user request to display “Grand Total” at the left of a Pivot Table. The client uses Excel 2007 and SSAS 2005


For instance, take a look the grand total at the left of the table


Grand Total       Laptop      Desktop                  Electronics

CA                          1000<

Get the "Grand total" with mdx ?


how can i use the grand total of a measure to calculate with?

I tried something like [Measures].[MeasureName].xxx but i didnt found the correct one.

thank you.

Grand Total problem in SSRS export to PDF



I have one report in which i have to show list of patients, department wise.. so i added one group for Department and patient belonging to respected department fall under that group.. but the requirement is each department (group) should start from new page.. till now everything works fine.. now the point is at the end of report i have to print total no. of patients (Grand total) included in all departments.. but this Grand Total is appearing one new page even if previous page completes half of the page, as i have activted "New Page After" for group property.. how to overcome this problem ?


With Regards.

Sudha Thiru

Display grand total without subtotal



Below is my testcase. I want to display grand total without any sub total.

create table report (name varchar(6),type1 varchar(6),amt int)

insert into report values( 'ABC','BILL',200)

insert into report values( 'DEF','BILL',200)

insert into report values( 'ABC','Query',100)

insert into report values( 'DEF','Query',100)

insert into report values( 

Grand total problem using sum(descedant) function


Hi there:

I use the sum descendant function to sum the employees that has a sale using the following MDX

Employee with sale =

,[Measures].[Employee wSales Count1]

The result is like this if I have all job category selected.

Employee Group

Employee Count

Employee with sale

Wrong Account being used to access files - Help - No Impersonation


I run a simple .aspx website on a Windows Server 2008 machine.

There is NO impersonation, and System.Security.Principal.WindowsIdentity.GetCurrent().Name returns NT AUTHORITY\NETWORK SERVICE, which it the account which the application pool runs. In my web.config, I have <authentication mode="Forms">.


I tried to test the security of the application and server by removing file permissions to the .aspx files. I was greatly worried when the website continued to run without problem (it should not have been able to read the .aspx files).

By turning on file level auditing, I discovered that the .aspx files were being read by the machine$ account (if the machine is called Serv1, then the files would be read by the Serv1$ account, which seems to have access to all files on the local machine).


Is this a security breach or is this behaviour by design ?

Please can somebody assist, as I am worried.

Whats wrong with this statement


Im trying to updated some old ASP pages with some new .net pages and cant seem to get this update statement to work. I need to update the current ASP code below and then once thats working im going to use that same statement in a procedure for all our new .Net pages..

So can anyone see what im doing wrong by inserting the 2nd column to the update statement?

strSqual = "update tas set date_completed='" & TransDate & ", trans_id=" & InsertedTransID & "' where date_completed is null and sercontract_id="& strContractID & " and DATEDIFF(dd,task_due_date,'" & strProcDate & "')<=14"


I am trying to add an extra column to the update, but not sure if the syntax is correct.

Usability in Practice: When Things Go Wrong


This month our usability experts explain what it takes to create informative, useful error messages.

Dr. Charles Kreitzberg and Ambrose Little

MSDN Magazine January 2009

UDP Delivers: Take Total Control Of Your Networking With .NET And UDP


UDP, the lesser-known sibling of TCP, is used for DNS resolution, SNMP network status, Kerberos security, digital media streaming, VoIP, and lots more. Learn how to put UDP to work for you.

Yaniv Pessach

MSDN Magazine February 2006

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend