Display only latest record

Post Author: rlivermore
CA Forum: Formula
(CR v10 Pro) How can I display only the lastest record if there are multiple entries for a specific job number (SO number). I have 2 groups {tblSO.SONumber} and {tblSONotes.LastModified}.  I tried sorting LastModified by descending order and putting all of the fields into the tblSONotes.LastModified Group and hiding the Details section and Group Footers to no avail.  Help?
Below are the fields in my report...
{tblSO.DateOpened}  {tblSO.SONumber}  {tblSO.Status}  {tblSONotes.LastModified}  {tblSONotes.Topic}  {tblSONotes.Notes}
Sample Data
1/12/08  124113  Scheduled  1/1/08  Dispatch  Technician scheduled on 1/15/08.
1/12/08  124113  Scheduled  1/15/08  Dispatch  Job has been completed.
In this example I'd only want the last record (1/15/08) to display on the report, suppressing the one on 1/1/08.

Post Author: Jagan
CA Forum: Formula
Sorry
Unlike SQL, a group in Crystal implies ordering (that's my understanding anyway).Here's two different ways to get the most recent record per job:
1)Group on Job. Group on date. Use the group selection formula to get the most recent date per job, i.e.{table.date} = maximum({table.date}, {table.job})
If your date fields are unique (e.g. timestamp rather than just a date) then you'll only get one record per job so you can use the details section. If not you'll need to add another field / formula to sort on to determine which of the multiple records to show using the date group header / footer to display.
2)Group on Job. Order by date. Suppress the details, print in the job group header / footer depending on the date ordering. Same process for non-unique dates.
There are advantages / disadvantages to both, e.g. the latter means that all other records are available to running totals etc. which is good/bad depending on what you want the report to do.
Is that better???

Similar Messages

  • How to display only one record.

    Hi Gurus,
    Here my requirement is i have 2 pages.
    first page having project_number lov,create and tableRN.
    once u select the projectnumber and click on the create button it is navigate to secound page,here enter the data and click on the submit button it ll insert into database table and navigate to fitst page and display the data in tableRN what ever u insert the data(this part is over).
    but the problem is, in tableRN displays all the records(previous records also displayed)
    my requirement is display only one record(click on the submit button at the time of record only).
    Plz help me
    its very urgent.
    Thanks
    Seshu.
    Edited by: its urgent on Jan 3, 2012 10:52 PM

    Seshu,
    Do u want to display the inserted row...
    Regards,
    Gyan
    www.gyanoracleapps.blogspot.com
    www.querenttech.com

  • Bex Report to show only latest record on report and then history

    Hello Gurus,
    Table 1:
    Employee
    Valid From
    Valid To
    Hours Perday
    1900
    01/01/2014
    02/28/2014
    8
    1900
    03/01/2014
    03/31/2014
    6
    1900
    04/01/2014
    12/31/9999
    4
    Table 2:
    I have above in DSO, On report I need to show the latest record without Valid From and Valid To Fields shown below.
    Employee
    Hours Perday
    1900
    4
    And when user drags Valid From and Valid To field from free charac. it should show history as in DSO. I have leveraged 0VALIDTO customer exit processing variable with variable as "Value Ranges" >= Key Date so when query is executed if date entered is 04/01/2014 it should bring last record with Hours perday=4 and if date is entered as 03/01/2014 should bring two records with hours per day 6 and 4 and so on.
    The problem on report is that the record being pulled is always latest but when Valid To and Valid From free characteristics are dragged on the report it still shows the latest record and no history. Is there a way that when key date is entered it should show latest record as per >= of that key date and when Valid from is dragged in to report it should display history prior to that key date?
    Thanks,
    Sam

    Hi Sam,
    You are almost in the right direction. A little fine tuning is required in your process
    As you are dealing with Time dependent Master data, the ideal thing to use is "Key Date" in the query. But there is a limitation here. Key Date can show only single date's relevant master data. I mean if you enter 03.01.2014, only second record would be shown. Key date cannot work on Multiple dates or ranges to fetch historical data or multiple records accordingly.
    To achieve your requirement, you should not use Key date in your query.
    I have leveraged 0VALIDTO customer exit processing variable with variable as "Value Ranges" >= Key Date
    The above idea is good. You should make Valid From as Cust exit(i_Step =2) processed and make it as User Entry enabled. So that user exit code can pick up values as per > = Valid From(User Entry Based). But this user exit will be picking historical records if user enters other than latest Valid from date. I mean no drilldown is required. You need to use Valid from in rows also, I believe.
    Try this and let me know if you want any more inputs.
    Regards,
    Suman

  • Display only 1 record using uploaded PDF document from 3rdparty Website

    Hi,
    Any help will be very much appreciated....
    I'm trying to create my first BI publisher report using a PDF document from 3rd party website. I want to populate the name from EMP table to one of the fields in the PDF doc.
    Here's the steps I've done:
    1. Created and saved a data set using only the ENAME column of EMP table. 14 records are available from the table.
    2. Run xml output and then save as sample data.
    3. Downloaded the PDF doc from the 3rd party website (government form - US Custom Form 7512).
    4. Using Adobe Acrobat X Version 10.1.4, I mapped the element name (ENAME) from my input XML file to the Name field.
    <output type="data-structure" >
    <dataStructure tagName="DATA_DS">
    <group name="G_2" source="Employee" label="G_2" >
    <element name="ENAME" value="ENAME" dataType="xsd:string" label="ENAME" breakOrder="None" fieldOrder="1"/>
    </group>
    </dataStructure>
    </output>
    5. Uploaded the revised PDF document to BI publisher.
    6. Created and saved the report.
    7. When I viewed the report in PDF, only 1 page is displayed. I'm expecting to see 14 pages because I have 14 records from the table EMP.
    Any report properties that I need to change to allow me to view all the records from the EMP table?
    Version of BI and Adobe
    Oracle BI Publisher 11.1.1.5.0
    Adobe Acrobat X Version 10.1.4

    There could be an issue with the Loop. I guess your Template is looking at the first record only and not reading through all the records.
    Try to get the BI Publisher Desktop tool. Using this tool you can merge PDF document and XML to see the output from your local PC/Laptop. It will be easy for you to debug.
    Rgds
    Chundi

  • Having to display only one record using XML tags in XML Publisher

    Hello,
    I have a query which returns two rows for one particular contract number. Output contains in the following style.
    ID | Contract_No | Item_Desc | Item_Num | colA | colB | Term_Dur
    1 ABC1 Item1 12 Y Y 20
    2 ABC1 Item2 13 Y Y 20
    the rows returned are having a column called 'Term_Duration' which is same and I'm using the for-each loop mean for every different Item_Desc column, corresponding terms are being displayed in the RTF document. Here I want the report to display the contract details only once if the 'Term_Dur' value is the same when queried up for a contract number.
    However the current RTF template is displaying both the two rows when the 'Term_Dur' is having a same value.
    P.S: I am a novice in using the XML Publisher and please provide your suggestions on the above requuirement.
    Thanks in advance,
    Uday

    Seshu,
    Do u want to display the inserted row...
    Regards,
    Gyan
    www.gyanoracleapps.blogspot.com
    www.querenttech.com

  • Latest record need to show in report

    Hi all,
    I have a requirment on shippment is as below.
    I want track a perticulat shippment based on shippment number.
    I am loading the shippment details to My ODS and the key's are 'Shippment number' and 'Date' and 'time'.
    Now my user don't want to see all the records that are relevent to perticulat shippment in bex report, he wants to see only latest record based on date and time by entering the shippment number only as input in the report.
    Can any one advice me on this, Points will be assigned.
    Regards,
    Raja reddy.

    Reddy,
    Did you try using a replacement Path variable on Date?
    If your req is to show all the shipment no.s for a date which is latest, you can do this by condition as TOPN.
    (If date is in KF list)
    But if Date is a charecteristic in the Provider, Use repl path and then put TOP N condition on it.
    Try it! You must get that.
    Cheers,
    Sri

  • How do we display only subordinate?

    I wanted to display only child records. The below query display starting with employee Scott and all subordinates... But i want to display only subordinate... How can i display here... any help is appreicated.
    SELECT HIERARCHY_NAME
    FROM T_HIERARCHY_CONVERT
    START WITH HIERARCHY_NAME = 'Scott'
    CONNECT BY PRIOR HIERARCHY_NO = HIERARCHY_MGR_NO

    The other way
    select
         sys_connect_by_path(ename,'/') xc, level, connect_by_root ename
    from      emp
    connect by  prior empno =   mgr
    start with ename='SCOTT'
    XC                                  LEVEL CONNECT_BY
    /SCOTT                                  1 SCOTT
    /SCOTT/ADAMS                            2 SCOTTOnly Subordinate.
    select
         sys_connect_by_path(ename,'/') xc
    from      emp
    where ename!='SCOTT'
    connect by  prior empno =   mgr
    start with ename='SCOTT'
    XC
    /SCOTT/ADAMS
    OR
    select
         ename xc
    from      emp
    where ename!='SCOTT'
    connect by  prior empno =   mgr
    start with ename='SCOTT'
    XC
    ADAMSSS

  • How to set Display Only for some records in CAT2 Worklist

    Hi,
    I have a requirement to modify an attributes for some records in the Worklist of CAT2.
    We have an external system where we book our time. Weekly we import data from that external system into CATSDB using BAPI for every single employee.
    We would like when the user wants to modify his time sheet to be able to add/modify all records except those which were imported from the external system. Which means that those records should be in Display only mode / grayed out / before release.
    Is there any user exit or BADI that could help to modify that attribute and that will be triggered before displaying the Worklist ?
    Please advise !
    Thanks,
    Stefan

    I've solved the problem.
    First I've added customer field in CI_CATSDB structure and when I am importing the data I am populating that field with 'X', which means that this is record from the external application.
    I've created enhancement implementation in Function group->CATS, screen->2003 MODULE->D2000_MODIFY_LOOP, subroutine->modify_d2000_loop where I am checking the field mentioned above if it is 'X' I am modifying the screnn-output = off.
    It works, thak you for your help.
    Regards,
    Stefan

  • Display current month records only

    Hi Experts,
    I have the following requirement.
    Report should display current month records only.
    For example If the report is run on 20090324, It should display records from 20090301 to 20090324.
    That means,  report may run on any date of that month, It should display from 01 (of that month) to current date.
    I have a select statement saying
      SELECT * FROM likp
      WHERE wadat_ist BETWEEN month_start_date AND sy-datum          
        AND vkorg IN s_vkorg
        AND vkbur IN s_vkbur
        AND kunnr IN s_kunnr.
    How to calculate date for month_start_date, so that it can display only current month records.
    Thanks in advance
    Rohan

    Hi Kunta, Suhas, Nandi,
    Thank you for your quick reply, I really appreciate it.
    for this current month records, I need to display a check box saying
    Open orders  and shipments with the current month.
    But where as Selection text is accepting 32 characters only. Is there any possibility to overcome this?
    Thanks in advance
    Rohan

  • Display latest Record First

    Hi,
    Could someone tell me where in forms builder you can configure the form so the latest record is displayed first in the application.
    As an example i query someones name in the application and i'd like to view the latest record saved to that person (there is a join between people and my new table). At the moment my custom form returns the first record entered against them.
    Thanks
    Steve

    You will have to identify this record in some way, e.g. by an increasing primary key number, or a date_created column. Then you have to order by this column in descending order in your form.

  • ONLY ONE RECORD IS DISPLAYED

    hi all.....
    i executed the smart form and called the FM in program....but only one record is
    getting displayed....i created a table in main window and put loop in main area...
    but still only on erecord..please help me.

    There are two ways of displaying data from a internal table in the smart form.
    1. Create a Table node and pass the internal to the table node along with a work area. Create a line type, which will have each of the columns. Create text elements for each of the columns you want to display.
    2. Create a Loop node, pass the internal table and create text element for each of the columns you want to display.
    Regards,
    Ravi
    Note - Please mark all the helpful answers

  • Latest record with active flag 'Y' (if only N, select that record)

    Hi All,
    I am having some records in table emp and need to select one record per id, which meets following criteria:-
    (1) if there is only one record for given id, select them. eg- '0154', '0155'
    (2) if more than one record then
    (2a) select record with active_flag = 'Y'.
    (2b) if more than one record with flag 'Y', select latest record where flag = 'Y'. Max eff_date.
    Emp table:-
    with emp as (
    select '0066' id, 'ABC' name, 'Y' active_flag, to_date('01-01-2009', 'dd-mm-yyyy') eff_date  from dual union
    select '0066', 'PQR', 'N', to_date('01-01-2010', 'dd-mm-yyyy') from dual union
    select '0066', 'XYZ', 'N', to_date('01-03-2010', 'dd-mm-yyyy') from dual union
    select '0154', 'PQR', 'N', to_date('01-05-2010', 'dd-mm-yyyy') from dual union
    select '0155', 'DEF', 'Y', to_date('01-05-2010', 'dd-mm-yyyy') from dual union
    select '8686', 'THY', 'N', to_date('01-10-2010', 'dd-mm-yyyy') from dual union
    select '8686', 'QWE', 'N', to_date('01-01-2010', 'dd-mm-yyyy') from dual union
    select '8686', 'POI', 'Y', to_date('01-04-2010', 'dd-mm-yyyy') from dual union
    select '8686', 'MNB', 'Y', to_date('01-03-2010', 'dd-mm-yyyy') from dual
    select * from emp;
    Output records:-
    with emp_selected as (
    select '0066' id, 'ABC' name, 'Y' active_flag, to_date('01-01-2009', 'dd-mm-yyyy') eff_date  from dual union
    select '0154', 'PQR', 'N', to_date('01-05-2010', 'dd-mm-yyyy') from dual union
    select '0155', 'DEF', 'Y', to_date('01-05-2010', 'dd-mm-yyyy') from dual union
    select '8686', 'POI', 'Y', to_date('01-04-2010', 'dd-mm-yyyy') from dual
    select * from emp_selected;Request you to please look at it.
    Regards,
    Ritesh

    Thanks for posting the sample data and expected resutls in such a useful way. It makes life so much easier.
    Assuming that the only valid values in active_flag are Y and N, and that there are no nulls, then this is one way:
    SQL > with emp as (
      2   select '0066' id, 'ABC' name, 'Y' active_flag, to_date('01-01-2009', 'dd-mm-yyyy') eff_date  from dual union
      3   select '0066', 'PQR', 'N', to_date('01-01-2010', 'dd-mm-yyyy') from dual union
      4   select '0066', 'XYZ', 'N', to_date('01-03-2010', 'dd-mm-yyyy') from dual union
      5   select '0154', 'PQR', 'N', to_date('01-05-2010', 'dd-mm-yyyy') from dual union
      6   select '0155', 'DEF', 'Y', to_date('01-05-2010', 'dd-mm-yyyy') from dual union
      7   select '8686', 'THY', 'N', to_date('01-10-2010', 'dd-mm-yyyy') from dual union
      8   select '8686', 'QWE', 'N', to_date('01-01-2010', 'dd-mm-yyyy') from dual union
      9   select '8686', 'POI', 'Y', to_date('01-04-2010', 'dd-mm-yyyy') from dual union
    10   select '8686', 'MNB', 'Y', to_date('01-03-2010', 'dd-mm-yyyy') from dual)
    11   SELECT id, name, active_flag, eff_date
    12   FROM (SELECT id, name, active_flag, eff_date,
    13                ROW_NUMBER() OVER(PARTITION BY id
    14                                  ORDER BY active_flag desc, eff_date desc) rn
    15         FROM emp)
    16   WHERE rn = 1;
    ID   NAM A EFF_DATE
    0066 ABC Y 01-JAN-09
    0154 PQR N 01-MAY-10
    0155 DEF Y 01-MAY-10
    8686 POI Y 01-APR-10If there could be nulls in active_flag, then you could use NVL to set the value to Y or N in the order by to sort it "correctly" based on your requirements.
    If there could be values other than Y and N, then use a case statement in the order by to fix the order to give preference to what you want.
    For example, if valid values could be Y, N, P and you wanted them selected in that order, then neither ascending nor descending sorts would be right, so you could do something like:
    ORDER BY CASE active_flag WHEN 'Y' THEN 1
                              WHEN 'N' THEN 2
                              WHEN 'P' THEN 3
                              ELSE 4 ENDJohn

  • How to get only the latest record in a folder

    Hi all,
    We have an OA SIT that is not a "standard" SIT in that it does not have the traditional Begin and End date. It only has an Effective date. Is there some way I can filter this table to only give me the latest record in the series? I know how to do this in SQL, but don't see how it would be possible in the EUL.
    We're trying to avoid creating database views, but at this point, I'm thinking it may be the easiest way to address this. Any other suggestions?
    Thanks in advance,
    Jewell

    Jewell.
    Of course I'm not going to mention that I have no idea what a 'standard' SIT is compared to your basic 'non-standard' SIT ... and I have to watch my spelling of such ... but however ...
    As you're most likely aware, in SQL you would get all the 'standard' SIT records first by going through the table. Then you'd go back through them all and find the most recent one.
    Because of this 2 table pass, I agree that just putting the SQL code in a custom folder (as you're not using views) would make the most sense.
    Russ

  • Display only the first record

    I have report in BEx where we want to find the first time a customer ordered Quantity of more than 500 in a data range (For Ex: From April 10 to April 30). In a particluar date range the customer may order more than once (Qty > 500). The catch is we want display only one first time he ordered qty > 500.
    Customer    Date         Qty > 500.
    ABC         4/21/2005        2,035 CA
              4/22/2005        12,290 CA
              4/23/2005        4,826 CA
              4/26/2005        6,397 CA
              4/27/2005        1,538 CA
              4/28/2005        4,849 CA
    XYZ         4/25/2005        2,000 CA
              4/26/2005        12,000 CA
              4/27/2005        4,500 CA
              4/28/2005        6,300 CA
    In the output report we want to display the first record for each customer as:
    Customer    Date         Qty > 500.
    ABC         4/21/2005        2,035 CA
    XYZ         4/25/2005        2,000 CA
    Your help is really appreciated. Thanks.

    jayant,
    i think, you could use your date as a condition to filter by in your report... try looking that the properties of your KF and, under Calculations, set the 'Calculate Result as...' to the first value only.
    hope this helps - don't forget to give out points. =)
    ryan.
    ps. i've tried this, and it sort of works - just need a bit more of tweaking around. =)
    Message was edited by: Ryan Kristoffer Tan

  • Query needs display only the recent record that was updated into BW.

    Hi Gurus,
    I have a question related to query creation.
    I hve one Infoset which was built on top of Opportunities data and Activities data cubes.  Tthey are linked using Opportunity GUID.  And in the query I am displaying the Opportunity ID(from Opportunity cube),  Sales order Number from the Activities data and a keyfigure No of Doc headers from the opportunities cube.  Everything is fine.  I want to display One Opportunity ID and One Activity associated with it.  I mean I want to display only the activity ID which is very recent.  But the query displays all the activity IDs which are associated with the opportunity ID.   We are not using any time characteristics too as the query has to display all the data that is there in the cubeI just want to see the recent activity that has got updated into the cube.  Kindly advice on how to achieve this..
    THanks in Advance
    Mohan Kumar

    Hi mohan,
    try to do some restriction by using  request ID (0requid) and variable 0S_RQMRC (Most current data on 0requid).
    for example a restriction on activiy id by most current request ID.
    hope it helps.

Maybe you are looking for

  • "Fast Web View" not supported in Acrobat X plug-in for FireFox/Chrome

    The Acrobat X plug-in for displaying PDFs in FireFox/Chrome does NOT support fast web view.   This means that PDFs don't display until after the entire file has been download. For example, try viewing this document in either IE(Windows) or Safari(Mac

  • HELP: My mail program is running at a snail's pace...

    My Mail program has slowed to a crawl. Everything else on my computer is running fine, but even with nothing else running, every single function takes forever. Things that should be instantaneous (selecting text, positioning the cursor, changing font

  • Remove cancelled appointment

    I have 2 calendars I sync with my iPhone, Exchange 2010 and Google Calendar. Whenever I receive a meeting invitation on my google calendar I can't edit the appointment at all, in fact the edit button is not there. The meeting shows up surrounded by a

  • Tagging records with the Map_Run_ID

    I load dimension tables incrementally. So the target dimension table only receives source records that have been inserted or updated since the last ETL run. I want to capture the mappings map_run_id (stored in the all_rt_audit_step_runs table) as a c

  • Count the number of carriage returns in a multiline text box

    Hello, I have a script to count the number of carriage returns at the end of each line of text in a multiline text box. After running the script in the console, the result keeps showing as 0. Can anyone please advise how the script can be revised to