How to print only the 2 most recent values in a multi-value table field

Hi there,
I have a history table field in my report that may contain anywhere up to 100 values for any one database record... however for each database record, I only want the LAST 2 (ie. 2 most recent) values of this field to be included in the report. I then want to do a value change comparison and produce a percentage change for the field.
It seems like a simple concept... can anyone assist?
-Karen

Hi Jyothi,
I'm not sure I understand your qeustion.
For example:
The table field may contain a list of 4 values:
(value1) 5000
(value2) 4000
(value3) 7000
(value4) 7500
I only want the report to include value3 and value4, and then I want it to show the difference between these values (ie. 7500 minus 7000) and then also express a percentage change between these two values). I am not sure what kind of formula to use for this.
Thanks for your time!
-Karen

Similar Messages

  • How to return only the most recent row?

    Hi guys,
    I have a question which I am hoping is not too difficult but I just am not sure how to do it. I need to run a query on a table which may bring back multiple rows for my criteria, however I only want to bring back 1 of these multiple rows and the one I want to bring back has to be the most recent. I do have a date_created column on my table as well as a date_last_updated column. So basically using the select statement below as an example this query could return lets say 5 rows, I however only want it to return the most recent row and the most recent row is determined by the date_last_updated (which will only be populated if the record has been updated otherwise it is null) or the date_created fields.
    select * from my_table
    where model_id = 234
    Any help on this matter would be greatly appreciated.
    Thank you.

    Hi,
    you can do; -
    select *
    from
    (select *
    from my_table
    order by creation_date desc)
    where rownum = 1This does not guarantee that you will get the most recent in cases of records being created at exactly the same time, but if your table has a prime key then you could use this as the order by to get the same effect, though if say 5 records are inserted as a batch what does it really mean to be inserted last....
    regards,
    Robert.
    Edited by: Robert Angel on 09-Jul-2012 08:22 to add code tags.

  • For Multi value attributes, how we can view only the most recent value?

    Where we can set what in endeca servers (MDEX, Clover & Studio) to view only the most recent value of a multi assign value attribute on Studio server?

    That's correct, multi-value attributes do not support this in Endeca.
    If you're looking to do it, I would keep writing your updates to the multi-value attribute (to maintain the functionality that depends on this attribute and its multiple values) and also write it to a separate single-value that is constantly being updated, rather than appended to.
    Something like:
    One attribute called MyValueMulti as a multi-assign.
    AND
    One attribute called MyValueLatest as a single-assign.
    Regards,
    Patrick Rafferty
    http://branchbird.com

  • 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

  • To change info in library file then info, only the most recent cd's allow me to change info, all others 14,000, do not, any ideas???

    Understand to change cd info in library  File then info, as of recent only the most recent music added to my library enabled to make changes, all others (14,000) do not highlight change categories, that is gray not black. Any suggestions.

    I suspect a permissions problem. This can happen when a library is moved between systems or the system is upgraded to a new version of Windows.
    Right-click on your main iTunes folder (or ithe Tunes Media folder if that is elsewhere) and click Properties, then go to the Security tab and click Advanced. If necessary grant your account and SYSTEM full control of this folder, subfolders and files, then tick the option to replace permissions on child objects which will repair permissions throughout the library. This is the XP dialog but Windows 7 shouldn't be too different.
    If it won't let you change the permissions use the Owner tab to take ownneship from an account with administror privileges.
    tt2

  • I got a new iphone 6.  When I restore my phone from my icloud backup my most recent photos and messages not restored from icloud backup.  How do I get the most recent backup onto my new phone?

    I got a new iphone 6.  When I restore my phone from my icloud backup my most recent photos and messages not restored from icloud backup.  How do I get the most recent backup onto my new phone?

    Hello, Anita.  
    Thank you for visiting Apple Support Communities.  
    I understand that you are wanting to restore your new iPhone 6 from an iPhone 5 backup.  This sounds like the iOS version of your old iPhone 5 may be newer than what was installed on your iPhone 6.  Try going through the steps in the article below.  
    iOS: Unable to restore from backup of a newer device
    I would also check to see the backup dates in iTunes and if the  backup is located on iCloud instead of iTunes.  
    Back up and restore your iPhone, iPad, or iPod touch using iCloud or iTunes
    Cheers, 
    Jason H.  

  • HT4623 I have ios 5.1 and according to my ipad there are no ios updates but yet there are apps I would like to use that require 6.0 or later.  how do i get the most recent ios 7.0.3?

    how and where do I the the latest IOS for IPAD!!!

    Fredronalderman wrote:
    there are apps I would like to use that require 6.0 or later.  how do i get the most recent ios 7.0.3?
    Finding iOS Apps Compatible with Older Devices
    App Store: Downloading Older Versions of Apps

  • How do I change mail so only the most recent mail from a person opens?

    When I open mail and go to a new mail all of the files/documents that, that person has ever sent me from previous days open as well. The other emails that I do not want also show up on the right side of my mail in the preview the document part. How do I change it so that I only see the email I am clicking on not a scrolling document of all of the mail items the sender has sent me. Also how do I change it so I only see the most recent item (the one I am clicking on) in the preview email on the right side? Thanks

    In the View menu, uncheck (Expand All Conversations).

  • How to read only the most current records in PL/SQL

    Oracle version: 11.2
    I have a table in ORACLE called RATES and there is a EFFECTIVE_DATE, RATE_NAME, RATE_AMOUNT
    RATE
    1 RATE_ONE 1/1/2000 0.10
    2 RATE_ONE 5/1/2005 0.15
    3 RATE_ONE 12/1/2010 0.20
    4 RATE_TWO 10/15/2009 0.33
    5 RATE_THREE 9/7/2011 0.05
    6 RATE_THREE 12/31/2011 0.06
    A rate can be in there multiple times, but the most recent rate is the active rate. I need to query this table and only want to bring back the currently active rows:
    RECORDS 3, 4 and 6
    How can I do this in the most elegant way?
    Can I say:
    SELECT RATE WHERE trunc(sysdate) between EFFECTIVE_DATE and trunc(sysdate);
    (this will not work. I'm not sure how to do this without an exp date column and then I could say
    SELECT RATE WHERE trunc(sysdate) between EFFECTIVE_DATE and END_DATE
    The problem is that I cannot add that column at this time, so need to find a way to do it programatically
    Edited by: userLynx on Feb 1, 2012 8:56 AM

    Try This:
    WITH a
            AS (SELECT 'RATE_ONE' ratename,
                       TO_DATE ('1/1/2000', 'mm/dd/yyyy') eff_date,
                       0.10 amount
                  FROM DUAL
                UNION ALL
                SELECT 'RATE_ONE' ratename,
                       TO_DATE ('5/1/2005', 'mm/dd/yyyy') eff_date,
                       0.15 amount
                  FROM DUAL
                UNION ALL
                SELECT 'RATE_ONE' ratename,
                       TO_DATE ('12/1/2010', 'mm/dd/yyyy') eff_date,
                       0.20 amount
                  FROM DUAL
                UNION ALL
                SELECT 'RATE_TWO' ratename,
                       TO_DATE ('10/15/2009', 'mm/dd/yyyy') eff_date,
                       0.33 amount
                  FROM DUAL
                UNION ALL
                SELECT 'RATE_THREE' ratename,
                       TO_DATE ('9/7/2011', 'mm/dd/yyyy') eff_date,
                       0.05 amount
                  FROM DUAL
                UNION ALL
                SELECT 'RATE_THREE' ratename,
                       TO_DATE ('12/31/2011', 'mm/dd/yyyy') eff_date,
                       0.06 amount
                  FROM DUAL)
    SELECT ratename, eff_date, amount
      FROM (SELECT ratename,
                   eff_date,
                   amount,
                   RANK () OVER (PARTITION BY ratename ORDER BY eff_date DESC) rk
              FROM a)
    WHERE rk = 1

  • When I sort by date added in Column View in Finder, how can I make the most recent files appear at the top of the list?(Mavericks)

    In 10.8, when I sorted Finder by date added or date created in column view, the most recent files would appear at the top of the list. Currently, this happens as it should in every single view mode EXCEPT column view (which is pretty much the only view I ever use). Currently, I have a folder with over 2000 files in it that date back to 2011, so now I have to scroll for like ten minutes just te get to files that were most recently added. Who in their right mind would want to sort by last modified with the oldest result listed FIRST? Ridiculous. I can't figure this out. Any help?

    Thanks for the reply leroydouglas! Unfurtunately this doesn't cause the column to be ordered correctly either. After selecting this option, the files seem to be ordered by label, and the most recently added file is somewhere in the middle of the list. I'd like it to be at the top, and have other files/folders descend in retrochronological order by their add date.
    Any other input from the community would be greatly appreciated, even if it's just confirming that this is/is not expected behavior. I'd be super bummed to find out that this IS expected behavior, as it's really counterintuitive and extremely inconvenient.
    Thanks again!

  • ITunes is a blank-slate...How do I load the most recent previous version of my library?

    I "re-arranged" my files on my computer to free up space and now my iTunes is completely blank.  No apps, no music, no ringtones.  Nothing.  How do I find and load the most recent previous version of iTunes?  Since we went to the cloud I haven't actually plugged my phone in to sync it...I'm afraid it will ask me if I want to load what's on my phone into iTunes, and I just want my old iTunes back.  Any ideas?  TIA!

    When you re-arranged your Files for iTunes, in your C:\Users\Your Username\Music\iTunes folder ->should be a iTunes library.xml, and a Itunes library.lib- if you moved those thats why your library is blank.
    Simply go to File- Add folder to library-> locate your Music folder- click choose - and you library should come back

  • I have more songs than can fit on my ipod.  How do I add the most recent when I sync?

    I suppose sometime I will have to get a bigger IPOD, but I still love hwat I have but like to mix up the music.  I now have too many songs on my computer to load on my IPOD.  Is there any way to automatically load the most recently added tunes when I sync or do I have to manually deselect tunes I don't want to load?

    Hello sifishman,
    Instead of trying to reinvent the wheel on this one or explain it myself, have a look at this Apple support document.  Should be able to answer your question.
    How to sync music to your iPod when your library is bigger than your iPod storage space
    B-rock

  • How do I find the most recent version of ipad apps?

    I have duplicate app icons on my ipad2. How do I find out which is the most recent so I can delete the older version?

    Unless you have a Free and paid version of an App that happen to be two distinct Apps in the store, there's really no way to have 2 versions of the same App.
    When most apps update they replace the existing one automatically.
    Though I do know of a few that have released completely different apps in an update instead of updating the existing one. When that happens usually the old version no longer works, and prompts you to update to the newer one. So all you can do is remove it.

  • How can I use only the most recent data in an average?

    I have a class which has regular listening quizzes.  If a student's average from the last three tests falls below 10 points (out of 20), then that student has to come in for extra practice.
    My Sheets are set up with the students' names running down column A.  Test 1 is column B.  A a check box for whether students handed in the pre-listening homework is in column C.  The test and homework column pattern is continued for tests 1 through 20. 
    I then have an average for all the tests for that student further over to the right.
    Next to the overall average, I would like to make a column with an average showing only the latest three test scores.  So, for example, the students have just finished test 10, the average of test 10, 9 and 8 would appear, but everything prior to that would be ignored.
    I appreciate any suggestions on a formula for how I could make that happen.
    Thank you!

    CB,
    Here's one approach. Note that I used Header Columns to make the programming easier. If you choose not to use Header Columns, you can adjust the formulas to account for the difference.
    The formula in Overall Average is: =IFERROR(AVERAGE(2:2), 0) for Alice. Fill Down.
    The formula in Last Three Scores average is: =IF(COUNT(2:2)<3, B, AVERAGE(OFFSET(D2, 0, (COUNT(2:2)-3)*2, 1, 6))) for Alice. Fill Down.
    Regards,
    Jerry

  • Show only the most recent event in XML list based on date

    Hello,
    I'm working with Spry and an XML list of events for my site.
    Displaying the full list of events isn't a problem. However, I'd like to display only the next upcoming event, based on the date.
    For instance, today is April 27th. I'd like to be able to display only the next upcoming event which happens to be on May 3rd. Then once that date passes, the next upcoming event is shown (May 17th).
    Can anyone give me a hand?
    Thanks!

    This seems like it's on the right path. Thank you for your response, though, I'm afraid I need a bit more help.
    I can get the statement to work, but I'm having trouble trying to figure out how to use the results. I can run the IF statement, and it checks the first value in the XML list. Since the first item in the list is older than the date I input, it just returns "false". I'm not really sure how I can make it return just the first entry that is "true".
    Secondly, I'm not sure how to get it to use the "Current Date" without manually entering the date in the if statement. Is there an easy way I can get the system date for it to check with?
    Thanks!!

Maybe you are looking for