How to display record with most recent date in sapui5?

Hi
I have a local json data with me, in which I have number of records.
And in each record I have an "AENDATE" as a date property.
Now I want to display the record with most recent date in the records.
How I can I do it......????????
Please help me with this.
Thanks
Sathish

How about sorting your json model descending, and display only first (index:0) item?

Similar Messages

  • Selcting records with most recent date

    Hello Friends
    I am new to this group.
    I am having a set of records as follows in a table
    col1,col2, col3(dd/mm/yyyy)
    1 abc 1/1/2007
    1 def 2/1/2007
    2 ghi 1/1/2007
    2 --- 3/1/2007 (No value in col2)
    3 jkl 1/1/2007
    3 mno 4/1/2007
    I would like the output as follows:
    col1, col2,col3
    1 abc 2/1/2007
    2 3/1/2007
    3 mno 4/1/2007
    (ie with most recent update_dates)
    How to implement this in SQL?

    or:
    SQL> create table t
      2  as
      3  select 1 col1, 'abc' col2, date '2007-01-01' col3 from dual union all
      4  select 1, 'def', date '2007-01-02' from dual union all
      5  select 2, 'ghi', date '2007-01-01' from dual union all
      6  select 2, null,  date '2007-01-03' from dual union all
      7  select 3, 'jkl', date '2007-01-01' from dual union all
      8  select 3, 'mno', date '2007-01-04' from dual
      9  /
    Tabel is aangemaakt.
    SQL> set autotrace on explain
    SQL> select col1, col2, col3
      2    from (select col1, col2, col3, row_number() over (partition by col1 order by col3 desc) rn
      3            from t)
      4   where rn = 1
      5  /
          COL1 COL COL3
             1 def 02-01-2007 00:00:00
             2     03-01-2007 00:00:00
             3 mno 04-01-2007 00:00:00
    3 rijen zijn geselecteerd.
    Uitvoeringspan
       0      SELECT STATEMENT Optimizer=CHOOSE
       1    0   VIEW
       2    1     WINDOW (SORT PUSHED RANK)
       3    2       TABLE ACCESS (FULL) OF 'T' (TABLE)
    SQL> select col1
      2       , max(col2) keep (dense_rank first order by col3 desc) col2
      3       , max(col3) col3
      4    from t
      5   group by col1
      6  /
          COL1 COL COL3
             1 def 02-01-2007 00:00:00
             2     03-01-2007 00:00:00
             3 mno 04-01-2007 00:00:00
    3 rijen zijn geselecteerd.
    Uitvoeringspan
       0      SELECT STATEMENT Optimizer=CHOOSE
       1    0   SORT (GROUP BY)
       2    1     TABLE ACCESS (FULL) OF 'T' (TABLE)Regards,
    Rob.

  • Seelcting records with most recent date

    Hello Friends
    I am new to this group.
    I am having a set of records as follows in a table
    col1,col2, col3(dd/mm/yyyy)
    1 abc 1/1/2007
    1 def 2/1/2007
    2 ghi 1/1/2007
    2 --- 3/1/2007 (No value in col2)
    3 jkl 1/1/2007
    3 mno 4/1/2007
    I would like the output as follows:
    col1, col2,col3
    1 abc 2/1/2007
    2 3/1/2007
    3 mno 4/1/2007
    (ie with most recent update_dates)
    How to implement this in SQL?

    Double post.

  • Select record having most recent date

    Table: Order
    Code     ImportId     EntryDate
    1 100
    10/11/2014
    1 101
    10/14/2014
    1 102
    10/10/2014
    2  103  10/11/2014
    2   104  10/15/2014
    I want to select the record having the most recent EntryDate grouped by Code. In the select, i need to return the ImportId.
    Anonymous

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Nothing you posted
    was right. Temporal data should use ISO-8601 formats. This is the only format allowed in the ANSI-ISO SQL Standards and it is the most common IT standard on Earth; but you do not know it! 
    Code should be in Standard SQL as much as possible and not local dialect. There is no such crap as a generic “code” in RDBMS. Table have keys, so you have no table! Rows are not records; this is a basic concept. 
    This is minimal polite behavior on SQL forums. Here is my guess at what a polite, competent person might have posted. 
    CREATE TABLE Import_Orders
    (order_type INTEGER NOT NULL
     CHECK(order_type IN (1,2)),
     import_id CHAR(3) NOT NULL PRIMARY KEY, 
     entry_date DATE NOT NULL);
    INSERT INTO Import_Orders
    VALUES
    (1, 100, '2014-10-11'),
    (1, 101, '2014-10-14'),
    (1, 102, '2014-10-10'),
    (2, 103, '2014-10-11'),
    (2, 104, '2014-10-15');
    I want to select the record [sic] having the most recent entry_date grouped by order_type. In the select, I need to return the import_id.
    If you return only the import_id, then the most recent entry_date does not matter! Think about it! Did you want the whole row with the most recent entry_date? Here is a common idiom. 
    WITH X (import_id, order_type, entry_date, entry_date_max)
    AS
    (SELECT import_id, order_type, entry_date, 
            MAX(entry_date) OVER (PARTITION BY order_type)
       FROM Import_Orders) 
    SELECT import_id, order_type, entry_date
      FROM X
     WHERE entry_date = entry_date_max;
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Chronologically display email with most recent at top?

    How do I display my most recent e-mail chronologically at the top on iMac with OS X Lion?  I am a somewhat new Mac user and love the mail set up with OS X Lion, but I prefer to have the most chronologically recent emails displayed at the top, vs. at the bottom.  Can anyone walk me through how to do this?

    Nevermind.  I actually figured it out right after I posted this.... In case anyone else has this problem,
    In the mail menu, go to Mail, View, Sort By, and make sure there is a check mark in Descending.  Hope I can help someone else.

  • How to display records with radio buttons

    Well,
    <b>This is what I have right now:</b>
    When I execute  the Sales Orders report, it takes me to a selection screen with fields (VBELN, AUDAT, UNAME,....). I have Display, Create and Edit buttons below the selection criteria. The database table will have a DELETE FLAG.
    <b>This is what I need to do:</b>
    When I click on Edit button, it should take me to a new screen (this screen will have 3 buttons: Change, Delete, Undelete) with records based on the selection criteria. Also each record should have radio button.
    So if I select a record and <u>click on CHANGE</u> button it should take me to a new screen with only that record and the fields should be editable. Upon changing the fields, the records should be updated in the database.
    If I <u>click on DELETE</u> button it should set the DELETE FLAG in the database, so that when I click on Display button in main screen it shouldn't show me this record next time.
    If I <u>click on UNDELETE</u> button it should reset the DELETE FLAG.
    <b>This is what you get:</b>
    Reward points if helpful

    You can use AT SELECTION-SCREEN OUTPUT event to capture the dynamic screen changes like selecting the radio buttons, once you captured the user action then you can call the other screen and you can work on that.
    regards,
    Dj
    reward, if its useful

  • How to display maximum (most recent) date value in a query

    hello,
    I have the following query:
    StudentNumber | ExternalOrganization | Date |         | NumbeOfAdmissions
    0112                  050                            06/27/2007   1
    0234                  060                            07/15/2008   1
    1356                  025                            01/08/2008   1
    My dilemma is how to display only the row that has the most recent Date, e.g. here I want to only see the row with student number 0234 and date 07/15/2008; everything else should be hidden.
    I know it should be very simple....yes/no?
    thanks

    Hi
    even I am facing the same problem..
    Can you please tell me what did you do to get most recent record..
    Even I have made my date field as KF.. n have put condition on it.. but not getting desired result.. may be I am missing something.. somewhere..
    I resolved it.. thanks
    Regards
    Swati
    Edited by: Swati on Feb 17, 2009 7:49 AM

  • How to determine most recent date from the date column of internal table

    Dear friends
    would you like to tell me. how i determine the most recently changed record by looking at date and time from internal table i am not supposed to sort the table by date and time... I must check date and time with other records date and time to determine which record is most recently changed...
    here the scenario is.
    id idnumber chdate chtime
    1 123456 20060606 135312
    2 123456 20060606 135900
    3 123456 20060606 132300
    4 123457 20060606 140000
    5 123457 20060606 142500
    in the above scenario i must keep in my mind that the most recently changed record is identical to its idnumber i can say that:
    the record should be fetched this way
    id idnumber chdate chtime
    3 123456 20060606 132300
    5 123457 20060606 142500
    because here the id 3 is the most recently changed in the idnumber 123456
    where id 5 is the most recently changed in the idnumber 123457
    please help me to determin how i am supposed to carry out this task any suggestion, code will be great help of mine.
    regards
    Naim

    After testing my suggestion above, I realized that it doesn't work because the delete adjacent actually will keep the first one and delete the rest.  I'm working with Srinivas's code a bit now,  I think it is almost what you want.  I am under the impression that you dont' want to HIGHest date/time, but just the last record of the sequence, if this is the case, then this code will help.  Here we will assign an index to each record per the idnumber, that way we can sort it and get the lastest record.
    report zrich_0001.
    types: begin of itab_type,
            id       type i,
            idnumber type i,
            chdate   like sy-datum,
            chtime   like sy-uzeit.
    types: end of itab_type.
    types: begin of itab_type2,
            id       type i,
            idnumber type i,
            index    type i,
            chdate   like sy-datum,
            chtime   like sy-uzeit.
    types: end of itab_type2.
    data: itab     type table of itab_type with header line,
          itab2    type table of itab_type2 with header line,
          prev_rec type itab_type.
    data: v_id type i.
    start-of-selection.
      itab-id       = 1.
      itab-idnumber = 123456.
      itab-chdate   = '20060606'.
      itab-chtime   = '135312'.
      append itab. clear itab.
      itab-id       = 2.
      itab-idnumber = 123456.
      itab-chdate   = '20060606'.
      itab-chtime   = '135900'.
      append itab. clear itab.
      itab-id       = 3.
      itab-idnumber = 123456.
      itab-chdate   = '20060606'.
      itab-chtime   = '142500'.
      append itab. clear itab.
      itab-id       = 4.
      itab-idnumber = 123457.
      itab-chdate   = '20060606'.
      itab-chtime   = '140000'.
      append itab. clear itab.
      itab-id       = 5.
      itab-idnumber = 123457.
      itab-chdate   = '20060606'.
      itab-chtime   = '120000'.
      append itab.
      clear itab.
    <b>  data: counter type i.
    * Assign an index to each row per idnumber
      loop at itab.
        on change of itab-idnumber.
        if sy-tabix > 1.
          clear counter.
          endif.
        endon.
        clear itab2.
        move-corresponding itab to itab2.
        counter = counter + 1.
        itab2-index = counter.
        append itab2.
      endloop.
    * Sort it and get rid of older records.
      sort itab2  by idnumber ascending
                     index descending.
      delete adjacent duplicates from itab2 comparing idnumber.</b>
      read table itab2 with key idnumber = '123456'.
      write:/ itab2-chdate, itab2-chtime.
      read table itab2 with key idnumber = '123457'.
      write:/ itab2-chdate, itab2-chtime.
    Regards,
    Rich Heilman

  • Most recent date with two other conditions met

    Ok, so I'm sure somebody is going to suggest that I do a search first before posting on here.  So let me assure you, that I have exhausted all search possibilities that I could possibly think of before registering to post on here.  I've read a lot of good suggestions that got me just as far as I was getting on my own, because I couldn't find any posts of somebody asking exactly what I'm looking to do.  I have tried quite close to 100 different formulas without achieving the desired results.
    I'm a pilot, and I track all of my flights myself in a very well organized(I think so ) Numbers spreadsheet that I've been tweaking and perfecting over the past few years.  I have created plenty of formulas in it, and they all work great...except ONE.
    I've created a simplified version of the columns I am trying to match specific conditions with.  Essentially, I need the formula to return the most recent date(column 1), that is completed during a night time flight status(column 2), that is equal to or greater than 1.0 flight hours(column 3).
    As you can see, by evaluating the table below, the correct formula should return to me:        8-4-13
    The closest I've come to getting the correct results was with a "LOOKUP" formula, but I could not figure out how to get it to properly assess whether it was equal to or greater than 1.0 hours of flight, thus returning me the wrong date EVERYTIME(the most recent night flight period).
    I'm sure I've gotten close at least a few times, but I need some help getting this final formula figured out.  I really appreciate anybody's input on this.
    Date
    Flight Status
    Flight Hours
    8-1-13
    D
    2.4
    8-2-13
    N
    3.0
    8-3-13
    N
    1.1
    8-4-13
    N
    1.3
    8-5-13
    D
    2.2
    8-6-13
    N
    0.5
    8-7-13
    D
    1.1

    This may work and requires and extra column in your Data entry table (the one you provided in your post).  You can hide this new column.
    D2=IF(AND(C2>=1, B2="N"), A2, "")
    select D2 and fill down as needed.
    The table on the right is a summary table and is set up as follows:
    B2=MAX(Data :: D)
    I hope this is helpful

  • How do I get the numbers ipad app to plot a graph of dates against values, where the most recent date is on the right of the graph, but the most recent date is at the top rather than bottom of the rows in the table?

    How do I get the numbers ipad app to plot a graph of dates against values, where the most recent date is on the right of the graph, but the most recent date is at the top rather than bottom of the rows in the table?
    Also how can it be a line graph without plotting a circle at each value?
    Thanks this is very frustrating

    Make a copy of the table and produce your Line chart or Bar chart from the copy. Sort the copy into the order you want to see in your chart.
    Alternately you could use a Scatter Chart...
    Jerry

  • In Messages, how can I get the most recent entries to appear on top, like with my emails?  Thanks!

    In Messages, how can I get the most recent entries to appear on top, like with my emails?  Thanks!

    HI,
    A Note.
    Technically the most recent Conversation (or Chat) that has a new message (be it iMessage or IM) will move to the top in the list on the left if it is set in the View  Menu to do so.
    Obviously this does need more than one Conversation or Chat to be listed to work.
    It does not change the focus of the Chat/Conversation you are viewing.
    iChat - the forerunner naver had an option to invert the chats.
    The iChat Feedback page is where I use.
    You will also see it does not list iChat 6 depsite listing Lion.
    In this sense it has always beeen out of step on the iChat/Messages version front  (it took me a long time via the Lounge and Host help to get it on the list of pages to be updated on New OS versions)
    11:00 PM      Friday; June 28, 2013
      iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.4)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • Most recent date (UDATE) from CDHDR table based on CDPOS

    Hi,
    I am working on one object where i stuck with one issue. The requirement is I have to retrieve the most recent date from CDHDR table based on CHANGENR in CDPOS table. Where i am doing FOR ALL ENTRIES on CDPOS table to get the MAX( date )and i got the error, that aggregate functions are not allowed except COUNT( * ) with for all entries.
    Any thread which can solve this issue would help aswel.
    Please guide me how to achieve this. <removed>
    Edited by: Thomas Zloch on Mar 13, 2010 9:10 PM

    Hi Li,
    Thats was really helpful information , infact my requirement is same as what you said. I even checked in the table entries there is only one changenumber.
    You said we can take the first record, i even did the same. But for TABNAME I have to pass 3 table name 'LFA1', 'LFB1' and 'LFM1'. For FNAME 'LOEVM', 'SPERR'. I have written the code as below.
      SELECT objectclas
                   objectid
                   changenr
                   FROM cdpos
                   INTO TABLE i_cdpos_a1
                   FOR ALL ENTRIES IN i_lfabm1
                   WHERE objectclas = c_kred               "KRED
                   AND objectid EQ i_lfabm1-objectid       "Lifnr
                   AND ( tabname EQ c_lfa1 OR tabname EQ c_lfb1 OR tabname EQ c_lfm1 )          "LFA1, LFB1 and LFM1
                   AND ( fname EQ c_loevm OR fname OR fname EQ c_sperr )    "LOEVM, SPERR
                   AND value_new EQ c_x.
            IF sy-subrc EQ c_0.
              IF i_cdpos_a1[] IS NOT INITIAL.
    Select UDATE from CDHDR based on CHANGENR in CDPOS.
                SELECT objectclas
                       objectid
                       changenr
                       udate
                       FROM cdhdr
                       INTO TABLE i_cdhdr_a1
                       FOR ALL ENTRIES IN i_cdpos_a1
                       WHERE objectclas = c_kred             "KRED
                       AND  objectid EQ i_lfabm1-objectid               "Lifnr
                       AND changenr EQ i_cdpos_a1-changenr.   "(this is coming from CDPOS above selection)
    Here i got UDATE which have all the dates from 3 tables. I have to display in the output the field value (X) of LOEVM and UDATE for LFA1, SPERR value and UDATE for LFA1.Same way for other two tables, I have to display the UDATE and its field value (X). Where UDATE should be most recent date respectively.
    How can I populate the Recent date (UDATE) from one interal table for indvidual field values and table names.

  • "next" most recent date

    Hello!
    I have an order header record with a order line detail table.
    ORDERS
    OrderID > 1
    ORDER_LINES
    orderID1, line1, item1, date_due
    1,1,ITEM1,01-MAR-07
    1,2,ITEM2,15-MAR-07
    1,3,ITEM3,01-ARP-07
    I want to select the single next most recent date from order_lines where the date_due is the next future date closest to sysdate. There could also be several lines with dates beyond that, but I'm only interested in the next most recent line.
    For the example above, if sysdate = 03-MAR-07 the query would return order 1, line 2 (with the date of 15-mar-07).
    I've seen example in the forum with max(), however as pointed out, there could be several future line dates out there, I'm only interested in the next one from the current sysdate.
    In addition there could be no lines at all that map to the order id, requiring a NLV type of test output.
    Thanks!

    Maybe like this?
    SQL> select * from order_lines;
                ORDERID1                LINE1 ITEM1      DATE_DUE
                       1                    1 ITEM1      01-MAR-2007
                       1                    2 ITEM2      15-MAR-2007
                       1                    3 ITEM3      01-APR-2007
    SQL> select *
      2  from
      3  (
      4     select ol.*
      5           ,dense_rank() over (partition by orderid1 order by date_due) dr
      6     from   order_lines ol
      7     where  date_due > trunc(sysdate)
      8  )
      9  where dr = 1;
                ORDERID1                LINE1 ITEM1      DATE_DUE                      DR
                       1                    2 ITEM2      15-MAR-2007                    1

  • Select most recent DATE for an ID.

    Hi All,
    I need to SELECT the records with the most recent DATE for each ID. A DATE range is part of the selection criteria.
    My data.
    MY_ID MY_DATE
    1684662 26-JAN-09
    1424097 27-JAN-09
    1684663 27-JAN-09
    1684664 27-JAN-09
    1684672 28-JAN-09
    0689073 28-JAN-09
    1052476 21-JAN-09
    1052476 21-JAN-09
    1360828 23-JAN-09
    1684661 23-JAN-09
    1052476 30-JAN-09
    1052476 30-JAN-09
    1052476 30-JAN-09
    1052476 30-JAN-09
    The code below works fine when selecting 1 ID in the SUBSELECT, but with multiple ID it still selects rownum=1 (of course). This as far as my thinking takes me.
    SELECT my_id,
    my_date
    FROM
    (SELECT my_id,
    my_date
    FROM my_table
    ORDER BY my_date DESC
    WHERE rownum = 1
    AND *{color:#ff0000}my_id = 1052476{color}*
    AND TO_CHAR(my_date,'YYYY/MM/DD') BETWEEN '2009/01/01' AND '2009/01/31';
    If I could somehow pass the SELECT ID into the SUBSELECT WHERE clause I should have this done.
    Any suggestions?
    Thank You in Advance for Your help,
    Lou

    One of many possible soultions.
    ME_XE?with data as
      2  (
      3     select 1684662 as id, to_date('26-JAN-09','dd-mon-yyyy') as the_date from dual union all
      4     select 1424097 as id, to_date('27-JAN-09','dd-mon-yyyy') as the_date from dual union all
      5     select 1684663 as id, to_date('27-JAN-09','dd-mon-yyyy') as the_date from dual union all
      6     select 1684664 as id, to_date('27-JAN-09','dd-mon-yyyy') as the_date from dual union all
      7     select 1684672 as id, to_date('28-JAN-09','dd-mon-yyyy') as the_date from dual union all
      8     select 0689073 as id, to_date('28-JAN-09','dd-mon-yyyy') as the_date from dual union all
      9     select 1052476 as id, to_date('21-JAN-09','dd-mon-yyyy') as the_date from dual union all
    10     select 1052476 as id, to_date('21-JAN-09','dd-mon-yyyy') as the_date from dual union all
    11     select 1360828 as id, to_date('23-JAN-09','dd-mon-yyyy') as the_date from dual union all
    12     select 1684661 as id, to_date('23-JAN-09','dd-mon-yyyy') as the_date from dual union all
    13     select 1052476 as id, to_date('30-JAN-09','dd-mon-yyyy') as the_date from dual union all
    14     select 1052476 as id, to_date('30-JAN-09','dd-mon-yyyy') as the_date from dual union all
    15     select 1052476 as id, to_date('30-JAN-09','dd-mon-yyyy') as the_date from dual union all
    16     select 1052476 as id, to_date('30-JAN-09','dd-mon-yyyy') as the_date from dual
    17  )
    18  select id, the_date
    19  from
    20  (
    21     select id, the_date, max(the_date) over (partition by id) as max_the_date
    22     from data
    23  )
    24  where the_date = max_the_date;
                    ID THE_DATE
                689073 28-JAN-0009 12 00:00
               1052476 30-JAN-0009 12 00:00
               1052476 30-JAN-0009 12 00:00
               1052476 30-JAN-0009 12 00:00
               1052476 30-JAN-0009 12 00:00
               1360828 23-JAN-0009 12 00:00
               1424097 27-JAN-0009 12 00:00
               1684661 23-JAN-0009 12 00:00
               1684662 26-JAN-0009 12 00:00
               1684663 27-JAN-0009 12 00:00
               1684664 27-JAN-0009 12 00:00
                    ID THE_DATE
               1684672 28-JAN-0009 12 00:00
    12 rows selected.
    Elapsed: 00:00:00.03

  • Selecting row by most recent date

    I'm attempting to select a row where the time ends in :00 and
    date is the most recent date or just the last record where time
    ends in :00, either will do.
    Once I have that record selected I need to query that query
    to pull in the previous 3 records which will be times ending in
    :15, :30 and :45 to round out that full hour of data for
    processing.
    It seems to me that this should be pretty easy but my CF
    books are not helping me here.
    Any Ideas?

    Two things I do to make this sort of thing easier are:
    1. Take baby steps. Start with one field and the date field.
    Once you get that to work, add one or two fields at at time.
    2. Comma control. This structure helps prevent extra commas
    from slipping into your query.
    select field1
    , field2
    , date
    from yourtable join (
    select field1 f1
    , field2 f2
    , max(datefield) maxdate)
    from yourtable
    where something
    group by field1
    , field2
    ) temp on field1 = f1 etc
    where clause

Maybe you are looking for

  • One user can not map a network drive

                       Hi, A costumer of mine is trying to map a network drive for an existing user that has always had access to the NSS6000 Network Storage Device. This still works for all other users except this one. It looks like an authentication fa

  • CustomObjectTreeModel not displaying correctly

    Hi, I have created a database explorer tree model. It seems my attempts at trying to make it as simple as possible has gotten the better of me. I created a Generic Object that has a name property with a getter and a setter, I also override the toStri

  • Border color change of UILoader

    Hi Does anyone now how to change the border color of the UILoader component when user clicks on that. I have put UILoader in the sprite container and i need to implement that if user selects that UILoader its border color will be changed (to red may

  • Send an activation link to new user's email ID in webdynpro java

    Hi Experts, We have developed a custom Web Dynpro java application for the SAP user self registration. The user is being created successfully in UME db and we are also able to send an email to the user's registered Email ID. Now, as per the requireme

  • Refreshing Message server ports on Netweaver 7.1

    Hi, I have a problem with a Netweaver 7.1 Java server; I was creating a JCO destination, and it was missing a logical port definition for the message server. So I edited the server's "services" file (c:\windows\system32\drivers\etc\services), and acc