How to use the AGO function to calculate the sum of the last 12 months?

year     |     month     |     amount                    
2009     |     01     |     100                    
2009     |     02     |     150                    
2009     |     03     |     120                    
2009     |     04     |     110                    
2009     |     05     |     155                    
2009     |     06     |     180                    
2009     |     07     |     105                    
2009     |     08     |     145                    
2009     |     09     |     200                    
2009     |     10     |     205                    
2009     |     11     |     150                    
2009     |     12     |     120                    
2010     |     01     |     225
SUM OF THE LAST 12 MONTHS OF 201001=>225+120+150+205+200+145+105+180+155+110+120+150     *1.865*
How do I do this? Could anyone help me?
Thanks.

hi,
Create a dummy column in Fx
Use *Filter ( amount_col using date col= TimeStampAdd(SQLTSI_MONTH, -12 ,date_col)*
If u want to show at grand total level
Go with combine with similar request
same as u mentioned (1st criteria)
date_col, month, use the above formula (2nd criteria)
try this and let me know
Thanks,
Saichand.v
Edited by: Saichand Varanasi on Oct 7, 2010 7:27 PM

Similar Messages

  • How to use case when function to calculate time ?

    Dear All,
    May i know how to use case when function to calculate the time ?
    for the example , if the First_EP_scan_time is 12.30,  then must minus 30 min.  
    CASE WHEN FIRSTSCAN.EP_SHIFT <> 'R1' AND FIRSTSCAN.EP_SHIFT <> 'R2'
    THEN ROUND(CAST((DATEDIFF(MINUTE,CAST(STUFF(STUFF((CASE WHEN SHIFTCAL.EP_SHIFT = 'N1'
    THEN CONVERT(VARCHAR(8),DATEADD(DAY,+1,LEFT(FIRSTSCAN.EP_SCAN_DATE ,8)),112) + ' ' + REPLACE(CONVERT(VARCHAR(8),DATEADD(HOUR,+0,SHIFTDESC.EP_SHIFT_TIMETO + ':00'),108),':','')
    ELSE LEFT(FIRSTSCAN.EP_SCAN_DATE ,8) + ' ' + REPLACE(CONVERT(VARCHAR(8),DATEADD(HOUR,+0,SHIFTDESC.EP_SHIFT_TIMETO + ':00'),108),':','') END),12,0,':'),15,0,':') AS DATETIME),CAST(STUFF(STUFF(LASTSCAN.EP_SCAN_DATE,12,0,':'),15,0,':') AS DATETIME)) / 60.0 - 0.25) AS FLOAT),2)
    ELSE ROUND(CAST((DATEDIFF(MINUTE,CAST(STUFF(STUFF(FIRSTSCAN.EP_SCAN_DATE,12,0,':'),15,0,':') AS DATETIME),CAST(STUFF(STUFF(LASTSCAN.EP_SCAN_DATE,12,0,':'),15,0,':') AS DATETIME)) / 60.0) AS FLOAT),2) END AS OTWORK_HOUR

    Do not use computations in a declarative language.  This is SQL and not COBOL.
    Use a table of time slots set to one more decimal second of precision than your data. You can now use temporal math to add it to a DATE to TIME(1) get a full DATETIME2(0). Here is the basic skeleton. 
    CREATE TABLE Timeslots
    (slot_start_time TIME(1) NOT NULL PRIMARY KEY,
     slot_end_time TIME(1) NOT NULL,
     CHECK (start_time < end_time));
    INSERT INTO Timeslots  --15 min intervals 
    VALUES ('00:00:00.0', '00:14:59.9'),
    ('00:15:00.0', '00:29:59.9'),
    ('00:30:00.0', '00:44:59.9'),
    ('00:45:00.0', '01:00:59.9'), 
    ('23:45:00.0', '23:59:59.9'); 
    Here is the basic query for rounding down to a time slot. 
    SELECT CAST (@in_timestamp AS DATE), T.start_time
      FROM Timeslots AS T
     WHERE CAST (@in_timestamp AS TIME)
           BETWEEN T.slot_start_time 
               AND T.slot_end_time;
    --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

  • NQSError: 22047] The Dimension used in AGO function must be referenced

    Hi All,
    I am selecting the following columns in the report:
    1. Dimension.Product
    2. Sales: Directly mapped to physical datasource
    3. Prior Month Sales: calculated using the AGO function at the Month Level
    4. Var from Prior Month : Sales - Prior Month Sales (Calculated at the Logical Level)
    Time Dimensional Hierarchy is Year > Quarter > Month
    I am getting the data for the same but when I apply Grand Total is throws the error:
    nQSError: 22047] The Dimension used in AGO function must be referenced in the query. (HY000)
    When I use the filter for the Month filed it is coming up fine but when I remove the month filter and apply on Year it doesnt work.
    Can anybody please let me know how this works?

    This error is happening in request?
    You have to apply filter MONTH because you are calling month in AGO function. Try to create YEAR AGO calculation and then try combining filters, you will see that then YEAR will be important, not month.

  • I have transefer function like (1/(s^2+s+​5)) and i have a square wave input , i want to use this transfer function with this input to see the output , how can i do that , with example please.

    i need to know also how to represent this transfer function in labview, try to send me example. answer me at my mail

    "st" wrote:
    > answer me at my mail
    give a valid e-mail first, and your name, we don't like to help anonymous
    people
    > try to send me example.
    how much do you pay ?
    > i have transefer function like (1/(s^2+s+5)) and i have a square wave
    > input , i want to use this transfer function with this input to see
    > the output , how can i do that
    First you have to know what you are doing, like an engineer : you have a
    Laplace, continuous time transfer function but LabView handles discrete
    signals only. Use matlab/simulink if you want to simulate continuous time
    systems easily...
    If you definitely want to use LabView, the first step is to discretize your
    continuous-time transfer function, i.e. decide a sampling rate and convert
    it to a "z transfor
    m". Then you can directly use the "IIR Filter.vi" as I
    said earlier.
    Philippe Guglielmetti - www.dynabits.com me at my mail

  • On the AGO Function need to Create TODATE function with Diff levels - MTD,Q

    Hi All,
    My Basic Requirement is to Create Time Series Function on AAA ie ( Month To Date , Quarter To Date and Year To Date )
    The Logic for the AAA = XXX / Previous 3 Months Revenue.
    we know that we can use the AGO Function to create Previous 3 months Revenue with Month is Level . But the issue is .... i cant use AGO function since i need to perform Year to Date, QTD and MTD upon 'AAA' this OBIEE doesn't permit to use nested time series functions upon varying levels .
    So How can i Resolve the issue ie creation of TODATE function on the AGO Function with Diff levels
    Thanks,
    Swapna S

    hi,
    for your requirement create three repository variables like
    for previous 3 months create repository variable like
    select to_char(sysdate,'yyyymm') -3 from dual;
    for month to date first calculate first day of the month
    select To_Char(Add_Months(Last_Day(Sysdate),-1) + 1,'MM/DD/YYYY') from dual;
    after put a filter in answers date between first date of the present month and current date
    create the same thing for year to date
    calculate first date in the year like following query
    select To_Char(Trunc(Sysdate,'YEAR'),'MM/DD/YYYY') from dual;
    after that apply filter date b/w first date in the year and current date
    i hope it works for your scenario
    Regards
    Naresh
    Edited by: Naresh Meda on Nov 10, 2008 2:08 AM
    Edited by: Naresh Meda on Nov 10, 2008 2:12 AM

  • How to use xsl document() function with LiveCycle XSLT processor

    Hello,
    I would like to use LiveCycle XSLT processor to merge xml documents by using the xsl document() function.
    However, I have not, yet, found  clear reference information on the specifics of how to accomplish in LC. For instance if you have
    a transformation that does merging using a standalone xml editor (such as Oxygen), than what is required to accomplish the same
    using the LiveCycle XSLT service.  How do you specify the URI of the XML document that is specified as an input in the xsl document() function. Your insight is appreciated.   Regards

    Hello Steve,
    I checked the reference that you cited (XSLT Transformation).   The reference omits discussing how to use xlst document() function within a stylesheet.  I think that probably means that feature of xslt technology is not directly available through LiveCycle.  When I find a workaround, I'll post an update...for the user community that might encounter the same issue.  Thank you for your response and insight.  Regards, jb1809

  • How to use Round off function in TAX Formula

    Dear All,
             I have to do Round off in the Tax Formula. Hence I was suggested by the SAP Forum Team to use Round off function in the Tax Formulae.
             But sir I don't know how to use Round off function in the Tax Formulae.
            For Eg. BaseAmt = Total
                        TaxAmt = BaseAmt * Rate
               Now within this Eg. How will i use the Round off function and where i will use it.
               Please guide me with example.
      Regards
    Hitesh Parsawala

    Hi Hitesh,
    you can do like this
    Cess_ST_TaxAmt=Round(Cess_ST_BaseAmt*Cess_ST_Rate,0)
    where you can introduce rounding function by choosing from dropdown available in Operation and by click on Insert.
    It will post following in formulla window
    Round (Number, Decimals as Number)
    where in parameter you have to give 1.Number-which is to be round and 2.Decimals as Number-as per your requirement like by 2 decimal or 0 decimal
    If required give me call,
    BR
    Samir Gandhi

  • How to use Spell-check functionality for textbox (like Orkut, gtalk)

    How to use Spell-check functionality for tex Hello Friends,
    I am working on a JSP application. I wanted to add Spell check for text box like we have here, when we post a message. It automatically shows red line under the word, when ever spelling is wrong. Please tell me how I can do this. If possible, the code too.
    Thanks.

    I believe the spell checking you see here, or on any other site, is the spell checking built into Firefox. At least that's what I see. Are you using Firefox?

  • How to use trigger file functionality in File Adapters - Match file names

    Hi,
    I am using trigger file functionality in File adapters to pick up data files as:-
    <property name="TriggerFilePhysicalDirectory" value="/pub/Dev/eastern/brs/"/>
    <property name="TriggerFile" value="*.trg"/>
    Here any file with .trg extension is taken as a trigger file and File adapter randomly picks up one of the data files.
    My requirement is that the trigger file will be of the same name as that of the data file like:- <data_file>.data <data_file>.trg
    How to implement this feature using trigger file functionality of File adapters??

    The trigger file is any file that indicates(triggers) that the actual data file has been put in ftp location, i.e- determines the state when data file should be read.
    This helps usually when a large data file is being transferred and at that incomplete state the FTP adapter tries to read it(which is not desirable)
    It is configured when you create the ftp adapter service in your process(in wizard) or u can manually configure that in the JCA file for the FTP Adapter service as below:-
    <?xml version="1.0" encoding="UTF-8"?>
    <adapter-config name="FlatStructureIn" adapter="File Adapter" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
    <connection-factory location="eis/FileAdapter" UIincludeWildcard="*.txt" adapterRef=""/>
    <endpoint-activation operation="Read">
    <activation-spec className="oracle.tip.adapter.file.inbound.FileActivationSpec">
    <property.../>
    <property name="*TriggerFilePhysicalDirectory*" value="/tmp/flat/ArchiveDir"/>
    </activation-spec>
    </endpoint-activation>
    </adapter-config>
    Reference: http://download.oracle.com/docs/cd/E12839_01/integration.1111/e10231/adptr_file.htm#CIAJCBGI

  • How to use a C function as a native method

    Could anybody tell me how to use a C function as a Java native method.
    Thanks

    Read all about it.
    You'd probably have to write a little wrapper (using JNI) that passes
    parameters and return values around between your C function and
    the JVM.
    kind regards,
    Jos

  • How to use a partner function?

    1. I would like to link a project (or WBS) to the Invoice Approver (for the workflow)
    2. I would like to link a project to a Customer or several Customers
    3. I would like to link a project to a Vendor or number of Vendors
    Not clear how to use a partner function for that reason and where this will be visible.

    Getting following error message for the Customer:
    Customer for function Y2 may not have account group Z010
    Message no. VP303
    Why and where such restrictions are applied?

  • How to use 'several screen function' used to be in os x 10.6

    hi ! ^^
    how r u ? good !
    how to use 'several screen function' used to be in os x 10.6 ??
    it was possible to change whole screen with 'command + arrow keys' (option + arrow keys maybe ??)
    but, in os x 10.7, it seems it is not possible. and instread of it 'mission controls' that is not uesful ..
    no windows drive direct access. no several screen function. crash when control panel ask me administration right.
    os x 10.5 or 10.4 was much easy to control.  
    plz fix and add good functions of 10.6 , remove good functions is not called 'upgrade'.

    You can still do it with CONTROL + Arrow keys, the same as 10.6
    Regards,
    Captfred

  • Who can tell me how to use ni-imaq functions imgSessionSerialWrite and imgSessionSerialRead to set and get my carema attribute?

    Who can tell me how to use ni-imaq functions imgSessionSerialFlash,imgSessionSerialWrite and imgSessionSerialRead to set and get my carema attribute?
    My camera is duncantech ms3100 and the frame grabber is pci-1428.I use ni-imaq2.6.When I use these functions,it tell me error -1074397163(IMG_ERR_BINT:Bad interface) .

    I have the same problem on my IPAD 2. One calender that i cant delete or find any settings for... Its just in the calender app under diffrent calenders.  how do i delete it?

  • How can I have both functions "Read Only" & "Write" mode on the same form?

    Dear all,
    How can I have both functions "Read Only" & "Write" mode on the same form? Is it possibile for this?
    Please advice,
    Amy

    This is what I use in some dialogs:
    PROCEDURE SET_QUERY_ONLY IS
      -- Procedure Set_query_only
      -- Rend les blocks non modifiables   --
      -- Disable menus Insert/Delete/Clear --
      -- Entree               :
      -- Sortie               :
      -- Ent/Sortie     :
      -- Creation               : FD    10/2003
      -- Modification     : 
         LC$Block     Varchar2(30) ;
    BEGIN
      Set_Menu_Item_Property('Edit.Insert', ENABLED, PROPERTY_FALSE ) ;
      Set_Menu_Item_Property('Edit.Remove', ENABLED, PROPERTY_FALSE ) ;
      Set_Menu_Item_Property('Edit.Clear', ENABLED, PROPERTY_FALSE ) ;
      Set_Menu_Item_Property('Action.Save', ENABLED, PROPERTY_FALSE ) ;
      LC$Block := get_form_property( NAME_IN('System.Current_Form'), FIRST_BLOCK ) ;
      -- Tous les blocs en Query only --
      While LC$Block is not null Loop
           Enable_Block( LC$Block, FALSE ) ;
           LC$Block := get_block_property( LC$Block, NEXTBLOCK ) ;
      End loop ;
    END;
    PROCEDURE ENABLE_BLOCK
              PC$Block in Varchar2,
              PB$Enable in Boolean Default TRUE
         ) IS
      -- Procedure Enable_block
      -- Rend le bloc Enable / Disable --
      -- Entree          : PC$Block (nom du bloc Forms)
      --               : PB$Enable (TRUE ou FALSE)
      -- Sortie          :
      -- Ent/Sortie             :
      -- Creation          : FD    10/2003
      -- Modification     : 
    BEGIN
         If PB$Enable Then
              Set_Block_Property( PC$Block, INSERT_ALLOWED, PROPERTY_TRUE ) ;
              Set_Block_Property( PC$Block, UPDATE_ALLOWED, PROPERTY_TRUE ) ;
              Set_Block_Property( PC$Block, DELETE_ALLOWED, PROPERTY_TRUE ) ;
              Set_Menu_Item_Property('Edit.Insert', ENABLED, PROPERTY_TRUE ) ;
              Set_Menu_Item_Property('Edit.Remove', ENABLED, PROPERTY_TRUE ) ;
              Set_Menu_Item_Property('Edit.Clear', ENABLED, PROPERTY_TRUE ) ;
              Set_Menu_Item_Property('Action.Save', ENABLED, PROPERTY_TRUE ) ;
         Else
              Set_Block_Property( PC$Block, INSERT_ALLOWED, PROPERTY_FALSE ) ;
              Set_Block_Property( PC$Block, UPDATE_ALLOWED, PROPERTY_FALSE ) ;
              Set_Block_Property( PC$Block, DELETE_ALLOWED, PROPERTY_FALSE ) ;
              Set_Menu_Item_Property('Edit.Insert', ENABLED, PROPERTY_FALSE ) ;
              Set_Menu_Item_Property('Edit.Remove', ENABLED, PROPERTY_FALSE ) ;
              Set_Menu_Item_Property('Edit.Clear', ENABLED, PROPERTY_FALSE ) ;
              Set_Menu_Item_Property('Action.Save', ENABLED, PROPERTY_FALSE ) ;
         End if ;
    END;Francois

  • How do I get the Speech function for accessibility to work in the Windows 8 version?

    How do I get the Speech function for accessibility to work in the Windows 8 version? There is no "File" option where you would normally find it. I tried using Narrator from Windows however it cannot read "explorable text" I guess

    Adobe Reader Touch (Windows Store app with "modern" UI) is not really accessible.
    If you have a device running the Windows 8 operating system (as opposed to the Windows RT operating system), you can install and run Adobe Reader XI (desktop app with classic UI), which offers better accessibility support for screen readers.  It also has the "Read Out Loud" functionality.

Maybe you are looking for

  • IPhoto Crash on Import (9.2, after Lion/iCloud Update

    This first happens on when i plugged in the ipad and it pops up to ask if i want to upgrade iPhoto. Now, iPhoto still opens but whenever I try to import photo it would crash and quit itself. I have turned off photo stream, as if I have that on I cann

  • Multiple problems with iTunes 12

    Problem 1: I did a clean install of Yosemite on my mac, and updated iTunes (from 12 to 12.0.1) before I opened it. Since I have my iTunes Media folder in a different drive I used preferences to choose (really point to) the location. After clicking OK

  • Mini won't charge

    My ipod mini won't charge with the ISP or AC adapter. I reset it and it gives me the "plug into AC Adapeter" icon. (Adapter arrowed to wall plug image) What can I do? It won't get past that icon and there is no info on that icon on apple.com. Help! M

  • Forms Error Message displayed twice

    But on clicking the save button to commit the changes in the form, the validation trigger fires and the error message is displayed twice. This is once for the item and at the other at the form level. The error message has to be displayed only once i.

  • Mac Book Pro heating up and fans working continuously

    Hi, This is my second Mac Book Pro, the first one "died" because of heating issues and only after an overhaul from the Mac Store, it worked again, but never the same, so I went to the Mac Store to get another one. I purchased this one on March 2009 a