How to select TopN members on a given level?

Background:
"Products_dim" has two level,"Product" and "Category".
Target:
Select Products holding biggest Cost_measure Value on
"Product" level.
Code:
select distinct PROD_id
FROM TABLE(
OLAP_TABLE(
'SCOTT.SALES_AWS DURATION QUERY',
'middle_table',
'call TOPN_PRG',
'MEASURE COST FROM SALES_AWS!cost_measure
DIMENSION customers_dim WITH
HIERARCHY customers_dim_parentrel
DIMension prod_id FROM sim_products_dim WITH
HIERARCHY sim_products_dim_parentrel
the context of prgram 'TOPN_PRG' is:
limit products_dim to products_dim_levelrel 'PRODUCT'
limit products_dim to top 4 basedon COST_MEASURE
Return Result:
CATEGPRY.1
CATEGORY.2
PRODUCT.2
PRODUCT.4
My Desire results:
PRODUCT.2
PRODUCT.4
PRODUCT.8
PRODUCT.12
somebody can tell me how to achive it?

I haven't read through this extensively, but think you need just a simple tweak in your program:
limit products_dim to products_dim_levelrel 'PRODUCT'
limit products_dim KEEP top 4 basedon COST_MEASURE
Basically, first you pick all products at the PRODUCT level, and then of those you keep the top 4.
if you say "to" in the 2nd limit, then it ignores anything in status and starts over from scratch.
Hope this helps,
Scott

Similar Messages

  • Excel 2010 cubeformula MDX syntax: how to get all members at a certain level of an AS cube hierarchy?

    I have a cube hierarchy that has full path
    [Location].[Location Hierarchy].[Department].&[DEPT 07].&[East].&[Manager].&[site code]
    I can return the full hierarchy using something like
    [Location].[Location Hierarchy].[All]
    However, I want to return everything ([All]) at a lower level of the hierarchy. For example,
    [Location].[Location Hierarchy].[Department].&[DEPT 07].&[All]
    To get everything in Dept 07.
    Of course your first response would be - just use the same statement without ALL
    [Location].[Location Hierarchy].[Department].&[DEPT 07]
    but the problem is I want to use a lookup cell that allows the user to select All, East, or West
    =Cubemember("MyCube","[Location].[Location Hierarchy].[Department].&[DEPT 07].&[" & B1 & "]")
    And that works for East and West, but not All, because I can't just append [All]  partway down a hierarchy to get everything underneath (at least as far as I can tell).
    Can anyone throw me a hint on how to accomplish a dynamic cubemember formula that includes/allows an All option?
    I even tried embedding the cubeformula in an IF statement (If B2="All", Cubemember(formula1), Cubemember(formula2)) but Excel didn't like that either.
    Thanks for any help!!

    If you want to display the sum for a given hierarchy level, you should use CUBESET function.
     e.g.
    =IF(B2="all",CUBESET("mycube","[Location].[Location Hierarchy].[Department].&[DEPT 07]","all"),Cubemember("MyCube","[Location].[Location Hierarchy].[Department].&[DEPT 07].&["&B1&"]"))
    Hope it helps.

  • How to delete all members at same sub level under one dimension?

    Hello,
    How do I delete all members at a certain sub level in a demension? I know I can do this manually in the hyperion essbase admin panel, but the number of members is large. How would I go about removing these members using a script or excel?

    Hi,
    The API used in the excel template is 9.2. You may need to update this according to your version of Essbase.
    You can delete the existing module and import the esb32.bas and esberror.bas module which is located at C:\Hyperion\AnalyticServices\api\include directory (this is for version 9)
    You also need to install the API when you install essbase client (add-ins) on your PC.
    To open the VBA, click Ctrl-F11 after you open the workbook.
    The program should output 3 message if everything is OK:
    1. Write Outline Success: hOutline = ... (any number)
    2. Restructre Successful: hCtx = ..., ESB_DOR_ALLDATA = 1
    3. Close outline Successful: hOutline = ... (any number)
    Regards

  • How to Select Members Based on Attributes using Excel VBA

    Hi there,Does anyone know how to select members based on attributes using Excel VBA?I don't seem to be able to find macros or functions to do that.Panda

    you can use the Range or the Cells objects to get a reference to your range values
    in this sample the data is on A1 to B5
    Dim lineList(4)
    lineList(0) = Array(Cells(1, 1).Value, Cells(1, 2).Value)
    lineList(1) = Array(Cells(2, 1).Value, Cells(2, 2).Value)
    lineList(2) = Array(Cells(3, 1).Value, Cells(3, 2).Value)
    lineList(3) = Array(Cells(4, 1).Value, Cells(4, 2).Value)
    lineList(4) = Array(Cells(5, 1).Value, Cells(5, 2).Value)

  • How do multiple family members use iTunes.? One account or multiple?

    How do multiple family members use iTunes. One account right now but apps gets added to all devices and iTunes messages go to all devices.  Can multiple accounts be setup and still have ability to share purchased items?

    Hey Ajtt!
    I have an article for you that can help inform you about using Apple IDs in a variety of ways:
    Using your Apple ID for Apple services
    http://support.apple.com/kb/ht4895
    Using one Apple ID for iCloud and a different Apple ID for Store Purchases
    You can use different Apple IDs for iCloud and Store purchases and still get all of the benefits of iCloud. Just follow these steps:
    iPhone, iPad, or iPod touch:
    When you first set up your device with iOS 5 or later, enter the Apple ID you want to use with iCloud. If you skipped the setup assistant, sign in to Settings > iCloud and enter the Apple ID you’d like to use with iCloud.
    In Settings > iTunes and App Stores, sign in with the Apple ID you want to use for Store purchases (including iTunes in the Cloud and iTunes Match). You may need to sign out first to change the Apple ID.
    Mac:
    Enter the Apple ID you want to use for iCloud in Apple () menu > System Preferences > iCloud.
    Enter the Apple ID you want to use for Store purchases (including iTunes in the Cloud and iTunes Match) in Store > Sign In. In iTunes 11, you can also click iTunes Store > Quick Links: Account.
    PC (Windows 8):
    Enter the Apple ID you want to use for iCloud in the Control Panel. To access the iCloud Control Panel, move the pointer to the upper-right corner of the screen to show the Charms bar, click the Search charm, and then click the iCloud Control Panel on the left.
    Enter the Apple ID you want to use for Store purchases (including iTunes in the Cloud and iTunes Match) in iTunes. In iTunes 10, select Store > Sign In. In iTunes 11, click iTunes Store > Quick Links: Account.
    PC (Windows 7 and Vista):
    Enter the Apple ID you want to use for iCloud in Control Panel > Network and Internet > iCloud.
    Enter the Apple ID you want to use for Store purchases (including iTunes in the Cloud and iTunes Match) in iTunes 10 in Store > Sign In. In iTunes 11, click iTunes Store > Quick Links: Account.
    Note: Once a device or computer is associated with your Apple ID for your iTunes Store account, you cannot associate that device or computer with another Apple ID for 90 days. Learn more about associating a device or computer to your Apple ID.
    Thanks for using the Apple Support Communities!
    Cheers,
    Braden

  • How to select the "in columns" dimension on export all Command ?

    Hello,
    I'm trying to export data from an V6.5 Essbase database to a 9.2 one.
    The easier and faster way I found is to use the 'Export database all data in Columns' from the 6.5 cube and load the data with a rule file in the 9.2 (The Export database command is MaxL command).
    The Export All Command with the "in columns options", export all data and put one dimensions in columns. Previously, It was always the Time dimension (M01 .... M12). And all worked fine.
    But someone changed the order of the dimensions in the V6.5 Essbase database. And now, there is another dimension (which changes more often) in columns and which have a lot of members (meanwhile my time dimension only have 12 members).
    So do you know how to select the dimensions which is in columns when using the export database all data function ? I do not see any options in Maxl ?? Maybe there is a rule to follow, in the dimensions order ?
    Do you have any idea about it ?
    Thanks for your help
    P.S : I'd prefer to avoid workaround such as using Reports Scripts or Calc Script (there are too slow).

    Why not use Essbase's native export format, bring it over onto your new environment, and reimport? Change to your heart's content on the target.
    Yes, the dimensionality (names, order, members, etc.) will have to be the same, but this approach, not the columnar export, is the fastest and most efficient way.
    Regards,
    Cameron Lackpour

  • How to select all files in "user dir" (LastAccessedDirectrory) using applet

    Hi,
    Can anyone tell me " How to select all files in "user dir" (Last Accessed Directrory) using applet"?
    For this which method in applet used?
    Thanks in Advance.

    1) Do you want "user dir" (watever that is) or do you wnat the last accessed directory? Last accessed by what/whom?
    2) Applets can't access the local file sytem, and for good reason, unless they're signed and the client has given permission.

  • Windows Explorer - How to select the first item once we open the explorer?

    Hi,
    In Windows Explorer - How to select the first item once we open the explorer using keyboard shortcut. I typically use downward arrow, it goes to the 2nd item in the list, then I again have to use upward arrow to go up.
    Is there a shortcut to select the first item in the list using keyboard? This is not specific to Windows 7, it has been the behavior even in previous Windows OS versions.
    Thanks,
    Mallik

    Opening a Microsoft Ticket is probably your best option. Unfortunately the change will not happen immediately and it will require multiple users to send in a ticket. I hope this ends up being resolved though.
    Good luck Mallik
    Also, don't forget to mark the post as answered so that it does not show up as unanswered to help others who search the forums.
    Agreed, MS wont change it easily. :)
    Arnav Sharma | http://arnavsharma.net/ Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading
    the thread.

  • How to select textFrames with tracking different to 0 (zero)?

    How to select textFrames with tracking different to zero (greater or smaller than zero)?
    Thanks.

    Hi All,
    Thanks for your help. The orignal clips are from Sony PMW F3 camera and I have got Dimensions: 1920 × 1080, Codecs: MPEG-2 Video, Linear PCM, Timecode, Color profile: HD (1-1-1), Total bit rate: 36,623.
    The other camera has given me .MTS files which I have converted in MPEG-2 also. I used Wondershare Video Converter to convert second cameras clip.
    I don't think the clips are matching with first camera's clips because still that is saying the same thing.
    Regards,
    Jai

  • Select UDA Members

    I am working in Excel and trying to populate a treeview on a form with the members of a given dimension. Using GetMemberInfo that all works well. Now my question is I would like to be able to include or exclude certain members from the treeview based on UDA's attached to the members. How do I go about reading the UDA's associated with a given member? Ultimately my goal is to write a sub that works similar to GetMemberInfo, but that accept one of more UDA's to filter the output by.

    I assume that it is possible that you might add new members during the budget process which is why you are seeking to find a solution that would take care of that.<BR><BR>If it is the case that members won't change, then why not just pull down the members by UDA using the Excel Add In into a worksheet, and then structure them so that they can be used in a Treeview control.<BR><BR>I know its a bit clunky, but that was what I did before I got my interactive dimension display model to work properly.<BR><BR>It saved me much time, and also meant that people could work on it offline (such as at home or in a different office).<BR><BR>Just a thought that may allow you time to go back when things are quieter to look at it again.<BR><BR>If, however you have to do it now because things might change, then I think the only thing you could do would be to:<BR><BR>Allocate a range in a worksheet that can be hidden/unhidden<BR><BR>At the start of the process you would need to clear it<BR><BR>Then use your method to get the dimension members, and use the GetUserAttributes to see if you want to write it to the range or not. <BR><BR>Then you could run the Treeview from the range.<BR><BR>The downside is that you won't know when to refresh it or not. If it is very quick to do, then it won't matter, but if it takes a while you might need to ask the user if they want to refresh their data.<BR><BR>Sorry but my Excel is corrupted tonight, otherwise I would have had a go at producing something to check out the timings of it.<BR><BR>I would be interested to see your solution.<BR>

  • How to build the members in essbase based on levels using EAL

    Hi All,
    How to restrict the members to build the in essbase based on levels using EAL.
    I've requirement, in one dimension, needs to build the one level1 member as level0 in essbase.
    please let me know the procedure, if any one implemented or face similar.
    Thanks in advance,
    Kiran

    there's no such functionality in EAL to create Essbase outlines based on levels. the only workaround to this is to use Mapping tables:
    1- create the dimension in essbase with the desired HFM level 1 members as level 0.
    2- set this specific dimension to mapping in your design grid within your EAL Bridge
    3- create the SQL Mapping table and start mapping those members from HFM to Essbase.
    Tanios

  • How to select the data from a Maintainance View into an internal table

    Hi All,
    Can anybody tell me how to select the data from a Maintainance View into an internal table.
    Thanks,
    srinivas.

    HI,
    You can not retrieve data from A mentenance view.
    For detail check this link,
    http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ed2d446011d189700000e8322d00/content.htm
    Regards,
    Anirban

  • How to select the download location? its automatically downloading to users folder in c drive. i wanna change it..plz help me out......

    how to select the download location? its automatically downloading to users folder in c drive.. i wanna change to my desktop...plz help me out...

    Tools -> Options -> Save files to -> Click browse button and browse for folder where you want to save the file.

  • How to select text from a webpage

    hi. i have firefox for my n900. i would like to know how to select some text from a webpage so i can copy and paste it. thanks for the help. i couldn't it anywhere.

    First tap where you want the selection to start. (It might help to zoom in as far as possible first. You can do this using the volume buttons in the newly-released Firefox 1.1rc1.) Then hold the Shift key while pressing the arrow keys on the N900 keyboard to select text.
    Note: We are aware that this is not a very user-friendly way to select text, and we hope to include a better design in a future version of mobile Firefox.

  • How to select multiple values from a listbox

    Hi,
    I have a list box on my UI which is not allowing me to select multiple values
    I want to use multi select list box .. When i go to source of UI component and change that to select many listbox my page is not rendering it is giving error
    When i drag & drop the component i am unable to drop it as a multi select list box that option is not coming.
    I am working on Jdev 11.1.1.3 and I am using ADF/BC components
    How to select multiple values from a listbox ?
    Thanks,

    Hi,
    I want to use multi select list box .. When i go to source of UI component and change that to select many listbox my page is not rendering it is giving errorank
    And what is the error ?
    Frank

Maybe you are looking for

  • Home sharing not working on ipad with different account name but same apple id that was created, what to do?

    PC is set up for home sharing and 2 iPads and 1 iPhone is sharing fine.  1 iPad and 1 iPhone is not home sharing.  The only difference on the devices not working is that the Apple account name is [email protected] while the Apple ID is [email protect

  • How to get full sound library for Garage Band

    I recently purchased the upgrade for Garage Band on my 06 iMac.  I received a huge library of sounds with the upgrade.  However, two days later, we had a power spike and I lost that computer.  So - I bought a New MacBook Pro Retna with the latest ver

  • Logo using  List ALV list dispaly

    Hi, I am using FM:REUSE_ALV_COMMENTARY_WRITE to print logo in ALv header with list display using REUSE_ALV_LIST_DISPLAY. Header is being displayed except logo.Below is the code. Please let me know if anything to be done additionally to get the logo ,

  • Excise Duty Payment Process in CIN

    Hi Experts Can any body help me to know process for payment of Excise duty in CIN. Regards Vijay Puri

  • Draw tables?

    Post Author: mike7510uk CA Forum: General is there any way in crystal x1 to draw tables?I have a timetable report to do and it seems very primitive that i have to draw all the lines