MDX 'TopPercent' function

The Essbase Tech Reference gives the following MDX code as an example of the TopPercent function:
SELECT
CrossJoin(
*[Product].[Diet].Children,*
*[Year].Children*
ON COLUMNS,
TopPercent(
*[Market].Levels(0).Members,*
*25,*
*[Product].[Diet]*
ON ROWS
FROM Sample.Basic
*WHERE ([Scenario].[Actual],*
*[Measures].[Sales])*
The output of this is supposed to give us the markets that make up 25% of sales for all products under "Diet". In the example, Illinois, California and Colorado are shown as being the markets that make up 25% for all products under "Diet". This strikes me as a unrealistic, i.e. how is it that only these three states always make the top 25% ? What would the output be if New York was in the top 25% for just one of the products, say Diet.200-20? How would this be captured in the output? Would the output contain a fourth row for New York and only have a value in one cell, i.e. NewYork->200-20->Sales ?
Appreciate any thoughts on this..
thanks,
Axe

Hi Brian, i do not have experience in using MDX in EVDRE but i HAVE used it for EVEXP.
Essentially we use the filter parameter of the EVEXP to supply the MDX statement i,e:
(([ACCOUNT].[INPUT_FLG],[CATEGORY].[GROUP1],[DATASRC].[INPUT],[INTCO].[Non_InterCo],[RPTCURRENCY].[LC],[MEASURES].[YTD],[TIME].[FY10.M1])<>0)
if you require an example of returning top 10 or something similar please let me know, but i believe the document you are refering to has some examples.
If your question only MDX in context of EVDRE then, i hope an expert can inform me also as i am not aware of such functionality. I assumed the scope of the document was regarding 'filters' in EVEXP.
Please let me know how you get on.

Similar Messages

  • How to optimize a MDX aggregation functions containing "Exists"?

    I have the following calculated measure:
    sum(([D Player].[Player Name].[All],
    exists([D Match].[Match Id].children,([D Player].[Player Name].currentmember,[Measures].[In Time]),"F Player In Match Stat" ))
    ,[Measures].[Goals])
    Analyzing this calculated measure (the one with "nonempty") in MDX Studio shows "Function
    'Exists' was used inside aggregation function - this disables block computation mode".
    Mosha Pasumansky spoke about this in one of his posts titled "Optimizing
    MDX aggregation functions" where he explains how to optimize MDX aggregation functions containing "Filter",
    "NonEmpty", and "Union", but he said he didn't have time to write about Exists, CrossJoin, Descendants, or EXISTING (he posted this in Oct. 2008 and the busy man didn't have time since that date :P )... so anyone knows an article that continues
    on what Mosha miss or forgot? how to optimize a MDX aggregation function containing "Exists"? what can I do to achieve the same as this calculated measure but in block mode not cell-by-cell mode ?

    Sorry for the late replay.
    I didn't check if your last proposed solution is faster or not, but I'm sorry to say that it gave the wrong result, look at this:
    Player Name
    Players Team
    Goals Player Scored with Team
    A
    Team's Goals in Player's Played Matches
    Lionel Messi
    Argentina
    28
    28
    110
    Lionel Messi
    Barcelona
    341
    330
    978
    The correct result should be like the green column. The last proposed solution in the red column.
    If you look at the query in my first post you will find that the intention is to find the total number of goals a team scored in all matches a player participated in. So in the above example Messi scored 28 goals for Argentina (before the last world cup:)
    )  when the whole Argentinian team scored 110 goals (including Messi's goals) in those matches that Messi played even one minute in.

  • MDX Properties function

    I use ADOMD/MDX to query data against SAP BW.
    Can any BW expert answer me whether BW support MDX Properties function. That is, Does BW support a MDX as following:
    Select Filter([CProduct].Members,[CProduct].CurrentMember.Properties("2CCOLOR")="RED") On Columns From [$CSale]
    Thanks in advance.

    In NW you can't use property values in equations...the answer is to hard code in the logic or use a BADI to retrieve the property value and execute the equation.  Please see my answer to the following threads
    [Re: Select Distinct]
    [Re: Script logic question]

  • Essbase MDX - string functions are not working!

    Hi all!
    this MDX code works fine (LEN function):
    With
    member Scenario.MS1 as 'Len([Account].currentmember.member_name)'
    select { Scenario.MS1} on columns from http://Planing.Budget
    this code raises error (UPPER or any string function):
    With
    member Scenario.MS1 as 'Upper([Account].currentmember.member_name)'
    select { Scenario.MS1} on columns from http://Planing.Budget
    The administration tool I am using is for version 11.1.1.3 ..
    why? O_o
    Edited by: serzzzh on 14.10.2009 22:54

    Unless maybe if you're using J2ME and have very tight memory requirements (are you?) either an array or a Vector should be fine to hold 8000 strings.
    So I'm guessing, either:
    1) you're using J2ME, have a device with tight memory, in which case you probably need a redesign, either to move data off the device and into an online service or the like, or possibly to use the record db system that's in one of the J2ME profiles (although 8000 seems like a lot of stuff to put in such a small form factor device).
    2) the strings are in fact enormous, in which case array-or-vector isn't the issue
    3) there's some other problem. maybe you have a runaway recursive method or something.

  • How create filter in olap universe with MDX LIKE Function

    Hi all
    I need to create a filter in a olap universe with the LIKE MDX function.
    Problem:
    There is a dimension with account numbers whit 10 digits like this: 5683492703 and i need to create a filter whit all account numbers whit the number 7 in the sixth position in a olap universe.
    How to do this?
    Thanks all

    Try like this :
    <FILTER KEY="[Level Object Definition]">
         <CONDITION OPERATORCONDITION="Like">
              <CONSTANT CAPTION="_____7*"/>
         </CONDITION>
    </FILTER>
    Not sure if it is _ or ? to represent a single character. Try ? in place of _ if the above code doesn't work.
    Regards

  • MDX Rank function

    I am having some trouble getting expected results when using the RANK function. My MDX is below with the result set that gets created. 
    The [SF OCC Rank] results are correct but the [Net Rentals Rank] is not.  I am wanting to rank each of the measures to be able to identify which Site is ranked highest in [SF Occ %] and then which site is ranked highest in [Net Rentals].
    My data has in total 43 sites.  In my filter I am limiting it to the Sites in [Site Groups].[Site Group Name].&[12].  There are only 14 sites that should display.  It looks like the [Net Rentals Rank] is ranking all 43 sites instead of
    just the 14 that I am wanting. 
    Any help is greatly appreciated.  Thanks!
    WITH
    MEMBER [Measures].[SF Occ Rank] as RANK(([Unit].[Site Name].CurrentMember),ORDER(([Unit].[Site Name].[Site Name].Members),[Measures].[SF Occ %], BDESC))
    MEMBER [Measures].[Net Rentals Rank] as RANK(([Unit].[Site Name].CurrentMember),ORDER(([Unit].[Site Name].[Site Name].Members),[Measures].[Net Rentals], BDESC))
    select {[Measures].[SF OCC %],[Measures].[SF Occ Rank],
               [Measures].[Net Rentals], [Measures].[Net Rentals Rank]} on COLUMNS,
        filter( [Unit].[Site Name].[Site Name].Members,[Site Groups].[Site Group Name].&[12]) on ROWS
    from [CUBE]
    where ( [Date].[Calendar].[Month of Year].&[201412],[Site Groups].[Site Group Name].&[12])

    Hi rocko,
       You are correct the Net Rentals Rank will be calculated for all the Sites and will display the result for the current Sites being selected. Do some changes to the query so that you will get the ranks for only the sites you selected. 
    WITH
    MEMBER [Measures].[SF Occ Rank] as RANK(([Unit].[Site Name].CurrentMember),ORDER(([Unit].[Site Name].[Site Name].Members),[Measures].[SF Occ %], BDESC))
    MEMBER [Measures].[Net Rentals Rank] as RANK([Unit].[Site Name].CurrentMember,ORDER( Exists( [Unit].[Site Name].[Site Name].Members,[Site Groups].[Site Group Name].&[12]),[Measures].[Net Rentals], BDESC))
    select {[Measures].[SF OCC %],[Measures].[SF Occ Rank],
               [Measures].[Net Rentals], [Measures].[Net Rentals Rank]} on COLUMNS,
        Exists( [Unit].[Site Name].[Site Name].Members,[Site Groups].[Site Group Name].&[12]) on ROWS
    from [CUBE]
    where ( [Date].[Calendar].[Month of Year].&[201412],[Site Groups].[Site Group Name].&[12])
    Regards,
    Venkata Koppula

  • MDX + Generate function

    Hi all,
    I have query below which works and I understand the output. However, if I remove the Generate I also get the top 5 products per country, descending order, but the Order amounts or not the same and thus not correct. 
    My question, what does the generate actually do to make it a different output?
    WITH SET [5MostInternetOrderedProductsByCountry] AS
    GENERATE([Customer].[Customer Geography].[Country].Members, 
     CROSSJOIN([Customer].[Customer Geography].CurrentMember, 
    HEAD(
    ORDER([Product].[Product].[Product].Members, 
    [Measures].[Internet Order Count],BDESC),
    5)
    SELECT 
          {[Measures].[Internet Order Count]} ON COLUMNS,
          {[5MostInternetOrderedProductsByCountry]} ON ROWS 
    FROM
          [Adventure Works]
    Thanks in advance for helping!

    Hi,
    Generate( Set_Expression1 ,  Set_Expression2 [ , ALL ]  )
    Applies a set to each member of another set, and then joins the resulting sets by union.
    If a second set is specified, the Generate function returns a set generated by applying the tuples in the second set to each tuple in the first set, and then joining the resulting sets by union. If
    ALL is specified, the function retains duplicates in the resulting set.
    Generate (MDX)
    Regards,
    Charlie Liao
    TechNet Community Support

  • MDX AGGREGATE FUNCTION FOR UNIVERSE DESIGNER

    Hallo Friends,
    I'm trying to get the summatory of a meassure in Universe Designer for a certain period of time, and I think I can make it with the function AGGREGATE MDX but it always results in an error, I've tried to make it in some different ways but I have again an error. Could somebody please help me with an example of this function in Universe Designer.
    Thanks in advance!

    Hi,
    It's probably (definitely) easier to do this in the Bex layer, but here are some useful samples for you to digest:
    https://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/c0a45246-ce76-2b10-e688-f5c8206203eb&overridelayout=true
    regards,
    H

  • MDX - Int function

    How to use INT() function with mdx?
    I'm trying to run the Int(104.504) function from EAS (essbase administration services console - file\editors\mdx script editor), exactly the same that is in the Oracle tech ref guide, but I keep getting a sintax error. What am I doing wrong?

    You're welcome - that's interesting.  This works for me in Sample.Basic:
    WITH MEMBER Measures.TestFunction AS 'Int(Sum(Children([Profit])))'
    SELECT {Measures.TestFunction} ON COLUMNS
    FROM Sample.Basic
    I think Essbase doesn't like the multiple levels in your WITH specification.  Measure.Profit.TestFunction doesn't work for me either, for example.
    The WITH clause sets up a 'virtual' member - it makes sense to think of it as belonging to a dimension, but it doesn't really make sense to think of it as having any particular position in that dimension.  Even if it was valid syntax, there would be no difference between Measures.TestFunction and Measures.Profit.TestFunction.  Metadata functions such as Parent don't work with calculated members - at least, not according to the MDX With Section entry in the Technical Reference.

  • MDX IsLeaf Function for the Hierarchy Member

    Hi Guys
    Could you share your knowledge about the behaviour of SSAS for this MDX query Please ?
    A similar query about the below takes less than a sec to complete with a particular member. However with different member (Parent Member of a Hierarchy), it is running forever and I killed the query.
    The profiler shows the event “Query Cube Begin” then nothing happens and I don’t see any event at all. Also I am the only user connected with the SSAS cube.
    Could you share your thoughts to investigate this issue ?
    Please let me know, if you need any more information.
    Similar MDX Query:
    With
    Member [Measures].[IsLeafFlag]
    as
    IsLeaf([Customer].[Customer Geography].[Country].[Canada])
    Select [Measures].[IsLeafFlag]
    on Columns
    from [Adventure Works]

    Hi SQLguy,
    I have tested it on my local environment in AdventureWorks cube, and we cannot reproduce this issue. The query return the result in less than a second no matter which member in IsLeaf function.
    IsLeaf (MDX)
    Returns whether a specified member is a leaf member.
    Argument
    Member_Expression
    A valid Multidimensional Expressions (MDX) expression that returns a member.
    In your scenario, the query run forever when putting a parent member of a hierarchy into IsLeaf function, please ensure that this is a valid member.
    Regards,
    Charlie Liao
    If you have any feedback on our support, please click
    here
    Charlie Liao
    TechNet Community Support

  • MDX filter function doesn't work properly

    hi, 
    the filter that I'm using in my query is not working properly and i don't see what i'm missing, i tried to convert to double with CDbl function, but i got the same result. 
    the query : 
    SELECT NON EMPTY 
         [Measures].[Montant - Fact Ventes]
        ,[Measures].[QQT - Fact Ventes]
    } ON COLUMNS,
    NON EMPTY 
        ([Dim Date].[Year].&[2014],[Dim Date].[MonthOfYear].&[7],[Dim Date].[Date].[Date])
        FILTER
         [DIM FA Clients].[FaCuNumberX].members,
         CDbl([Measures].[QQT - Fact Ventes])=0
    } ON ROWS
    FROM [CubeAll]
    the result : 
    thank you!

    Hi Merouane,
    I think your filter is working correctly, just not the way you expect.
    The filter is filtering Clients that have a non zero Ventes, THEN it is multiplying it by the dates.  So, as long as the client has some ventes, it will be included.  To only show rows with a non zero ventes try something like
    SELECT NON EMPTY 
         [Measures].[Montant - Fact Ventes]
        ,[Measures].[QQT - Fact Ventes]
    } ON COLUMNS,
    NON EMPTY 
     FILTER(
       {[Dim Date].[Year].&[2014]}
         *{[Dim Date].[MonthOfYear].&[7]}
          *{[Dim Date].[Date].[Date]}
        * {[DIM
    FA Clients].[FaCuNumberX].members},
         CDbl([Measures].[QQT - Fact Ventes])=0
     ON ROWS
    FROM [CubeAll]
    Richard

  • MDX - MIN Function Help

    I just have 2 dims (Measures and Segment). The below formula is on my Measurs member 'Min $/Yd'. My data is loaded to 'Dollars' member.
    When I retrive on spreadsheet the below MDX gives me the MIN of the entire Segment dimension rather than the MIN of all the level zero members of the parent I'm currently retrieving on. Any ideas what I did wrong?
    Min(
    Filter ( CurrentMember( [Segment] ).levels(0).Members,
    [Dollars] <> Missing ),
    [Measures].[Dollars]
    )

    Answere was that you can't use 'Levels 0' as that defaults to the dim level. Thus it should be:
    Min(
    Filter ( Leaves( [Segment] ).CurrentMember,
    [Dollars] Missing ),
    [Measures].[Dollars]
    )

  • MDX UDA function

    Here are my dimensions in ASO cube
    Account
    xyz
    Time Periods
    FY10
    FY10_Jan (UDA: Jan1)
    FY10_Feb (UDA: Feb1)
    and so on..
    Time View
    FebCalc
    I'm puting a formula in the FebCalc to calculate the sum of FY10_Jan and FY10_Feb using the UDAs dynamically so I don't have to hard code in the members. This is the formula : SUM({UDA([Time Periods],"Jan1"), UDA([Time Periods, "Feb1")}). I'm getting the syntax error. I can't figure out where it's wrong. Any help is appreciated!

    May I know the error??
    +SUM({UDA([Time Periods],"Jan1"), UDA(_[Time Periods_, "Feb1")})+
    End brace is missing for the _[Time Periods]_ in the second argument of SUM.
    That can be the reason.
    Regards

  • MDX substring function

    Hi all,
    I am trying to use select {Substring([Q1W01],1,4)} ON COLUMNS FROM [test].[db]
    But it throws syntax error. What am I doing wrong?
    Essbase 11.1.2.2
    Many thanks.

    What are you trying to accomplish?
    Are you trying to retrieve a member [Q1W0] or are you trying to retrieve all members that begin with "Q1W0" or are you trying to retrieve member [Q1W04] but you want to rename it in the report to show as "Q1W0"?
    If you want to return members that start with Q1W0 then you need to do the following
    SELECT
    {FILTER({[Time].members},
         Substring([Time].CurrentMember.Member_Name, 1, 3) = "Q1W0")} ON COLUMNS
    FROM [test.db];

  • Rank function use in MDX

    Hi Expert,
    Could you please let me know how can I use rank function in MDX to achieve the result in below format. Highest value should be ranked as 1
    Actual/Expected Dataset appears as:
    Thanks Chandan

    Hi C,
    You can use the mdx RANK() function. For example, this query has ranking of cities by sales amount. You could create two sets, and two calcs with RANK() functions for your challenge.
    WITH
    SET OrderedCities AS Order
    ([Geography].[City].[City].members
    , [Measures].[Reseller Sales Amount], BDESC
    MEMBER [Measures].[City Rank] AS Rank
    ([Geography].[City].CurrentMember, OrderedCities)
    SELECT {[Measures].[City Rank],[Measures].[Reseller Sales Amount],[Measures].[City Rank]} ON 0
    ,[Geography].[City].[City].MEMBERS
    ON 1
    FROM [Adventure Works]
    Hope that helps,
    Richard

Maybe you are looking for

  • How to change the user of a cancelled background (batch) job?

    Hi All, I have a batch job which is being cancelled as the reference user account is locked. I want to update the job with a new user. How can I change the user for a cancelled job? I am able to change the user for a scheduled job (by right clicking

  • RFC call From BPM

    Hi, I have a  scenario where I need to access a Function Module from BPM for certain business validations. My FM is in XI and I need to invoke that FM from BPM. How can we do that ? I am trying an RFC call but it gives me an error "No identifier defi

  • Can we have custom properties with adobe illustrator items?

    Is I am able to add my custom property with the any kind of item in adobe illustrator ?. Examples pathItem have location property  like : pathItem.location = some value but I want to write my location property like I am giving name as myLocation. Its

  • Tracking where I am in between TTL pulses

    Greetings.  I have a little Labview experience but very little with counters.  I have a PCI-6602 card with a CB-68LP connector block.  I have used up 7 of the 8 channels counting events so I have one channel left.  What I have is a Z pulse that is fo

  • Why are my comp tracks blank after several takes?

    Any insight on why this is happening please let me know.It seems random. I will be doing punchins on a track and the comp track shows up blank..I have to redrag thru preceeding tracks to recreate the comp..pain in the butt.