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

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

IIF works on calcd member but grand total is wrong

Posted By:      Posted Date: May 22, 2011    Points: 0   Category :

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.


View Complete Post

More Related Resource Links

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

Wrong Grand Total value


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",

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.

How do I create a calculated member for daily total revenue?

Hi everyone! I'm new to MDX and I can't figure out how to create a working calculated member. Here's business background: There are 2 measures in the cube - a and b. The formula for Total Revenue is a - b - $1000 ( don't ask me why =), 1000 is being subtracted from each day's Total Revenue - a ball park adjustment for something) My calculated member [Measures]. [Total Revenue] looks like this Case     When IsEmpty([Measures].[a]- [Measures].[b])     Then null     Else [Measures].[a]- [Measures].[b]-1000 Unfortunately this calculated member doesn't work correctly, it subtracts $1000 from everywhere and not from the intersection of [Dim Calendar].[HierarchyTime].[Day] and Total Revenue. How do I make it work in accordance with business logic? The objective is to adjust Total Revenue by subtracting $1000 for each day.  Thanks in advance!    

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

Percent of Total for Each Member in a Dimension Across Another Dimension


I've got a particularly nasty problem that I've been pounding my head against that I hope someone has encountered and can help me with.  I have a hospital cube that has a Hospital dimension and a Service Line Dimension (among others).  Service Lines are such things like General Medical, Surgical, Cardiology (there are 16 total).  Each member hospital in the Hospital dimension will have Discharges associated with each Service Line.  I'm trying to construct a percent of total calculation for each Hospital and Service Line, so I can look at the percent of total of each Service Line across Hospitals.  I'm trying to create a report in SSRS based off this cube.  Here's what the dimensions look like:

Hospital Name1    General Medical
Hospital Name2    General Medical
Hospital Name3    General Medical

What I want to do is calculate the percent of total of each hospital's Service Lines, using the total for each Service Line across hospitals.  This will show the contribution of a Service Line at a specific Hospital to the overall total for that Service Line for all Hospitals.  Here's the MDX I've been working with that does not work the way I want:

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.



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.

Question regarding Calculated Member Grand Totals


I have a Calculated Measure that was inherited. The logic is:



"[Time].[Time Hierarchy].[Month].&["

+ VBA!CStr(year ([ForecastMonth].[Month].

CurrentMember.Properties("Key0")) )

+ "]&["

+ VBA!Cstr(Month([ForecastMonth].[Month].


+ "]"

),[Measures].[Regular Cases])

If the [ForecastMonth].[Forecast Month].[Month] is assigned

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

svcutil ( wrong code) and add service reference (works smoothly)


Hi all,

I have a web service at java and I want to consume it with wcf. When I use add service reference to create the proxy everything works ok! When I tried to generate the proxy with svcutil it's generates me two files (*.cs and app.config) which I think is all I need. But nothing works, no errors but when I try to call the services I get nothing!!! But in the case you can't use add service reference (like an authenticated scenario which is the next step for me) what can I do? Why is this happening?Can someone help me?


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