.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

MDX for Prior Year

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :Sql Server

Hi All,


I have a measure called Actual Hours in my cube. I need to create a calculation in the cube for Budget Hour which needs to be something like

Budget Hour = (Last Year's Actual Hour)*1.25 and when I drill down(to say Month level) it should be Budget Hour = (Last Month's Actual Hour)*1.25 etc.

Any idea how to go about this? Any help would be truly appreciated. Thanks in advance.

View Complete Post

More Related Resource Links

Timeout expired. The timeout period elapsed prior to completion of the operation or the server is no



 I keep getting the following error. I also added time out parameter in the connection stirng and it still did not help. Has any one faced similar issues.

Thanks in adavance.

Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.


Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.]

Editor's Note: A New Year-A Fresh Perspective


The results of our reader survey are in. This month, Howard Dierking shares the takeaways.

Howard Dierking

MSDN Magazine January 2008

Editor's Note: A New Year-A New Vista


Josh Trupin revs the engine to get us all ready for Windows Vista.

Joshua Trupin

MSDN Magazine January 2007

Editor's Note: Celebrating Our 20-Year Milestone


The world of software development is all about milestones. At the lowest level, a programmer has to create a certain set of functions in a fixed amount of time, and is then judged on this performance.

Joshua Trupin

MSDN Magazine January 2005

Calculating Full Year Total

Im creating a sales report in SSRS by pointing it at a cube in SSAS.  Im creating calculated members to aggregate my data in various ways so they can be shown on the report.   I have a FACT table containing sales figures and various dimension tables including a server created time dimension.   Ive managed to create pretty much everthing I need (e.g. Current YTD, Prior year YTD).  What I now need is a full year figure to compare current year sales to.   Below is what Im aiming for i.e. the total of 122712 from 2009 appearing against every month in 2010.   Fiscal Year Fiscal Month Count Full Prior Year sales 2009 Apr-09 9805     May-09 9942     Jun-09 8986     Jul-09 9696     Aug-09 8912     Sep-09 10097     Oct-09 11713     Nov-09 10434     Dec-09 8820     Jan-10 10821     Feb-10 11844     Mar-10 11645     Total 122712   2010 Apr-10 3517 122712   May-10 1669 122712   Jun-10 2518 122712   Jul-10 3306 122712   Ive been bashing my head against a brick wall with this one so any help would be gratefully received!

Timeout error - The timeout period elapsed prior to completion

Hi, I'm using ASP.NET 3.5 (c#) with SQL Server 2008 server. Recently, I started getting error "Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.". After looking at forums for solutions, I added the below common code to my application. protected DbCommand CreateCommand() { SqlCommand sqlCommand = new SqlCommand(); sqlCommand.CommandTimeout = 600; // 10 minutes return sqlCommand; } However, intermittently, I'm still getting the timeout error. I added the logging to see where error is occuring. And found that before executing one of the query, it is giving this error. Now, my assumption is that I should have received this error after runnign query for 600 seconds (10 minutes) since I set it in the above function. But the timeout error is occuring instantaneously within 1 second itself. In the log, I printed one line above & after the query to identify how much time it would take. Surprisingly, the log says that 9:00 AM "Before query execution" & at 9:01 AM "timeout expired...." I would really appreciate if some one can help me out here! Thanks!

Quater and Year(Urgent)

  The following metric values are dependent upon the Completion data parameter.  Actually, a one to one mapping exist.   Metrics Parameter Count of valid credentials earned by Month Completion Date Parameter Current Month Count of valid credentials earned by Quarter Completion Date Parameter (options include) FY-Q1 FY-Q2 FY-Q3 FT-Q4 Count of valid credentials earned FYTD (Oct 1 = FY start) Completion Date Parameter Fiscal Year     how can i create the Multi select and how can i write the query  in dataset for feting the data from data base table .By defalut current month is selectd in multiselect plz let me know

Date format for Year, Year-Month, and Date (Year-Month-Day) where input is not known

I have a requirement to capture historical events in a table. Now some events will have only Year, some Year/Month, and remaining where Date is known. We should be able to store them in the column and be able to sort etc. When publishing the information, we should be able to publish as was the input, Year only, Year-Month only, or Date. I looked at the newer Date data type. I can insert a 4 digit year, but on retrieving it is YYYY-01-01. I do not know if it has input YYYY or YYYY-MM-DD and is indeed a Date or a Year. I am trying to avoid saving the format information in another column or something. For sorting, when records have same Year, I would have another column to do relative sorting... So question is - what are my best options with SQL/Entity Framework combo. And what others have done, when encountering similar - if any. Thanks in advance. --Sharad 

do i need to install .NET Framework 2.0 prior to .NET Framework 3.5?

hello, i need to install on my computer .NET Framework 2.0 and .NET Framework 3.5. .NET Framework 3.5 installs .NET Framework 2.0 SP2. I've searched the web for an answer but i find different opinions. is it ok, to install the 3.5 only (for .net 2.0 applications!!!)? In Windows XP, you have sp3 as an exe file which only upgrades an existing operating system. maybe this is the case with the 2.0 sp2 within the 3.5 installation? everything points to the conclusion that it is ok to install only the 3.5, but the opinions that say otherwise, are making me second guess my instinct. i want to know if it is sufficient to install the 2.0 SP2 (that's in the 3.5 installation) or do i need to install the 2.0 prior to  the sp2. should i write a script like this: start /w dotnet2.0Installation.exe ... start /w dotnet3.5Installation.exe ... or like this: start /w dotnet3.5Installation.exe ...   thank you in advance Udi

How I select Start of week is Friday from date of Year ?

Hello everyone, I am tring to solve How i select Start date is Friday from week? Details for which i want to show I have dtmDate column in a query. from that date i display week of that date as per using (ww,dtmDate) as dtmWeek, and parameters are StartDate & EndDate Suppose I select StartDate as 1/1/2007 & End Date as 12/31/2007   I  do not want to show Output as: Weeks                      Column1          Column2 1/1/2007 (Thuesday)       5                     6 1/2/2007 (Wed)               4                     2 | | 1/5/2007  (Friday)            1                      8 1/6/2007 (Saturday)        7                     

Display the Sum of hours and Month Year using sql Query

Hi,  I have,hours(in varchar),Id in table tbl_x ,i need the sum of hours, monthyear(eg. mar 2010)for the last three months.But with two separate queries i am getting these results.but actually i need in the following format   Month/Year      TotalHours-----------------    ----------------Mar 2010            0400Apr 2010             0450-----------------------------------to get month/Year i am using this querySELECT right(convert(varchar, fromdate, 106), 8) from tbl_x where id='11101' for the sum of hours SELECT SUM(CAST(hours AS INT))AS TOTALHRS FROM tbl_x WHERE id='11101'

report expression for month and year

Hi , Can anyone help me how to write a report expression to get the following out put? Actually this value is the month of previous month. I want to set default month name of the parameter to previous month. This is sep.So it should display like this; Aug - 10 Thanks shamen

Calculate Fiscal Year

HI Experts,  I need help in calculating Fiscal year for given Date.  My fiscal year begins on Oct 1st of every year and I also need to calculate Fiscal Day number of year,  EX: if Date in table is 2010-10-5 then my fiscal year start date should be 2010-10-01 and in my next column I should get day of year as 5    any help is greatly appreciated.  thanks, vishal   

Leep Year Issue

I use the following to get the start of a year period, it might be a fiscal or calandar year.Date.Parse(dtrSurveyData.Item("EndDate1").ToString()).AddDays(-364) I'm just setting a label to this date. If the user enters 12/31/2008 as the enddate1 it shows as 1/2/2008, because it was a leep year. I cannot just use the "1/1/" becuase they might be entering 7/1/2009 as the end of the fiscal year period. Any suggestions on how to handle the leep year?

YEAR --WEEK of the YEAR -- DAY of the WEEK to datetime

Good Evening Can someone help me covert a string in the format YEAR --WEEK of the YEAR(1-53)  -- DAY of the WEEK(1-7)to datetime ie 2010-38-6 is today = '2010-09-17'  valid sql server date nb day numbers are 1 to 7, 1= sunday thanks   David          

Help with Percentage Counts for Prior 3 months

I am trying to calculate the counts of issues for the prior 3 months as a percent of the total of all issues for the prior 3 months. eg. For Sept. I would need the counts for Jun, Jul, Aug for each issue type divided by the total number for all issue types for those 3 months..

For the numerator I used the following and have confirmed that it is correct via SQL queries. 

CREATE MEMBER CURRENTCUBE.[Measures].[PctUniqueIssuesNumerator] AS Aggregate
( {[IssueDate].[ProgMonth].CurrentMember.Lag(3) : [IssueDate].[ProgMonth].CurrentMember.Lag(1)}
    [InvoiceIssueType].[Invoice Issue Type].CurrentMember
    [Measures].[Invc Id Distinct Count - IssueFact]

For the denominator I am using this MDX but doesnt seem to be correct. Should I be doing it differently? I need the sum of [Invc Id Distinct Count - IssueFact] for all issues types for the prior 3 months.

CREATE MEMBER CURRENTCUBE.[Measures].[PctUniqueIssuesDenominator] AS Sum(
    DESCENDANTS([InvoiceIssueType].[Invoice Issue Type].[All],1),
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