MDX fomula question

I have a Measures member called TOP_PERCENT which uses the following member formula:
- *iif(isLeaf([Products].Currentmember) and contains([Products].Currentmember, TopPercent(Siblings([Products].CurrentMember), 50, [Measures].[Revenue])), 1, 0)*
This formula checks if the currentmember of [Products] dim is part of a set of members returned by the TopPercent function. The value of TOP_PERCENT for the current Products member is set to *1* when the expression is TRUE.
My issue is the following: I also have a [Period] dim, and when the above expression returns a TRUE, I want the value *1* to be set at the intersection of each sibling of a given [Period] member (say month). In other words, I want to add something to the formula like: *[Period].CurrentMember.Siblings = 1* . So if the current member is January, I want all the remaining months of the year to also get a *1*
What i the correct MDX syntax (for membe formula) for achieving this?
Thanks in advance for any help.
Edited by: 806008 on Nov 22, 2010 2:15 PM
Edited by: 806008 on Nov 22, 2010 2:16 PM

Hi,
From my understanding part one is simply slicing those measures by that set. It should return an aggregated record for the location in the cube specified. Here is a clear example using Adventure Works cube. I want to bring back Internet Sales for
05/01/2007 where the currency is Dollar for product 346.
The query below will return one record, this record is the aggregated data for that specific location in the cube.
SELECT
{[Measures].[Internet Sales Amount]} ON COLUMNS,
NON EMPTY
([Date].[Date].&[20050701], [Product].[Product].&[346],[Destination Currency].[Destination Currency].&[US Dollar]) ON ROWS
FROM [Adventure Works]
Note it looks like your statement is bringing back the aggregated total for all receipt numbers and product codes for a specific Branch and Till Button (ID of 11) for 2/8/2014.
No part 1 returns many rows not one row. Like what i have said part 1 and part 2 returns exact same result, which is cross join of those sets (applied non empty afterwards).

Similar Messages

  • MDX set question

    I have this MDX query, part 1 or part 2 returns exact same result. I can understand part 2, can someone explains part 1? I am overwhelmed with tuple, set etc. I don't need explanation on basic concepts,  just need a clarification on what's happening
    in part 1? I mean how the () part converted to many rows(tuples) in result? Thanks.
    select 
    [Measures].[Till button sold value]
    ,[Measures].[Till button units]
    ,[Measures].[Till button baskets]
    on columns
    ,non empty
    {-- part 1
    [Branch].[Branch].[Carlisle]
    ,[Till Button].[Till Button].[11]
    ,[Time].[Day].&[20140202]: [Time].[Day].&[20140208]
    ,[Products].[Product code].[Product code]
    ,[Sales order details].[Receipt No].[Receipt No]
    -- part 2
    //{[Branch].[Branch].[Carlisle]}
    //*{[Till Button].[Till Button].[11]}
    //*{[Time].[Day].&[20140202]: [Time].[Day].&[20140208]}
    //*{[Products].[Product code].[Product code]}
    //*{[Sales order details].[Receipt No].[Receipt No]}
    on rows
    from [Rmis]

    Hi,
    From my understanding part one is simply slicing those measures by that set. It should return an aggregated record for the location in the cube specified. Here is a clear example using Adventure Works cube. I want to bring back Internet Sales for
    05/01/2007 where the currency is Dollar for product 346.
    The query below will return one record, this record is the aggregated data for that specific location in the cube.
    SELECT
    {[Measures].[Internet Sales Amount]} ON COLUMNS,
    NON EMPTY
    ([Date].[Date].&[20050701], [Product].[Product].&[346],[Destination Currency].[Destination Currency].&[US Dollar]) ON ROWS
    FROM [Adventure Works]
    Note it looks like your statement is bringing back the aggregated total for all receipt numbers and product codes for a specific Branch and Till Button (ID of 11) for 2/8/2014.
    No part 1 returns many rows not one row. Like what i have said part 1 and part 2 returns exact same result, which is cross join of those sets (applied non empty afterwards).

  • PerformancePoint: MDX Filter Question

    I have a PerformancePoint member selection filter (multi-select) using a hierarchy
    The Hierarchy is:
               Studio -> Property -> Title
    When the user selects a Property, I want to return its Studio with it. If the user selects a 'Title' I want to return both the Property and the Studio with it.
    Here is what I have tried so far, and it has not worked for me. I have verified that the ordinal is correct (Studio = 1, Property = 2, Title = 3)
    I'm sure it won't be this simple, but here is what I have tried:
    CASE <<SourceValue>>.Ordinal
    WHEN <<SourceValue>>.Ordinal = 1 THEN <<SourceValue>>
    WHEN <<SourceValue>>.Ordinal = 2 THEN <<SourceValue>>.Ascendants + ";" + <<SourceValue>>
    WHEN <<SourceValue>>.Ordinal = 3 THEN <<SourceValue>>.Ascendants + ";" + <<SourceValue>>
    END
    The problem I see with this is that <<SourceValue>> could contain different members at different ordinals? Aghh..
    Any suggestions? I need some help.
    Thank you in advance for any advice/help
    -cp

    I figured it out:
    IIF(<<SourceValue>>.Level.Ordinal = 1, <<SourceValue>>,
               IIF(<<SourceValue>>.Level.Ordinal = 2, Ancestors(<<SourceValue>>,0) + Ancestors(<<SourceValue>>,1),
                IIF(<<SourceValue>>.Level.Ordinal = 3, Ancestors(<<SourceValue>>,0) + Ancestors(<<SourceValue>>,1) + Ancestors(<<SourceValue>>,2),"")))

  • Question on MDX Query

    Hi,
    I have the following MDX query
    1.WITH
    2.MEMBER [GE].[GEOSUM] AS 'Sum({[GE].[TX],[GE].[OK]})'
    3.SELECT {[GE].[TX],[GE].[OK]} ON ROWS,
    4.{[Metrics].[Revenue]} ON COLUMNS FROM Cube1.Basic1
    The o/p is follows :
    Axis 1 || Revenue ||
    (TX) || 1000 ||
    (OK) || 2000 ||
    I am trying to create this MDX query dynamically at runtime. Line 1 and 2 would come from a table. I need to add append line 3 and 4.
    Is there any way that I can get the same output by replacing Line 3 (i.e {[GE].[TX],[GE].[OK]} ) with something more generic (like say [GE].[GEOSUM]....).I tried [GE].[GEOSUM].members but this returns me all the dimension members not just TX on OK.
    Is anyone aware of any MDX member functions that I can use to achieve this ?
    Appreciate any help/pointer in this regard.
    Thanks in advance,
    Joel
    --

    Hi Praveen,
    In SSAS, we can use Order() function to specify the order. Please take a look at the following articles:
    Order:
    http://www.ssas-info.com/analysis-services-faq/27-mdx/792-how-in-the-report-can-i-order-date-dimension-members-in-descending-order
    http://www.sqlchick.com/entries/2011/9/30/sorting-descending-in-analysis-services-for-a-date-dimension.html
    If you have any questions regarding Mondrian, please discuss it in the forum below:
    http://forums.pentaho.com/forumdisplay.php?79-Mondrian-Pentaho-Analysis-Services
    Regards,
    Elvis Long
    TechNet Community Support

  • Statistical calc with MDX question (Mode function as an excel)

    Hi All,
      I need to create an MDX Calc to Returns the most frequently occurring, or repetitive, value in an array or range of data.
      For example, the mode of 2, 3, 3, 5, 7, 10 is 3.
      In Excel I use the MODE() function but I don't know how to do this in MDX and add it as a measure in Universe.
      I can't do the formula in WEBI because we have big data volume and I can't retrieve all the customers in WEBI.
      We have SAP BW 7.0 and SAP BusinessObjects XI 3.1 fix pack 1.3
    Thanks in advance.

    Hi,
    it looks like you created the entry twice so I would suggest you close on of them:
    Statistical calc with MDX question (Mode function as an excel)
    I don't think that those kind of statistical functions are available in MDX. you can always go to se37 and use the bapi_get_functions to see the list of supported functions.
    Ingo

  • Essbase MDX question

    Hi there
    I am at a client where I have to do comparative store analysis. Basically with MDX I need to do the following:
    When doing comparable store analysis on a daily level in my Time dimension a store must have traded a year ago on the same comparable day as per the company's trading calendar.
    When doing comparable store analysis on a weekly level a store must have traded a year ago for the full same comparable previous year's week (i.e. all the days in the week) as per company's trading calendar.
    If the criteria is not met #missing must be returned else the day or week value.
    On day level my MDX works fine:
    CASE
    WHEN
    IsLevel([Entity].CurrentMember, 0) AND
    IsLevel([Time].CurrentMember, 0) AND
    NOT IsEmpty([Periodicity].[LY])
    THEN
    ([LY], [Act], [Time].CurrentMember, [Entity].CurrentMember, [Account].CurrentMember)
    END
    The question is on a week level how do I check if a store traded on every single day of the same week last year. Getting the week is no problem, but checking every child of that week.
    Just another point on this: I need to do this on month, quarter etc levels as well, so hard coding to check from day 1 to 7 will not suffice.
    Thanks
    Johan

    You are correct, currently Essbase does not support updates via MDX.

  • What is MDX on earth? some questions ...

    Hello gurus
    I am planning to use a 3-party tool to make query to acccess data within SAP BW, which intends to replace Bex tools. I heard that OLE DB/OLAP BAPI/XMLA are three options of interfaces, and all those three interfaces are based on MDX. After rough investigation, I found that MDX is a standard query language to query MOLAP storage data. So I have the following questions:
    1. Since MDX only serves for MOLAP data storage, shall I firstly need to convert all the relative infocube in SAP BW from relational data storage into multidimensional data storage?
    2. Since MOLAP only serves for MS SQL 2000 database, so if we use oracle as SAP BW database server, then we cannot use MOLAP? and cannot use MDX?
    3. How to use MDX? Shall I firstly use tcode MDXTEST to generate the MDX code for certain infocubes, and then copy such code into 3-party tool?
    can anybody answer my questions or part?
    thank you very much!

    hi Patrick,
    what 3rd party tools will you use ?
    as mentioned by Anil, 1 & 2 are wrong.
    regarding XMLA, take a look
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/81dffe69-0a01-0010-af96-c0d285359e80
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/67acb63d-0401-0010-b685-b1b87dd78892
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1d71d190-0201-0010-239a-8b96516bf372
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9d8dd190-0201-0010-069b-98b83362f6a3
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/daa5b390-0201-0010-de8b-f5e8c6625d9b
    hope this helps.

  • Question using Java API in a multi threaded application for MDX queries

    Currently I’m building a web application that makes a lot of MDX calls using the Essbase Java API. Each time we run an MDX call we basically run the following code:
    IEssbase ess = IEssbase.Home.create(IEssbase.JAPI_VERSION);
    IEssDomain dom = ess.signOn(userName, password, false, null, "embedded");
    IEssCubeView cv = cv=dom.openCubeView("view", hostName, appName, cubeName);
    IEssOpMdxQuery op = cv.createIEssOpMdxQuery();
    op.setQuery(false,mdx,false,IEssOpMdxQuery.EEssMemberIdentifierType.NAME);
    cv.performOperation(op);
    IEssMdDataSet mddata = cv.getMdDataSet();
    cv.close();
    My questions is, is this the correct way to use the API in multi threaded environment where many users may be hitting the application at the same time? For every request do I need to create a separate IEssbase object and sign on to an IEssDomain? Or can I use a single IEssbase and IEssDomain object for the entire application? If not should I call the IEssDomain.signOff() method after each user’s request has completed? Which of the above objects are thread safe? I’m using Essabae 9.3.1. Any insight would be really appreciated.
    Thanks
    David

    Thanks for the input friend,
    I should have mentioned that in my application all
    connections to Essbase use the same user name and
    password so the filtering isn’t a concern. This is my
    first Java application using Essbase has a data
    source, I’m used to connecting to various SQL
    databases and I always use a connection pool, how is
    connection pooling handled in the Essbase java API?I'm not sure what happened to it since I never used it, but there used to be something called the High Availability Services or something that was essentially a connection pool for Essbase JAPI connections, but it required an extra license.
    Since you don't care about identity (everyone has full access to everything), you can create your own connection pool, but you'll have to manage your multithreading yourself. Its been this way since the beginning. The C API isn't/wasn't thread-safe either (we tried).

  • Discussions relating to MDX and other Analysis Services or OLAP questions

    In my Analysis services i have DimGeography, DimCustomer, DimDate dimemsions and Sales measure group. 
    By using above cube i have created SSRS report for the Area wise sales. 
    DimGeography will contains the region values.(East, West, North, Souuth,.....)
    DimGeography will contains the Customers details.
    Now the the requirment is for few customers we have to devide the Region wise sales based on customers. 
    For example 
    in case of Customer_1, the sales will be 10% East, 30% West, 25% Notrth, 35% South..  
    in case of Customer_2, the sales will be 15% East, 40% West, 20% Notrth, 55% South..
    in case of Customer_n, the sales will be 30% East, 30% West, 25% Notrth, 15% South..
    The above persentage values will change for every quarter. We will generate report as per new values only. We are not considering old values. We will store these values in Table and will update every quarter These table not having in Cubes.
    Can you please suggest me how to impliment this logic in Report.
    Sudhan

    Thank you both for your comments, I had previous discussed this & the issue with the wrist strap, I'll have to find those comments & repost as advised by nokia support.
    So the sensor isn't idea, the inner ear canal exists unfortunately the sensor cannot deal with it when the sensor goes over the ear under those circumstances. I'll have to repost those comments soon.
    I'll have to check out Slide Answer to see if it helps, thanks.
    Remember, Questions and Answers are required by this Nokia support board. It's very strict, don't complain, criticise or express opinions which does not answer question or your post could be deleted. My friendly warning.

  • Question on MDX

    Dear Experts,
    Can any body explain me wht is MDX & importance in BPC.
    And how can i execute this below code.
    IIF(Account.H1.CurrentMember is Account.H1.http://All Account.H1 And
    Account.H3.CurrentMember is Account.H3.http://All Account.H3,
    (Account.H2.IFRSTRATE/Account.H2.WKSYR)*Account.H2.WKSCURMTH, NULL)
    And Where i can see output.
    I saw in a Function "AvgBal(FSA200)" in Formula Column of Account Dimension in a Sample Application. From where i can call this function & see out put.
    Please explain.
    Cheers,

    Hi there is one logic library file called MDX.lgl
    there you would see all mdx queries within *function and *end function something like that.
    Then in your account type dimension member sheets excel file you have one more sheet called options
    there write the below script
    *include MDX.Lgl
    then you can customise your own MDX functions and call them
    Thanks and Regards
    Harish B K

  • Question on MDX Dimension Formula.

    Dear Experts,
    Can any body explain me wht is MDX & importance in BPC.
    And how can i execute this below code.
    IIF(Account.H1.CurrentMember is Account.H1.[All Account.H1] And
    Account.H3.CurrentMember is Account.H3.[All Account.H3],
    (Account.H2.IFRSTRATE/Account.H2.WKSYR)*Account.H2.WKSCURMTH, NULL)
    And Where i can see output.
    I saw in a Function "AvgBal(FSA200)" in Formula Column of Account Dimension in a Sample Application. From where i can call this function & see out put.
    Please explain.
    Cheers,

    Hi Vadim,
    okay, let me explain the full Excel sheet in detail. It contains several reports all based on the same rows (accounts) and with the same dimensions in columns (datasource and entity). The difference is the members selected for datasource and entity. The whole report on one screenshot doesn't work, so here is the top left part:
    The yellow columns are the first report, the grey column to the right is my local member. Then follows the next report with a few columns, then another and so on.
    If we look at the local member in detail:
    you can see the formula is a sum listing individual members. In my options, the local member recognition is on and the option to use the position in axis is off.
    This is the definition of the local member
    My first attempt was to replace the formula with the one given above.
    the result is
    the sum now has only one element.
    I then tried to change the local member to this.
    which made the column disappear completely.
    Thanks,
    Arnold

  • MDX question

    hi allAgregate storage databasei have dim [MEASURES] where some elements have UDA "NoScl"and dim [SCALE] where is two elemetsa1 - all data imports into itand a2 which has member formula iif (isuda([MEASURES].currentmember, "NoScl"), [a1]/1000)when i try to verify this formula essbase writes me "sintax error in input MDX query on line 1 at token ')' a2what is wrong with formula?if possible please mail me at [email protected]

    I have this issue with Essbase 7.1 on a Unix server (Sun).If I remember correctly, when you remove the [] from any member name in your formula, then the formula validates.The problem is that the formula won't work properly.This should be solved in 7.2.Denis

  • Basic question with measures & MDX

    Is there a way tell Essbase not to rollup a measure for example if at the lowest customer ID we did a calc X*Y but we don't want the parent customer to aggregate the sum of all of it's children for that one measure...For example if you had a parent and you gave each customer a rating according to sales turnover, when you get to the parent, you don't want to add all the sales turnover %s together, you might do a weighted avg.
    Thanks
    Heather

    Hi Gary,
    Thank you for responding.
    I am finding the syntax for MDX to be much more "challenging" than the Essbase syntax. I miss having the 2 pass.
    Here is the formula:
    case
    when [drawn/undrawn].currentmember=[drawn] and isleaf([customer].currentmember) then [amount]*[risk PCT]*[corp PCT]
    when [drawn/undrawn].currentmember=[drawn] and (not isleaf([customer].currentmember)) then [amount]*[risk PCT]*[corp PCT]
    when [drawn/undrawn].currentmember=[undrawn] and isleaf([customer].currentmember) then [amount]*[Commited PCT]*[corp PCT]
    when [drawn/undrawn].currentmember=[undrawn] and (not isleaf([customer].currentmember)) then [amount]*[Committed PCT]*[corp PCT]
    end
    Basically I need it to calc at level 0 and then roll up for anything not level 0. Now it is SUPER slow. I know it's the isleaf, but not sure what else to do. I tried islevel(customer,0) but didn't work. The customer dimension is HUGE!!! 154000 members stored.
    The data loaded at level 0 for drawn, customer, product, measure, period, year, Costcenter. I just want it to calc at this level and roll up only this portion of the calc. My issue is at level 1, etc it is still doing the amt*risk PCT* Corp pct. Which ultimately is giving us ridiculous answers.
    I pinged some of my colleagues and they said "yeah, this is why we try to do BSO when possible" There has to be a simple way to do this...it's not that complex of a calc....
    Thanks so much for any insight!!!

  • Question converting calc to mdx

    &ForecastStart and &ForecastEnd are 2 of my substitution variables in Essbase.
    How to express "&ForecastStart:&ForecastEnd" in mdx formula please? Thanks!

    Hello,
    have a look at this.
    Using Substitution Variables in MDX Queries:
    http://docs.oracle.com/cd/E12825_01/epm.111/esb_dbag/dmaxldml.htm#dmaxldml50380
    Regards,
    Ahmet

  • Filtring and more/MDX Question

    Hello,
    I sure am new in MDX and since it differ so much from standart SQL Im looking for some help. For example in this particular query:
    select
    nonEmptyCrossJoin(
    [Customer].[Country].Members,
    [Customer].[State-Province].Members
    on 0,
    nonEmptyCrossJoin(
    [Date].[Calendar Year].Members,
    [Product].[Category].Members
    on 1
    from [Adventure Works]
    where (Measures.[Internet Sales Amount]) 
    1. How can I apply filter so I will only get results for 'Bikes' sold in particular period of time?
    2. Is it possible to remove all columns that contains at last one null value?
    3. And is it possible to apply filter on Sales Amount for example to obtain only values greater than 2.000.
    The database is AdventureWorks for analysis service from microsoft.
    Regards, Uszkers

    Try the query below. It gives u the ability to filter bikes only and sales amount > number.
    It is possible to put Country/state in your columns such as Country * state crossjoin, but this would mean you kinda get an odd table with multiple columns and a large amount of cells per column, and than it is not possible to filter. (Cause you will be
    forced to filter an entire row or entire column), if you know what I mean :)
    Please try query below as I'm new to MDX myself and still learning :)
    select
    ORDER(
    NONEMPTY(
    [Measures].[Internet Sales Amount] 
    BDESC
    ) on COLUMNS,
    FILTER(
    NONEMPTY(
    [Date].[Calendar Year].[Calendar Year]
    *[Product].[Product Categories].[Category].&[1]
    *[Customer].[Customer Geography].[Country]
    *[Geography].[State-Province].[State-Province]
    ,[Measures].[Internet Sales Amount]
    [Measures].[Internet Sales Amount] > 2000000
    )on ROWS
    FROM [Adventure Works]

Maybe you are looking for

  • Change of Item Categoy in Sales Order - AFS

    Hi Gurus, I am working on AFS. In the sales order for which delivery has not been created, system is not allowing to change the item category. From TAN to TAQ. I have maintained the Manual item category in VOV4. Still the item category field in sales

  • Planning in EC-PCA with material number

    We have a requirement to enter Revenue plan data in PCA by using Profit Center & Account number & Material number.    However, I do not see 'material' as a characteristic that can be added to the plan layout.    The only available field is 'Represent

  • Database Restarting

    HI, Oracle database version 9.2.0.4: O/S Version :SuSE Linux Enterprise Server 9 (x86_64) Around last week the database was restarting and it was showing in the log file that "Restarting background process QMN0". So what i did was I changed the AQ_TM

  • Windows Jumping In and Out Intermittently

    Every few days my open windows begin doing an exposé dance swinging left and doing a dosy doe (sic). Whatever I do during these episodes doesn't stop it including rebooting. After a while everything calms down and goes away for a while. I turned off

  • How to make weather shown in the notification bar

    I'm running IOS5 on ipad2. Can weather be shown in the notification bar ? If yes, how do I do it?