SQL query in mapping to load the table from the warehouse

Hi experts,

I hope you can help me solve my problem. I already tried here in the forum how we can add a query in a mapping, but still not found the answer.
In my store, I have a time dimension table that has a unique dimension key and all the date information. In my source database, I have a table for business information. In this dirty table, I have a field named date. This date will be in exact format.
I also have a table sales in my warehouse which is almost a copy of the sales table from the source. I don't have that one more field in this table sale warehouse called "time_dim_key". This field should get the key of the dimension of the time dimension table warehouse based on the date of the sales table of source.
Do I think a mapping, which includes:
-the table sales source
-the time of warehouse dimension table
-the table of sales warehouse
Normal fields can I directly table card sales from source to sale warehouse table.
But the 'time_dim_key' of the table field dirty warehouse should fill up as:
Select dimension_key in the warehouse_time_dim_table where day_date = source_sales_table.date
Unfortunately I do not know how to include a query to get the exact date of this sale of source table in the mapping to fill the sales table from the warehouse.
I hope someone can help me solve this issue.

Thank you very much!
Kind regards
David

take the Carpenter of the palette
and create two groups
1.warehouse_time_dim_table
2.source_sales_table

then, write the join condition,
warehouse_time_dim_table.day_date = source_sales_table.date

Who will solve the purpose.

See you soon
Katia

Tags: Business Intelligence

Similar Questions

  • Performance problem on the SQL query that does not use the primary key index

    Hello!

    I have some performance issues on a single SQL query (Oracle 10 g).
    I could solve the problem by using the INDEX indicator, but I would like to know WHY this is happening.

    * Tables *.
    create table jobs)
    ID number (5) not null,
    name varchar2 (100),
    primary key constraint Job_PK (id)
    )
    /
    -Record count: 298

    create table Comp)
    integer ID not null,
    name varchar2 (100),
    primary key constraint Comp_PK (id)
    )
    /
    -Record count: 193

    -Relation m: n
    create table JobComp)
    integer ID not null,
    id_job integer not null,
    id_comp integer not null,
    primary key constraint JobComp_PK (id),
    unique key constraint JobComp_UK (id_job, id_comp),
    Constraint JobComp_FK_Job foreign key (id_job) refers to Job (id),
    Constraint JobComp_FK_Comp foreign key (id_comp) makes reference Comp (id)
    )
    /
    create index JobComp_IX_Comp on JobComp (Cod_Comp)
    /
    create index JobComp_IX_Job on JobComp (Cod_Job)
    /
    -Record count: 6431

    * Ask *.

    When I run this query, the execution plan shows the index using (JobComp_PK and JobComp_IX_Comp).
    No problem.

    Select JobComp.*
    of JobComp
    Join jobs
    on Job.id = JobComp.id_job
    where JobComp.id_comp = 134
    /
    -runs in 0.20 sec

    But when I add the field 'name' of the work table the plan uses full access table to the table of work

    Select JobComp.*, Job.name
    of JobComp
    Join jobs
    on Job.id = JobComp.id_job
    where JobComp.id_comp = 134
    /
    -runs in the 2.70 dry

    With the help of the index

    Select / * + INDEX (Job Job_PK) * /.
    JobComp.*, Job.name
    of JobComp
    Join jobs
    on Job.id = JobComp.id_job
    where JobComp.id_comp = 134
    /
    -runs in 0.20 sec

    * Doubt *.

    This behavior is correct?

    PS. : I tried to recalculate the statistics, but nothing changes:

    analyze the job calculation table statistics.
    /
    change the statistical calculation of index Job_PK reconstruction;
    /
    Start
    dbms_utility.analyze_schema (sys_context ('userenv', 'current_schema'), 'CALCULATE');
    end;
    /

    [of]
    Gustavo Ehrhardt

    Gus.EHR wrote:
    Hello.
    I'm sorry for the plan unformatted.
    The execution time of the querys "without field name' and 'with the field name with suspicion" are equal.
    He has no problem caching, because I get the plans of the sequence different from the querys and repeated the performance. The result is always the same.

    I don't think that there is no problem with oracle crossing LOOP IMBRIQUEE to the HASH JOIN when you include the field name and this should be the expected behavior. But it seems that your WORKING table has a degree of parallelism set against what is causing the query to run in parallel (as JOB table is now available with full table scan, instead of indexed access earlier). It could be that the parallel execution is contributor to extra Runtime.
    (a) do you know why the degree of parallelism on the WORK table has been defined? Do you need it?

    You can see if the following query provides a better response time?

    select /*+ NOPARALLEL(JOB) */ JobComp.*, Job.Name
      from JobComp
      join Job
        on Job.id = JobComp.id_job
     where JobComp.id_comp = 134
    
  • SQL Query to retrieve records in a table with the same records or only one record in a table

    Hello

    Got a curious requirment to extract the Non-distincts records in a table

    Example of

    Account number Type of account
    12345SB
    12345

    SB

    12346CR
    12346SB
    12347SB
    12348CR
    12349SB

    Requrirement is to retrieve the records as follows

    Result must be

    Account number Type of account
    12345SB
    12345

    SB

    12347SB
    12348CR
    12349SB

    You will notice that 12346 which has two separate lines have been eliminated in the result. I tried several qeries to achieve this result, one or the other had a few mismatch. Can someone give me a request for it.

    Thanks in advance.

    SELECT ACCOUNT_NUMBER,

    ACCOUNT_TYPE

    DE)

    SELECT ACCOUNT_NUMBER,

    ACCOUNT_TYPE,

    COUNT (*) ON CNT_ACC (ACCOUNT_NUMBER PARTITION).

    COUNT (*) ON CNT_NUM_TYP (PARTITION ACCOUNT_NUMBER, ACCOUNT_TYPE)

    FROM T1)

    WHERE CNT_ACC = CNT_NUM_TYP;

    exit;

    12345 SB
    12345 SB
    12347 SB
    12348 CR
    12349 SB
  • Help with sql query / a subquery to perform the COUNT

    Hello everyone,

    Co-worker colleague asked me to post a request here in hopes of getting more support.  Here's the question:

    There are 3 tables associated with this request.  A table of the application, which displays a number of application open for a particular request, an audit table that shows you all employees who worked on this application and one employee who shows you the details of the employee table.  My colleague is trying to understand what, how to see only applications that have been published by a wizard, but not a Manager.  There are a few applications that worked on both, but he won't see this request in its results.

    Here are the tables

    EMP

    ID FULL_NAME
    1234John Doe
    5467Jane Doe
    2345Clark Kent
    5432June Cleaver

    Unfortunately, this table does not have a title column (which was created provider, so we cannot change the internal structure).  My colleague knows who is the Assistant and the Director, then in this case, the first two of the id:

    1234 and 5467 are managers and the other 2 are assistants

    T_APPLICATION

    app_id app_number date_opened app_type
    901854778JANUARY 10, 2014NETWORK
    901954779JANUARY 11, 2014DATABASE
    901055000MARCH 12, 2014MATERIAL

    T_APP_AUDIT

    APP_ID PROCESSED_BY
    90181234
    90182345
    90185432
    90192345
    90195432
    90105432

    So, here is the actual query, I was given: it is actually to check the number of times that each application has been published per person:

    Select a.app_id, c.full_name, count (*) that controls

    t_application a, t_app_audit b, c of the emp

    where a.app_id = b.app_id and b.processed_by = c.id and

    a.app_type in ('NETWORK', "DATABASE")

    and b.processed not in ('1234, ' 5467')

    GROUP OF A.APP_ID, c.full_name;

    IF I won't see 9018 in my results, since at one time it was edited by a Manager (1234).  Unfortunately, this request does not eliminate the app_id 9018, it eliminates only the name of handlers appear in the query.  I hope I've explained this properly, and any help to point us in the right direction is welcomed.  Thanks in advance.

    Select

    a.app_id

    c.full_name

    , count (*) as the controls

    of t_application one

    t_app_audit b

    c of the emp

    where a.app_id = b.app_id

    and b.processed_by = c.id

    and a.app_type in ('NETWORK', "DATABASE")

    and b.app_id by (not in

    Select app_id

    of t_app_audit

    where processed_by in ('1234, ' 5467')

    )

    GROUP OF A.APP_ID, c.full_name;

  • Why the result of the SQL query is not displayed in the HTML text box?

    Hello

    Under query result appears in home > workshop SQL > SQL commands.

    Select t.nom
    of pm_task t
    where: P5_Project_id = t.project_id
    and: P5_task_id = t.id

    But when the same code is run through EditRegion of HTML text box > region definition > sources > Source region, the result is not displayed.
    Why is this so, and what is the solution?

    Thank you
    Guy

    You need a report from the region for this ;) A region of HTML is to display a static text or page items.

    Denes Kubicek
    ------------------------------------------------------------------------------
    http://deneskubicek.blogspot.com/
    http://www.Opal-consulting.de/training
    http://Apex.Oracle.com/pls/OTN/f?p=31517:1
    ------------------------------------------------------------------------------

  • Using SQL query, create data according to the requirement

    Hello

    Here is my table

    CREATE TABLE Test_Data
      ( Test_Id VARCHAR2(10), Start_Date DATE, end_date DATE
      );
    INSERT
    INTO Test_Data VALUES
      (
        'A1',
        To_Date('10-OCT-2013','DD-MON-YYYY'),
        To_Date('11-OCT-2013','DD-MON-YYYY')
      );
      
    INSERT
    INTO Test_Data VALUES
      (
        'A2',
        to_date('05-APR-2014','DD-MON-YYYY'),
        to_date('05-APR-2014','DD-MON-YYYY')
      );
    commit
    

    Nauru output like:

    ID
    Date Date_Part
    A1OCTOBER 10, 20131
    A1OCTOBER 10, 20132
    A1OCTOBER 10, 20133
    A1OCTOBER 10, 20134
    A1OCTOBER 11, 20131
    A1OCTOBER 11, 20132
    A1OCTOBER 11, 20133
    A1OCTOBER 11, 20134
    A2APRIL 5, 20141
    A2APRIL 5, 20142
    A2APRIL 5, 20143
    A2APRIL 5, 20144

    Help, please.

    Something along these lines perhaps, but I suggest that you create your own collection types.

    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    With partitioning, OLAP, Data Mining and Real Application Testing options

    SQL > WITH test_data AS

    2 (SELECT 'A1' test_id, to_date (October 10, 2013 ',' MON-DD-YYYY "") start_date,)

    3 to_date (11 October 2013 ',' MON-DD-YYYY "") end_date

    4 DOUBLE

    5. ANY TRADE UNION

    6. SELECT 'A2', to_date (5 April 2014 ',' MON-DD-YYYY "").

    7 to_date (5 April 2014 ',' MON-DD-YYYY "")

    8 DOUBLE)

    9. SELECT td.test_id 'ID', da.column_value 'Date', pa.column_value 'Date_Part '.

    10 test_data TD,

    TABLE 11 (CAST (MULTISET

    12 (SELECT td.start_date + LEVEL - 1

    13 DOUBLE

    14 CONNECT BY LEVEL<= td.end_date="" -="" td.start_date="" +="" 1)="">

    da 15 sys.odcidatelist)).

    16 pa TABLE (sys.odcinumberlist (1, 2, 3, 4));

    ID Date Date_Part

    -- --------- ----------

    A1 10 OCTOBER 13 1

    OCTOBER 10, 13 2 A1

    OCTOBER 10, 13 3 A1

    A1 10 OCTOBER 13 4

    OCTOBER 11, 13 1 A1

    OCTOBER 11, 13 2 A1

    OCTOBER 11, 13 3 A1

    OCTOBER 11, 13 4 A1

    A2 5 APRIL 14 1

    APRIL 5, 14 2 A2

    APRIL 5, 14 3 A2

    APRIL 5, 14 4 A2

    12 selected lines.

    SQL >

  • Error SQL query while trying to fetch the record that has MAX Effective_Date

    Hello

    Could you please suggest me on request below.
    I need to select the record which is having Maximam effectivity_date.
    Below a no not gives a group of expressin

    SELECT safety_stock_quantity
    OF mtl_safety_stocks
    WHERE inventory_item_id = 936
    GROUP BY safety_stock_quantity
    After having effectivity_date = MAX (effectivity_date);



    Thank you
    Pravin

    855902 wrote:
    Hello

    Could you please suggest me on request below.
    I need to select the record which is having Maximam effectivity_date.
    Below a no not gives a group of expressin

    SELECT safety_stock_quantity
    OF mtl_safety_stocks
    WHERE inventory_item_id = 936
    GROUP BY safety_stock_quantity
    After having effectivity_date = MAX (effectivity_date);

    Thank you
    Pravin

    SQL> select * from emp where mep_hiredate = (select max(mep_hiredate) from emp);
    
        EMP_ID EMP_NAME   EMP_SAL                    MEP_HIREDATE
    ---------- ---------- ------------------------------ -------------------
          COMM
    ----------
          1 ED           2                     2010-12-20 09:40:50
          2
    
  • SQL Query - to find users with the end of the responsibilities

    Oracle Apps worm: 11.5.10.2

    Oracle DB - 9i

    How can I list users and access given to them for a distribution Specifies any responsibility end being dated at the level of responsibility

    Sakshi,

    Try this, hope will solve your problem,

    Select a.user_name, a.description, c.RESPONSIBILITY_NAME, b.START_DATE, b.end_date
    fnd_user a.,
    B FND_USER_RESP_GROUPS_DIRECT,
    c fnd_responsibility_vl
    where a.user_id = b.user_id
    and b.RESPONSIBILITY_ID = c.RESPONSIBILITY_ID
    and a.user_id = 'ENTER_USER_ID';

    Thank you
    Anchorage :)

  • What is the best way to optimize a SQL query: call a function or doing a join?

    Hi, I want to know what is the best way to optimize a SQL query, call a function inside the SELECT statement, or make a simple join?

    It depends on.  Could be a.  Could be the other.  Could be no difference.  You would need to compare with your tables in your environment with your settings.

    If you put a gun to my head, I was given no other information and required that I answered the question, I would tend to wait that the join would be more effective.  In general, if you can do something in pure SQL, it will be more effective than if you call PL/SQL.

    Justin

  • SQL query in the apex

    Hi all

    I have table with the following fields start_time, end_time
    and data are 25/01/2010 12:00, 25/01/2010 12:48

    I run a sql query to get information on the time spent

    Select end_time - start_time
    table

    but it donne.033333333
    I want follwing result

    time_spent
    00:48 min


    Help, please

    The output you get is the difference between two dates and therefore the number of days
    You'll need extract the component you need by multiplying as a result...

    Something like that for the hour and minute component...

    sql> ed
    Wrote file afiedt.buf
    
      1  select start_date,
      2         end_date,
      3         (end_date-start_date) usual_diff,
      4         trunc(end_date-start_date) || ' days ' ||
      5         mod(trunc((end_date-start_date)*24),24) || ' hours ' ||
      6         mod(trunc((end_date-start_date)*24*60),60) || ' minutes ' ||
      7         mod(trunc((end_date-start_date)*24*60*60),60) || 'Seconds ' diff
      8*    from t2
    sql> /
    
    START_DATE           END_DATE             USUAL_DIFF DIFF
    -------------------- -------------------- ---------- --------------------------------------
    25-JAN-2010 03:00:00 26-JAN-2010 05:30:00 1.10416667 1 days 2 hours 30 minutes 0Seconds
    

    Or you can use the oracle supplied NUMTODSINTERVAL function and pass the two dates...

      1  select start_date,
      2         end_date,
      3         (end_date-start_date) diff_in_days_default,
      4*        numtodsinterval((end_date-start_date),'DAY') diff2 from t
    sql> /
    
    START_DATE           END_DATE             DIFF_IN_DAYS_DEFAULT DIFF2
    -------------------- -------------------- -------------------- -------------------------------
    25-JAN-2010 12:00:00 25-JAN-2010 12:48:00           .033333333 +000000000 00:47:59.999999999
    25-JAN-2010 00:00:00 27-JAN-2010 00:00:00                    2 +000000002 00:00:00.000000000
    

    .

    Published by: January 25, 2010 09:09: fixed error based on the comment below.

  • Help in the Search Condition in the SQL query

    Hi gurus,

    I had the table with 3 columns
    col1           col2             col3
    123        johns123     edwin321s
    seenu       janu      satya123reset
    3456       kris         123stest
    
    In single SQL query i want to print the value based on the '123' is  
    
    123,john123,
    satya123reset,
    123test
    
    or to print the records starts with 's' like 
    s123
    seenu,satya123reset
    stest
    Thanks in advance

    Published by: SeenuGuddu on October 15, 2009 21:55

    Published by: SeenuGuddu on October 15, 2009 21:55

    Published by: SeenuGuddu on October 15, 2009 22:07

    Hello

    Not sure you mean exactly, but maybe you could do something like:

    MHO%xe> with t as ( -- generating your sample data:
      2  select '123' col1, 'johns123' col2, 'edwin321s' col3 from dual union all
      3  select 'seenu', 'janu', 'satya123reset' from dual union all
      4  select '3456', 'kris', '123stest' from dual
      5  )
      6  --
      7  -- actual query:
      8  --
      9  select rtrim ( case when col1 like '%123%' or col1 like 's%' then col1||', '  end
     10         ||      case when col2 like '%123%' or col2 like 's%' then col2||', '  end
     11         ||      case when col3 like '%123%' or col3 like 's%' then col3||', '  end
     12         , ', ')
     13  from   t;
    
    RTRIM(CASEWHENCOL1LIKE'%123%'ORC
    --------------------------------
    123, johns123
    seenu, satya123reset
    123stest
    

    You mention:

    or print the records begins by a ' as

    However the output desired is not begin with s for 's123' and "stest"... you can adjust your specification or your output...

  • Passing the value of the SQL query select list

    Hello

    In my application users have in their homepage to a region which has two simple things, a part of LIST SLECT lov function and a BUTTON

    There is also another page which has a normal life to report which shows the employees.


    Homepage the user can select certain number of Department in its 'SLECT-LIST' and click 'open '.


    For example: If the user has selected a DEP_NUM_5 and click on the BUTTON it will be redirected to the page of a report and gets only showed the employees belonging to the Department 5.


    The report page contains a simple SQL query, and I understand that somehow I must pass the value in the SELECT LIST, where I now have the '?


    How can I do this, where should I start?

    Of course I would really appreciate an example of code, if anyone has time to do a.

    
    select "EMP_ID", 
    "EMP_FORNAME",
    "EMP_SURNAME",
    "DEP_NUMBER"
    from EMP E
    where E.DEP_NUMBER = ????????
    
    

    Hi Sozua,

    1. create an item hidden on the page where you have the report.

    I say P2_DEPT_NO

    2 assign to that in your sql query

    select "EMP_ID",
        "EMP_FORNAME",
        "EMP_SURNAME",
        "DEP_NUMBER"
        from EMP E
        where E.DEP_NUMBER = :P2_DEPT_NO
    

    below the area source ther is also an option

    Elements of page to submit-> put this element in this.

    for example;

    Page to submit items: P2_DEPT_NO

    3. change your button

    Action: Redirecting to page of this application

    Page: 2 / / assuming that page 2 is the report page

    Place these items: P2_DEPT_NO

    with these values: & P1_SELECT_LIST.  assuming that selection list is on page 1

    Hope this helps you,

    Kind regards

    Jitendra

  • How to measure the performance of the sql query?

    Hi Experts,

    How to measure the cost of performance, efficiency and CPU of an sql query?

    What are all the measures available to a sql query?

    How to identify the optimal query writing?

    I use Oracle 9i...

    It'll be useful for me to write the effective query...

    Thanks and greetings

    PSRAM wrote:
    Could you tell me how to activate the PLUSTRACE role?

    First put on when you do a search on PLUSTRACE: http://forums.oracle.com/forums/search.jspa?threadID=&q=plustrace&objID=f75&dateRange=all&numResults=15&rankBy=10001

    Kind regards
    Rob.

  • Loading the XML file with the missing elements dynamically by ODI

    Hi guys,.

    I have the XML with two nodes Employee and address below. On a daily basis, sometimes the address element might not come from the source xml file, but my interface has columns mapped to the elements of the address, and that is why it may fail because of the source element is not found in the file or data could not get charged because the State 'and' in the sql query that is generated between the employee and address elements.  Is there a way where I can load the data dynamically where I can search in the file only for items (used) present and dynamically loading data only for these items?

    XML file:

    <? XML version = "1.0" encoding = "UTF-8"? >

    < EMP >

    < Empsch >

    < employee >

    < EmployeeID 12345 > < / EmployeeID >

    < original > t < / initials >

    John < name > < / LastName >

    DOE < FirstName > < / name >

    < / employee >

    < address >

    < > 12345 as WorkPhone < / as WorkPhone >

    < WorkAddress > test 234 < / WorkAddress >

    < / address >

    < / Empsch >

    < / EMP >

    Thank you

    Fabien Tambisetty

    I managed to solve it by using left outer joins, and in referring to the structure of the table of the XSD

  • Substring of SQL query

    Hello

    In my table, I have the name used like this

    EX:
    BOSE, MR. BIRAT
    NANDY, MR. AMITABHA

    The name before the colon is the name of family and after it's first name

    Now, I want to show in the front-end server like this for both above

    MR. BOSE BIRAT
    MR. AMITABHA NANDY


    How to write a Sql query, where you can get the name before the decimal point and place at the end of the name and remove the comma from also for display purpose.

    Thank you

    Something like that?

    WITH t AS
    (SELECT 'BOSE, Mr. BIRAT' as n FROM DUAL
     UNION ALL
     SELECT 'NANDY, Mr. AMITABHA' FROM dual
    )
    SELECT n,
           regexp_replace(n, '([^,]+), (.+)*', '\2 \1')
      FROM t;
    

Maybe you are looking for

  • no noise when shooting video!

    Help! I bought a Rebel T3 just prior to moving overseas (and I am no where near the store where I bought it) and I started to teach me today how to use the video function, I did a few video tests and there is no sound! I have the sound recording is e

  • Retail Windows 8.1 installation

    Godd moring I have a HP Envy 17-J010EL. I'll install a fresh retail version of Windows 8.1 (Pro). Once it is installed, how can I install any drivers, HP programs, etc., as those who come pre-installed? Thank you Carlo

  • Formatting disk with Vista Home Basic

    Im trying to format a hard drive which is subject to vista and xp oem system builders install disc. He won't do it because it says there is a more recent version of windows installed. How can I get Hardrive in proper form, so that I can instakk the x

  • BlackBerry smartphones increase the length of characters in SMS Messages

    I have the 8830 curve and am limited to 160 characters when sending a SMS.  Is there a way to increase that amount or do it in a second SMS auto debit?

  • Problems of ACS1113 SE &amp; IP

    people thought I would let you know everything a problem I encountered with an ACS1113 SE sit in a DMZ Firewall 4.1 I had problems of connectivity with the box and had to go on-site and console on it only to find, he had lost his IP address I've reco