Creating buckets by comparing Dimension member against Measure using MDX

I have a Product dimension which has hierarchies - product_id, initial_price, product_name, category and Measures - units_sold, cost_per_unit, revenue_per_unit. For each product_id I need to compare initial_price against revenue_per_unit and then assign it
to a bucket based on the comparison. 
Consider the following example:
Input:
product_id   initial_price revenue_per_unit
1               10  
           12
2               20  
           18
3               30  
           35
And if Product 1, 2 are in Category Book and 3 in Clothes then output should look like
Output:
Category  revenue type        Amount
Book               Profit                
 2
                      Loss            
       2
Clothes           Profit                   5
                      Loss                     0
How can I achieve this using MDX?

Hi Vijay,
In your case, I couldn't found the "revenue type" attribute in the "Product" dimension. If you need to get the expected result, I suggest you calculate the amount at underlying data souce, and then retrieve the result set via MDX.
Regards,
Elvis Long
TechNet Community Support

Similar Messages

  • Creating UDA for a dimension member

    Hi All,
    when I am creating UDA for a dimension member in my planning application I get the following error.
    The associated dimension ID has not been set for this property. Do you want to create the association now?
    Can anyone please let me knwo wahts this error?
    Thanks

    I take this is an EPMA application, you have to create dimension association between the UDA property and the UDA dimension.
    Have a read of :- http://download.oracle.com/docs/cd/E17236_01/epm.1112/epma_admin/epma_create_assoc.html
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • BPC Error: Cannot fine dimension member sheet file

    Hi experts,
    I'm getting below error when I try to process the dimension.
    "Cannot fine dimension member sheet file; use the export dimension feature to restore it from the member file".
    Can anybody help me to resolve the error.
    Thanks in Advance

    Hi Hari,
    When you select your dimension, there will be an option "export dimension". Click on that.
    Hope this helps.

  • Creating a Dimension from a Measure

    Post Author: TMullan
    CA Forum: Desktop Intelligence Reporting
    I have a monthly report that includes a union query in order to bring in current and previous data.  I can create a variable that says if the Date = Max(Date) then current else previous.  Unfortunately, this creates the variable as a measure and I am unable to section from a variable.  Is there a way to create this as a dimension?

    Post Author: sn_ideal04
    CA Forum: Desktop Intelligence Reporting
    Yes u can, i think you need to change the Measure to a dimension in the Universe by changing the Object Properties.

  • Reading data from a text file into PAS - Dimension member names truncated

    Hi,
    I created a procedure to dump variables and data into a text file to load into another model. I used a semicolon as a field seperator.
    The data, measures and dimension members are dumped properly into a text file and no dimension member names are truncated .
    However when I read the data into  a measure, and I issue a peek command, dimension meber names are read in truncated
    and remain full names in the text file. Any reason for this? What do I need to do to prevent this from happening?
    THanks.
    Lungile

    Hi Lungile,
    The problem that you're likely having is that you haven't created a file description for the file from which you're reading.  When loading data into Application Server from a text file, you would normally go through three steps:
    1. Enter the ACCESS EXTERNAL subsystem
    2. Specify the name of the file to be read
    3. Specify the format of the file field names, types, widths, and positions.
    If you go into the Application Server help, select "Application Server Help", then "Application Server at the command level", then "Variables and reading in data", and then "Reading an external file", you will have the process of the steps you need to follow outlined for you, including links to the help topic for each command you need to issue.
    So what I think you need to do is use the DESCRIPTION command to specify the names of your fields, their type, and also their width, in order to ensure no truncation of data on the load.
    The same DESCRIPTION statement is required if you want to use your text file as the source of a dimension.
    Hope this helps,
    Robert

  • Remove Dimension Member

    Hi
    I want to remove a dimension member from a dimension.
    To do this, I create a maintenance script with only one step.
    This step includes a OLAP DML command in witch the following code is written (General tab):
    call remove_dimension_member('1', 'DIM_2', NA, NO) In the Measures tab I selected only one measure, because you have to select at least one.
    In the Status tab I leave the default selections.
    After running this maintenance script, the following Error occurs:
    <font color="red">INI: error creating a definition manager, Generic at TxsOqConnection::generic<BuildProcess>INI: XOQ-00703: error executing OLAP DML command "(call remove_dimension_member('1', 'DIM_2', NA, NO) : ORA-37162: OLAP error
    XOQ-01706: An unexpected condition occurred during the build: "xsoqBuildRecursive DBMS_CUBE.BUILD not supported".
    ORA-06512: at "SYS.DBMS_CUBE";, line 234
    ORA-06512: at "SYS.DBMS_CUBE";, line 287
    ORA-06512: at line 1
    )", Generic at TxsOqAWManager::executeCommand
    </font>
    When I run the same DML-Command in OLAP-Worksheet, it works.
    Do I something wrong?
    Thank you for any help.
    Markus

    The OLAP DML program, remove_dimension_member, is implemented using DBMS_CUBE.BUILD. So by calling it within a build script you are effectively calling DBMS_CUBE.BUILD from within DBMS_CUBE.BUILD, which is not supported. This is why you get the error message "xsoqBuildRecursive DBMS_CUBE.BUILD not supported".
    The obvious workaround is to execute the call outside of the contents of a maintenance script, but here is a (non AWM) workaround if you really need to integrate with DBMS_CUBE.BUILD.
    If you execute the remove_dimension_member in OLAP Worksheet, you can then look at the contents of the CUBE_BUILD_LOG for the latest build to see how it all connects. Here is an example I ran from SQL*Plus
    SQL > execute dbms_aw.execute(q'!
    call remove_dimension_member('APR-2011', 'TIME', NA, NO)!')
    IMPORTANT: Analytic workspace TEST_AW is read-only. Therefore, you will not be
    able to use the UPDATE command to save changes to it.
    PL/SQL procedure successfully completed.
    SQL > select command, status
         2 from cube_build_log
         3 where build_id = 10
         4 order by time;
    COMMAND             STATUS
    BUILD                 STARTED
    DELETE DIMENSION MEMBER   STARTED
    DELETE DIMENSION MEMBER   COMPLETED
    REBUILD FREEPOOLS       STARTED
    REBUILD FREEPOOLS       COMPLETED
    BUILD                 COMPLETED
    SQL> select build_script
         2 from cube_build_log
         3 where build_id = 10  and command = 'BUILD' and status = 'STARTED';
    BUILD_SCRIPT
    BUILD NO COMMIT "TIME" USING (DELETE FROM DIMENSION WHERE MEMBER = 'APR-2011')This means that you can delete a member directly using DBMS_CUBE.BUILD as follows. Note I removed the keyword BUILD when running this through DBMS_CUBE.BUILD.
    begin
    dbms_cube.build(q'!
      NO COMMIT "TIME" USING (DELETE FROM DIMENSION WHERE MEMBER = 'APR-2011')
    end;
    /Remove the NO COMMIT if you want the build to commit your change (as opposed to keeping in a READ ONLY session).

  • Bringing column from dimension as a measure

    Good morning,
    I have a measure in my fact table that is using 2 dimension columns for a calculation. For example:
    Fact table: "Expense"
    Dimension table: "own sq ft", "rented sq ft" (those went to dimension, because BAs thought they weren't gonna be used in calculations)
    I need to have a measure in fact "Expense"/"Total Sq Ft" ("own sq ft" + "rented sq ft")
    now I guess I'd have 2 options:
    a) create calculated column "Total Sq Ft" and in Fact table create a calculated column based on Dimension's value
    b) bring "own sq ft", "rented sq ft" to Fact table and base calculation off that
    Which method is most proper?

    I would go with option b. Create a separate logical fact table "Floor size" that is dimensioned against your "Store" dimension (or what it's called, I assume it is "Store"). This "Floor size" logical fact table is based on the same physical table (through the Logical Table Source) that is used for the "Store" dimension. When this is done you are able to create your calculated "Expense"/"Total Sq Ft" measure and use it against "Store".
    Option a (if I understand correctly what you are describing) is not the correct option in both of the following cases:
    * when you create the calculated column in the fact in the LTS, based on physical columns. This will not give the correct results because the division will be calculated for each fact row. You will have to supply an aggregation to avoid ending up with all the fact rows in your request. Using AVG will not give the right results.
    * when you create the calculated column in the logical table, based on existing logical colums. This will not give the correct results because this will force the measure to the level of "Total Sq Ft" in the "Store" dimension (which is probably at detail level). This will result in as much rows as you have stores (and higher levels of the "Store" dimension will not roll up).
    Good luck, go with b.
    Elio

  • MDX: Selecting specific dimension member and its descendants from parent child dimension where dimension member names can be same in dimension hierarchy

    I'm creating a SSRS report using SSAS cube as a source.
    When creating a dataset for the report, I'm having trouble with MDX to select a specific dimension member and its descendants from parent child dimension where dimension member names can be same in dimension hierarchy.
    Lets say for example that I have an account dimension where,
    In level 02 I have company ID:s 101, 102, 103 and so on...
    In level 03 I have Balance sheet
    In level 04 I have some account groups, Assets, Liabilities and so on... and In level 05 I have individual accounts
    How can I select for example company 102:s Assets from level 04 and its descendants?
    Normally in adventure works I would do this if I've wanted Current Assets and its descendants:
    SELECT NON EMPTY { [Measures].[Amount] } ON COLUMNS, NON EMPTY
    { (DESCENDANTS([Account].[Accounts].[Account Level 03].[Current Assets]) ) } ON ROWS
    FROM [Adventure Works]
    But in my Account dimension at level 04 I have Assets member as many times as I have companies in level 02.
    Tuomo

    Hi Tuomo Helminen,
    To this requirement of yours, I would recommend you use Cascading Parameters in Reporting services, you can refer to this FAQ How do I create cascading parameters when using cube database in Reporting Services at this link
    http://blogs.msdn.com/b/sqlforum/archive/2011/04/11/forum-faq-how-do-i-create-cascading-parameters-when-using-cube-database-in-reporting-services.aspx 
    Thanks,
    Challen Fu
    TechNet
    Subscriber Supportinforum
    If you have any feedback on our support, please [email protected]
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • How to get the ID of a dimension member in script logic?

    Hi everybody,
    I am working in some logic scripts and I wonder if exists any option to get the current member ID of a dimension in order to concatenate a string using the member referred and an additional set of caracters such as: MEMBER_ID&"_ccccc".
    Moreover, I would like to use this ID dimension member in order to filter members of another dimension whose attribute is equal to the ID of the desired member. Is it feasible?
    In conclusion, is it possible to get a variable which is referred to a member ID of a dimension, and using it in order to filtering other dimensions?
    Many thanks in advance,
    Antonio

    Hi Antonio,
    You ask if it is possible compare a dimension id with a property value.. yes it is posible , for doing that you will have to do something like this,
    *FOR %ACC1%=ThisA,ThisB,ThisC
          *WHEN DIMENSION.PROPERTY=%ACC1%
                  *REC(............)
           *ENDWHEN
    *NEXT
    if you want to concatenate using a filter theres a posibility, like this example using the time dimension.
    *xdim_memberset time=%year%.jan -
    >2011.jan
    hope it helps

  • [Forum FAQ] How do I create calculated measure using AMO in SQL Server Analysis Services?

    Introduction
    In SQL Server Analysis Services (SSAS), you can create a calculated measure in SQL Server Data Tool (SSDT)/Boniness Integrated Development Studio (BIDS). Sometimes you may need to create calculated measure by using AMO in a C# or VB project.
    In this article, I will demonstrate so how to create calculated measure using AMO in SSAS?
    Prerequisites
    Before create calculated measure using AMO, you need to ensure that the following components were installed in your server.
    The multidimensional database AdventureWorks Multidimensional Model 2012
    A SQL Server with SSIS and SSAS installed
    The AMO libraries installed:
    X86 Package (SQL_AS_AMO.msi)
    X64 Package (SQL_AS_AMO.msi)
    Solution
    Here is the detail steps to create calculated measure using AMO in SSAS.
    Open SSDT and create a new SSIS project.
    Drag Script Task to the design surface.
    Click SSIS-> Variables to open the Variables window and add two variables that used to connect to the server and database.
    Create a connection to connect to SSAS server.
    Rename the connection name to ssas.
    Double click the Script Task to open Script Task Editor.
    Add Connection and Database variables to ReadWriteVariables textbox and then click Edit Script button.
    Add AMO reference in the Solution Explore window.
    Copy the script below and paste it into the script.
    Dim objServer As Server
    Dim objDatabase As Database
    Dim strDataBaseID As String
    Dim objCube As Cube
    Dim objMdxScript As MdxScript
    Dim objCommand As Command
    Dim strCommand As String
    objServer = New Server
    objServer.Connect("localhost")
    objDatabase = objServer.Databases("AdventureWorksDW2012Multidimensional-EE2")
    strDataBaseID = objDatabase.ID
    If objDatabase.Cubes.Count > 0 Then
    objCube = objDatabase.Cubes("Adventure Works")
    If objCube.MdxScripts.Count > 0 Then
    objMdxScript = objCube.MdxScripts("MdxScript")
    objMdxScript = objCube.MdxScripts(0)
    Else
    objCube.MdxScripts.Add("MdxScript", "MdxScript")
    objMdxScript = objCube.MdxScripts("MdxScript")
    End If
    objCommand = New Command
    strCommand = "CREATE MEMBER CURRENTCUBE.[Measures].[Multipy Measures By 3]"
    strCommand = strCommand & " AS [Measures].[Internet Sales Amount] * 3, "
    strCommand = strCommand & " VISIBLE = 1 ; "
    objCommand.Text = strCommand
    objMdxScript.Commands.Add(objCommand)
    objMdxScript.Update()
    objCube.Update()
    End If
    objServer.Disconnect()
    Then you can run this SSIS package to create the calculated measure.
    Applies to
    Microsoft SQL Server 2005
    Microsoft SQL Server 2008
    Microsoft SQL Server 2008 R2
    Microsoft SQL Server 2012
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Thanks,
    Is this a supported scenario, or does it use unsupported features?
    For example, can we call exec [ReportServer].dbo.AddEvent @EventType='TimedSubscription', @EventData='b64ce7ec-d598-45cd-bbc2-ea202e0c129d'
    in a supported way?
    Thanks! Josh

  • Error: Invalid dimension member with special character / in BPC NW 7.5 SP7

    Hi experts,
    We are encountering the following problem in our Financial Planning application.
    We are migrating our existing BPC solution from one server to another through backup and restore. The existing solution was on BPC NW 7.5 SP 5. The profit_centre dimension in the existing solutions has several member ids with special character '/' (forward slash). The dimension never threw an error when processed in the existing solution and there is planning transactional data against these member ids.
    While the entire configration , appset , files were successfully restored through UJBR on the new system (BPC 7.5 SP7) through UJBR (backup and restore), the masterdata could not be restored only for this Profit_centre (masterdata for other dimensions were processed successfullu). All the member ids with / are rejected for this dimension. The same error is thrown if processed through the admin client from the member sheet. 
    Error: Dimension member PC_FF/WS/NT is an invalid member ID
              Error in Admin module
    Is there any setting which need to be made to allow / character in member ids? Any suggestion to get around this problem would be much appreciated.
    Thanks
    Abhiman

    Hi Abhiman,
    Yes, you need to maintain the transformation file to correct all dimension member IDs. Can you please refer to the following link with a similar issue:
    conversion file formula not working
    Hope this helps.
    Rgds,
    Poonam

  • Error selecting a dimension member in BPC EPM report - The given key was not present in the dictionary

    Hi,
    We are currently running SAP BPC 10.1 NW on Hana
    Version:
    CPMBPC  810 SP 4
    SAP_BW  740 SP 9
    HANABPC 810 SP 4
    EPM Excel Add-in 10 SP 21 .NET 4 build 9094.
    On my embedded model. I have a BEX query on a aggregation level which I access in a report using the EPM Add-in Excel .
    When I edit my report in EPM Add-in Excel , and I try to select the dimension members for a selected dimension member, I get the following error.
    "The given key was not present in the dictionary"
    Any assistance to help resolve the problem will be appreciated.
    Regards
    Gavin

    Hi Shrikant,
    I had a look at MBR_SEQ , it is a attribute on the dimension member in BW , this relates to a past version of BPC 7.5. We are currently on BPC 10.1 Embedded model , and the MBR_SEQ does not exist on any of the characteristics I have in my info cube.
    When I create a web report I am able to access the dimension members using the select dimensions options, the problem seems to be on the EPM Add-in Excel client only.
    Thanks
    Gavin

  • How to migrate dimension member text files from ODI to Hyperion Planning

    Hi
    We are having an issue with ODI that it was not connecting to planning.
    Later with some instructions from oracle, we have tried to set some RMI path in websphere and we tested the RMI connectivity test.
    It was successfully connecting to planning.
    Then we want to test that ODI is connecting to planning or not.
    For this I think if anyone can send the doc relating to dimension member upload thru ODI to hyperion planning using text files, it will be helpful.
    Appreciate if anyone can help us on this.
    Please communicate to [email protected] for doc sending.
    Thanks
    Rajesh Reddy

    Go through His(John's) earlier blogs which very clearly explains how to get connected & keep the ball rolling.
    If you're so scared to use the existing connections, you may want to-
    i) Set up new Master & work repository;
    ii) Do few quick configurations from Topology Manager;
    iii) Create your project, models, Interface;
    Let us know if something isn't still clear.
    - Natesh

  • How to export data from Elimination Value dimension member by HAL HFM adapter?

    Good day!<BR><BR>Is it possible to export HFM 4.0.5 data with HAL from the <Elimination> Value dimension member?<BR><BR>In 3.* versions it wasn't and there is Known Issue in the "HFM 3.* Adapter Read Me" file: "The Hyperion Financial Management Adapter exports data using the <entity currency> Value dimension member. The documentation erroneously states that there is a port available for the Value dimension"<BR>But there is not such point in the same file for HFM 4.0.5 AND there is Value port in the HFM 4.0.5. Adapter.<BR><BR>Thanks!<BR><BR>Regards,<BR>Georgy<BR>

    In the first approch, try to change the exporting parameter type REF TO DATA.
    Try like:
    CLASS lcl_test DEFINITION.
      PUBLIC SECTION.
        DATA: t_mara TYPE HASHED TABLE OF mara WITH UNIQUE KEY matnr.
        METHODS:
          constructor,
          get
            IMPORTING
              if_matnr TYPE matnr
            EXPORTING
              ea_mara  TYPE REF TO data.
    ENDCLASS.                    "lcl_test DEFINITION
    START-OF-SELECTION.
      DATA: lo_test TYPE REF TO lcl_test,
            lr_data TYPE REF TO data.
      FIELD-SYMBOLS: <fa_mara> TYPE ANY,
                     <f_field> TYPE ANY.
      CREATE OBJECT lo_test.
      lo_test->get(
        EXPORTING
          if_matnr = '000000000077000000'   " << Replace Your Material
        IMPORTING
          ea_mara  = lr_data ).
      ASSIGN lr_data->* TO <fa_mara>.
      ASSIGN COMPONENT 'ERSDA' OF STRUCTURE <fa_mara> TO <f_field>.
      <f_field> = space.
      WRITE: 'Done'.
    CLASS lcl_test IMPLEMENTATION.
      METHOD constructor.
        SELECT * INTO TABLE t_mara
               FROM mara
               UP TO 10 ROWS.
      ENDMETHOD.                    "constructor
      METHOD get.
        FIELD-SYMBOLS: <lfs_mara> LIKE LINE OF me->t_mara.
        READ TABLE me->t_mara ASSIGNING <lfs_mara> WITH KEY matnr = if_matnr.
        GET REFERENCE OF <lfs_mara> INTO ea_mara.
      ENDMETHOD.                    "get
    ENDCLASS.                    "lcl_test IMPLEMENTATION
    Regards,
    Naimesh Patel

  • Re-Order Voyager Dimension Member

    I've created reports in Voyager Workspace based on MSAS 2005 cubes. the dimension members are appearing as per the dimension structure in MSAS and I'm unable to re-order the dimension members. Is there a way to re-order the dimension members in Voyager workspace.
    This feature used to be available in the earlier OLAP Intelligence and Crystal Analysis as well.
    Thanks

    There is currently no real way of reordering members in Voyager, a workaround is to create a calculation of that member in the position where you want to see the existing member and then hide the existing member.

Maybe you are looking for

  • How to pop up error message when printing invoice / delivery note

    i have a problem that when I'm going to print the invoice (VF03), i have to check the field displayed e.g. port of loading, final destination should not be empty.If both are empty, when user is ready to print, then alert message is displayed (e.g. Pl

  • Can not find proper weblogic server install url.

    I want to learn oracle form. So I was download oracle 11g fusion middleware. Before install it I have to install oracle web logic server. I was download weblogic server [ http://download.oracle.com/auth/otn/nt/middleware/11g/wls/wls1034_dev.zip] but

  • Adding asset in the previous period and depreciation run

    Hi Experts, I want to know whether we can add an asset for the previous period and run the depreciation. I will try explaining with an example. Let us say,I forgot to add an asset and i want to add an asset now with date as 1st July 2008. Is it possi

  • EUL_US Schema Import

    my client got separated from its Parent company, now we in the process of setting up the Discoverer for my client, Actually my client's Parent company just gave us the EUL_US schema dump, we have created the EUL_US schema in our DB and Imported the d

  • Project chugging unbelievably slow when making changes

    Hey all. I'm working on a DVD demo reel, and I've got this 3D thing going on as the intro to the DVD. Take a look at my project: http://m-1studios.com/motion/DemoReel_Menu_Concept2.motn I have a group of groups that's basically a fan out as the camer