Fact table have tow column reference the same dim table

In my analytic domain, my fact table have tow column reference the same dim table, but in physical diagram, between two table ,can only have one join, so i create a copy of the dim table, then finish the join in physical. This method can resolve this question, but not so good, Anyone have perfect solution?

user4497169 wrote:
Thanks,
yours method is very very good, I don't know this method before. Where do you get this imfomation?The sample sales RPD has (good) modelling references you can refer to, otherwise think about how you'd write the SQL Statement yourself, you'd need to use an alias to access the same table on seperate joins.

Similar Messages

  • Multiple columns from the same dimension table as row labels performing slowly

    (Working with SSAS tabular)
    I'm trying to figure out what the approach should be for the following scenario:
    Lets say we have a Customer table. The table has columns such as account number, department number, name, salesperson, account manager, number of customers, delivery route, etc
    A user of the model could want to see any permutation of that information as the row labels. How should that be handled?
    What we've been doing so far is that the user adds each column they want into the "ROWS" section in Excel. This works fine with smaller tables (for example, "Department" table with a "Department Code" and "Department Name",
    but on large tables this quickly chokes. I understand why this is happening, I just haven't found a better way to accomplish the same thing.
    I can add a calculated column to the model through VS, but obviously this is unsupportable and unscalable when each person needs their own permutations of the data. Can something similar be done in Excel? 
    This question seems to be what I need:
    http://social.msdn.microsoft.com/Forums/en-US/97d1157a-1402-4227-b96a-79524401ddcd/mdx-query-performance-when-selecting-multiple-attributes-from-same-dimension?forum=sqlanalysisservices
    However I can't find any information on how to add those properties (is it a multidimensional-only thing?)

    Thanks for the help. Sorry but i'm a self-taught developer, and i may be missing some basics :)
    Anyway i've done what you suggested but i get this error:
    [nQSError: 15011]The dimension table source Dimension Services.DM_D_SERVIZI_SRV has an aggregate content specification that specifies the level Product. But the source mapping contains column COD_PRODUCT with a functional dependency association on a more detailed level .
    where:
    - DM_D_SERVIZI_SRV is the physical alias for the Service Dimension (and the name of the LTS too)
    - COD_PRODUCT is the leaf of the hierarchy, the physical primary key, but it hasnt to be included in the hierarchy
    Do i have to add another level with the primary key and hide it to the users?
    I tried to solve this going to the logical tables source properties, on the tab contents, setting "logical level" to null for the hierarchy, but i don't know if this is correct.
    Thanks

  • Can i have tow HttpService in the same application???

    I try to use tow HttpService (one for delete row in a table
    and the other for read the table):
    <mx:HTTPService id="listcls" url="
    http://127.0.0.1:32000/affcls.php"
    useProxy="false" method="POST">
    <mx:request xmlns="">
    <clsci>{clsci.text}</clsci><clsint>{clsint.text}</clsint><prfci>{lstprfci.text}</prfci>
    </mx:request>
    </mx:HTTPService>
    <mx:HTTPService id="supcls" url="
    http://127.0.0.1:32000/suprcls.php"
    useProxy="false" method="POST" >
    <mx:request xmlns="">
    <clsci>{toto.text}</clsci>
    </mx:request>
    </mx:HTTPService>
    PHP files work correcly! But i must kill my application and
    restart it to see the change!!!! Why?
    Please help me!!!

    Hey MattAka,
    If I understood correctly, you want to send DELETE, get
    result, then fire off READ, then get result? You can definitely use
    two HttpServices in your app. Make two result handlers, first call
    DELETE, then on result why not call both the DELETE result handler
    and READ send and wait for that result?
    <mx:HTTPService id="supcls" url="
    http://127.0.0.1:32000/suprcls.php"
    useProxy="false" method="POST" result="
    handleDeleteResult();listcls.send()">
    Or, handle the result of DELETE and in that function, call
    the READ.send(). I think that's the same thing Jeffrey was aiming
    at.

  • Want to use the same #TEMP table for multiple datasets in SSRS 2005

    I am using Visual Studio 2005 to create SSRS 2005 reports. The report will consist of two different matrix from two different dataset that will gather data from the same data source. The first dataset is a procedure that inserts data from a query into
    a #temp table and outputs it in the first matrix. I want the second dataset to be a different procedure that references the same #temp table. When the report is pulled then can the #temp table be dropped.

    Try in the Dataset properties.  In the Query tab, under and to the right of "Data source:" click the box with the elipses (...).  In the General tab, toward the bottom, there is a check box beside "Use single transaction".
    Rakesh M J | MCTS,MCITP ( SQL SERVER 2008 )
    Dont forget to mark it as Answered if found useful |
    myspeakonbi

  • Two columns in the same table that are foreign keys to the same master key

    i want to create a table let say X, which have two columns that are foreign key that reference the same column in the master table, so does this count as bad database design.

    here is the full ddl for the two table, where in the second table there are two columns that represent the primary key and they are also two foreign keys to the same columns in the master table (items)
    Desc item table;
    Item_id
    Item_name
    Item_price
    Item_quantitiy
    Create table item_recommendation ( item_id varchar(20), recommended_item varchar(20),
    CONSTRAINT recom_primary PRIMARY KEY (item_id, recommended_item),
    CONSTRAINT F1 FOREIGN KEY (item_id) REFERENCES items(item_id), ),
    CONSTRAINT F2 FOREIGN KEY (recommended_item) REFERENCES items(item_id));

  • How to sum different column in the same table

    Hi everyone
    I would like to know how can I make the sum of different column in the same table using apex
    exple:
    TR_PROJ_BIL_TRIM.ENTPIDFISC as ENTPIDFISC,
        TR_PROJ_BIL_TRIM.EXEANNEE as EXEANNEE,
        TR_PROJ_BIL_TRIM.PROJBILTRIMT1PREV as PROJBILTRIMT1PREV,
        TR_PROJ_BIL_TRIM.PROJBILTRIMT2PREV as PROJBILTRIMT2PREV,
        trunc( TR_PROJ_BIL_TRIM.PROJBILTRIMT1PREV)+(TR_PROJ_BIL_TRIM.PROJBILTRIMT2PREV)
    from TR_PROJ_BIL_TRIM TR_PROJ_BIL_TRIM
    group by TR_PROJ_BIL_TRIM.ENTPIDFISC,TR_PROJ_BIL_TRIM.EXEANNEE
    but while trying to run this script i get this error message:"ORA-00979: not a GROUP BY expression"
    thanks for reading me and I hope to hear from you soon

    Hi,
    Your question do not have anything do with APEX.
    It is pure SQL question and you will get better answer this kind questions from SQL and PL/SQL forum
    You need have GROUP BY when you use aggregate functions like SUM.
    I assume you like just add two columns.
    Try
    SELECT ENTPIDFISC
        ,EXEANNEE
        ,PROJBILTRIMT1PREV
        ,PROJBILTRIMT2PREV
        ,trunc(PROJBILTRIMT1PREV) + (PROJBILTRIMT2PREV)
    FROM TR_PROJ_BIL_TRIM
    Regards,
    Jari

  • Nsert/Update and Add Column at the same Table and at the "same" Time

    Hello,
    I want Insert/Update and Add Column at the same Table and at the "same" Time but in different sessions.
    Example:
    At first the "insert/update" statement:
    Insert into TestTable (Testid,Value) values (1,5105);
    After that the "add" statement:
    Alter table TestTable add TestColumn number;
    - sadly now I get the message: ORA-00054: resource busy and acquire with NOWAIT specified
    "insert/update" statement:
    Insert into TestTable (Testid,Value) values (2,1135);
    After that the execute commit.
    I don't know when the first session set the commit statement so I want that the DB the "Alter Table..." statement execute if it's possible.
    If it's possible I want to save a repeat loop with the "Alter Table..." statemtent.
    Thanks for ideas

    Well I want to walk in the rain without and umbrella and still stay dry, but it ain't gonna happen.
    You can't run a DDL statement against a table with transactions pending. Session 2 has to wait until session commits or rollbacks (or until the session is killed). That's just the way it is.
    This makes sense if you think about it. The data dictionary has to be consistent across all sessions. If session 2 was allowed to change the table structure whilst session 1 has a pending transaction then the database is in an inconsistent state. This is easier to see if you consider the reverse situation - the ALTER TABLE statement run by session 2 does a DROP COLUMN TESTID rather than adding a column: now what should happen to session 1's INSERT statement? You have retrospectively invalidated a statement that was perfectly legal when it was executed.
    If it's possible I want to save a repeat loop with the "Alter Table..." statemtent.Fnord.
    Cheers, APC

  • Count Distinct based on another column in the same table

    Hello,
    My question in short: is is it possible to add a new column to a view which holds the DISTINCT COUNTS of values/domains of another column in the same view?
    For example, in the below table the column "Distinct Count of Occurence" shows how many distinct values a person has in the Occurence column. So AAA has 1 and 2 therefore it is 2 distinct values etc.
    My issues is that I can retrieve unique values bu Count (Select Occurence)but I can not add the new column that would add the records to the corresponding Persons in the above table.
    Is there an easy way to achieve this on the DWH level or should it be done with MDX in the cube?
    Thanks

    Hi,
    Below a solution to use the view by adding a column with window functioning, maybe this will help.
    CREATE TABLE #TMP
    PERSON VARCHAR(10),
    OCCURENCE SMALLINT
    --DROP TABLE #TMP
    INSERT INTO #TMP(PERSON,OCCURENCE)
    VALUES
    ('AAA','1'),
    ('AAA','2'),
    ('BBB','1'),
    ('BBB','1'),
    ('BBB','1'),
    ('CCC','1'),
    ('CCC','2'),
    ('CCC','3');
    --TRUNCATE TABLE #TMP
    WITH CTE
    AS
    SELECT PERSON
    ,OCCURENCE
    ,ROW_NUMBER() OVER(PARTITION BY PERSON ORDER BY OCCURENCE) AS RN
    FROM #TMP
    SELECT PERSON, MAX(RN) AS RN
    FROM CTE
    GROUP BY PERSON
    Regards,
    Reshma
    Please Vote as Helpful if an answer is helpful and/or Please mark Proposed as Answer or Mark As Answer when question is answered

  • Filter on the same logical table source on two logical tables is not working properly

    Hi,
    In the RPD, assume that I have a physical table named Employee_fact, created an Alias called D0 Employee Fact
    In the BMM I've two logical tables called Employee_fact_Type1 and Employee_fact_Type2
    Each of these logical tables has the same Logical table source - D0 Employee
    But in each logical table source, I've a filter in where clause
    such as, for Employee_fact_Type1  employee_type = 'XXX'
                 for Employee_fact_Type2 employee_type='YYY'
    These two facts are present in the same BMM and each of them are connected to two dimensions
    such as
    Dept_type1 <- Employee_fact_type_1 -> Tenure_type1
    Dept_type2 <- Employee_fact_type_2 -> Tenure_type2
    In analysis, When I query the columns from Dept_type1 and Tenure_type1, the database query generated shows the condition employee_type='YYY' instead of employee_type='XXX' .
    But, adding the columns from Dept_Type1, Employee_fact_type_1, Tenure_type1 it shows proper filter.
    I checked the relationships, presentation layer for the sources of presentation tables and everything looks good.
    Can anybody tell me what goes wrong here?

    did you set the content level as well?

  • Can I have multiple hotspots on the same ALV grid?

    Hi,
    I have a simple ALV grid report with a hotspot.  I can't seem to find any examples or information on whether I can have 2 hotspots on the same ALV grid line.
    Is this possible and is there an example somewhere that I can look at?
    Thanks for your help!
    Andy

    Check the code below
      METHODS:set_hotspot_ebeln CHANGING pc_alv TYPE REF TO cl_salv_table
                                         pc_report TYPE REF TO lcl_report.
    *--Event Handlers for alv
        METHODS:on_link_click FOR EVENT link_click OF cl_salv_events_table
                              IMPORTING row column .
    METHOD set_hotspot_ebeln.
        DATA: lf_cols_tab TYPE REF TO cl_salv_columns_table,
              lf_col_tab  TYPE REF TO cl_salv_column_table.
        DATA: lf_events TYPE REF TO cl_salv_events_table.
        lf_cols_tab = pc_alv->get_columns( ).
        TRY.
            lf_col_tab ?= lf_cols_tab->get_column( 'VGBEL' ).
          CATCH cx_salv_not_found.
        ENDTRY.
        TRY.
            CALL METHOD lf_col_tab->set_cell_type
              EXPORTING
                value = if_salv_c_cell_type=>hotspot. "5-stands for hot spot
          CATCH cx_salv_data_error .
        ENDTRY.
        TRY.
            lf_col_tab ?= lf_cols_tab->get_column( 'VBELN' ).
          CATCH cx_salv_not_found.
        ENDTRY.
        TRY.
            CALL METHOD lf_col_tab->set_cell_type
              EXPORTING
                value = if_salv_c_cell_type=>hotspot. "5-stands for hot spot
          CATCH cx_salv_data_error .
        ENDTRY.
        lf_events = pc_alv->get_event( ).
    *--Set event handler for click on cell
        SET HANDLER lf_report->on_link_click FOR lf_events.
      ENDMETHOD.                    "set_hotspot_ebeln
      METHOD on_link_click.
        DATA:la_put TYPE type_put.
        READ TABLE lf_report->i_put INTO la_put INDEX row.
        CHECK sy-subrc = 0.
        if column = 'VGBEL'.
        SET PARAMETER ID 'BES' FIELD la_put-vgbel.
        CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
        elseif column = 'VBELN'
       "<----
       endif.
      ENDMETHOD.                    "on_link_click

  • Vector clone references the same objects??

    Hi all
    I'm developing a simple chess program.
    Obviously, each move the user tries must be checked against the following sets of chess rules:
    1.) Whether it is that colour player's turn to move
    2.) Whether this move is valid for this specific piece (eg. 3 forward for a King --> invalid of course)
    3.) Whether this move will jeopardize the player's king (put it in check)
    If from any of the above the move is found to be invalid, the move is not executed.
    My program structure is briefly this:
    A. abstract super class 'ChessPiece' - subclassed by the various specific Chess Piece classes.
    Each of the specific ChessPiece subclasses must implement an abstract method to check if a
    proposed move is valid, and also a method to actually do the move...
    B. 'PieceManager' class - has a Vector of ChessPieces:
    This class checks whether the given move is valid:
    For the piece: by calling the checking method (see A above)
    For the general game: by making sure the given move doesn't put the player's king in check.
    NOTE: In chess (for those who don't know), it is illegal to move any piece if, at the end of
    the move, your king will be in check [possible to be captured by any enemy piece]
    This last check I want to do in the following way:
    1) copy/clone the entire PieceManager object
    2) in this copied object, actually do the move
    3) still in the copied/cloned object, see if the moving player's king is now in check
    4) based on this evaluation, execute the move in the original PieceManger object or don't...
    The Problem:
    When I clone this PieceManager object, its 'pieces' Vector is obviously also cloned.
    BUT it seems that the cloned 'pieces' Vector references the same ChessPiece objects
    as those referenced by the original 'pieces' Vector; ie the 2 Vectors are sharing the same Objects.
    Thus, when I actually execute the move in the test/cloned PieceManager object,
    the original PieceManager's corresponding piece is moved too (well, it seems it is the same piece...).
    I am pretty stuck with this.
    I've tried the Vector clone method; it doesn't seem to copy the objects, but create another reference
    to the same objects, as I've said.
    I've tried cloning the entire object ; also not helping......
    I'd love any comments, helpful pointers, suggestions.
    Also any comments on my program structure... is a Vector the best tool for this job?
    Thanks very much -
    lutha

    Hi all, OP here.
    Ok thanks guys for all your posts...
    two points:
    1) I have tried the "copy constructor", and it seems to be doing the same thing. (ie 'shallow clone')
    What's really frustrating me is that nothing I do seems to actually physically copy the Vector's objects
    to new, separate copies of those objects...
    I had my PieceManager class implement Cloneable (just in case - not too sure on that one; in fact I
    commented that out later), and I overrode the clone method like this:
    public Object clone ()
            PieceManager pm = new PieceManager ();
            Vector pcs = new Vector ();
            // Enumeration e = pieces.elements ();
            //while (e.hasMoreElements ())
            //    ChessPiece p = (ChessPiece) e.nextElement ();
            //pcs.add ();
            //}  // still references the same objects!!
            pieces.trimToSize ();
            int size = pieces.size ();
            Object[] arr = new Object [size];
            Object[] initial = pieces.toArray ();
            System.arraycopy (initial, 0, arr, 0, size);
            for (int i = 0 ; i < size ; i++)
                ChessPiece p = (ChessPiece) arr ;
    pcs.add (p);
    pm.pieces = pcs;
    return pm;
    This all still does the same 'shallow cloning'...
    2) m.winter, my ChessPiece objects are not immutable - they have a co-ordinate field that
    changes as they are moved. This is for getting as called by another object, and for checking in
    the ChessPiece's own internal method for checking whether the passed-in square co-ordinate
    is a valid destination.
    Anyway, I don't think that's the main issue here. How can I properly clone/copy a Vector, resulting
    in :
    a) the original Vector
    b) a new, totally unrelated Vector.
    Thanks again all for your input.
    regards,
    lutha

  • ADF 11g Partial Triggers Row Column Update By Column in the Same Row

    Hi.
    I have a situation whereby I have a checkbox in a table row, which has an eventchangelistener, which upon activation, trys to update another column in the same row. I can not get this to work through partial triggers, even though I have set up my ids up correctly. The row though can be updated by a command button outside of the table using the same coding techniques, but I need it updated via the checkbox.
    Is there a limitation in updating a column within a row, from another row column's event change listener.
    Thanks.

    Updating the other rows from the checkbox works fine for me. Here is what I did.
    I DnD Emp table with a new column that says if the emp is new hire. If the checkbox is checked, I set Firstname and Lastname for that row as NewHire. I have partial triggers on Firstname and Lastname columns to update whenever checkbox is checked/unchecked and autosubmit on checkbox to true. Hope this helps.
    Try adding column selection property to single and see if it helps.
    Edited by: asatyana on Jan 16, 2012 12:48 AM
    Edited by: asatyana on Jan 16, 2012 12:49 AM

  • Radio group in classic report based on another column on the same row.

    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    Application Express 4.1.0.00.32
    How can I have a radio group column based on an LOV utilizing another column on the same row of the report?
    For example: what if I had a survey application and depending on the likert scale that was assigned to the question there would be different possible answer choices:
    Question 1 on row 1 of the report: The class instructor was friendly?
    Likert scale choice is Agreement.
    Choices on Radio Group: Strongly Agree, Agree, Undecided, Strongly Disagree
    Question 2 on row 2 of the report: The class offered good materials?
    Likert scale choice is Quality.
    Choices on Radio Group: Excellent, Below Average, Average, Above Average, Excellent
    The radio group can change per row depending on the Likert scale assigned to the question which is assigned to a different column on the row.
    Can LOV utilize the column? :
    SELECT scale_text
    FROM scale_choices
    WHERE scale_category_choice_id = 2 <<= this would be the Likert scale identifier
    ORDER
    BY display_order

    Here is the answer:
    APEX_ITEM.SELECT_LIST_FROM_QUERY(
    p_idx IN NUMBER,
    p_value IN VARCHAR2 DEFAULT NULL,
    p_query IN VARCHAR2,
    p_attributes IN VARCHAR2 DEFAULT NULL,
    p_show_null IN VARCHAR2 DEFAULT 'YES',
    p_null_value IN VARCHAR2 DEFAULT '%NULL%',
    p_null_text IN VARCHAR2 DEFAULT '%',
    p_item_id IN VARCHAR2 DEFAULT NULL,
    p_item_label IN VARCHAR2 DEFAULT NULL,
    p_show_extra IN VARCHAR2 DEFAULT 'YES')
    RETURN VARCHAR2;

  • Can you have multiple databases on the same LUN in Exchange 2010?

    I'm sure you can but is it possible with exchange 2010 to have multiple databases on the same LUN.  We currently have 8 DB's all writing to their own DB drive and separate log drive so 16 drives in total.  I need to spin a new DB up this week and
    wanted to double check this is possible.  I've looked online and cant find anything that I've seen before that says this is possible.
    Thanks.

    Hi,
    Yes, multiple databases could be placed on the same LUN, but it's not recommended.
    If you have 2 drives fail at the same time (it happens more than you think), then losing 100% of your DBs is a lot worse than losing one of them or some of them depending on where the failures are.
    Here is a similar thread for your reference:
    Multiple databases on the same LUN in Exchange 2010
    Hope this helps!
    Thanks.
    Niko Cheng
    TechNet Community Support

  • ITunes 11... I have multiple artists with the same album name... how do i have them show up as separate albums?

    I have itunes 11 with iTunes Match on 2 Macs and 2 ios devices... I know it all has bugs... but I have been ok.
    I am wondering how to show my library in the column browser view when I have multiple albums with the same names? I have noticed on my ipod in my car that an album titled "Christmas" plays and includes 2 different albums titled christmas... and in itunes it lists them both when not in the artwork view... (I primarily use the column browser to navigate my library.
    Just wondering if anyone else has experienced this/knows how to fix.
    Thanks!

    Various workarounds I can think of which basically involve playing around with tags.  See which meets your needs or come up with others:
    Give the albums slightly different names.  For example, "Greatest Hits" [ABBA]"
    Do the same but do it in the sort album field.
    Add a bogus disc number to different albums.  It may string them together still but at least they will be slightly grouped.

Maybe you are looking for

  • RAID 0s no longer appear

    Hi. I have a strange problem that seems too unlikely to be pure coincidence. I have two double disk external enclosures connected via firewire, each set up as a software RAID 0 from disk utility. I keep one as a backup of the other. The other day, BO

  • Number of data files per database!

    Hello, http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/limits002.htm#i287915 reads >> Database files Maximum per tablespace Operating system dependent; usually 1022 Maximum per database 65533 May be less on some operating systems Limit

  • Cover flow Scrollbar and mouse wheel issue?

    When I scroll my podcasts in cover flow view using the mouse wheel it skips some of the podcast album art. What I mean is when moving the scrollbar left or right with the mouse wheel the scrollbar skips like half way instead of being able to scroll e

  • CTM Server

    Hello I have to install CTM server on win. machen my SCM/APO server on aix machine. I have install standalone gatway with same SID as SCM server. then i install CTM Optimizeer by sapinst it seif . i have maintain sm59. saying run from explicit host.

  • Pages 5: How can I put a picture in the header of a Page?

    In the previous version (4.3) this was no problem. This seems not to possible any more?