MDX formulae design

Hi,
I have two measures A and B. i need to calculate another measure C. which is ratio of A and B (A/B).
B is constant for all the combination
My problem is: if we apply more than one member filter from one of the dimension ( Web Analyzer):
I need a formulae like below:
(A for member1+A for member2+A for memebr3+.....)/B
Right now its working like below:
(A for member1+A for member2+A for memebr3+.....)/(B for member1+B for member2+B for memebr3+.....)
As B is a constant, i am loosing the definition of ratio.
Any idea how to implement will be of great help.
TIA

Hi Glenn,
I did that like
Added one measure:
"No Of Filters"
MDX formulae:
IIF(Count(Intersect({[DIMx].CurrentMember}, {Descendants([Gen2 Memeber of DIMx]),Descendants([Another Gen2 Memeber of DIMx])}))=0,0,1)
now what is happening is if i add multiple members as filters from another dimension the values multiplied.
As long as single members i have no problem. once i put multiple members in filter section that count is not correct. its getting multiplied.
Suppose say : 2 members from DIM1, 2 memebrs from DIM2 and 2 members from DIMx then count is becoming as 2*2*2=8;
and i need actually count of number of filters from Dimx that is only 2. Here again i am breaking the defintion of ratio.
Is thers anyway to count how many filters from one dimension?
Again thanks Glenn for oyur input.

Similar Messages

  • MDX formulae reduces application performance

    Hi,
    I have few MDX formulae in my account dimension which is built as per our reporting requirements. But unfortunately having these formulae in greately affecting the performance. It takes 7- 8 minutes to generate a report if I have formulae.
    Can anyone tell me is there anyway I can increase the performance of the application without removing MDX formulae?
    Thanks
    Sharath

    Ok. Let me explain like this:
    Net Income is the highest level made up of below children and grand children.
    Memeber--Hlevel--Parent--
    Description  -
    EAT--H5--
    (Earnings After Tax)
    Tax -
    H4----
    EAT
    EBT--H4EAT--
    (Earnings Before Tax)
    Depreciation--H3--
    EBT
    Interest--H3--
    EBT
    EBIDT--H3EBT--
    (Earnings before Interest, Depreciation and Tax)
    GP--H2EBIDT--
    (Gross Profit)
    REVENUE--H1--
    GP
    COST--H1--
    GP
    In the above structure if EBIDT is a calculated member then I should add formula to both EBT and EAT as per MDX rule even though I can have this done through roll-ups. Other wise EBT and EAT will just return the value of EBIDT and ignores Interest, Depreciation and tax.
    Without formula it takes 25-30 sec. and with formula it takes 500-600 sec. to get the numbers from the report.
    Edited by: Raghavendra Sharath on Mar 20, 2009 6:03 PM

  • UDA and ISUDA not validating in MDX formulaes

    Hello,I need to use ISUDA in a MDX formula to calculate an account in an ASO database. The problem is that I cannot validate this formula:IIF(ISUDA([ORGANIZATION].CurrentMember, "TEST")), 10, 20)It always tell me "Error(1260052) - Syntax error in input MDX query on line 1 at token '"' Calc_Test"Any idea would be greatly appreciated.Thanks in advance,Denis

    I had the same issue.I reported it to the support center and they confirmed that it is a bug. Firstly, EAS does not recognize it as a correct formula and secondly the Server does not interpret it correctly.The bug number is 389881.

  • Less than in MDX Query Designer

    I have a month year parameter like March, 2014. I want to calculate actual for current year and Prior year.
    I have time intelligence build in the cube which will give me Prior year.
    When user select March,2014, I will show data in line chart with 2 series like current year and prior year.
    Current year data will be from Jan 2014 to march 2014 as user select march (not current month which is August,2014).
    But in Prior year series, I need to show data from jan 2013 to Dec 2013.
    I have a dataset right now which gives me current year and prior year full data. I have used ancestor function to get the full year data. How how I restrict data in chart to cut off at Mar 2014 and not show data till Dec 2014.

    Hi!
    Based on your question I assume you expect a result similar to this:
    If your entry parameter is month than and you have Year-Month-Date hierarchy in your cube you could do the following:
    select cnt on 0,
    [Date].[Y-M-D].[Year].members
    on 1 from
    select {[Date].[Y-M-D].[Month].&[14]&[2].parent.prevmember.firstchild:
    [Date].[Y-M-D].[Month].&[14]&[2]}
    on 0 from YOURCUBE)
    This query uses subselect to limit the cube space to date range starting at first month of previous year(firstchild) and ending at your entry date (in my case February 2014)
    So lets explain starting point expression for date range:
    [Date].[Y-M-D].[Month].&[14]&[2].parent.prevmember.firstchild
    [Date].[Y-M-D].[Month].&[14]&[2] - is your entry parameter 
    [Date].[Y-M-D].[Month].&[14]&[2].parent - sets position to [Date].[Y-M-D].[Year].&[2014] (assuming that the direct parent of Month level is Year level. If this is not the case you could use "ancestor" function).
    [Date].[Y-M-D].[Month].&[14]&[2].parent.prevmember -  sets the position to [Date].[Y-M-D].[Year].&[2013]
    [Date].[Y-M-D].[Month].&[14]&[2].parent.prevmember.firstchild   sets the position to January 2013
    This gives you date range starting from January 2013 and ending at February 2014.
    HTH
    Ivan Roguljić

  • Filter issue in MDX query leaving some values empty!

    Hi all,
    In short: I have a report with multiple values such as name of shop, postal code etc. The parameters have no default value and act as "like". If someone enters "krant" he'll get all the shop names that contain "krant" in their
    name etc. 
    Same goes for postal code, if someone enters 2550 he'll get all data for 2550. The problem although is that if a user start with postal code as parameters and leaves the shop name empty, the shop name is not shown in my report! The other way around it works,
    when I enter shop name i'll get all shops + postal code in my report.
    I know this is because POS name cannot be shown in report because it's left blank, but I want my MDX query to be able to give me the POS names even if I only enter postal code.
    Can someone please please look at my query below? I need to add 4 more parameters this way later on too!
    SELECT 
    [Measures].[Sales amount]
     ON COLUMNS, NON EMPTY
    Filter(
                                   [Point of sale].[POS name].AllMembers,
                                   InStr(
                                                   [Point of sale].[POS name].CurrentMember.MEMBER_CAPTION,
                                                   @PAR_POSName
                                   ) > 0
    *Filter(
                                   [Point of sale].[POS postal code].AllMembers,
                                   InStr(
                                                   [Point of sale].[POS postal code].CurrentMember.MEMBER_CAPTION,
                                                  @PAR_POSTAL_CODE
                                   ) > 0
    *[Point of sale].[Client id].[Client id]
    *[Point of sale].[POS id].[POS id]
    *[Point of sale].[POS street].[POS street]
    *[Point of sale].[POS town].[POS town]
    *[Point of sale].[POS housenumber].[POS housenumber]
    ON ROWS
    FROM [mycube]

    Hi Yvanlathem,
    Have you create the parameters in the MDX Query Designer? I haved tested it on my local environment (Microsoft SQL Server 2012 (SP1) - 11.0.3401.0 (X64) Enterprise Edition (64-bit)), we cannot reproduce this issue.
    with
    set subset1
    as
    filter ([Geography].[Geography].[Country].members,
    instr([Geography].[Geography].currentmember.name,@name)>0
    select {} on 0,
    subset1 on 1
    from
    [Adventure Works]
    Reference
    Define Parameters in the MDX Query Designer for Analysis Services (Report Builder and SSRS)
    Regards,
    Charlie Liao
    TechNet Community Support

  • MDX Query Desinger Slow to Respond on a WAN

    We are seeing the MDX Designer take a long time to open and to select filters.  Running a Query is fast, but selecting filters from dimension members that only have 2 to 10 members can take up to a minute to display and the same is true when dragging
    the member into the Filter pane.  Executing the query is not an issue and the returned results even 1000's of rows is fairly quick. 
    raym

    Hi rayishome,
    According to your description, when you using multiple parameters in Filter in MDX Query Designer, it takes long time to execute the query. Right?
    In this scenario, I want to know the version of SSRS you are using. It has reported similar issue in SSRS 2008, and this issue has been released in both SQL 2008 SP1 and SQL 2008 R2. Please refer to link below:
    SSRS BIDS Query Designer very slow when using multiple parameters
    Also please refer to a blog below:
    Speeding up the Query Parameters Dialog in the SSRS Query Designer
    Best Regards,
    Simon Hou
    TechNet Community Support

  • MDX Query for Top 10 in SSAS Project

    Hi Guys,
    Please I need an MDX query that will help me calculate Top 10 inside the SSAS project.
    Your help will be greatly appreciated.
    Thanks
    me

    Hi,
    I know nothing about PowerView and PerformancePoint Server but I played with Excel and I am able to use the named set I created. Here are the steps which I followed.
    1 - Create the named set. Remember... this name set appears inside the dimension which you use as the first parameter inside TOPCOUNT function.  
    2 - Deploy the cube and perform a process full.
    3 - Navigate to PowerPivot ribbon and click on PowerPivot Window.
    4 - Choose From Database > From Analysis Services or PowerPivot. Specify the necessary SSAS server credentials and connect to the Cube which you are interested.
    When it comes to the MDX query design window you construct your MDX code in SSMS and copy that code. You also can use the design mode as well. In this case you have to toggle the "design mode" option and enter to manual mode which you can type
    your MDX code. Here is a screenshot of that.
    5 - Validate your query and click Finish. Once the data is in you can create your power pivot report. Here is an example.
    I hope this helps to troubleshoot your issue.
    Best regards...
    Chandima Lakmal Fonseka

  • Query designer removing parts of where clause in VS 2012

    I'm new to reporting services and I'm finding the query designer very frustrating.  First off,  I have read here and
    am having a problem where the tool automatically wipes out parameters I have changed/added in the query designer.  I read this 5 years ago, yet it seems that this problem still exists.  I've tried changing the XML as suggested by some with mixed
    results.  Now I am having a problem when I changed the WHERE clause it keeps disappearing if I try and make any other change.  Does anyone have advice on working with this tool?  Should one keep a running copy of the query and keep pasting it
    back in whenever a change is needed?  Is this behavior not expected?  Is anything different with SSRS 2014?
    Thanks

    Hi billywinter,
    According to your description, parameters are wiping out automatically when you change something in query designer.
    In Reporting Service, if we use where clause to add parameters in query designer, Define Query Parameters will pop-up when running the query. Please refer to screenshot below:
    Regarding the issue, we couldn’t understand it clearly, and we would like to confirm something from you below:
    1. Does parameters disappear in your query? Or when you preview the report, the selected box of parameters doesn’t display?
    2. How about the query in query designer when parameters disappear?
    3. What’s the modification have you performed for where clause? And what’s the result after this modification?
    4. What the query type you are using, MDX query, stored procedure or another query type?
    Please provide more information about the issue then we can understand the issue clearly. If possible, please provide some screenshots about the query in query designer, and the results of parameters before and after changing where clause.
    In addition, we have found a feedback which descripts an issue about overwriting parameter in MDX query designer, and this issue is resolved by design. Is this issue same as yours? Please refer to this feedback:
    MDX Query Designer Overwrites Parameter Queries.
    Best regards,
    Qiuyun Yu

  • MDX Outline Formuale - Help

    Hi,
    I have outline MDX formulae is attached to measure member "Y" in ASO outlilne:
    X is another measure in the outline. I have dimension like : DIMx where x is 1 to 9. DIM1 is measure dimension
    IIF(X = 0 , IIF(Count(Intersect({DIM3.CurrentMember}, {Descendants([DIM3 Member]))}))=0, X, <SUM Logic>),X)
    This formulae is applying to all the member combination now.
    It should be applicable to all the members in the outline expect members in different dimension ( Say DIM2,DIM4,DIM5). I want apply different Sum Logic for them.
    In other words, I dont want to apply this formula (Sum logic) when my current member combination is having members from DIM2,DIM3,and DIM4.
    How can it be redesigned to cater the issue having current logic in place?
    Please let me know if any other information is requried
    TIA
    Edited by: user636938 on Nov 22, 2008 9:26 AM
    Edited by: user636938 on Nov 22, 2008 9:27 AM

    You can't fully exclude a dim, but basically you would just tell your formula to evaluate only for the root member. So use a CASE statement to say when the member IS Dim2, Dim4, Dim5, etc, then execute the formula. This will keep the formula from evaluating when you drill on those dimensions and perform much better, which I assume is why you are trying to do this.

  • ** How to simulate the conditional statements in web analysis

    i have an "average" member in the Measures dimension on ASO application.
    i wrote a MDX formulae to it as IIF(A=0 OR A=MISSING), B/12, A/12
    In the web analysis when i view the data at level-0 it will display correct value but when i apply filters on other dimensions the value is increasing, i have ~ consolidation operator applied to the average member and i have the measures dimension as dynamica hierachy and its an accounts dim.
    "As per the Average member it should take the average but the average is gettting doubled when we apply filters"
    so i have tried to apply a average formulale in web analysis rather than in essbase, when i apply filters also it is working fine but when the A value is 0 i am getting 0 value but as per the requirement it should be B/12
    so please guide me does can i use any coniditional statements in web analysis?
    if not when i drill up how does my essbase gives the correct result instead of consolidating.
    Any Thoughts or suggestings that would be really greatfull..

    How could it not be 5A?. If you have A for each member and then you select 5 members you are going to get 5A. If you don't want 5A then what do you want the Avg of A across the 5 members?
    The tools are working the way they are designed to, your requirement is a little out of the ordinary. Unfortunately, Web Analysis does not have conditional logic.
    Try taking my previous suggestion and adding another member in Essbase called "Count", make it dynamic calc and the formula should be ' 1; '
    The purpose here is to get a value of one in the count member for each member you are going to select in your filter. So, if you select five members in the filter, Web Analysis will now return 5A and it will return the result of "Count" which will be 5. Create a calculated member that divides the 5A value by the count value 5. That will give you the average A for the 5 members, then you can divide by 12.

  • How to get start date of the period for a given date from cube

    I have a situation where i need to find the start day of the period for a given date. is there a way to know that. i want to use that in my report. i enter the date from my report(i have date parameter), depends on the date, i want to display the start day
    of the period. how can i write expression for that in my report?
    ram

    Hi ramprasad74,
    According to your description, you are using Analysis Services as a data source for the report, the cube has hierarchy: Fyear, FQuarter, FPeriod, fweek, Fdate. You want to add a date parameter to the report, after you changed value of the parameter, the
    report will return the first day of FPeriod.
    To achieve your goal, we need to add a parameter to the report, then use the parameter in mdx query. For detail information, please refer to the following steps:
    In the Report Data pane, right-click on a dataset created from a SQL Server Analysis Services data source type, and then click Query. The MDX query designer opens in Design mode.
    On the toolbar, click Design to toggle to Query mode.
    On the MDX query designer toolbar, click Query Parameters symbol. The Query Parameters dialog box opens.
    In the Parameter column, click <Enter Parameter>, and then type the name of a parameter.
    In the Dimension column, choose a value from the drop-down list.
    In the Hierarchy column, choose a value from the drop-down list.
    In the Default column, from the drop-down list, select a single value.
    Click OK. 
    In query designer dialog box, type the mdx query like below:
    with member [Measures].[FirstChild]
    as
    [Date].[Fiscal].currentmember.parent.firstchild.name
    select {[Measures].[FirstChild]} on 0,
    [Date].[Fiscal].[Date].members on 1
    from
    ( SELECT ( STRTOSET(@ParameterName, CONSTRAINED) ) on 0
    from
    [Cube]
    Here are relevant threads you can reference:
    https://social.msdn.microsoft.com/forums/sqlserver/en-US/c7146ac3-40ea-4d53-b321-c707aebbd405/how-to-pass-date-parameter-to-mdx-query
    https://social.msdn.microsoft.com/forums/sqlserver/en-US/fd12a865-bc90-4a65-af42-ce38a8cfa29b/pass-date-time-parameter-to-mdx-query-ssrs
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    If you have any feedback on our support, please click
    here.

  • Regarding MCDBA Certification

    Intrested in Writing MCDBA Certification , can some one help me on
    1) Is there any certification exam that should be taken before the MCDBA exam.

    MCDBA is a SQL Server 2000 retired certification.
    Here are the SQL Server 2012 certifications:
    http://www.microsoft.com/learning/en-us/mcsa-sql-certification.aspx
    Article: SQL Server 2012 Certification Path by
    Rick Dobson
    Exam
    Credit For
    Selected Topics
    70-461: Querying Microsoft SQL Server 2012
    MCSA for SQL Server 2012 
    MCSE for SQL Server 2012 Data Platform 
    MCSE for SQL Server 2012 Business Intelligence
    Create/design tables and views 
    Use joins, sub-queries, new data types and query features 
    Create/design/modify stored process, aggregate functions, triggers 
    Modify data with INSERT/UPDATE/DELETE/MERGE 
    Design/apply user-defined functions
    70-462: Administering Microsoft SQL Server 2012 Databases
    MCSA for SQL Server 2012 
    MCSE for SQL Server 2012 Data Platform 
    MCSE for SQL Server 2012 Business Intelligence
    Install SQL Server 2012 and related services 
    Create and manage SQL Server instances, including a clustered instance 
    Diagnose and respond to blocking, locking, deadlocking 
    Backup and restore databases 
    Implement and maintain indexes 
    Contrast and compare AlwaysOn technologies
    70-463: Implementing a Data Warehouse with Microsoft SQL Server 2012
    MCSA for SQL Server 2012 
    MCSE for SQL Server 2012 Data Platform 
    MCSE for SQL Server 2012 Business Intelligence
    Design/implement star vs. snowflake schemas, fact tables, dimensions, keys 
    Create/apply project level connection managers, slowly changing dimensions, fuzzy lookups 
    Execute SSIS packages with SSMS, DTEXEC, SQL Server Agent 
    Create, assign, read variables and parameters 
    Plan and implement full and incremental loads for data warehouses 
    Implement solutions with Data Quality Services
    70-464: Developing Microsoft SQL Server 2012 Databases
    MCSE for SQL Server 2012 Data Platform
    Create/implement database objects without using built-in tools 
    Apply data types: CLR, sequential GUID values, spatial 
    Understand relative advantages of database tables, temporary tables, and table variables 
    Create, assign, read variables and parameters 
    Create and alter indexes, including filtered, semantic, XML 
    Optimize queries with execution plans and DTA
    70-465: Designing Database Solutions for Microsoft SQL Server 2012
    MCSE for SQL Server 2012 Data Platform
    Apply physical database issues, such as filestream and file groups 
    Monitor an instance using such tools as Profiler, Perfmon and DMVs 
    Automate (setup, maintenance, monitoring) across multiple databases and multiple instances
    Design instance-level security, such as logon triggers, transparent data encryption, DDL triggers 
    Manage maintenance administration, such as rebuild vs. defrag indexes, online vs. offline index rebuild 
    Implement high availability via clustered servers, mirroring, replication
    70-466: Implementing Data Models and Reports with Microsoft SQL Server 2012
    MCSE for SQL Server 2012 Business Intelligence
    Implement cubes: build cube with SQL Server Data Tools, configure additive and non-additive measures, and implement many-to-many relationships 
    Create and debug MDX queries 
    Contrast multidimensional and tabular data models 
    Deploy SSAS databases 
    Know SSRS report and design issues, such as crosstab report, drill-down reports, report parameters 
    Configure report data sources and datasets
    70-467: Designing Database Solutions for Microsoft SQL Server 2012
    MCSE for SQL Server 2012 Business Intelligence
    Specify and optimize MDX and DAX queries 
    Use partitioning to speed up the loading of a fact table 
    Design a BI reporting architecture, including such features as linked reports, drill-down reports, sub reports 
    Know when to choose between UDM and BISM 
    Possess a working knowledge of how to implement MDX calculations 
    Design SSIS deployments using the project deployment model, passing values at execution time, sharing parameters between packages
    Article link:
    http://www.mssqltips.com/sqlservertip/2819/sql-server-2012-certification-path/
    Kalman Toth Database & OLAP Architect
    SELECT Video Tutorials 4 Hours
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Filter Function Performance Improvement

    We have the Derived Measures created as calculation in the MDX Cube design. Whenever we use those metric in reporting, it's getting timed out and it executes for about 60 minutes in SSMS and timed out as well.
    Sum(    Filter([Standard Type].members,
            instr(1,"[Happy]","["
            + cstr([Standard Type].currentmember.Name) + "]") > 0),
    [Measures].[Total People])
    Any idea on improving the above formula/expression to use for the measure ? Please advise.

    You are correct you will get an error. It will show as #VALUE! in Excel PivotTables.
    Instead of using some very slow Filter and InStr functions, try this instead to avoid the errors:
    create member CurrentCube.[Measures].[Test Invalid Reference] as ([Standard Type].[Standard Type].[Happy], [Measures].[Total People]);--if Happy doesn't exist, null out the measure
    (iif(IsError([Standard Type].[Standard Type].[Happy]),[Measures].[Test Invalid Reference],{})) = null;
    The advantage of this approach is that upon the user connecting, it will evaluate whether Happy exists once. Your approach runs inside each cell calculated at query time.
    http://artisconsulting.com/Blogs/GregGalloway

  • Pass parameter to analysis services report to cube (Not filter)

    Hi I am trying to pass a parameter from a report to a subreport. Both reports are built on Analysis Services cubes.
    I can pass the parameter value to a FILTER parameter but I cannot pass it directly to parameters used in cube. Is it only possible to use the passed parameter as a filter? 
    My subreport is a lot slower when I have to return everything then filter it in Reporting Services, rather than only returning what I need.

    Hi Darkdushy,
    As you said, there are two ways to filter data using parameters. First is add a filter to the dataset or other report items. The second one is use the parameter on the query no matter the database is a multidimensional or relational database. Here is a sample
    query for your reference.
    select
    {[Measures].[Internet Sales Amount]
    } on columns,
    {[Date].[Date].members} on rows
    from(
    select
    STRTOMEMBER("[Date].[Date].&["+@StartDate+"]"):STRTOMEMBER("[Date].[Date].&["+@EndDate+"]")
    ) on columns
    from [Adventure Works]
    Reference:Define Parameters in the MDX Query Designer for Analysis Services (Report Builder and SSRS)
    Regards,
    Charlie Liao
    TechNet Community Support

  • Poor Processing Performance after Migration from SSRS 2005 to SSRS 2014

    Hello all,
    a customer is moving from SQL Server 2005 to SQL Server 2014 (clean install on a new machine). There are a lot of reports against an Analysis Services database. I have converted and deployed the reports. Most of them are showing a significant performance
    improvement, but some of them became very slow.
    Analyzing the report server's execution log I have discovered that the rendering time has increased very much (see picture for a specific report below - above the blue line is SSRS 2005 on an older machine, below is SSRS 2014 on a new machine).
    Do you have any hints what I can do?
    Thanks in advance and best regards,
    Gerald

    Thank you for your reply. Cumulative Update 4 has already been installed (I have just compared the installed version number with the list on
    sqlserverbuilds.blogspot.com).
    My first suspicion was also a rdl conversion problem. But as even reports with a blank page where showing this rendering performance problem I began to look at the datasets (although they are executed very fast according to the report server's
    execution log view).
    All MDX queries have been designed using the
    Analysis Services MDX Query Designer. The option for not showing empty cells is activated to supress empty rows. But this option always applies to both axes (when usings the query designer). Thus columns for measures with null values in all rows are omitted
    from the result set. When rendering a report the rsMissingFieldInDataSet-Error is shown, but in SSRS 2005 and also in the Data Tools for SQL Server 2014 this has no further impact.
    But SSRS 2014 is performing very bad in this case. If I remove the NON EMPTY clause for the columns (which only works when switching to the text query builder, so the customer is not able to modify the queries anymore) the report performance will be as expected.
    So far there're only two reports left where this does not solve the performance issue.
    During testing I have also observered the BIDS - SQL 2008 R2 Warnings not clearing-bug which can be reproduced by everyone except
    Microsoft ;)
    Regards,
    Gerald

Maybe you are looking for