Help in creating MDX Calculated Member using attributes from multiple Dimension

Hi All,
First of all my knowledge on MDX is basic. In one of our projects, there is a requirement to create calculated member (similar to derived fields in SQL) which is more of a dimension attribute and not really a calculated member. Due to IP issues I cannot paste
the actual queries but I will provide an SQL Query equivalent to what I am trying to achieve:
Select P.Product, Case When ISNULL(FS.ArtistName,'') = '' Then P.ArtistName Else FS.ArtistName End Artist
 From
dbo.FactMusicSales FS
Join dbo.dimProduct P
on P.DimProductKey =  FS.DimProductKey
We are trying to replicate the logic for derving the "Artist" field using MDX script.
We are running into issues while trying to build an MDX expression using the above logic. The main issue being that the new field/member "Artist" would not be calculated unless its elements are selected (FS.ArtistName, P.ArtistName). Besides this
we are also unable to place this new member in a different folder other than a sub folder under the measures. Any pointers to solving this would be really helpful.
Thanks in Advance,
Venki

Hi Venki,
According to your description, you need to create calculated member (similar to derived fields in SQL) which is more of a dimension attribute and not really a calculated member, right?
In your scenario, you needn't to achieve this requirement by using MDX. You can use a named query on your data source view. A named query is a SQL expression represented as a table. In a named query, you can specify an SQL expression to select rows and columns
returned from one or more tables in one or more data sources. So in you scenario, you can use your query on the DSV, and then use the modified table to create a dimension.
http://msdn.microsoft.com/en-IN/library/ms175683.aspx
Regards,
Charlie Liao
TechNet Community Support

Similar Messages

  • How do I create a single image using PSE12 from multiple originals where each original is still separate?

    How do I create a single image using PSE12 from multiple originals in which the originals are still separate (i.e. side by side or arranged in a square)? I could do this in PSE2, but can't find how to get PSE12 to do it.
    Grecophile55

    In PSE2 there was a single photo-merge. I browsed all my images and I could then click and drag each to its new position before saving. There doesn’t seem to be a similar facility in PSE12.

  • MDX Calculated Member With Multiple Conditions

    I need to create a calculated member in my cube that spans multiple dimensions. A current calculated member looks like this:
    [Employee Hours Category].[Utilization Category].[NON-PTO], [Measures].[Employee Hours]
    This calculated member returns all the hours an employee worked that are not PTO.
    I need to select employee hours but with multiple conditions:
    - [DIM BILL STATUS][Bill Status] equals 0
    - [Employee Hours Time Category].[Time Category] equals "Client Facing"
    - [DIM PROJECT].[Client] isn't like "Olson"
    I know this is probably pretty easy, but I'm horrible with MDX!
    Thank you!!
    A. M. Robinson

    Thank you...
    Your answer looks good but I was actually able to figure out most of it, but still looking how to incorporate a FILTER into the MDX. I would like to FILTER like this:
     FILTER ([DIM Project].[Client].[Client].Members , 
                 NOT InStr([DIM Project].[Client].CurrentMember.MEMBER_NAME, "Olson")
    Heres the MDX I have so far that is working fine:
    ([Employee Hours Time Category].[Time Category].&[Client Facing],
       [DIM BILL STATUS].[Bill Status ID].&[1], [Measures].[Employee Hours])
    Do you just wrap the whole MDX in the filter, and if so, how would that be formatted?
    A. M. Robinson

  • How to use attributes from different context nodes in one view?

    I am VERY new to the concept of CRM and currently working on creating an alternate version of the BP_HEAD_SEARCH. With help from SAPPRESSs book 'SAP CRM Web Client' i was ble to create my own simple Z-component.
    However after going back and forth the book and the forum (including this [article|https://wiki.sdn.sap.com/wiki/display/CRM/Howtoaddanexistingfieldtoasearchpageofadifferent+component]) i was not able to find a solution to my problem. My current search uses BuilHeaderAdvancedSearch as context node for searching. But the search should also be able to use attributes from BuilActivity, which is directly related to BuilHeader. I can't seem to find a way to get attributes from BuilActivity into the search window of my component without having to change SAP-Standard.
    Is this really the only way? Please advise on possible code and insertion point.

    Any suggestions?

  • Unable to use AirPlay from multiple iOS and MacBook pro

    HI, I seem to be having issues using AirPlay From multiple iOS devices.
    I have the following devices, iphone 6 plus, iPad air (both Gen 1 and 2) an iPad 2 and a MacBook Pro running Yosemit. I also have 2 Apple TVs (both gen 1 and 2).
    Recently I have found that I am unable to use AirPlay on any of the iOS devices to either Apple TVs, the MacBook Pro will Airplay mirror ok, I am however able to use iTunes shairing from a Windows 8PC. I have restarted and also reset both Apple TVs and my router, I have also reset the connection settings on all the iOS devices but still can't resolve the issue.
    The Apple TVs have Internet connection so I can't see any issues network connections.
    ANyone else got got any Ideas?
    Thanks

    Try the following steps, check whether things are working after each step where appropriate, before trying the next.
    Check AirPlay is turned on on the Apple TV (turn it off and on if it already is)
    Check that both devices are on the same network (Settings > Wifi, on the mobile device and Settings > General > Network, on the Apple TV).
    Restart the Apple TV (Settings > General > Restart).
    Restart the Apple TV by removing ALL the cables for 30 seconds.
    Restart your router. (Also try removing it’s power cord for at least 30 seconds)
    Restart your mobile device.
    If you are still having problems, the following article(s) may help you.
    Troubleshooting AirPlay
    Troubleshooting Wi-Fi networks and connections
    Recommended Wi-Fi settings
    Wifi Diagnostic Software (for Mac users)
    You may also find some help on this page, where I’ve collected some of the more unusual solutions to network issues.
    When making adjustments to your network for better optimisation, you may find some of the points mentioned on this page helpful.
    This is answer is provided from my own database of boilerplate responses and the content was last reviewed and/or tested on: 2014/12/16

  • Need help in creating a sample application using Oracle I\PM 10gR3.

    I am a new to Oracle I\PM 10gR3 and I need a guide to create a sample
    application using Filer and a sample Process.
    I have searched the net and was unable to find any documents. If any body has
    any kind of guide to create an application please let me know.
    Waiting for a response.

    Please see Kenichi Unnai in his blog "How to use UWL API for NetWeaver BPM Tasks"
    How to use UWL API for NetWeaver BPM Tasks
    The .sca-file can be found on the sap service marketplace, afterwards you need to import the .sca-file, add the SC to your "MyComponents" and then you can select your necessary DC's.

  • How do I create a merged document using information from Numbers?

    I am new to using Mac and am trying to create a mail merged document.  I do not seem to have the same options in my Inspector that are referenced in the tutorial I found online.  Can anyone help? 

    That is because these are removed from Pages 5.
    Pages 5 is a much cut down version from the previous Pages '09.
    Pages 5 is designed to work better with the less featured iPad version.
    Peter

  • Create XML (using DTD) from multiple relation tables

    Hello and thank you in advanced.
    I'm trying to create an XML document, based on a specific DTD, by selecting information from multiple tables in the database.
    Is there a tool (in XDK maybe?) that will allow me to map my relational tables to a specific DTD?
    I could build the XML manually, but I was hoping that Oracle has already solved this problem with an automated tool.
    Thanks again,
    Sean Cloutier

    Is that the same thing as me writing an XSQL document which contains all of my queries (or views).
    In other words, do I have to map everything by hand or is there a tool to do that for me?
    thanks again,
    Sean
    null

  • Is there a way to use music from multiple users itunes libraries on one iMac for a slideshow in Aperture?

    I am trying to put together a slide show for a trip my wife and I took to England. I would like to be able to use music from both our itunes libraries in the slide show. I am using Aperture to create the slide show since it seems to be more versatile than iPhoto for this. Only trouble is that when I log into my username on the iMac I only see my iTunes library and similar when logging into her username. We have different music but would like to use some from each library in the slide show.

    You can only use one library at a time in an Aperture slideshow, so I'd suggest to simply collect the audio that you want to use in a folder (export the songs from both iTunes Libraries) and then import this folder to Aperture. Now you have a project containing the audio files; you will see it in the Aperture Audio section of the audio Browser, right above the iTunes section.
    You can use the Apperture audio just like the audio in iTunes to drag to the timeline of your slideshow.
    Regards
    Léonie

  • How can I create a master PDX that pulls from multiple other PDXs?

    I process aviation maintenance manuals, with the individual manuals having their own PDX. How can I create a master PDX that pulls from the individual PDXs?
    I have access to myriad versions of Windows and Acrobat so there's that...

    I’ve got 100s of manuals each with their own PDX. I’ve been asked to create a master PDX that in effect combines all of the individual PDXs into a single (cross-manufacturer, cross-fleet, cross-manual-type) searchable PDX that can be easily updated.

  • Help, for getting data(photos, songs or vid) from multiple sources.....

    Here is a background of the situation. I've bought my Ipod, October 06. I still don't own a laptop or a PC due to the lack of space of living on a ship(Navy). When I got my Ipod I used a friend's laptop. I installed Itunes on there and was able to import songs I had from my collection of CDs and Photos. Just recently I separated from that command. Now I want to put some new songs and photos I've recently acquired. And I plan to use my girlfriend's laptop. She has her own Ipod therefore already has Itunes installed.
    Now my question is:
    Will I be able to get songs from her Itunes Library(that I've copied from my collection of CDs), AND new photos from her laptop and STILL retain the old songs and photos I already have on my Ipod.
    Thanks!

    heres a more simple answer...YES you can add more songs from your GF laptop or from any PC/laptop for that matter
    Just remember to have oyur IPOD to MANUALLY MANAGE SONGS
    if its in automatic mode, your ipod will be the mirror image of the pc you are syncing in...so if you sync with another pc in automatic, that pc's itunes library will be in your ipod and the old songs will be erased. so be in manual so you could sync from multiple computers.
    As far as pics are concerned, it a totally different matter, you cannot do it manually, since you specify the folder where the pics are stored, it copies whatever is inside that folder and erases the old ones. so pictures in ipod needs to be in just 1 pc, if you transfer to another pc it erases the old ones and brings in the pics from the new pc
    Clear?

  • Help to create a component model using Calculator Web Service :(

    Hello All,
    Im working on EP6 SP9 and have a Calculator Web Service.
    I want to create a component which should contain following UI elements:
    1. <i>InputField</i> - to enter 1st number
    2. <i>InputField</i> - to enter 2nd number.
    3. <i>TextView</i> - To show the result
    The calculator web service consists of 4 basic methods like addition, subtraction, division & multiplication.
    I want to know whether how can I provide seperate buttons to each of the above mentioned functions 'coz when I add the web service while creating a component using SAP Web Dynpro (<i>using SAP NEtweaver Developer Studio 2.0.9</i>) - Model Creation step, I get an option to select only one method (and that is add).
    Its not working......
    I am following the steps as mentioned in help pages on Web Dynpro, section "Web Dynpro & Web Services" and example on WebServiceEmail.
    Please help.......
    I have to show this in a presentation on coming Friday.
    Awaiting Reply.
    Thanks and Warm Regards,
    Ritu R Hunjan
    <i></i>

    Please re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:
    http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300?resid=-Z5tUwoHAiwAAA8@NLgAAAAS&rests=1254701640551

  • MDX : How to use filter on a dimension without showing it OR merge 2 attributes of the same dimension?

    Hello everyone,
    I'm kind of newbie with MDX language, I'm trying to get filtered measures from a cube with a specific layout.
    Here is my exemple :
    I want to get all the "order numbers" where the "invoice" cost is more than 300.  Each invoice is linked with an ID, one order number can have several invoices.
    So what I do is a select request with 2 dimensions : "order num" and "id_invoice"
    Here is the result : I get all the cost sorted by "order num" and I can easealy identify those who are above 300
    order num
    Id_invoice
    cost
    Total
    Total2
    15450307
    10032013094498
    1671
    1737
    ok
    15450307
    10032013099835
    66
    1737
    KO
    15450596
    10032013094078
    8524
    8524
    ok
    15451214
    10032013094119
    228
    4348
    KO
    15451214
    10032013097069
    978
    4348
    ok
    15451214
    10032013097071
    3142
    4348
    ok
    15542434
    10032013101736
    142
    142
    KO
    15550064
    10032013097016
    1261
    1261
    ok
    15550346
    10032013097586
    2252
    2252
    ok
    15550353
    10032013098446
    2617
    2617
    ok
    What i need : In "cost", I need to have the sum of each cost which are above 300 in one line (without showing the invoice id)
    order num
    cost
    Total
    Total2
    15450307
    1671
    1737
    ok
    15450596
    8524
    8524
    ok
    15451214
    4120
    4348
    ok
    15550064
    1261
    1261
    ok
    15550346
    2252
    2252
    ok
    15550353
    2617
    2617
    ok
    How is it possible to use a filter on a dimension without showing it or merge 2 attributes of the same dimension ?
    The problem is that if I show "id" column, the filter doesn't work properly : it compares 300 with the total cost of the whole order and does not compare with each invoice (which could be under 300 ! - see "KO" in Total2 column)
    Here is the request I use to generate this result :
    with
    member [Measures].[Total]
    as (
    [TP].[ID INVOICE].[All],
    [TP].[ORDER NUM].currentmember,
    [Measures].[COST]
    member [Measures].[Total2]
    as (
    IIF([Measures].[COST] >
    300, "ok",
    "KO")
    select
    {[Measures].[COST],[Measures].[Total],[Measures].[Total2]}
    on
    columns,           
    Filter
                 [TP].[ORDER NUM].[ORDER
    NUM].members *
                 [TP].[ID INVOICE].[ID
    INVOICE].members
                 ,[Measures].[COST]
    > 0
    on
    rows
    FROM [MYCUBE]
    Thank you  for your help !
    Kind regards,
    Olivier.

    Hi Olivier,
    hereunder a similar query against the AW. For all order numbers, we sum all lines above 30 without diplaying the line numbers:
    WITH
    MEMBER [Measures].[lines above 30] AS
    IIF(
    [Measures].[Internet Sales Amount] > 30,
    [Measures].[Internet Sales Amount],
    null
    MEMBER [Measures].[aggr lines above 30] AS
    SUM(
    exists(
    [Internet Sales Order Details].[Sales Order Line].[Sales Order Line],
    [Internet Sales Order Details].[Sales Order Number].currentmember
    [Measures].[lines above 30]
    SELECT
    [Measures].[Internet Sales Amount],
    [Measures].[aggr lines above 30]
    } ON 0,
    [Internet Sales Order Details].[Sales Order Number].[Sales Order Number] ON 1
    FROM ( SELECT
    [Product].[Category].[All Products] ON 0,
    [Internet Sales Order Details].[Sales Order Number].&[SO51177]:
    [Internet Sales Order Details].[Sales Order Number].&[SO51178]
    } ON 1
    FROM [Adventure Works] )
    I reduced the cube with a subselect.
    Philip,

  • I need help with this program ( Calculating Pi using random numbers)

    hi
    please understand that I am not trying to ask anymore to do this hw for me. I am new to java and working on the assignment. below is the specification of this program:
    Calculate PI using Random Numbers
    In geometry the ratio of the circumference of a circle to its diameter is known as �. The value of � can be estimated from an infinite series of the form:
    � / 4 = 1 - (1/3) + (1/5) - (1/7) + (1/9) - (1/11) + ...
    There is another novel approach to calculate �. Imagine that you have a dart board that is 2 units square. It inscribes a circle of unit radius. The center of the circle coincides with the center of the square. Now imagine that you throw darts at that dart board randomly. Then the ratio of the number of darts that fall within the circle to the total number of darts thrown is the same as the ratio of the area of the circle to the area of the square dart board. The area of a circle with unit radius is just � square unit. The area of the dart board is 4 square units. The ratio of the area of the circle to the area of the square is � / 4.
    To simuluate the throwing of darts we will use a random number generator. The Math class has a random() method that can be used. This method returns random numbers between 0.0 (inclusive) to 1.0 (exclusive). There is an even better random number generator that is provided the Random class. We will first create a Random object called randomGen. This random number generator needs a seed to get started. We will read the time from the System clock and use that as our seed.
    Random randomGen = new Random ( System.currentTimeMillis() );
    Imagine that the square dart board has a coordinate system attached to it. The upper right corner has coordinates ( 1.0, 1.0) and the lower left corner has coordinates ( -1.0, -1.0 ). It has sides that are 2 units long and its center (as well as the center of the inscribed circle) is at the origin.
    A random point inside the dart board can be specified by its x and y coordinates. These values are generated using the random number generator. There is a method nextDouble() that will return a double between 0.0 (inclusive) and 1.0 (exclusive). But we need random numbers between -1.0 and +1.0. The way we achieve that is:
    double xPos = (randomGen.nextDouble()) * 2 - 1.0;
    double yPos = (randomGen.nextDouble()) * 2 - 1.0;
    To determine if a point is inside the circle its distance from the center of the circle must be less than the radius of the circle. The distance of a point with coordinates ( xPos, yPos ) from the center is Math.sqrt ( xPos * xPos + yPos * yPos ). The radius of the circle is 1 unit.
    The class that you will be writing will be called CalculatePI. It will have the following structure:
    import java.util.*;
    public class CalculatePI
    public static boolean isInside ( double xPos, double yPos )
    public static double computePI ( int numThrows )
    public static void main ( String[] args )
    In your method main() you want to experiment and see if the accuracy of PI increases with the number of throws on the dartboard. You will compare your result with the value given by Math.PI. The quantity Difference in the output is your calculated value of PI minus Math.PI. Use the following number of throws to run your experiment - 100, 1000, 10,000, and 100,000. You will call the method computePI() with these numbers as input parameters. Your output will be of the following form:
    Computation of PI using Random Numbers
    Number of throws = 100, Computed PI = ..., Difference = ...
    Number of throws = 1000, Computed PI = ..., Difference = ...
    Number of throws = 10000, Computed PI = ..., Difference = ...
    Number of throws = 100000, Computed PI = ..., Difference = ...
    * Difference = Computed PI - Math.PI
    In the method computePI() you will simulate the throw of a dart by generating random numbers for the x and y coordinates. You will call the method isInside() to determine if the point is inside the circle or not. This you will do as many times as specified by the number of throws. You will keep a count of the number of times a dart landed inside the circle. That figure divided by the total number of throws is the ratio � / 4. The method computePI() will return the computed value of PI.
    and below is what i have so far:
    import java.util.*;
    public class CalculatePI
      public static boolean isInside ( double xPos, double yPos )
         double distance = Math.sqrt( xPos * xPos + yPos * yPos );        
      public static double computePI ( int numThrows )
        Random randomGen = new Random ( System.currentTimeMillis() );
        double xPos = (randomGen.nextDouble()) * 2 - 1.0;
        double yPos = (randomGen.nextDouble()) * 2 - 1.0;
        int hits = 0;
        int darts = 0;
        int i = 0;
        int areaSquare = 4 ;
        while (i <= numThrows)
            if (distance< 1)
                hits = hits + 1;
            if (distance <= areaSquare)
                darts = darts + 1;
            double PI = 4 * ( hits / darts );       
            i = i+1;
      public static void main ( String[] args )
        Scanner sc = new Scanner (System.in);
        System.out.print ("Enter number of throws:");
        int numThrows = sc.nextInt();
        double Difference = PI - Math.PI;
        System.out.println ("Number of throws = " + numThrows + ", Computed PI = " + PI + ", Difference = " + difference );       
    }when I tried to compile it says "cannot find variable 'distance' " in the while loop. but i thought i already declare that variable in the above method. Please give me some ideas to solve this problem and please check my program to see if there is any other mistakes.
    Thanks a lot.

    You've declared a local variable, distance, in the method isInside(). The scope of this variable is limited to the method in which it is declared. There is no declaration for distance in computePI() and that is why the compiler gives you an error.
    I won't check your entire program but I did notice that isInside() is declared to be a boolean method but doesn't return anything, let alone a boolean value. In fact, it doesn't even compute a boolean value.

  • Help to create a text layer using scripting

    Hello everyone.
    I want to create a image as above.
    I know the box's left top point coordinate and the box's width and height. How can i create this layer ?
    I am using the following code, but it seems incorrect.
    app.documents.add(2175,1575, 300);
    var FontName = "BouwsmaText";
    var FontSize = 11;
    var black = new SolidColor();
    black.rgb.hexValue = '000000';
    var startRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    app.preferences.typeUnits = TypeUnits.POINTS;
    var newTextLayer = activeDocument.artLayers.add();
    newTextLayer.kind = LayerKind.TEXT;
    newTextLayer.textItem.kind = TextType.POINTTEXT;
    newTextLayer.textItem.color = black;
    newTextLayer.textItem.font = FontName;
    newTextLayer.textItem.size = FontSize;
    newTextLayer.textItem.contents = "Hello world\rThank you very much";
    newTextLayer.textItem.position = [new UnitValue(50, 'px'), new UnitValue(80, 'px')];
    newTextLayer.textItem.justification=Justification.CENTER;
    I don't know how to set the box's width and height. if I use TextType.PARAGRAPHTEXT, the width and height and coordinate are incorrect. Please help me , Thanks!

    If you do not add the text layer as paragraph text it is very easy to align the text to a selection. Make the selection after adding the text to the top left cornor of your document as a single or multiline text layer the use align layer to selection(scriptlistener code).  Paul has posted code in this forum you can steal like I did for aligning layers to a selection. For example
    //                              Helper Functions                                                  //
    function align(method) {
              var desc = new ActionDescriptor();
              var ref = new ActionReference();
              ref.putEnumerated( charIDToTypeID( "Lyr " ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
              desc.putReference( charIDToTypeID( "null" ), ref );
              desc.putEnumerated( charIDToTypeID( "Usng" ), charIDToTypeID( "ADSt" ), charIDToTypeID( method ) );
              try{
                        executeAction( charIDToTypeID( "Algn" ), desc, DialogModes.NO );
              }catch(e){}
    // In the main line I used it like this with other code Paul posted
    // Add Filename Text if called for
    if ( PopCollage.msgPnl.StampImage.st.value) {
    stampFilename(textFont,textSizeFactor,textColor,Name);
    loadAlpha("Image " + imageNumber);
    var Position = Number(PopCollage.msgPnl.grp5a.dd1.selection.index) + 1;
    switch (Position){
    case 1 : align('AdLf'); align('AdTp'); break;
    case 2 : align('AdCH'); align('AdTp');break;
    case 3 : align('AdRg'); align('AdTp'); break
    case 4 : align('AdLf'); align('AdCV'); break;
    case 5 : align('AdCH'); align('AdCV');activeDocument.selection.deselect();activeDocument.activeLayer.rotate(textA ngle); break;
    case 6 : align('AdRg'); align('AdCV'); break;
    case 7 : align('AdLf'); align('AdBt'); break;
    case 8 : align('AdCH'); align('AdBt'); break;
    case 9 : align('AdRg'); align('AdBt'); break;
    default : break;
    activeDocument.selection.deselect();
    // Add text Layer's layer style
    addStyle(textStyle);
    }  //end if

Maybe you are looking for

  • Mobile Accounts

    Hello, I have a G5 Server running Leopard Server. Is there a way to setup a mobile account where on some Macs, it syncs the Home Folder, but on others, it just accesses the Folder and does not sync it? Thanks

  • J1iex "capture excise duty" not updating Part1

    Hi MM masters, we have configred for capturing excise duty in MIGO and it is working fine. Now case is that when we are selecting "no excise"  at MIGO in excise tab and capturing excise at J1IEX "Capture excise Duty" with ref. of Material Doc. it is

  • How do I download and reinstall Adobe Acrobat X Standard?

    My computer got wiped and I need to reinstall the program. I have the original order details and serial number. Please help.  Thank you.

  • Using array in forall

    I was wondering what the syntax is for using a forall with a array. I want to do something like below but this doesnt work correctly. forall i in 1 .. p_array.COUNT insert into test_object (attr_id, attr_1, attr_2) values (p_array(i).attr_id, p_array

  • Exception on keyfigure depending on 3 characteristics

    Hi Experts, I am facing a problem in exceptions of query designing.The scenario is there are 2 characteristics and one keyfigure. the keyfigure (KF) needs to be highlighted according to the 2 characterisctics Eg if employee    factory      sales(KF)