How to display current postion and previous position in the same row?

I need to produce a promotions/transfer report that gives the employee's current position as well as his/her previous position in the same row.
for example:
Employee current position current organization current company previous postion previous organization previous company
Jane Smith Executive PA ZYX ltd Harmony personal assistant ABC ltd Yahoo
I am using the per_all_people_f, per_all_assignments_f, per_periods_of_service, hr.all_organization_units, per_all_positions tables
Somehow i cannot manage to display the previous position. I can only get so far to display the current postions
Any ideas? here is the full code
--this query gives current info
select ppf.employee_number, ppf.full_name
, (DECODE (ppf.sex, 'M', 'Male', 'F', 'Female') ) gender
, (DECODE (ppf.per_information4
,'01', 'Indian'
,'02', 'African'
,'03', 'Coloured'
,'04', 'White') ) race
, ppf.ORIGINAL_DATE_OF_HIRE
, paf.EFFECTIVE_START_DATE current_postion_start_date
, RTRIM (SUBSTR (hpt.NAME, 1, INSTR (hpt.NAME, ';') ),';')Current_Position
, ho.name Current_Organization
, xx_return_structures.xx_return_company_name
(paf.person_id,
paf.effective_start_date
) current_company
from per_all_assignments_f paf,
hr_all_positions_f_tl hpt,
hr_all_organization_units_tl ho,
per_all_people_f ppf
--where paf.person_id = 16170
and paf.POSITION_ID=hpt.POSITION_ID
and paf.ASSIGNMENT_NUMBER is not null
and ho.organization_id = paf.organization_id
and ppf.person_id=paf.person_id
and paf.EFFECTIVE_START_DATE between ppf.EFFECTIVE_START_DATE and ppf.EFFECTIVE_END_DATE
order by paf.EFFECTIVE_START_DATE
--this query gives previous position, organization and company
select ass.EFFECTIVE_START_DATE
, RTRIM (SUBSTR (hpt.NAME, 1, INSTR (hpt.NAME, ';') ),';')Previous_Position
, ho.NAME previous_organization
, xx_return_structures.xx_return_company_name
(paf.person_id,
paf.effective_start_date
) previous_company
from per_all_assignments_f paf, hr_all_positions_f_tl hpt, hr_all_organization_units_tl ho
where paf.person_id = 16170
and paf.EFFECTIVE_START_DATE not in (select max(paf.EFFECTIVE_START_DATE)
f rom per_all_assignments_f paf
where ass.person_id = 16170)
and paf.PRIMARY_FLAG ='Y'
and paf.POSITION_ID=hpt.POSITION_ID
and paf.ORGANIZATION_ID=ho.ORGANIZATION_ID

Ok so here is my problem. The current position display 3 times. The rest is correct. it only display once. Any ideas on how to get rid of the 2 extra rows that is being displayed with the current position?? I only need the current position to display once with the previous position info.
select distinct pvs.person_id,
peo.EMPLOYEE_NUMBER empno,
peo.FULL_NAME,
(DECODE (peo.sex, 'M', 'Male', 'F', 'Female') ) gender,
(DECODE (peo.per_information4
,'01', 'Indian'
,'02', 'African'
,'03', 'Coloured'
,'04', 'White') ) race,
peo.ORIGINAL_DATE_OF_HIRE,
pvs.EFFECTIVE_START_DATE curr_start_date,
RTRIM (SUBSTR (pvs.job, 1, INSTR (pvs.job, ';') ) ,';') current_position,
pvs.ORGANIZATION current_organization,
substr(pvs.PAYROLL,5)current_company,
a1.previous_position,
a1.previous_organisation,
a1.previous_company
from per_periods_of_work_v pv,
per_assignments_v2 pvs,
per_all_people_f peo,(select distinct RTRIM (SUBSTR (pvs.job, 1, INSTR (pvs.job, ';') ) ,';') previous_position,
pvs.ORGANIZATION previous_organisation,
substr(pvs.PAYROLL,5)previous_company,
pvs.job_id job_id,
pvs.organization_id,
pvs.position_id,
pvs.location_id,
pvs.PERSON_ID,
pvs.PEOPLE_GROUP_ID,
pvs.EFFECTIVE_END_DATE,
pvs.EFFECTIVE_START_DATE
from per_assignments_v2 pvs
where sysdate > pvs.EFFECTIVE_END_DATE
and pvs.person_id=4723
)a1
where peo.person_id = pvs.person_id
and pvs.person_id = pv.person_id
and a1.person_id = pvs.person_id
and pvs.EFFECTIVE_START_DATE between peo.EFFECTIVE_START_DATE and peo.EFFECTIVE_END_DATE
and pvs.PEOPLE_GROUP_ID <> a1.people_group_id
and pvs.JOB_ID <> a1.job_id
and pvs.ORGANIZATION_ID <> a1.organization_id
and pvs.position_id <> a1.position_id                     activating this elimnates 1-Feb-2008 info
and pvs.effective_start_date -1 = a1.effective_end_date     activating this eliminates 1-feb-2008, 1-jul-2006, 1-april-1996 info
and pv.person_id = 4723
order by pvs.effective_start_date desc

Similar Messages

  • UIX: How to display more items in 1 column on the same row

    Hi
    I have a uix table with a couple of columns.
    Now I want to display more elements in 1 column, but on the same row
    E.g.
    article | quantity <> | price
    The quantity column has also to buttons to increase/decrease the quantity. Something like:
    <column>
    <columnFormat displayGrid="true" cellNoWrapFormat="true" columnDataFormat="numberFormat"/>
    <columnHeader>
    <sortableHeader text="Quantity" required="yes"/>
    </columnHeader>
    <contents>
    <messageTextInput id="${ui:concat('PurchaseInvoiceLinesView3:Quantity:',uix.current.tableIndex)}" model="${ui:cond(uix.current.isNewRow,null,uix.current.PurchaseInvoiceLinesQuantity)}" text="${uix.current.PurchaseInvoiceLinesQuantity}" name="Quantity" promptAndAccessKey="Quantity" rows="1" maximumLength="6" columns="8">
    <onSubmitValidater>
    <decimal/>
    </onSubmitValidater>
    </messageTextInput>
    <button text="&lt;" onClick="..."/>
    <button text="&gt;" onClick="..."/>
    </contents>
    </column>
    But both buttons appear on a new line. Resulting in:
    [   1]
    <
    >
    The useSeperateRows attribute is by default false, so that should be ok. Any ideas to get the buttons on the same row?
    Regards.

    Hi,
         If all of your line items are getting displayed in different pages, to my knowledge, there may be two possibilities.
    1) May be the size of the main window can accomodate only one line item. If one item data fills up the window, then there wont' be any space for the next line item data to be accomodated in the same window in the same page, so, the system triggers the next page. Like-wise for each item data. If this is the case, increase the height of the main window to display items in same page.
    2) Check the driver program. Find the Write_form block, which is written inside an item loop. May be there is a Form-control Function module( Control_form with parameter 'NEW-PAGE' ) being called after the write_fom block, within the loop. If this is the case, remove the control_form FM section to make the data display in same page.
    Best Regards,
    Kumaar.S

  • BEx - Display current year and previous year by day on the same row

    Hello experts, need some help/suggestions on how I can accomplish the following please. 
    We have a requirement to show MTD revenue by day for the current year and previous year.  The desired result will have the following columns
    Calendar Day   |     Current MTD Revenue     |     Prev MTD Revenue
    11/01/2009       |      15,131,005                    |        15,138,668
    11/02/2009         |    15,055,345    |                        15,523,762
    However, the result is showing up as follows:
    Calendar Day   |     Current MTD Revenue     |     Prev MTD Revenue
    11/01/2008       | |                                                   15,138,668
    11/02/2008       | |                                                   15,523,762
    11/01/2009       |      15,131,005 |
    11/02/2009       |      15,055,345 |
    The number of rows for Calendar Day varies depending on the date the user selects.  We only want to display the days for the current year with the Previous Year Column on the same row. 
    Can someone please let me know how I can get the results to display on one line for each day? 
    Thanks,
    David

    I have the same issue on my end, and am interested in responses. I searched the forum and found this suggestion in another post; not sure if this solution will help, but it looks like it might. This was a response from poster RadhaN:
    RadhaN  
    Posts: 390
    Registered: 8/27/09
    Forum Points: 876 
       Re: a simple query to show sales versus last year on daily basis/   
    Posted: Sep 21, 2009 9:53 AM    in response to: Shlomi Weiss           Reply 
    HI Shlomi
    Create a virtual characteristic in your infoprovider that can calculate the day from calendar Day. In ZXRSRZZZ while adding code for this virtual characteristic use the function module DATE_COMPUTE_DAY to compute the day for every calendar day.
    For calculating Sales Current year, create a restricted ky figure with Sales as the key figure. Add 0CalDay to this RKF and create a variable for this infoobject(Eg: ZCURYEAR) that will receive input from the user for the range of dates eg: 08/16/2009 - 08/22/2009.
    For Sales Prior year, create another restricted key figure with Sales. Add 0CalDay to this RKF and add a customer exit variable. In the Customer exit code use the ZCURYEAR variable and offset it to prior year in both the upper and lower limits. This should work.
    I hope this helps.
    Thanks.

  • How to display Current Year and Month in Drop Down list

    Hi Dear friends,
    I am devloping a report. It has got 2 pages--input and output(Report) page.
    IN input page, user will select Month and Year from drop down list as one of the input parameters. (seperate drop down list 4 month and year)
    Now, my problem is:
    HOw to display current month and year by default in the dropdown list...........
    I hope my question is clear.
    Please help.
    Regards,
    ASh

    NO da,
    it is not working.
    First i tired with for-loop. I initialized variable "i" to -2 (i=-2) I would get the year drop down list from 2003 but, by default 2003 would come.
    So, i posted the question.
    I tried your code. It is giving following error.
    A Servlet Exception Has Occurred
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occured between lines: 122 and 127 in the jsp file: /test/inpt.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:182: Invalid type expression.
    first.set(Calendar.YEAR, 2003)
    ^
    An error occured between lines: 127 and 131 in the jsp file: /test/inpt.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:186: Invalid declaration.
    out.write("\r\n \r\nYear : \r\n \r\n"); ^ An error occured between lines: 198 and 203 in the jsp file: /test/inpt.jsp Generated servlet error: C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:282: Invalid type expression. first1.set(Calendar.YEAR, 2003) ^ An error occured between lines: 203 and 207 in the jsp file: /test/inpt.jsp Generated servlet error: C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:286: Invalid declaration. out.write("\r\n \r\nYear :\r\n \r\n");
    ^
    4 errors
    Pls. Help.
    Regards,
    Ashu

  • Display Current Quarter and Previous Quarter???

    Hi Gurus,
    I Had a requirement to display only the current Quarter and previous quarter in the report level using single quarter column.
    and my quarter value type is Q1 2013.
    Please anyone help me out on this asap/
    Thanks.

    Hi,
    Using time serious function you can acheive this requirement.
    http://obieetutorialguide.blogspot.in/2012/02/modeling-time-series-function-in-obiee.html
    OBIEE 11g Time Series Function
    or,
    Using presentation variable you can achieve this.
    Re: OBIEE 10g LY YTD returns YTD for past years
    The above thread for year you can change to qtr.
    Hope this help's
    Thanks,
    Satya

  • Urgent! Display lookup value and return value at the same time.

    We are using pop up lov.
    How can we display lookup value and return value at the same time. let me claer..
    Our lov query is like fallowing
    select dname, deptno from dept
    we want to return deptno column into a database bind text item and dname column into a display item (look up)
    can we do it (we need to do)
    thanks for your help.

    We did it .
    But pop up key lov (display description return value ) property doesn't appear for tabular forms item.
    (Report Attributes pages Tabular Form Element section display As property list)
    can we set or not.
    Thank you.

  • How do i have landscape and portrait slides in the same keynote file?

    how do i create landscape and portrait slides in the same keynote file?

    You cant, its one or the other not both, the slide size setting is for the whole presentation, not for individual slides.
    The slide format is chosen to match the display the presentation is shown on. I have presentations showing on vertical, horizontal, square, circular and iregular shaped screens with rear projection, but a single format must still be set.

  • How to export an album and keep images in the same order in elements 11 mac

    I made an album of my trip to Australia (lots of pictures) and changed the order of the images (not the same as shooting order) and when I export the images in the album to a folder or memorystick, the images are copied to that place but I lost the album order of the images.
    How can I prevent that, without having to renumber al 500 images separatly?
    Gr Jos

    Thanks for the tip, Michel
    It worked like a charm…
    cheers Jos
    Op 28 okt. 2013, om 18:49 heeft MichelBParis <[email protected]> het volgende geschreven:
    Re: How to export an album and keep images in the same order in elements 11 mac
    created by MichelBParis in Photoshop Elements - View the full discussion
    JosU a écrit:
    I made an album of my trip to Australia (lots of pictures) and changed the order of the images (not the same as shooting order) and when I export the images in the album to a folder or memorystick, the images are copied to that place but I lost the album order of the images.
    How can I prevent that, without having to renumber al 500 images separatly?
    Gr Jos
    The order in album is only kept in the organizer database, so the only way not to lose that order is to rename files.
    If you are using the 'export' function, select your album in custom order, select all photos and in the dialog, choose to rename with a common base name.
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5794538#5794538
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5794538#5794538
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5794538#5794538. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Photoshop Elements at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Displaying current year and previous year's data.

    hi all,
    we have fields like doc.no, company code, costcenter, posting date, year etc... in a query.
    we are using this query to display data in VC,
    how can i display the current year and previous year's data in two different tables using the available fields.
    any help will be highly appreciated.
    thanks,
    Rk

    Hi Rk,
    You can achieve your requirement using 'Filter' operator. Drag one 'Filter' operator into visual composer story board and drag the output into filter and add condition(Check year=2008) and drag one table from filter. For another table use another filter and change the condition.
    Hope it helps...
    Regards
    Basheer

  • Is it possible to display list alv and grid alv in the same screen

    Hi
    There are methods to display more than 1 alv grid in the same screen by using block append grid . In the same manner its available for more than 1 list alv report display by REUSE_ALV_BLOCK_LIST_APPEND.
    My question is I want to display 1 alv list and 1 alv grid report in the same output screen .
    Please let me know how to do it ?  I will definetly appreciate the answers.
    Thanks!!

    Hi Anindita,
                                      Previously i ad told v cant display two lists together in same screen. But u can use Block ALV for this. Use FM "REUSE_ALV_BLOCK_LIST_APPEND.
    In OO u can use Cl_GUI_EAST_SPLITTER_CONTAINER for displayin more than two lists in same screen.
    If useful giv points
    Regards
    Vanitha P

  • How do I make Organizer and Editor open at the same time?

    I'm new to PSE 10 and want to know how to make Organizer and Editor open at the same time. I can get the Organizer up, but have to pick out a photo and click on Fix: Full Photo Edit to get Editor to open. Is that the only way to do it?
    Thanks,
    K

    Create Desktop shortcuts for the Organizer and the Editor:
    The Editor's executable is:
    "C:\Program Files (x86)\Adobe\Photoshop Elements 10\PhotoshopElementsEditor.exe"
    The Organizer's executable is:
    "C:\Program Files (x86)\Adobe\Elements 10 Organizer\PhotoshopElementsOrganizer.exe"
    Ken

  • How to align output formatted and output text in the same line?

    Hi All,
    I want an output formatted label and a text on the same line,. I've surrounded these components wth a panel form layout and they automatically align one below the other. how do I kepe them in the same line?
    Thanks.

    Try as per the code snippet below:
    <af:document title="TestPage.jspx" id="d1">
    <af:messages id="m1" inline="true"/>
    <af:form id="f1">
    *<af:panelGroupLayout id="pgl1" layout="horizontal">*
    *<af:outputFormatted value="outputFormatted1" id="of1"/>*
    *<h:outputText value="outputText1" id="ot1"/>*
    *</af:panelGroupLayout>*
    </af:form>
    </af:document>
    Thanks,
    Navaneeth

  • How to use Forms 5 and DevSuite 10g in the same machine

    Hello everybody,
    I have installed forms 5 and IDS 10g in one machine and both the versions of the forms were working simultaneously. Now I have un-installed both the versions of the forms and re-installed in the same machine. Installation was successful. but I am not able to connect to the database in forms 5. It shows TNS could not resolve service name. TNS is created in both the versions with same name as well as different name. The IDS is working fine. Please help.
    Thanks and regards
    Sukanta sarkar

    Sukanto,
    What error are you getting? One potential problem you will have with more than one version of Oracle Dev Suite installed is keeping the TNSNAMES.ORA synchronized. I've found the easiest solution to this problem is to add the TNS_ADMIN registry key to each Oracle Home so I can share a single copy of the TNSNAMES.ORA file. You can add this entry by starting the Window Registry editor (regedt32.exe or regedit.exe) and navigate to the following registry hive:
    HKEY_LOCAL_MACHINE => SOFTWARE => ORACLE => HOME? (where ? represents the number of the Oracle Home, eg., 0-9).
    In your example, Forms 5 should be in HOME0 and IDS 10g should be in HOME1. Open each home and add a new "String Value" and name it: TNS_ADMIN. After you have added the new String Value entry, edit the String Value and enter the path to the copy of your TNSNAMES.ORA that is working. Then do the same thing with HOME1 and exit the Registry. You should be able to connect to your database with Forms 5 and IDS 10g. Normally, changes to the registry do not require you to reboot your computer, but I have seen where this is necessary - though not very often.
    Note: Always ensure you have a BACKUP of the Windows Registry before you make any changes. If you uncomfortable modifying the Windows Regisitry, then I don't recommend you make this change.
    Hope this helps.
    Craig...

  • Display entity-attributes and global-attributes in the same screen

    Hi,
    I have a question about entity.
    Is it possible to display in the same screen, entity-attributes and global-attributes?
    thanks
    Rosalia

    Hi Rosalia,
    You can only display attributes from the current entity and the entity or entities that it is contained by (the parent entities).
    So if you had the following data model
    Global
    ..the person
    ...the income
    the person is contained by global.
    the income is contained by the person (which is contained by global).
    If you want to create a person-level question screen, you can display global attributes on that screen by using subsitution like %global_field_1%. You cannot, however, input global attributes on that screen (ONLY attributes belonging to the person)
    If you want to create an income-level question screen, you can display attributes from the person such as "tell us about %person_name%'s income..." as well as global attributes. Again, you cannot input person or global attributes on that screen (ONLY attributes belonging to the income)
    However it only works from child-to-parent containment relationships! You cannot have a global question screen which loops through the person instances and displays attributes from the person, or from the income out-of-the-box.
    We have managed to implement this using custom controls.
    You can map individual attributes back up to the parent level, and then display them,
    such as
    the first person's name = InstanceValueIf(the people, the person's name, the person's id = 1)
    the first person's name is now a global attribute and can be displayed on global question screens.
    Hope this helps!
    Ben

  • Display a cruve and a table in the same servlet

    Hi,
    I want to display a curve in a servlet, I can do it, but I can't display the table which is after the curve, the code is the following :
    public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
           XYDataset dataset = createDataset(pathFile, pathFileTimer);
          JFreeChart chart = createChart(dataset);
          resp.setContentType("image/png");
          OutputStream out1 = resp.getOutputStream();
          ChartUtilities.writeChartAsPNG(out1, chart, 800, 600);
          out1.close();
          PrintWriter out = resp.getWriter();
          out.println("<html>");
          out.println("<body>");
          out.println("<head>");
          out.println("<title>Informations batterie</title>");
          out.println("</head>");
          out.println("<body bgcolor=\"white\">");
          out.println("<TABLE id=\"Table1\" style=\"WIDTH: 864px; HEIGHT: 75px\" cellSpacing=\"1\" cellPadding=\"1\" width=\"864\" border=\"1\">");
    ...So how can I display the table in the same servlet ? Or perhaps can I display the curve in an another servlet, but it would be better to call this servlet automatically and not manually with a post method.
    Thanks for any help.

    So how can I display the table in the same servlet ?You can't. You either send HTML or you send PNG. You can't combine the two in the same request.
    Or perhaps can I display the curve in an another
    servlet, but it would be better to call this servlet
    automatically and not manually with a post method.Yes, you would use another servlet to display the curve. Servlet A would generate the HTML, including a link to Servlet B. I don't know what you think the difference between calling a servlet automatically and manually is, but if you use this two-step process:
    1. Decide what HTML you want the browser to see.
    2. Write code to produce that HTML.
    you will find things a lot less confusing.

Maybe you are looking for

  • Ipad losing network connection--why?

    Ipad I has started losing connection to home network (ATT Uverse) in past few weeks after several years of no such problems. Have not recently upgraded anything. Have not noted same problem with IMac, which also is on same WiFi connection. Has happen

  • Can i restore to a smaller drive

    I have tried to restore from a 640 GB drive to a 500 G drive and have had no luck.  Restore goes through with no errors, but does not create a Windows OS partition at all..  Big problem.. Drive size should not matter as long as the drive is large eno

  • How can you get a non-usb microphone to work?

    So i've run into a few discussions on this topic, but never seen an answer to it. I have a non-usb microphone (A HyperX Cloud headset) that I want to use with my MacBook Pro. How can I do this? I'm assuming there is an adapter I can get for the micro

  • How to get the link when right-clicked (for extension development)?

    Hi, I want to get the link when I right-click it in a page. I explain: when you right-click a link, you get "Open link in a new window"; this menuitem sends the link to the js function to perform an action and that's exactly what I an looking for Tha

  • Link ups of movement types, valuation class & g/l  A/c's

    hi, please send me the information regarding what are the link ups between the movement type valuation class & G/L A/cs Thanks Regards Santosh Rothe 9421542585