Combine two resultset sidebyside in coulmn using mdx

hi i am new to mdx,
i want to combine two select statement resultset (side by side like union) using mdx query,please any body help me to solve this query
first query:
 SELECT
{ [Last Year] }
ON COLUMNS,
 { {[Location].[Location].&[7], [Location].[Location].&[12], [Location].[Location].&[11],
[Location].[Location].&[19], [Location].[Location].&[17], [Location].[Location].&[16],
[Location].[Location].&[9], [Location].[Location].&[18] },{[Location].[Location].[All]}}
ON ROWS
FROM [Cube1]
WHERE ( [Measures].[Labour %] )
here [Last Year] is a calculated set
{STRTOMEMBER("[Date].[Month].&["+ cstr(year(now())-2) +"-11-01T00:00:00]"):
        (STRTOMEMBER("[Date].[Month].&["+ cstr(year(now())-1) +"-10-01T00:00:00]"))}
2nd query:
WITH MEMBER [Measures].[Budget ] AS IIF(avg([Last Year],IIF(([Measures].[Budget]>0),[Measures].[Budget],null)),
                                        avg([Last Year],IIF(([Measures].[Budget]>0),[Measures].[Budget],null)),0.00),
MEMBER [Measures].[YTD] AS IIF(avg([Last Year], IIF(([Measures].[Labour %]>0),[Measures].[Labour %],null))<>null,
                              avg([Last Year], IIF(([Measures].[Labour %]>0),[Measures].[Labour %],null)),0.00),
FORMAT_STRING = "Standard",
BACK_COLOR = CASE WHEN [YTD] = 0  THEN /*White*/16777215 /*White*/  
WHEN [YTD] <= [Measures].[Budget ] THEN 65408
     WHEN [YTD]<= [Measures].[Budget ] +5 THEN 65535
     WHEN [YTD]> [Measures].[Budget ] +5 THEN 255
END,
VISIBLE = 1
SELECT
{  [Measures].[YTD], [Measures].[Budget ] }
ON COLUMNS,
{ { [Location].[Location].&[7], [Location].[Location].&[12], [Location].[Location].&[11], [Location].[Location].&[19], [Location].[Location].&[17], [Location].[Location].&[16], [Location].[Location].&[9], [Location].[Location].&[18]
},{[Location].[Location].[All]} }
ON ROWS
FROM [Cube1]
here   ==> [Measures].[YTD], [Measures].[Budget ] are calculated member
i want result like in
coulmns===> ytd,budget,nov,dec,jan,feb.,,,,,,,,,,out
rows ====> are only locations and total(average of all locations)
please guide me to get solution like mdx query

Hi Vsp,
According to your description, you want to create a calculated member to combine two members, and then set it as Default member, right?
In SQL Server Analysis Services, we can use the script below to create a calculated members.
create member currentcube.[Date].[Day of Week].[weekend]
as
{[Date].[Day of Week].&[6],[Date].[Day of Week].&[7]
Every attribute in a dimension in Microsoft SQL Server Analysis Services has a default member, which you can specify by using the
DefaultMember property for an attribute. This setting is used to evaluate expressions if an attribute is not included in a query. Please refer to the link below to see the detail information about specify a default member.
http://technet.microsoft.com/en-us/library/ms174822(v=sql.105).aspx
Regards,
Charlie Liao
TechNet Community Support

Similar Messages

  • Combine two reports in query designer using key figure with sap exit

    Hi experts,
    i want to combine two reports in query designer using key figure with sap exit
    in the report 1 key figure calculation based on the open on key date(0P_DATE_OPEN)
    to calculate due and not due in two columns
    in report 2 key figure calculate in the time zones using given in variable Grid Width (0DPM_BV0) like due in 1 to 30 days, 31 to 60 days...the due amount based on the open on key date(0P_DATE_OPEN)
    to calculate in 1-30, 31-60, 61-90, 91-120, 121-150 and >150 days in 6 columns
    now i have requirement like this
    not due, 1-30, 31-60, >60, due,1-30, 31-60, >60 in 8 columns
    or
    not due, due, 1-30, 31-60, 61-90, 91-120, 121-150 and >150 in 8 col
    thank you

    Hi Dirk,
    you perhaps know my requirement,
    for the management to make used in one report,
    we have in reporting finacials Ehp3.
    Vendor Due Date Analysis - which show due, not due
    Vendor Overdue Analysis - show only due and analysis in time grid frame
    i want to combine in one report that show NOT DUE, DUE, DUE time frames in grid.
    krish...

  • How do I combine two pdf documents into one using preview?

    If I remember correctly I have done this in the past but now I can't remember how to do it.
    Message was edited by: admiral_koa
    i finally found some other questions like mine which got answered. So I'm closing this out.

    That would be kind of you. Thank you. This is my first post on the new support setup. I find it a lot different than the previous arrangement. Harder actually.  I don't remember what I did when I first posted it. It seemed like my searches for my subject I could not find until I posted my question and then I found some immediately. Evidence of my struggling with how this works.
    thanks again,
    AK

  • Can I combine two pdf files by using command lines?

    Hi
    I always need to combine two pdf files into one in my regular work
    Currently, I open one of them, press ctrl+shift+I,
    find another file and double click it.
    It works but not so efficient since I need to do
    this procedure many times everyday
    So I'm looking for a better solution
    Something like command lines,
    for example:
    acrobat.exe "combine" "doc1.pdf" "doc2.pdf"
    Does acrobat have these functions or not?
    Thx &
    Best Regards

    File > Combine

  • Combining two single recordset into one two column recordset

    Hi Forum
    Assume we have three types , each 'table of'
    CREATE OR REPLACE type type1 as table of number ;
    CREATE OR REPLACE type type2 as table of varchar2 (255);
    CREATE OR REPLACE TYPE TYPEVALUE AS OBJECT
    (object_type number ,
    object_value varchar2(255)
    resultset1 type1 := type1() ;
    resultset2 type2 := type2() ;
    resultset3 typevalue := typeValue3() ;
    I want to populate records of resultset3 from resultset1 and resultset2 , using resultset1 for first column of record and resultset2 for second column.
    One way is to do for loop but I don't want to use this.
    I need something similar to resultset3 to use it dynamically in select statement to do MINUS operation with another resultset . I think things like MULTISET, COLLECT, CAST can achieve what I want to do.
    Can you please help me to have a select statement that combines two single column rowset and put into a two column recordset.
    Thanks

    Hi,
    You can do something like this:
    SQL> create or replace type type1 as table of number;
      2  /
    Type created.
    SQL> create or replace type type2 as table of varchar2(255);
      2  /
    Type created.
    SQL> create or replace type typevalue as object(object_type number, object_value varchar2(255));
      2  /
    Type created.
    SQL> create type typevalue_tab as table of typevalue;
      2  /
    Type created.
    SQL> ed
      1  declare
      2     resultset1 type1 := type1(1, 2, 3, 4, 5);
      3     resultset2 type2 := type2('one', 'two', 'three', 'four', 'five');
      4     resultset3 typevalue_tab;
      5  begin
      6     for l_res in (
      7        select typevalue(t1.col1, t2.col2) as col
      8        from (
      9           select column_value col1
    10           , rownum rn
    11           from table(cast(resultset1 as type1))
    12        ) t1
    13        , (
    14           select column_value col2
    15           , rownum rn
    16           from table(cast(resultset2 as type2))
    17        ) t2
    18        where t1.rn = t2.rn
    19     )
    20     loop
    21        dbms_output.put_line(
    22           'Object Type:  '||l_res.col.object_type||' '||
    23           'Object Value: '||l_res.col.object_value
    24        );
    25     end loop;
    26* end;
    SQL> /
    Object Type:  1 Object Value: one
    Object Type:  2 Object Value: two
    Object Type:  3 Object Value: three
    Object Type:  4 Object Value: four
    Object Type:  5 Object Value: five
    PL/SQL procedure successfully completed.All the work here is done in SQL so it should work similarly if you have these things defined as nested table columns in the database.
    However, there is a caveat here: the lines highlighted in bold above are defining an arbitrary ordering for the nested table elements using rownum, as there is no concept of ordering within a nested table. You should change this part of the query to whatever makes sense in your environment, otherwise this solution cannot be guaranteed to be correct. Another option would be to use VARRAYs, as they will retain the order of elements.
    cheers,
    Anthony

  • How to combine two datarows (business component data) in BI Publisher

    Hi ,
    We are using BI Publisher in Siebel Environment.
    We have data coming from two business components (like from 2 diff tables)
    a) <?for-each:ssTest1?>
    b) <?for-each:ssTest2?>
    ssTest1 and ssTest2 are the business components
    We need to combine these 2 datarows (a&b) and show the data into a single combined data row for ex like <?for-each:ssTest1ssTest2?> and show all the fields in that.
    I'm not sure how we can combine these two data rows into a single combined data row and show the data.
    Any help from any one would be apprecated.
    Thanks
    PV
    Edited by: user8633002 on Oct 21, 2010 4:05 PM

    Hi sajid
    There was nothing more description about your issue in this site and I found an issue below is mostly like yours
    http://www.codeproject.com/Questions/855487/how-to-combine-two-table-value-in-rdlc-report
    In the issue above, if you want to show the two other tables in the report, I think you could combine the tables into one datatable joining on key. The link below show an example of a DataSet Helper from Microsoft about combine DataSets. Take note of
    the related content for other DataSet Helper examples. And then you could use the datatable in your RDLC.
    # HOW TO: Implement a DataSet JOIN helper class in Visual C# .NET
    http://support.microsoft.com/kb/326080/en-us
    In an alternative way, I think you could create a view in the database which combine your tables and use it in your rdlc.
    In addition, your issue is about asp.net and you could get more support in the asp.net forum whose link as below.
    http://forums.asp.net
    Best Regards
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a
    href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.

  • Controversy in two ResultSet!!!

    Could anyone please provide me a solution for this problem..
    I've created two ResultSet rs1 and rs2, both are retrieving the data from the same table. Manipulation of rs2 or any kind of processing should affect the rs1. So, if i updating something in the same table through rs2 , so it should affect the entire table . So, for other retrieval of data it should be updated. I've written this code, but it's not working.....
    Statement stmt=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
                    ResultSet rs,rs1;
                    rs=stmt.executeQuery("select * from checkdata");
                    while(rs.next())
                        String s1=rs.getString(1);
                        int count=1;
                        rs1=stmt.executeQuery("select phone_no from checkdata where phone_no='"+s1+"'");
                        while(rs1.next())
                            if(!(rs1.isLast()))
                                count=count+1;
                                rs1.deleteRow();
                            stmt.executeUpdate("update checkdata set count='"+count+"' where phone_no='"+s1+"'");Please help me out!!!!
    in advance thanks a lot....

    First of all i've this sample_log.txt file which i've putted into the table using bulk insert command . The text file looks like:
    123:books:java:Tue Dec 24 10:34:56 IST 2006
    123:books:java:Wed Dec 25 16:45:58 IST 2006
    123:books:java:Fri Dec 27 10:34:12 IST 2006
    234:books:C++:Mon Mar ..............................
    etc. it's a log file so it just added into the text as the request comes.
    Now i've putted all these values into the table.
    What i want is to read all these details and update the details as the last accessed. Suppose in this example, there should be only one entry for '123' and also update the details as the latest time that is 'Fri Dec 27 10:34:12 IST 2006' rest the two(2) should be deleted from the database and also there should be one more coloumn name count which is to be incremented as it encountered the same no. i.e '123' else it should be 1. The result i want is:
    after putting the logic it should appear as:
    123:books:java:Fri Dec 27 10:34:12 IST 2006:3
    234:books:c++:Mon Mar 12 10:12:10 IST 2006:1
    etc......
    I've to do all this in my jsp page using jdbc connectivity, with SQL 2005 as database.

  • How to combine +two fields without submitting page (via AJAX/HTMLDB_Get)?

    Hi all,
    After my last contribution "Request for Scott Spendolini" I was able to create the scripts to update fields in forms without having to refresh the page. Thanks again to Scott, Carl and the others who helped me solving my problem.
    I have another question regarding this however. How do I combine two (or more) values on a form to fill a field with the values, for instance to create a unique Primary-key field?
    This is the example: combine the postcode and the house-number (and maybe an extension to the housenumber) in one field 'adrescode'. This uniquely identifies an adress in the Netherlands. I can 'get' the postcode to fill the first part of the adrescode, but how do I modify the scripts to 'get' the housenumber (huisnummer) and - if not left null - the extension to the housenumber?
    Here are the scripts I created to far:
    in the region source of the page I have the following Javascript:
    <script language="JavaScript1.1" type="text/javascript">
    function f_P52_getAdrescode ()
    var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=P52_getAdrescode',0);
    get.add('P52_POSTCODE',html_GetElement('P52_POSTCODE').value)
    gReturn = get.get();
    if(gReturn)
    {  html_GetElement('P52_ADRESCODE').value = gReturn  }
    else
    {  html_GetElement('P52_ADRESCODE').value = 'null'  }
    get = null;
    </script>
    and in the shared components of the application I have created an process P52_getAdrescode as follows:
    declare
      l_adrescode varchar2(16);
    begin
        l_adrescode := :P52_POSTCODE || :P52_HUISNR ;
        if :P52_HUISNRTOEVOEGING is null then
              NULL ;
        else
              l_adrescode := l_adrescode ||':'||:P52_HUISNRTOEVOEGING ;
        end if ;
        htp.prn(l_adrescode);
    -- dbms_output.put_line(l_adrescode);
    end;
    I ran this PL/SQL in the SQL-section of HTMLDB and it does what a expect: combine the values in a new string.
    In my page however, it only gets the value of postcode and puts this into the adrescode field.
    So my question is: how do I modify the Javascript (I Guess) so that also the fields 'huisnummer' and 'huisnummertoevoeging' end up in the adrescode field?
    Thanks for your help,
    Jan.

    Carl, Scott,
    I have two pages with exact the same fields and codings (as described before in this Post.
    I now have two different named functions and application processes, a javascript an process for each page. They both do the same thing, use the same code except for the page-number (:P52_ and :P92). I tried to make one process to replace both, but ran into problems when I changed the name in the get.add statement.
    Changing the get.add from: get.add('P52_POSTCODE',html_GetElement('P52_POSTCODE').value) to: get.add('POSTCODE',html_GetElement('P52_POSTCODE').value) always ends up in what looks like a complete html-(source)dump of the page in the field that has to be updated. Even when I replace the :P52_POSTCODE in the application process as well Changing back the application process and the javascript to so that both javascript and process use the :P52_ again and the function returns the correct value again. What am I doing wrong?
    I requested an online-workspace to post the application to it, but have no answer to my request yet, so I can't provide a working example at the moment....
    Thanks for your help again,
    Jan.

  • How do I combine two user accounts into one account?

    When we originally set-up our iMac, I set-up two accounts for my wife and I. Since then it has been a royal pain with music and applications sharing. How do I merge the two accounts into one?

    I found an answer to this by searching on "merging two accounts" rather than "combining two accounts." BTW, it's a little mini-nightmare if you only use "combine" on both Google and Apple support. At least this post might help others avoid the same fate.
    Here's where to go to find the answer: http://discussions.apple.com/message.jspa?messageID=5629676#5629676

  • How do I combine two PDF files into one?

    I want to merge two PDF files into one to make things easier when I take the file(s) to a professional printer.
    Can I do this in Preview?
    Thanks.

    You can't do in Preview.
    You can combine individual PDFs into one PDF using one of these freeware utilities.
    PDFMergeX @ http://www.malcom-mac.com/blog/pdfmergex/
    joinPDF @ http://www.macupdate.com/info.php/id/16604
    Combine PDFs @ http://www.monkeybreadsoftware.de/Freeware/CombinePDFs.shtml>
    PDFLab (join & split) @ http://pdflab.en.softonic.com/mac
     Cheers, Tom

  • How can I combine two itunes accounts into one?

    How can I combine two itunes accounts into one?

    Items purchased from the iTunes Store are permanently associated with the account from which they were originally purchased.  Apple provides no way to change this.
    However, if you wish to put content from two accounts into a single iTunes library, you can easily do so.  Use the command File > Add File (or Folder) to Library.

  • Is it possible to combine two existing iTune accounts and then cancelling one? Many thanks.

    I am trying to combine two accounts that I have on iTunes (created separately over the years) so as to then delete/cancel one to only have one active account (with all of my combined purchases, etc. on this combined account).
    Is this possible, or is there another way of transfering purchases to one of the accounts and then just deleting the then "empty" one?
    Thanks for any advice / input

    method one from the following support article should do the trick: How to use multiple iPods, iPads, or iPhones with one computer.

  • How do you combine two or more movie clips into one movie clip in iMovie '09

    how do you combine two or more movie clips into one movie clip in iMovie '09

    First create an iMovie project. Then drag the clips (or portions of clips) that you need into the project.
    When finished, use the SHARE menu to share the project.

  • Can I combine two iTunes accounts into one?

    Hello. I have an iPod touch, but to download and install apps, I have to use my dad's account to download. Is it possible to combine two together into one( I just created an Apple ID. ) thanks for answering!0.0

    this Apple article says no:
    http://support.apple.com/kb/he37
    "I have multiple Apple IDs. Is there a way for me to consolidate them into a single Apple ID?
    At this time, Apple IDs cannot be consolidated. "

  • Trying to combine two 'lines' to make a 'shape'?

    I've been trying for hours to combine two curves I drew with the pencil tool into a shape that I can fill with a color or gradient:
    http://img199.imageshack.us/img199/4155/flametests01.png
    The top row has the two lines (stroked).   When I move them together, I get a pleasing 'flame' shape that I want to use in a logo.
    The bottom row shows what happens when the two 'lines' are 'filled', and what happens when the flame is 'filled'.   I've tried all manor of grouping, merging, combining....I've lost track at this point....
    I think part of my problem is that I assume the pencil tool would draw lines (or perhaps 'paths' is more accurate?)--but it seems to be drawing 'shapes'.
    I've tried using the pen tool, but the curves are never as smooth as the ones I drew 'freehand'...
    What should I have done / be doing differently?

    Just drag-select the upper two points with the Direct Select tool and use the KBSC CmdOpt-Shift-J to unite the lines. Do the same at the bottom to complete the shape.

Maybe you are looking for

  • Need opinions on a VERY low end power supply handling a low end graphics card

    Greetings. I have acquired my father's old(old) HP Slimline S3400F and have intentions of turning it into a media computer. Problem : Due to the tiny form factor, it has an abysmal 160watt PSU. Inquiry : I know that most manufacturers FAR overstate t

  • Development of a add-on

    Hi. Could me explain how to create a form for a UDO using the SBO SDK and Visual C# 2008 Express? Or at least the main points in the development of a add-on Thanks

  • Systemd system-modules-load error [Solved]

    After recent update of kernel too linux-3.14.4-1I now cannot boot system due too this error -- Logs begin at Fri 2014-05-16 11:58:04 BST, end at Fri 2014-05-16 12:00:56 BST. -- May 16 11:59:33 arch systemd[1]: Starting Graphical Interface. -- Subject

  • Post code error?

    Hi there I have just moved to an area where FTTC is available right up to the entrance to our cul de sac only to be told via both Infinity line checker and BT themselves that I am unable to get Infinity. Just spoke to an Openreach engineer who was do

  • Firefox sometimes grabs 50% of my CPU, which slows my computer. Any suggestions for fixing this?

    It usually seems to occur when I'm trying to get into a secure account (my 401k) or download something, but not always. Sometimes it just seems to occur when I've been on-line for awhile. I just downloaded Firefox v3.6.