Need help with sum from previous years

Hi All,
In a report i have 4 fields. The first field shows the YTD invoice totals for the current FY 2010 (which i accomplished). The other 3 fields are :
2nd field Sum of the value of invoices for the FY 1YEAR prior to the current year
3rd field Sum of the value of invoices for the FY 2YEAR's prior to the current year.
4th field Sum of the value of invoices for the FY 3YEAR's prior to the current year.
How can i get the desired results for the second,third and the fourth fields, please need help or advice.
Thanks

Hi
If you have the values for several years in the same report you should be able to do what you want using the analytic LEAD and LAG.
LAG will retrieve values from previous rows whereas LEAD will retrieve values from following rows.
The basic syntax is the same and look like this:
LAG(value, offset) OVER ({optional_partition_clause} ORDER BY mandatory_order_clause)
The ORDER BY clause is mandatory and cannot be omitted. However, this ORDER BY has nothing to do with the sort order you manually create in the worksheet. Generally, most people will set their sort order the same as the ORDER BY in the calculation.
Here's an example that gets year to date from 2 financial years ago:
LAG(YTD,2) OVER (ORDER BY FY)
You have to understand that Discoverer will pull values from previous rows not from previous cells as displayed on the report, although if the cells may happen to be rows too then it will appear as though it is pulling previous cells. I personally am very experienced with analytuc functions and can make manipulate data within Discoverer just about any way that I want. Generally, if I can see data on the screen even when they are in different cells or rows I can create functions to manipulate it. This capability only comes about as a result of experience and I would strongly advise you to practice with the analytics and see if you can at least master some of them. You'll find your Discoverer capabilities will improve dramatically and you will become a great asset at work.
When working with a new report I generally duplicate the report as a table so that I can see the values. Then if I need to sort the items in order to line up the values I want to work with I do so. Having worked out what sort order I need I can then see what offset I use then I create the analytic and use it in the main worksheet.
Hope this helps
Best wishes
Michael

Similar Messages

  • Please i need help with switch from the us store to malaysian store how i can switch

    Please i need help with switch from the us store to malaysian store how i can switch

    Click here and follow the instructions to change the iTunes Store country.
    (82303)

  • HT1766 I need help with restore from bachup

    I NEED HELP WITH MY IPAD RESTORE FROM BACKUP

    This is the iPod touch forum and you are not providing any information to help you.

  • I need help with restoring a previous Firefox session from the other day, that seems to not be opening back up.

    I had many tabs opened in my Firefox browser and usually I can close the browser and reopen it, and the tabs are still there.
    After restarting my computer, I went to Firefox and it started with a new session, without the option to restore the previous session.
    I have a feeling that there is a way to restore these tabs, but in the case that it is not, then I'll just have to accept that.
    I was thinking maybe a backup file of the tabs, like how the bookmarks can be backed up.
    The tabs were important, so I just wanted to use this as the last resort to see if they can be restored in some way, shape or form.
    This is the first time that I'm using this, so I'm hoping that someone can help me with this issue, as I'm sure that I am not the only one that has ever experienced this problem.

    You can make a backup copy of the file sessionstore.js in the profile folder.
    *http://kb.mozillazine.org/sessionstore.js
    *Help > Troubleshooting Information > Profile Directory: Open Containing Folder
    You can also bookmark all open tabs via the right-click context menu of a tab on the tab bar.

  • Need help with upgrade from Adobe Creative Suite to PS CS4

    My old laptop with Photoshop on it crashed and I ended up purchasing a new laptop.
    I'm trying to reload my PS CS4.  I am using an upgrade from an educational Adobe Creative Suite Premium to the CS4 and when I loaded it on my old laptop I had to get installation help through customer service, but now customer service will not help me since it is CS4.
    When installing the upgrade, it tell me to select the product I already own.  I own the educational full creative suite, but am only upgrading the Photoshop.  I chose Photoshop CS and tried entering the serial number for the suite.  It tells me that the serial number doesn't match the product chosen.  Of course the only products I'm allowed to choose from is Photoshop CS, CS2, or CS3 and not Creative Suite Premium.
    The other serial numbers on this CS is Golive CO and Pagemaker Plug-in.
    I was told there are Adobe customer service reps here on the forum, please tell me what it was I need to do to get my Photoshop installed.
    Thanks

    i wasn't aware that you could get a ps4 at an upgrade price using an older creative suite produect.  i searched online and found this thread (http://forums.adobe.com/thread/476009) which makes it appear that was not a valid upgrade path.
    but, if you're confident that was a valid upgrade path, i'm pretty sure something will need to be done on adobe's end and no amount of manipulation, on your end only, will work.
    your best bet would be to get help in this forum from an adobe staff member like jeff wright who is very knowledgeable and goes out of his way to help adobe customers.  to that end, if i were you, i would start a new thread mentioning his name in your title and in your initial post explaining:
    you have the educational Adobe Creative Suite Premium and purchased a photoshop cs4 upgrade years ago that required adobe support help to install years ago. 
    that worked well until a recent computer problem forced you buy a new laptop and you are now trying to reinstall that ps cs4 and again need support help but have been refused help because cs4 is not current.

  • BPS Currency Translation with rate from previous year

    Dear All,
    I am trying to use the BPS currency translation function. However, I would like to use an exchange rate from the previous fiscal year, in order to reveal currency effects.
    I would appreciate any help, hopefully regarding ways to mend the standard function. I am afraid a workaround with the FM CONVERT_TO_LOCAL_CURRENCY would end up in a giant crutch.
    Thank you in advance,
    Lars Biederstedt

    Thank you for your answer, Marc.
    I would definitely like to know more about option 1.
    Option 2, a fixed data, would not work, because data had to be translated monthly, with the exchange rate from exactly one year ago. I was really surprised, that you could not enter a variable as a time reference and use offsets, like you can in queries.
    I ended up using an Exit-Function with the function module convert_to_foreign_currency. Unfortunately you cannot change characteristic values with Exit-Function, so I have to repost after every currency translation.
    Anyway, it works.
    Best regards,
    Lars
    cundus AG

  • Need help with calc from tables

    I have a table that contains query #1 and have another table
    that contains a field that needs to use the result of the cfset in
    another calc.
    The new calc in query #2 needs to divide the Num_Checks_Trans
    from query #1 by the by the Weekly_Hours_Recorded in query #2.
    Can anyone help me figure this out?
    <b>1.</b>
    <cfquery name="QryEmployeeDetail"
    datasource="NBProdReports">
    SELECT TblContractInfo_SubMenuTable.User_ID,
    TblContractInfo_SubMenuTable.Contract_Number,
    TblContractInfo_SubMenuTable.Transaction_Type,
    TblContractInfo_SubMenuTable.Num_Checks_Trans, TblTransType.Value,
    TblContractInfo_SubMenuTable.Notes, TblMasterTrans.Date_Opened
    from TblContractInfo_SubMenuTable, TblMasterTrans,
    TblTransType
    WHERE TblContractInfo_SubMenuTable.Task_Number =
    TblMasterTrans.Task_Number
    and TblTransType.Transaction_Type =
    TblContractInfo_SubMenuTable.Transaction_Type
    And TblMasterTrans.Date_Opened BETWEEN
    #createODBCDate(DED_startDate)# AND #createODBCDate(DED_endDate)#
    order BY TblMasterTrans.Date_Opened ASC,
    TblContractInfo_SubMenuTable.User_id ASC
    </cfquery>
    <cfset totalTrans = 0 />
    <cfloop query="QryEmployeeDetail">
    <cfset totalTrans = totalTrans +
    (QryEmployeeDetail.Num_Checks_Trans * QryEmployeeDetail.Value)
    /></cfloop>
    Text
    2.
    <cfquery name="QryEmployeeDetail"
    datasource="NBProdReports">
    SELECT TblContractInfo_SubMenuTable.User_ID,
    TblContractInfo_SubMenuTable.Contract_Number,
    TblContractInfo_SubMenuTable.Transaction_Type,
    TblContractInfo_SubMenuTable.Num_Checks_Trans, TblTransType.Value,
    TblContractInfo_SubMenuTable.Notes, TblMasterTrans.Date_Opened
    from TblContractInfo_SubMenuTable, TblMasterTrans,
    TblTransType
    WHERE TblContractInfo_SubMenuTable.Task_Number =
    TblMasterTrans.Task_Number
    and TblTransType.Transaction_Type =
    TblContractInfo_SubMenuTable.Transaction_Type
    And TblMasterTrans.Date_Opened BETWEEN
    #createODBCDate(DED_startDate)# AND #createODBCDate(DED_endDate)#
    order BY TblMasterTrans.Date_Opened ASC,
    TblContractInfo_SubMenuTable.User_id ASC
    </cfquery>

    This can be rewritten as a single query which is good for a
    number of reasons, including we only make one trip to the database
    and we do our calculations on the SQL backend, which is faster than
    doing them in CFML.
    What you're going to want to do is SUM() the total
    transaction values by having a column like SUM(Num_Checks_Trans *
    Value) AS totalTrans. To get the value for your other column you
    can calculate that like Num_Checks_Trans / Weekly_Hours_Recorded. I
    didn't see the latter in either of your queries so I'm not sure
    where it comes from, but you can definitely use it in your SELECT
    clause when calculating.
    Since SUM() is an aggregate function, you'll have to use a
    GROUP BY clause to make it work. You'll have to GROUP BY each
    column in the SELECT statement. If some of the columns have
    differing data that you won't want to use in the GROUP, you can
    always use a nested subquery as part of your FROM clause and then
    join that to the original queries with the totals.
    I hope that helps.
    - William

  • Actuate to BIP Conversion Need Help with Sum and Distinct

    Hi,
    I am in the process of converting an Actuate report to BI Publisher .rtf format. Within the actuate report I have encountered the following code in one of the fields:
    Sum([ssCalc])Distinct([ssProfessional_Id])
    From what I understand this Actuate code is grouping by distinct ssProfessional_Id then taking the sum of the ssCalc field.
    In my .rtf template I have the following:
    <?for-each-group:ssSRA;./ssCIN?>
    <?ssCalc?>
    <?end for-each-group?>
    I need to convert the Actuate code into the place where I currently have <?ssCalc?> in my template but I have no idea how I can translate translate this. Does anyone have any suggestions?????
    Thanks,
    Fred

    Fred
    Can you post the XML, easier to help then
    Tim

  • HT1296 Need help with sync from phone to computer

    When I sync my phone to my laptop, I would like info I entered on the calendar on my phone to be added to the calendar on my computer.  I can only get it to sync from computer to phone.  I need to update both
    any ideas.  I have searched the help files and can't find this anywhere

    My problem is similar. I just upgraded from the 4S to the 5 and I used to be able to sync the calendar on my iMac and iPhone using iCloud without getting duplicates by selecting/deselecting the appropriate calendars on the respective devices. Everything synced as I entered it. 
    I'm pretty sure it was working with the 5 until recently...
    Today I noticed that an event I entered on the 5 for last week didn't show up on my iMac. When I checked the EDIT screen on the phone to see what calendars were checked, only the calendar for that event was (on the All on my iPhone).  All but the Unfiled calendar are checked on the All on my iCloud.  When I unchecked and rechecked the calendars under the Phone didn't help. Can't get the thing to sync...
    Seems like most people are having problems with Exchange accts, but here I am with my iMac/Phone/Cloud...

  • New ipod need help with songs from old one NEED HELP!!!!

    I got a new ipod nano 3rd gen. but it wont let me take all of my old songs from my old ipod(nano 1st gen) and put them on my new one! I dont want to lose my songs so PLEASE HELP!!

    When I did that on my old ipod and it said doing so will delete all the songs on it and replace it with my library. When I did it on my new ipod it just put the songs that was already in that playlist back on the ipod, not the songs that i need from the old one.

  • I need help with programs from my MacBookAir.

    Hello. I've intalled programs on my MacbookAit that I don't need anymore and I have no idea how to remove them from my laptop. I've been a PC user and I knew there how to remove them but here I just don't know. I know that dragging them to the trash won't work. I want to remove them and free the space that is taking. I hope you guys can help me with this. Thank you Very Much!!!

    Uninstalling Software: The Basics
    Most OS X applications are completely self-contained "packages" that can be uninstalled by simply dragging the application to the Trash.  Applications may create preference files that are stored in the /Home/Library/Preferences/ folder.  Although they do nothing once you delete the associated application, they do take up some disk space.  If you want you can look for them in the above location and delete them, too.
    Some applications may install an uninstaller program that can be used to remove the application.  In some cases the uninstaller may be part of the application's installer, and is invoked by clicking on a Customize button that will appear during the install process.
    Some applications may install components in the /Home/Library/Applications Support/ folder.  You can also check there to see if the application has created a folder.  You can also delete the folder that's in the Applications Support folder.  Again, they don't do anything but take up disk space once the application is trashed.
    Some applications may install a startupitem or a Log In item.  Startupitems are usually installed in the /Library/StartupItems/ folder and less often in the /Home/Library/StartupItems/ folder.  Log In Items are set in the Accounts preferences.  Open System Preferences, click on the Accounts icon, then click on the LogIn Items tab.  Locate the item in the list for the application you want to remove and click on the "-" button to delete it from the list.
    Some software use startup daemons or agents that are a new feature of the OS.  Look for them in /Library/LaunchAgents/ and /Library/LaunchDaemons/ or in /Home/Library/LaunchAgents/.
    If an application installs any other files the best way to track them down is to do a Finder search using the application name or the developer name as the search term.  Unfortunately Spotlight will not look in certain folders by default.  You can modify Spotlight's behavior or use a third-party search utility, Easy Find, instead.  Download Easy Find at VersionTracker or MacUpdate.
    Some applications install a receipt in the /Library/Receipts/ folder.  Usually with the same name as the program or the developer.  The item generally has a ".pkg" extension.  Be sure you also delete this item as some programs use it to determine if it's already installed.
    There are many utilities that can uninstall applications.  Here is a selection:
    AppZapper 2.0.1
    AppDelete 3.2.6
    Automaton 1.50
    Hazel
    AppCleaner 2.1.0
    CleanApp
    iTrash 1.8.2
    Amnesia
    Uninstaller 1.15.1
    Spring Cleaning 11.0.1
    Look for them at VersionTracker or MacUpdate.
    For more information visit The XLab FAQs and read the FAQ on removing software.

  • Need help with mail from pc

    I received some mail from outlook that had some odd characteristics and I'm hoping that someone can help me figure out how to get it to display normally.
    1. no header information (I don't see who the sender is, subject, etc. in Mail). The top of the message looks like this:
    ------=NextPart_000_002201C7B31B.65BC0BE0
    Content-Type: multipart/alternative;
    boundary="----=NextPart_001_002301C7B31B.65BC0BE0"
    ------=NextPart_001_002301C7B31B.65BC0BE0
    Content-Type: text/plain;
    charset="us-ascii"
    Content-Transfer-Encoding: 7bit
    2. There are embedded table in the message that in one column instead of multiple columns.
    In both cases, I can view the messages okay if I log onto the webmail server.

    I got it working i tried all the ISO files from microsoft media creation tool and none worked and i dont know why but i checked the sticker on my pc "windows 8.1 with bing" so i googled windows 8.1 with bing iso, donwloaded it and now the key worked

  • Need help with query from .csv file

    I am trying to import a csv file with only 1 column in it.
    The column will only contain a 9 digit ID number. I want to read
    the file then use the contents to query a table to get the names
    and other information and display it. Here is what I have so far:
    <cffile action="read" file="#form.FiletoUpload#"
    variable="csvfile">
    <cfloop index="index" list="#csvfile#">
    <cfquery name="massimport" datasource="data1">
    SELECT * FROM IDTable
    WHERE CardNumber = ('#csvfile#')
    </cfquery>
    </cfloop>
    <cfoutput>#Name# #ID# #Site#</cfoutput>
    I get no errors but I am not getting any results. Just a
    blank page. Does anyone know how to query directly from a csv
    import? Thanks.

    You need to convert your file to a list somehow. Not sure if
    this is the most efficient way but, you can use the cfhttp tag to
    produce a query. Then your where clause becomes,
    where cardnumber in (#quotedvaluelist(query.column)#)
    and you won't need a loop.

  • I need help with upgrade from CS5.5 to CS6 Production Premium DISC version

    Hi,
    i bought the Production Premium CS5.5 in 2011. I then bought the CS6 Upgrade (the boxed version). After the security desaster at Adobe, the keys were invalidated. So when now years after purchase I wanted to use my product, Adobe said I had to download the file CS6 (6GB) from the Adobe server. I did that. After unzipping, the Installer says that a file is missing and I should use a tool which is now not on the Adobe site since it has been discontinued.
    It would be nice if anybody had an idea how to get this to work.
    Thank you in advance.
    A former premiere fanboy that is now really annoyed.

    Hi, thank you for the fast reply. I tried to put the downloaded file (7zip, CS6) und the small file (setup file 1MB) in a new folder with write priviledges. 150GB free space. It starts to unpack 3% then cancels due to insufficient space or a write priviledges error (none is true). I will try your link. Yes, I have both boxes here with the serial keys. CS 5.5 is installed on the PC so it should find it. The tool I mentioned is:  Adobe - Adobe Support Advisor

  • Need help with data from databases

    Hi,
    I need to search several columns in a table, for ex. the Id column and the Headline column. Of cource the id must be connected to the right headline when I want to do something to the data.
    Now I get a Resultset and I have tried out different ways to get the data out from the Resultset but the result doesn't seems to be right. Can anyone help me, please.
    -Thanks-

    You can iterate on your ResultSet if it contains several
    rows.
    Let's imagine you have defined a class Element containing
    the values you want to use.
    List l = new ArrayList();
    // Calling rs.next() put the cursor on the next row
    // and return false if there is no more row
    while (rs.next()) {
    Element e = new Element(rs.getString(1), rs.getInt(2));
    l.add(e);

Maybe you are looking for

  • Export Release Build on Flash Builder 4 Beta 2

    Hi Everyone, I have a Flex 4 project that is organized as a main app project with several related projects that are linked in, along with several libraries that get included (I use granite dataservice and tweener, among others). The project runs fine

  • ABAP report in Webdynpro iview

    Hi All I have to show output of an ABAP report in a webdynpro iview. The original report output is in list format. How to show this report output in webdynpro iview? Please help. Thanks Raktim

  • Java code to check system of another PC

    i would like to check the system (i.e. CPU name, CPU speed, etc) of another PC from my PC. How will I do it? Currently, I can check the system of a PC if I launched my java application on that PC. But now, I want it to be checked via network. Can you

  • Multiple statements in a preparestatement function of Connection object?

    hi, is it possible to have multiple statements prepared and executed at one go? such as; PreparedStatement stmt = conn.prepareStatement("SET ISOLATION TO DIRTY READ SELECT * FROM " + srcTable); im trying to set the isolation to dirty read, currently

  • AIR for iOS Data Protection question again

    We are looking into Protecting Data Using On-Disk Encryption for our AIR for iOS iPad apps. An article on the adobe site (Protecting content on an iOS device with DPS | Adobe Developer Connection) mentioned this can be achieved by generating Data Pro