I need to create a mapping with the sql below.

Hi Everyone,
Please take a look at the query below and help me out how i can re-write the same logic and create a mapping in the warehouse builder.
I appreciate your help.
select learner_id,template_id,delivery_id,
dense_rank() over (partition by template_id,learner_id order by end_date desc nulls last ) dr,
max(end_date) keep (dense_rank first order by end_date desc nulls last) over (partition by template_id,learner_id) max_end_date,
min(end_date) keep (dense_rank last order by end_date desc nulls last ) over (partition by template_id,learner_id) min_end_date,
lead(end_date, 1, null) over (partition by template_id,learner_id order by end_date desc nulls last ) next_max_end_date,
start_date,
Created_on
from offering_action
where action_status_code = '200'
and completion_status_code = '200'
Thanks,
Sushma

In this order:
Source table (offering_action) -->
Filter (where action_status_code = '200' and completion_status_code = '200') -->
Expression with 4 output columns ---- dr, max_end_date, min_end_date, next_max_end_date ----
dense_rank() over (partition by template_id,learner_id order by end_date desc nulls last ) dr,
max(end_date) keep (dense_rank first order by end_date desc nulls last) over (partition by template_id,learner_id) max_end_date,
min(end_date) keep (dense_rank last order by end_date desc nulls last ) over (partition by template_id,learner_id) min_end_date,
lead(end_date, 1, null) over (partition by template_id,learner_id order by end_date desc nulls last ) next_max_end_date,
that's it.

Similar Messages

  • Need to Create a Map with Dots Where There Is Activity

    I need to create a U.S. map (plain with just state borders), with a dot (bullet, period) in each city where my client has activity. There will maybe be a few hundred dots. Although the dots don't have to be positioned with precision, it's still a lot of work to look up the smaller cities and see where to position them at all. Is there an automated way of doing this? My fantasy is map software into which I can simply import a list of cities, with controls that allow me to specify the size, color, and shape of the dot. Perhaps different dots for dfferent categories, etc. (I am positing this here somewhat arbitrarily since ID is my favorite program and what I'm looking for probably isn't an Adobe product anyway.)

    Have you tried http://batchgeo.com/
    Not Adobe software but may do the trick....

  • Please Help with the sql below for hierarchies

    Hi all.
    I have a table named stg_org_hier whose data looks like this
    i would like to build the hierarchy from BU,AREA,REGION,DISTRICT,TERR
    There are data cyles in the data below
    stg_org has this data
    QTR_CD     HIER_LVL_CD CURR_RDT_ID     DISTRICT_RDT_ID
    2007Q4     AREA     E0F7B00000000     E0F7B00000000
    2007Q4     BU     E0F7B00000000     E0F7B00000000
    2007Q4     AREA     E0F7B40000088     E0F7B40000000
    2007Q4     REGION     N0F7B40400000     E0F7B40000000
    2007Q4     REGION     E0F7B40700000     E0F7B40000000
    2007Q4     AREA     E0F7B00000088     E0F7B00000000
    2007Q4     AREA     E0F7B40000000     E0F7B00000000
    2007Q4     DISTRICT     N0F6B40405C99     N0F7B40400000
    2007Q4     REGION     N0F7B40400088     N0F7B40400000
    2007Q4     DISTRICT     N0F7B40405M99     N0F7B40400000
    2007Q4     TERR     N0F1B40405201     N0F7B40405M99
    they would like to see the output in the below in the below form
    QTR_CD     HIER_LVL_CD CURR_RDT_ID     DISTRICT_RDT_ID
    2007Q4     BU     E0F7B00000000     E0F7B00000000
    2007Q4     AREA     E0F7B00000000     E0F7B00000000
    2007Q4     AREA     E0F7B00000088     E0F7B00000000
    2007Q4     AREA     E0F7B40000000     E0F7B00000000
    2007Q4     AREA     E0F7B40000088     E0F7B40000000
    2007Q4     REGION     E0F7B40700000     E0F7B40000000
    2007Q4     REGION     N0F7B40400000     E0F7B40000000
    2007Q4     DISTRICT     N0F6B40405C99     N0F7B40400000
    2007Q4     REGION     N0F7B40400088     N0F7B40400000
    2007Q4     DISTRICT     N0F7B40405M99     N0F7B40400000
    2007Q4     TERR     N0F1B40405201     N0F7B40405M99
    Here is the sql i have written :
    select curr_terr_rdt_id,district_rdt_id,hier_lvl_cd,level from STG_ORG_QTR_SF_HCHY
    connect by prior
    curr_terr_rdt_id=district_rdt_id

    qtr_cd,hier_lvl_cd,curr_rdt_id,  district_rdt_id
    2007Q4,BU,         E0F7B00000000,E0F7B00000000
    2007Q4,AREA,       E0F7B00000000,E0F7B00000000
    2007Q4,AREA,       E0F7B00000088,E0F7B00000000
    2007Q4,AREA,       E0F7B40000000,E0F7B00000000
    2007Q4,AREA,       E0F7B40000088,E0F7B40000000
    2007Q4,REGION,     E0F7B40700000,E0F7B40000000
    2007Q4,REGION,     N0F7B40400000,E0F7B40000000
    2007Q4,DISTRICT,   N0F6B40405C99,N0F7B40400000
    2007Q4,REGION,     N0F7B40400088,N0F7B40400000
    2007Q4,DISTRICT,   N0F7B40405M99,N0F7B40400000
    2007Q4,TERR,       N0F1B40405201,N0F7B40405M99Not having a database at hand right now is helpful this time ;)
    Indenting the data clearly shows that the hierarchy rules are being violated (cycles you are mentioning do not matter in this case):
    Each node must have a unique predecessor except the root having none (in your case data on lines 3 and 4 both point to lines 1 and 2)
    2007Q4,BU,         E0F7B00000000,E0F7B00000000
    2007Q4,AREA,       E0F7B00000000,E0F7B00000000
           2007Q4,AREA,       E0F7B00000088,E0F7B00000000
           2007Q4,AREA,       E0F7B40000000,E0F7B00000000
                  2007Q4,AREA,       E0F7B40000088,E0F7B40000000
                  2007Q4,REGION,     E0F7B40700000,E0F7B40000000
                  2007Q4,REGION,     N0F7B40400000,E0F7B40000000
                         2007Q4,DISTRICT,   N0F6B40405C99,N0F7B40400000
                         2007Q4,REGION,     N0F7B40400088,N0F7B40400000
                         2007Q4,DISTRICT,   N0F7B40405M99,N0F7B40400000
                                2007Q4,TERR,       N0F1B40405201,N0F7B40405M99Removing the first data line or changing it's curr_rdt_id will make hierarhical queries work (lines 1 and 2 would better not point to themself)
    Regards
    Etbin
    Message was edited by: Etbin
    user596003

  • How to create a mapping with text file as my target

    I need to create a mapping with source as a table and target as a text file.
    I am using OWB 10g R2. with database Oracle10g.
    Any one can help me to create a mapping with a text file as target.

    Hi,
    just create a File-Location and File-definition and use this file-operator as target object inside your mapping.
    Regards jwehner

  • Creating a mapping using the API

    Hi Brian, I am curious about this use case - what's the reason you are looking to do it using the API? You can create several objects using the API and the most typical use case we have observed is where mapping developers create a pattern or what we call as a "template" - which is a mapping with various properties parameterized. For example you can create a mapping with the filter parameterized, or define a very generic mapping with source, target and the field map between those all parameterized. Once you do that, you can create a "task" for this mapping (known as Mapping Configuration Task) - that can be done using our UI or using our REST API. If you choose the latter, you can pass on parameter values as part of the API request. Suggest you to take a look at our new Developer Portal, and specifically at the sections Templates and REST API there. Feel free to post any further questions here. If you sign up to the developer program there, you will get much more direct help.https://community.informatica.com/community/technology_partner_network Amol

    I was wondering about creating a mapping using the API. It clearly states in the Dev guide that this is possible, but when I perform a get mapping request, I don't see all the information given for a certain object.  For example, I don't see an expression in the mapping object (although one exists when I view the object in Cloud).   Has anyone else done this? Is it easy to create objects via the API?  Thanks!

  • I need your expert opinion on how to create a map with multiple conditions.

    Hello.
    I need your expert opinion on how to create a map with multiple conditions.
    I have a procedure (which i cannot import or re-create in OWB due to the bug), so i am trying to create a map instead :-(
    How can i create a cursors within the map?
    My function creates table and cursor.
    Then it will have to check for duplicates in the tables (the one created and another table) - the criteria for finding duplicates is a number of fields.I then need to place few different conditions (if some attributes are not available) and it has to load cursor based on this conditions. The next step is to fetch the data into the cursor based on what attributes are missing.
    The next thing it will do is insert the data into table (if record doesn't exist), output the error in separate table is record is corrupted, or update the record with changed information.
    In short i need to re-create match / merge but with conditions, iterations etc 'built into' it.
    I can read up on available functions - it's just what would be the best options? and what would be the best approach to do so?
    In my function i use %rowtype - but cannot use it in owb - so what would be the alternative? i don't really want to create a lot of variables and then have a nightmare of maintaing it. are there any tips regarding this?
    having looked through Oracle dedupe - it's not really what i need because it is just DISTINCT.
    I would appreciate any help / advise on this.
    Thank you very much

    thanks a lot for your reply - i will look into this option :-)
    it is a bit more complicated now as i have to re-create the match / merge and then somehow 'tweak' it to achieve the result i need.
    At the moment i am looking to breakdown the package into smaller chunks 'functions' and try creating the map that way.
    Anyway, thank you very much for your suggestion.

  • HT5622 We are a family of 4, each with their own apple device. Is it best for us to set up individual apple ID's for things like ITunes? If we do can the same e-mail address be used for all of them or do we need to create e-mails for the kids? Thank-you

    We are a family of 4, each with their own apple device. Is it best for us to set up individual apple ID's for things like ITunes? If we do can the same e-mail address be used for all of them or do we need to create e-mails for the kids?
    Thank-you

    1. Yes, it is.
    2. You may be able to use the same address by adding a plussed suffix to it, such as [email protected] If that doesn't work, create separate emails.
    (103279)

  • HT202879 I downloaded the new version of pages about a month ago.  Today I tried to open documents that I created and saved with the new version and received a message that I needed to download the new version.  The app store shows the download.  HUH?!?

    I downloaded the new version of pages about a month ago.  Today I tried to open documents that I created and saved with the new version and received a message that I needed to download the new version.  The app store shows the download.  HUH?!?

    I'm not sure what you mean by it making accessing files more complicated. I have both Pages 4.3 & Pages 5.1 icons in my Dock as well as Numbers 2.3 & Numbers 3.1. I continue to use the iWork '09 versions for my everyday needs. As long as the new versions are in your Applications folder & the '09 versions in the iWork '09 folder, Software Update will not have a problem updating them even if Apple should come out with a new update for the '09 versions.
    Because I have moved the new versions to an external drive & renamed the apps because I want '09 to be the default apps, I do have to remember to move them back to my applications folder & restore the original names before updating. But since you like the new versions this "complication" doesn't apply to you.

  • Runtime-Error after deploying a mapping with the generated script

    For example a very easy scenario:
    1. Create a table and a view in a DB-schema, witch ist registered as WB-target-schema with the following scripts:
    create view v1(c1) as select 'a' c1 from dual;
    create table t1(c1 varchar2(1));
    2. Import the table and the view into a OWB-module
    3. Create a mapping ‘m1’
    4. Drag and drop view and table into the mapping
    5. Draw an arrow from the view-column to the table-column
    6. Save and close the mapping
    7. Mark the mapping in the ‘Design Center’ and klick the ‘Generate’-Button
    8. Save the generated script ‘M1.pls’ to file
    9. Run the script in SQL*Plus, connected with the target-schema (without using the Control Center Manager)
    => very easy right now ;-)
    10. Start the mapping with the following script will produce the following error
    SQL> declare
    2 v_status varchar2(100);
    3 begin
    4 m1.main(v_status);
    5 end;
    6 /
    declare
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at "OWB_OWN.WB_RT_MAPAUDIT_UTIL", line 1027
    ORA-06512: at "SCOTT.M1", line 2048
    ORA-06512: at line 4
    If i delete or comment the four WB_RT_MAPAUDIT_UTIL-calls - it work´s fine!
    But is this a good advise?
    What exactly does the wrapped package ‘WB_RT_MAPAUDIT_UTIL do?
    Thanks
    jwehner

    I just ran into the same problem myself. I used the same technique of saving the generated OWB script to file and then compiling it through sqlplus. When I used the "Deploy" option for the mapping, then the problem went away. So when OWB is deploying the code it seems to be setting something internally that doesn't get set when you simple compile the PL/SQL. I don't know of any workaround to this. I will need it eventually, since I don't want to use the UI to deploy to various test environments and production. Maybe the built-in scripting language is the way to go.

  • I am new to IPAD and I want o use facetime, how can I use it to communicate with my mac at home, do I need to create another account with a different email account

    I am new to IPAD and I want o use facetime, how can I use it to communicate with my mac at home, do I need to create another account with a different email account

    do I need to create another account with a different email account
    Yes, the email addresses need to be unique to each device. You may use the same Apple ID on each device, but the email address used by each device needs to be different.

  • Purchased a second iphone need to create an account, however the computer already has an itunes account...How do I create a second  account using one copy of itunes on a computer??

    Purchased a second iphone need to create an account, however the computer already has an itunes account for the first iphone...How do I create a second  account using one copy of itunes on single computer??

    Why do you need a new account?
    Use the same account on both.
    How to use multiple iPods, iPads, or iPhones with one computer

  • Creating Materialized View with the Distinct key word

    Hi
    I need help to create Materialized View with the Distinct key word.
    my query is
    select distinct col1, col2 from t1;
    is there any alternate of DISTINCT because I can not refresh the MV as fast on demand if I am using it and Fast on Demand is a must for me.

    hi
    check out this link
    http://download-west.oracle.com/docs/cd/B12037_01/server.101/b10736/basicmv.htm#i1007299
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/intro.htm#sthref183
    hope this helps
    CHeers

  • Create Employee code with the mix of alphabets & numeric

    Hai,
    Is there any possibility to create Employee code with the mix of alphabets & numeric instead of the system generated employee code in employee master data? If so,   pls explain.
    Any suggestion is appreciated.
    Thanks,
    Parvatha Solai.N

    Hi Solai,
    You can do a work around for it. Just Leave the Employee ID field as it is. Create a new User Defined field (Alpha Numeric Type) And make it visible on the the employee master data form.
    Step2 : Depending upon your need  write the code that is if it should be auto generated write the code for else leave it blank for the user to enter the employee code.
    Step3: In before action = True. Make the newly created field as mandatory and check whether the value in the field is unique.
    Refer Route Class. Hope you understand
    Regards,
    P. Anand
    Edited by: Anand peter on Jan 2, 2012 11:59 AM

  • Can someone tell me how to create accounting entries with the account status as error

    Hi,
    Can someone tell me how to create accounting entries with the
    account status as error?
    Thanks!!
    Danny

    It's call fixed/static background, and it is NOT directly support by iweb, you will need post processing either in html or javascript.
    Varkgirl (you need to search the previous forum) and I did it since iweb1:
    try Safari, and scroll: http://www.geocities.com/[email protected]/Links.html
    invisible link? roddy, fishing for info again?

  • Need to create P.O with reference to only P.R

    2)Need to create P.O with reference to only P.R. Mean without P.R system should not allow to create P.O how to do?

    hi
    try this
    go to SPRO-MM-Purchasing- Authorization Management-Define Function Authorizations for Buyers
    click on Function Authorizations: Purchase Order
    create  a new entry and
    check ref to PR then
    goto SU01 and on parameter tab enter the Parameter id = EFB and parameter value is what you define in the functional authorization key
    Enter the desired key as a parameter under the parameter ID EFB in the user master
    Also make sure that,In OMET in details of function Authorization>Possible ref. objects>Tick only Ref. to purchase requisition and not anything else.
    this way u can restrict the user from creating po with ref to pr

Maybe you are looking for

  • Schedule lines are not modified when i change the requested delivery date

    Hi   i have a issue when i am created sales order with requested delivery date 10.11.2011 and the same is copied in to item schedule lines as a 10.11.2011 before saving the order i change the requested derlivery date to 11.11.2011 this new requested

  • Outlook 2007 Sync Issues with Calendar and Contacts

    I have an original iPhone and since the last iTunes update I can no longer sync my Contacts and Calendar in Outlook 2007 with my iPhone. The separate calendars are no longer showing in iTunes as a sync option only the sync all is available. When I pl

  • IPod Touch 5th gen headphone jack and battery not working properly

    Yesterday my iPod touch 5th gen's battery started draning at an incredible rate. Won't last longer then 1 or 2 hours now. And add onto it the headphone jack stopped working properly. It's now only plays in one ear, it's all static over the sound it's

  • How to add hard disc to time capsule

    Just got new Time Capsule which works well with my MacBook pro. it says a hard disc can be added by USB but when I plugged it in it is not recognised. Help please

  • AIR seems to install but won't install any AIR apps

    I installed AIR on Windows 7 64-bit Enterprise Edition, and it seems to install OK (no error messages).  But when I go to install an AIR app (Yammer desktop in this case) it will not install the app and I never see the installer come up.  This is a n