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

Similar Messages

  • MDX generate from gui

    Just wondering I saw on the net that one can generate a MDX script from a GUI drag N drop
    cube report in Essbase... I loaded the visual explorer and can't see how to do it... also bought
    up excel and dont see how to generate the script. Do I need to install another reporting tool.
    Hate to bring this up but I can generate MDX query scripts from Microsoft reporting services
    connecting to a cube by drag n dropping a report. This is useful if I would like to tweak the
    MDX statement, plus its cool and I saw on the web from one of the Oracle Gurus that you
    can do it. I am using Essbase 9 and have the server and client installed and that's it but can
    connect and generate reports from the explorer.... any thoughts

    I'm not sure if there's a way of viewing this in v9, maybe the demo you saw was on v11.1.1?
    There is a way of seeing the MDX generated in v9 by looking at the logfile generated on the Visual Explorer client. By default my logfile is in My Documents\My HVE Repository\Logs. If you look at the log you should see the MDX used for the query:
    09:51:14.687: SELECT
    09:51:14.687: {[Margin].[Sales]} DIMENSION PROPERTIES [MEMNOR],[ANCESTOR_NAMES] ON COLUMNS,
    09:51:14.687: NON EMPTY CROSSJOIN(
    09:51:14.687: [Market].Generations(3).Members,
    09:51:14.687: [Product].Generations(3).Members) DIMENSION PROPERTIES [MEMNOR],[ANCESTOR_NAMES] ON ROWS
    09:51:14.687: FROM [Basic]
    You'll have to edit the script as the format that the data gets extracted is pretty horrible!
    OBIEE has this functionality and that works pretty well.
    Gee

  • Doubt in Generating Function!!!!!:(

    Hi All,
    It is said that
    "A target field with maxOccurs=<n> that is assigned a generating function is generated <n> times in the target structure. if maxOccurs=unbounded for the target field, then exactly 5 target field are created".
    But if we have done Message Mapping, we could realise that this statement does not hold.
    Could anyone please help me out by explaining what this statement actually means.
    Regards,
    Sundar.

    Hi,
    Are you sure it is said like that?
    Because in help.sap it says
    http://help.sap.com/saphelp_nw04/helpdata/en/e4/82cf0ec8b9494db92e27e2be69524f/frameset.htm
    +If generating functions are assigned to a target field, the attributes minOccurs and maxOccurs determine how frequently a value is generated:
    If minOccurs = 0 the value of the function is generated once.
    · Otherwise, the value of the function is generated as often as is specified by minOccurs.
        ( This applies regardless of the value set in maxOccurs. Even if maxOccurs = “unbounded“, the mapping runtime will still only generate the value as often as is specified by minOccurs.)+
    Regards
    Suraj

  • 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]

  • Log MDX generated against the cube

    All,
    I am creating Webi reports using the universe built on MSAS 2005 cube.We have BOXI 3.1 base version ( no fixpacks/service packs) on Windows.
    I would like to automatically log the MDX generated by BO to perform some analysis. Would also like some more time-line details as to when BO fired the query to cube, how long did cube take to return data and time taken by BO to output the report.
    Can someone suggest a simple way to do this? Would tracing on any Webi Reporting Servers help?
    Regards

    Sorry Didier.
    For some reason if i save the file it is saved as 0 bytes and if i try to open directly , the zip archive is empty.
    Can you please attach this as a pdf or word document?

  • Difference between Generic and Generating functions

    Hi,
    Can any body explain me the difference between Generic and Generating functions? Do also let me kwno which Standard functions are Genereic and which are Generating/
    Regards,
    Pranshu

    Hi Pranshu,
    All functions (regardless of whether they are standard or user-defined functions) that do not have input values are refered to as Generating Functions (Constant, Sender, Receiver and CopyValue() are generating functions). All other functions are generic.
    So, the standard XI functions can be generic or generating.
    Hope this helps
    Regards
    Kiran..

  • Difference between  Generating Function,  Generic Function, Conversion func

    Difference between  Generating Function,  Generic Function, Conversion function?

    Hi,
    Generating functions are those functions which do not fetch any values from the source message,but generate target message based upon some conditions.All functions(regardless of whether Used Defined or standard) which do not take any values are called generating functions.functions of the Constant function category(e.g.constant,copyvalue,sender,receiver) are generating functions.
    conversion is used to convert the data from one format to the other.
    for ex: we use the FCC parameters to get the desired solutions .
    http://help.sap.com/saphelp_nw04/helpdata/en/43/4c38c4cf105f85e10000000a1553f6/frameset.htm
    SAP conversion agent it a tool that helps to convert unstructured data
    (like EDI messages, work files, pdf files etc) into XI (or from XI)
    you just use an IDE to develop the program that you can later on
    put inside the adapter module (for fiel adapter for example)
    so no programming (as it's drag and drop)
    for many documents
    generic function?
    All functions (regardless of whether they are standard or user-defined functions) that do not have input values are refered to as Generating Functions (Constant, Sender, Receiver and CopyValue() are generating functions).
    Thanks
    Vikranth

  • Table Maintenance Generator - Function Group regeneration issue

    I have table maintenance genertor in a function group that contains lot of tables . I by mistable regenerate the whole function group using table mainteance generator.
    Now i want to check which of the programs changed during the regenerator. I am looking for some sap table that contains all the changed objects and their transport number.
    Please rememebr i have still not released the transport,
    I have checked E071, E071, VRSD . That contains the entry for function group and does not contains the programs inside the function group changed
    Thanks

    Thomas,
    Thanks for your reply. Currently I don't want to release the transport.
    Is there any table i can check which are programs changed without releasing transport
    a®s
    Edited by: a®s on Jul 13, 2009 12:42 PM

  • 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.

  • Call Function not Generating Function Module for Smartform

    Hi Gurus,
    We have a work copy print program use to print deliveries (smartforms). This program works fine in Production but right now we are doing some testing and I found out that when we run this program in QUALITY environtment, it shortdumps with error saying "Function Module Not Found"
    Basically when it gets to the Function Module "SSF_FUNCTION_MODULE_NAME", it could not generate any function module for the form it Sy-Subrc = 2 Exception meaning NO_FUNCTION_MODULE.
    The problem is this only happens in our QUALITY environment.I compare the function module in the 2 systems, there was not diff as this is a Standard SAP module. I passed diff smartforms we have in QUALITY through the FM and it will not generating any FM for any of them. So this is not an error from the smartforms, bcos all the same smartforms generates FM in Prod.
    So what I did next is to Debug the FM "SSF_FUNCTION_MODULE_NAME" in the 2 systems to see where the diff is coming from. I noticed 2 views that the FM is using, they are STXFADM and D010SINF . So on the Production system, STXFADM-LASTDATE and D010SINF-UDAT fields are the same value, so it generates the FM. On the QUALITY systems, the values are different hence it skips the code to generate the FM.
    Thanks Guys.
    Points will greatly be awarded for this.

    Please guys, help me look into this, I really need a solution fast.
    Thanks

  • 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

  • Error generating Function Module 'TEXT_CONVERT_XLS_TO_SAP'

    Hi All,
    When i am executing the FM 'TEXT_CONVERT_XLS_TO_SAP' i am getting the error Error generating the test frame.
    Can you please tell me how to execute the FM.
    Thanks & Regards,
    Vivek Agarwal

    Hello...
                   Iam sending a sample code.
                   Hope it will helps U how to deal with FM :  TEXT_CONVERT_XLS_TO_SAP.
    TYPE-POOLS : TRUXS.
    TYPES : BEGIN OF TY_TAB,
             F1(10) TYPE C,
             F2(10) TYPE C,
             F3(10) TYPE C,
            END OF TY_TAB.
    DATA : WA_TAB TYPE TY_TAB,
           LT_TAB LIKE STANDARD TABLE OF WA_TAB.
    DATA : I_TAB_RAW_DATA TYPE TRUXS_T_TEXT_DATA.
    DATA : FNAM TYPE IBIPPARMS-PATH.
    PARAMETER : P_FNAM TYPE RLGRAP-FILENAME.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FNAM.
    CALL FUNCTION 'F4_FILENAME'
    IMPORTING
       FILE_NAME           = FNAM
    P_FNAM = FNAM.
    START-OF-SELECTION.
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
      EXPORTING
        I_TAB_RAW_DATA             = I_TAB_RAW_DATA
        I_FILENAME                 = FNAM
      TABLES
        I_TAB_CONVERTED_DATA       = LT_TAB.
    LOOP AT LT_TAB INTO WA_TAB.
    WRITE :/ WA_TAB-F1, WA_TAB-F2.
    ENDLOOP.
    But my suggestion is why cant you use FM : ALSM_EXCEL_TO_INTERNAL_TABLE
    instead of TEXT_CONVERT_XLS_TO_SAP.
    The performance can be improved much by ALSM... FM.
    Thanks and Regards
    Sekhar.C

  • 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 '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.

Maybe you are looking for

  • SOAPFault and ORABPEL-03013

    Hi all, In our flow, we are catching a specific soap fault which is defined as the following in our partner wsdl file: <wsdl:message name="PolicyException"> <wsdl:part name="PolicyException" element="parlayx_common_xsd:PolicyException"/> </wsdl:messa

  • Corrupted ipod nano 1st gen

    I have a corrupted Ipod nano 1st gen... and restoring the nano wont work at all... I cant find a single way to fix it...

  • Help in removing duplicates?

    Does Bridge help automate the task of removing duplicate images as I understand ACDSee does? I know this isn't the right forum, but perhaps someone knows if PS Elements automates duplicate removal? Thanks for your help.

  • Replication on the table with XMLType column and schema registered

    Dear All, Does Oracle XML DB 11g support replication for tables with schema registered? Is there any recommended approach? Thanks and regards, Swapnil

  • Anyway to downgrade from ios 7 to ios 5?

    Anyway to downgrade from ios 7 to ios 5? That worked so well with iPhone4, I wish I had never upgraded.