Constructing Calculated Measures in MDX for different measures using same columns in a fact table

Hello,
i have a fact table with 2 columns corresponding to dimensions Dim1, Dim2. In the same table i have 4 other columns Value_Type(int), INT_VALUE(int), FLOAT_VALUE(float), TEXT_VALUE(string). There are a number of measures which are identified by Value_Type and
depending on their nature could be written in one of the 3 columns (INT_VALUE(int), FLOAT_VALUE(float), TEXT_VALUE(string)) Let's say Measure1 with Measure_Type=1 is age, 2 is account balance and 3 is Name for clarity. There could be other measure types that
use these 3 same columns for data. So the sample fact table looks like this
Dim1 Dim2 Measure_Type INT_VALUE FLOAT_VALUE TEXT_VALUE
10 10 1 25
10 10 2 2000,34
10 10 3 John
10 20 1 28
10 20 2 3490,23
10 20 3 Frank
My task is to write an MDX query for each Dim1, Dim2 combination which returns all 3 measures in the same row. The idea is to construct a calculated member for each Measure that returns value from the right field. For example for Measure1 we take INT_VALUE
with measure_type=1. The problem is i don't know how to construct MDX query for these calculated members. Can you please help me?
So my final goal is to write an MDX query that returns all measures in one row for each set of Dim1, Dim2
SELECT [Measure1], [Measure2], [Measure3] ON COLUMNS,
NON EMPTY [Dim1].[Dim1].[Dim1].Members*[Dim2].[Dim2].[Dim2].Members ON ROWS
FROM [Cube]
Dim1 Dim2 Measure1 Measure2 Measure3
10 10 25 2000,34 John
10 20 28 3490,23 Frank

Hi Kosmipt,
I would combine the "INT_VALUE", "FLOAT_VALUE" and "TEXT_VALUE" columns into one with STRING data type for the fact table. And there should be one dimension to store the Measure_Type informations. Then in cube, you can write MDX scope for every one of
"Measure_Type" dimension members. For example,
scope(
            [Measures].[M]
    [DimMType].[MType].&[1]= CINT([Measures].[M]);                                                                                                                             
end scope;
Once the cube is built by the above way, you can write MDX like something like the following to achieve your purpose.
WITH member [Measures].[Measure1] AS ([DimMType].[MType].&[1],[Measures].[M])
         member [Measures].[Measure2] AS ([DimMType].[MType].&[2],[Measures].[M])
         member [Measures].[Measure3] AS ([DimMType].[MType].&[3],[Measures].[M])
thanks,
Jerry

Similar Messages

  • How to set different renderers to different cells in same column of JTable?

    Hello Friends,
    I need your help again...
    Does any body knows, how to set different renderer's for different cells of same column in JTable..??
    For ex.
    Col1 Col2 Col3 Col4
    A       A       A      A
    A       A       A      B
    A       A       A      C
    A       A      A       D
    Where A B C D would be different Renderers.  I want set exactly same ,,, ie. one column with different renderer at different cell positions..
    Right now i m setting renderer using statement bellow :
    table.getColumnModel().getColumn(int).setCellRenderer(rederer_Instance);But with this, effect in the last renderer is applicable whole column....
    Can any body help me out ?????????
    please refer this thread for similar kind of discussion...
    http://forums.sun.com/thread.jspa?forumID=57&threadID=571445Thanks
    Suyog

    Please refer to the first reply of [this thread|http://forums.sun.com/thread.jspa?forumID=57&threadID=571445] for the answer. If you have a specific problem implementing it, post you code with a specific question.

  • Execute BAPI for different input values and dispaly data in a table

    Hi all,
    I have a specific problem about executing BAPI multiple times for different input values and didplay result in a table.
    I am using the code similar to the following logic.
    Bapi_Mydata_Input in = new Bapi_Mydata_Input();
    wdContext.nodeBapi_Mydata_Input().bind(in);
    String in = wdContext.currentperdataElement.getnumber();
    in.setDestination_From(10)
    wdThis.wdGetMydataComponentController().executeBapi_Mydata_Input();
    in.setDestination_From(20)
    wdThis.wdGetMydataComponentController().executeBapi_Mydata_Input();
    in.setDestination_From(30)
    wdThis.wdGetMydataComponentController().executeBapi_Mydata_Input();
    And I want to display the data in a single table. I want the result in a table for Bapi execution based on input parameters passed 10,20 30.
    But I am getting the table data only for the input parameter 30.I mean its actually display the data in table only for the last input parameter.
    So May I ask you all if you know the solution for this problem.PLease advise me with some tips .or sample code is very much appreciated.I promise to award points to the right answer/nice advises.
    Regards
    Maruti
    Thank you in advance.

    Maruti,
    It seems that WDCopyService replaces content of node, rather then adds to content.
    Try this:
    Bapi_Persdata_Getdetailedlist_Input frelan_in = new Bapi_Persdata_Getdetailedlist_Input();
    wdContext.nodeBapi_Persdata_Getdetailedlist_Input().bind(frelan_in);
    final Collection personalData = new ArrayList();
    String fr1 = wdContext.currentE_Lfa1Element().getZzpernr1();
    frelan_in.setEmployeenumber(fr1);
    wdThis.wdGetFreLanReEngCompController().executeBapi_Persdata_Getdetailedlist_Input();
    WDCopyService.copyElements(wdContext.nodePersonaldata(), wdContext.nodeNewPersonaldata());
    for (int i = 0, c = wdContext.nodePersonaldata().size(); i < c; i++)
      personalData.add( wdContext.nodePersonaldata().getElementAt(i).model() );
    String fr2=wdContext.currentE_Lfa1Element().getZzpernr2();
    frelan_in.setEmployeenumber(fr2);
    wdThis.wdGetFreLanReEngCompController().executeBapi_Persdata_Getdetailedlist_Input();
    WDCopyService.copyElements(wdContext.nodePersonaldata(), wdContext.nodeNewPersonaldata());
    for (int i = 0, c = wdContext.nodePersonaldata().size(); i < c; i++)
      personalData.add( wdContext.nodePersonaldata().getElementAt(i).model() );
    wdContext.nodeNewPersonalData().bind( personalData );
    Valery Silaev
    EPAM Systems
    http://www.NetWeaverTeam.com

  • I am setting up a Numbers table for gas milage using one column for gallons divided by the next column of miles and having the answer in the third column in miles per gallon.

    I am setting up a Numbers table for gas milage using one column for miles and the next column for gallons, the two to be divided to produce the third column of miles per gallon and am unable to find out how to do that.  Add and/or subtract, yes, but not to divide.

    ...and results in yield signs indicating an error:
    Hi Wayne,
    Yield signs must be different in Texas. Here (and in much of the rest of the world) they're white with a red border, and installed with an apex pointing down:
    Some still include the word "Yield" (or in Quebec, "Cedez"in black letters.
    Maybe you're thinking of the "Warning triangle", which is similar, but installed base down, and often including a symbol in the white space:
    These are more common in Europe, with the exception of the portable version, which I've seen used at road construction sites or as 'flares' to warn of a disabled vehicle on the road.
    Or maybe you were thinking of this
    (Most of these 'slow moving vehicle' triangles have an orange center. This one looked a bit more 'Texas,' though.)
    Cheers,
    Barry

  • How to set different renderers to same column

    I am trying to set different renderer to same column.
    table.getColumn("columnname").setCellRenderer(
                   FirstCellRenderer);
    table.getColumn("columnname").setCellRenderer(SecondCellRenderer);
    I want both to work at the same time.
    It is taking the second renderer but not first.
    Can anyone please help me, how can i achive it.

    In my situation i need first renderer for all the columns in the table.
    Second renderer only for one column.(which shows thw column value as tooltip)
    Can you please tell me how can i do it.
    when i tried to consolidate in one renderer , it is showing me the same value to all the columns.

  • Not able to open mail from my mac, gmail repeatedly asking for password. but using same password able to open gmail on safari

    not able to open mail from my mac, gmail repeatedly asking for password. but using same password able to open gmail on safari

    okay well they got me to take out some .plist files to see if that would help it didn't. I'm not sure what ones that they deleted for my self maybe someone here would be abel to tell you what ones to take out but didn't work the one that came close to working was this going into keychain and deleting the account(s) then reading them again.
    if you are to do this please back up first with Time Machine. You can do this with a usb drive.
    Okay so go back to where you had internet accounts and make sure mail is shut. click the - on the account your having problems with then quit system preferences.
    Okay so then press cmd and space bar at the same time then type 'keychain access' into the search then click on 'keychain access'
    once it is open go to the top of the window and put your email address that you are having problems with.
    once you have put in your full email, have a look at what comes up i deleted things in the kind colome with 'internet password' and anything with under name that had smtp.gmail.com or imap.gmail.com so it would look like this, map.gmail.com - internet password.
    right click and delete them. make sure not to touch any other files that dont say them things on them.
    Once you have done this quit keychain access and then restart the computer, once the computer is restarted go back to system preferences and internet accounts and re-add the account.
    Hope this helps. if something is not clear just ask.

  • Me and my wife both have iPhone for iTunes I use same laptop now our contacts are all mixed up. I want to delete our old synchronize a/c. To start up freshly. How can I do that?

    Me and my wife both have iPhone for iTunes I use same laptop now our contacts are all mixed up. I want to delete our old synchronize a/c. To start up freshly. How can I do that?

    Anyone at all can advise- still not sorted :-(

  • I have downloaded whats app/brave temple run but using netsafe card. well now it shows 1.98$ is pending , though m trying with new netsafe card to pay it is showing error saying Pls select valid method for payment. i used same method as i did earlier

    i have downloaded whats app/brave temple run but using netsafe card. well now it shows 1.98$ is pending , though m trying with new netsafe card to pay it is showing error saying Pls select valid method for payment. i used same method as i did earlier

    I have recently started having this problem in PSE8. The Adobe workaround
    did work, but I don't fancy having to re register each time I use it.
    What I have discovered is that it's nothing to do with the image metadata as it occurs before any image is opened.
    It SEEMS to only occur if you use file/open with to open an image in the editor - IE start PSE with that command.
    If you close elements down, and start it using programs/PSE/Elements (or your desktop shortcut) - the panorama feature magically works.
    Each time I've opened the editor 'automatically' using image/open with, it seems to create the problem.
    Hope this helps

  • Show different key fields for different caracteristics in the column.

    Hi, experts
    I am creating a query where there are 4 colomns reprensenting 4 different dates. But I would like to display diffferent key fields for them. For example, under DAY 1, i would like to diplay KeyField 1, for DAY2, DAY3 and DAY4, KeyField 2 et 3 will be added under them.
    To do that, i made these key fields "Constant selection" and made some definition in the cells-------
    On the line of DAY1 in the colomn KeyField 2 and KeyField 3, I made them "Always Hide".
    But I didn't get what i wanted as the two columns (KF2 et KF3) still appear in the report, even if there are no data in these two columns.
    Is it possible to realise this requirement:
    DAY1   DAY2          DAY3
    KF1     KF2    KF3   KF2     KF3
    Thanks in advance!!!!

    There is no need to define a cell for this, use a restricted key figure:
    KF1 needs to be restricted by Day1
    KF2 restrict it by Day2 and so on,
    and use those restricted figure in the key figure section, but to make the column more descriptive use a text variable for the name of the columns.
    this should be easier than cell definition.
    thanks.
    Wond

  • Managing DCs in NWDI for different releases in same Client Project

    Hi all,
    We are working for a client and as part of the first phase of the project, we have developed Portal applications for one geography of the world. Currently maintenance and support for this phase 1 is going on. At the same time, phase 2 of the project has started for a different geography of the world. For this phase, the same Portal applications are going to be used along with enhancements.
    My query is how should we manage these DCs at the same time for:
    1) doing enhancements as part of Phase 1 support work; and
    2) enhancements for Phase 2 new requirements
    We cannot put hold on the Phase 1 support enhancements till the Phase 2 goes live. I understand that we would have to create a copy of the current DCs for development in Phase 2. So my first question is can the DCs from one track be copied (exactly) to another track in NWDI? If yes, how?
    Once we have done this, we are still confused about how to merge these two parallel developments going on when the right time comes (i.e. Go Live for Phase 2). Please advise on this as well.
    Thanks in advance.
    Regards,
    Ankur

    Hi,
    This one is also very good and complete:
    Blog
    [/people/guenter.schiele/blog/2005/12/21/best-practices-for-running-the-nwdi|/people/guenter.schiele/blog/2005/12/21/best-practices-for-running-the-nwdi]
    Application Maintenance
    [http://help.sap.com/saphelp_nw04s/helpdata/en/ba/2e61fda9764a29833ddc41feb4e113/content.htm|http://help.sap.com/saphelp_nw04s/helpdata/en/ba/2e61fda9764a29833ddc41feb4e113/content.htm]

  • Ldt files for different templates have same data

    i was asked to get .ldt files for different templates. I used FNDLOAD to download the files using xdotmpl.lct file. all the .ldt file when open in text has the same data. Am I doing something wrong. If the files are same why do we need seperate .ldt file for each template.

    But if you developing something and you are going to version it, then
    In case of single LDT
    ==================
    Its easy as you said, we can down load all def into one file.
    But, if one of the template def. got changed, all data gets downloaded unnecessarily .
    Single file , so you can say its easy .
    In case of multiple LDT
    ==================
    But, if one of the template def. got changed, then download that one only into ldt.
    Multiple file , little more effort is needed to create them.
    But more easy to maintain,

  • RFC Destinations for different clients on same host

    Hi
    I have an SRM and SUS on the same server and the clients are different. I have a flow from SRM to SUS and also back from SUS from SRM.
    Do I have to create seperate RFC Destinations for different clients?
    What about the other details likePort, Partner Profile, Logical system etc, do we have to maintain all for both of them seperately ?
    Regards
    Ajith

    Hi Ajith,
    Do I have to create seperate RFC Destinations for different clients?
    >>> A set of RFC Destination, Port & Parnter Profile is used to connect two systems between one client of source system to one client of Target system. Eg. from clinet 100 of XXX system to clinet 100 of YYY system. So, you need to take this into account and create seperate RFC destination for each different pair of connections.
    What about the other details likePort, Partner Profile, Logical system etc, do we have to maintain all for both of them seperately ?
    >>>In PI, you need to create BS for each different client of SRM & SUS system.
    I hope this helps.
    Regards, Gaurav.

  • Seperate server log for different projects on same domain

    Hi All,
    Could someone help me initiate code to seperate server log of domain for different projects running on the domain.
    For example, If I have two projects 1,2 in the same domain, then I should get two server log files for each project.
    Regards,
    SunnyPhani

    iCal Server sends invitations to internal users too if you remove the email addresses of your internal users under "Info" in Workgroup Manager.
    So the Open Directory does not have an entry for the users with your internal domain, which makes iCal Server see the user as an external one.

  • Sharing files for different users on same computer without duplicating

    Newbie here, I got my 1st mac (in ten years) last week and have been really enjoying it. I set up 3 user's accounts and wanted to share files such as iphoto and itune for all users. So I put my pictures in the shared folder, however, when I opened iphoto in each user's account, I had to import all the photos for every user, which resulted in duplicated files on each user's folders. I have tens of thousands of photos and don't want redundant files eat up my hard drive space. For this reason I'm holding off sharing my itune files.
    I'm wondering if there's a way to allow access for different users without making duplicates.
    20 in. imac   Mac OS X (10.4.8)  

    ewrspotter
    Preferably only admin can edit/import
    Well this makes things very easy and is the way that iPhoto is intended to share. In your Admin account, go to iPhoto -> Preferences -> Sharing and enable Sharing. Note that you can share an entire library or just individual albums. Leave iPhoto running and use Fast-User Switching to move to the other Account(s). In Launch iPhoto and go to Preferences -> Sharing and enable 'Look for Shared Photos'. The main library will turn up in the Source (or left-hand) pane of the other iPhoto.
    Remember that for this to work, the Admin account must be logged in and iPhoto must be running there.
    I don't really care as long as there's no redundant files.
    Define 'redundant'. You do realise that iPhoto is a database, with built-in image viewer, lightweight editor and version control. Version control means that if you modify a photo then iPhoto makes a copy, including the changes, and keeps the Original. This way you can always Revert to Original from the Photos menu. Many people switching to iPhoto are confused by this at first. If you don't want version control I strongly suggest using a different app. There a many, many image viewers for the Mac.
    As to your point comment about One-Touch DVD. I'm not familiar with that piece of Software, but every DVD (and CD) that you burn is assembled on the HD first, then burned. That assembly is a cache file and should be trashed on completion.
    As to disk space: you need to keep about 10 gigs of space on the Start-Up disk for Virtual memory, Temp files and other OS uses. If you do get an external at some point in the future it is possible to run both iPhoto and iTunes from it to free up space on the internal. Just check the help or post back to the relevant forum before moving them. It's not difficult, but there is a procedure that needs to be followed.
    Regards
    TD

  • Three iPods to be used for different collections by same owner

    Hi.
    I'm the happy owner of three iPods: an older iPod (maybe second or third gen 40 GB), a Nano, and the newer Video. I'd like to reset all of them to factory reset - erase all content and associations. Then, I'd like to reset iTune's knowledge of them.
    I would like to create different subsets of my music from iTunes so I can use them for different purposes. They have different capabilities (storage limits, video, etc.) so this will help me optimize their features as well.
    Does somebody know how to do these things?
    Thanks.
    aps.
    Aluminum 1.67, MacMini, Quicksilver, iBook, 3xPowerbook   Mac OS X (10.4.4)   Former UNIX kernel hacker.

    After some more research, I developed the answer I was looking for. Essentially, use the iPod updater to reset the iPod. Sometimes, you have to quit iTunes when it is updating, even if it is in the middle of updating. Then after reseting the iPod with the iPod updater, when iTunes starts, assign unique names to each iPod.

Maybe you are looking for

  • MS ACCESS exception when updating memo field

    I use JDBC - stmt.setCharachterStream() to set large amount of characters to the db. I get a MS Access "Function sewuence error" when updating a large amount of data (for smaller amounts there is no problem). Any Ideas ? note: I was using stmt.setAsc

  • Oracle 10.2 on Windows 2008R2 64bit

    Hello, I obtained IDES installation DVDs from SAP. I wanted to start installation, so first step was Oracle database. The problem is that SAP gave me DVD from 2006 with Oracle 10.2. There are three architectures available and noone wants to cooperate

  • Order related intercompany billing scenarios

    Hi, Need suggestion for order related intercompany billing from project. The scenarios is as follows. There will be two diffenr company code under the controlling area of the project. Parent company will use resources from supplying company for execu

  • Help with a reinstall Mavericks Questions

    I am in the process of planning some upgrades (SSD) on my iMac and then doing a reinstall of OSx Mavericks.  Currently I use Apple Mail to access my Gmail account.  My current settings in Gmail are: 1. POP is enabled for all mail that has arrived sin

  • Trouble eprint at sign in used id & password but comes up ajax submit error 403 forbidden

    just bought photosmart 5515 printer trying to get started with e print went to eprintventer.com clicked sign in entered user id and password but comes up ajax submit failed error=403 forbidden can anyone help