Ago/Todate Function

How to make use of AGO/TODATE function in answer not RPD?
I do not know how to insert data,such as time_level [AGO(expr, time_level, offset) ]

Hi,
AGO(<measure_expression>, <level>, <number of period>)
Where:
expr is an expression that references at least one measure column.
time_level is an optional argument that specifies the type of time period, such as quarter, month, or year.
offset is an integer literal that represents the time shift amount.
Refer the below example:
http://www.rittmanmead.com/2007/04/obi-ee-time-dimensions-and-time-series-calculations/
http://sandybi.wordpress.com/2009/12/08/time-series-caclulations-in-obiee/
Thanks
Deva

Similar Messages

  • OBIEE 11g time series: regression on ago / todate function ?

    Hello,
    We are testing the migration to OBIEE 11G.
    We are currently in 10.3 version
    We have a problem on AGO / TO_DATE OBIEE functions that returns null results on existing reports.
    In 10.3 version, these functions work properly with the actual TIME dimension.
    Here is how we designed time Dimension:
    TOTAL -> Year -> Quarter -> MONTH -> WEEK -> DATE_KEY, FULL_DATE
    DATE_KEY is a number and referenced as a foreign key on our fact table.
    CREATE TABLE TD_DATE
    +(+
    DATE_KEY NUMBER (11) NOT NULL,
    FULL_DATE DATE
    WEEK NUMBER (2),
    MONTH NUMBER (2),
    QUARTER NUMBER (1)
    YEAR NUMBER (4),
    TOTAL_DATE VARCHAR2 (11 BYTE)
    +)+
    Database version: Oracle 11g
    All elements of the dimension are chronological key (except full date) in order to optimize performance.
    Have you encountered similar problems in inplémentation of AGO / TO_DATE function on version 11g?
    Thanks,
    Romain

    Does a month have always the same number of week and begin with the first day of a week ?
    If it's not the case, your dimension is not good when you make a report on the week grain for a year ago for instance.
    Here a check list:
    http://gerardnico.com/wiki/dat/obiee/ago_todate_configuration#timecalender_dimension_design_verification
    Success
    Nico

  • AGO ToDate  function not using aggregates

    I use aggregated table and a detailed table
    I have time hierarchy whose lowest level is date. For sales I
    created year-to-year (YTD) comparision with AGO function. It
    works OK.
    BUT, I want to speed it up, so I used aggregates. I created new
    time table grouped by MONTH and corresponding agg_SALES table. I
    created connections and mapped the fields. It works OK for
    normal queries, that means my queries at month level use
    aggregates. BUT when I add YTD measures or YAGO measure in query, it goes to
    then SALES table whose grain is date.
    How can I force BI Server to use AGO function with aggregates?
    I use OBIEE 10.1.3.4
    Thank you
    Ishaq
    (Question originally taken from ITtoolbox and posted by Gorazd)

    Hi,
    you can not do it in Administration tool but you can set agregation for that field in Answers (fx->Agregation rule->Sum) and effect should be the same. Note that it may not work properly on Oracle 10g as generated SQL is not 100% recognized, on 11g everything is OK (at least in my case).
    Regards,
    Marko
    Edited by: user10449532 on 2008.11.19 06:29

  • Nesting of AGO or TODATE functions with differing level arguments is not supported

    I have a column in BMM which calculates the Year-To-Date Sales. This function uses the ToDate function to caculate the YTD.
    I need to develop another formula column which shows the last-year's YTD.
    I develop this formula in BMM by AGO on the YTD column which already uses a ToDate function.
    In BI Answers when selecting this column, results in the below message:
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 43119] Query Failed: [nQSError: 22044] Nesting of AGO or TODATE functions with differing level arguments is not supported. (HY000)

    To reply to my own question. It appears I got it working, that is, the error message problem is solved, but I still have questions on how to use these functions.
    To get it to work, I added the primary key D_TIJD.TIJDKEY at the level of the lowest grain in my dimension (level tab).
    What I still wonder is how to make it select the right values. I have the following hierarchy: bookyear - bookperiod - week. A bookperiod contains 4 or 5 weeks (4,4,5 in a quarter), so 12 periods in one year. I defined a measure at period level and another at that level with the ago function, that should return the figures for that same period of the year before. My first question is, whether to go back 12 periods or 52 weeks (which is the lowest grain in my dimension)?
    The second question is how to use a combination of TODATE and AGO so that if I calculate the current period (of which only 2 weeks are passed), I also only want to include the same two weeks for that period one year ago in order to make a correct comparison. How do I do that???

  • 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

  • AGO and TODATE functions

    I want to use the AGO and TODATE functions to calculate a measure for the selected year and the year before, as well as a year--o date measure, but cannot get it to work. It fails with the following error:
    A general error has occurred. [nQSError: 22040] To use TODATE function, the storage level of the query ('[D_TIJD.TIJDKEY]') must be a static level.
    I have setup a time dimensions in which I can drill up and down and followed exactly the same steps that were layed out in the Oracle training activity guide, but so far without any luck. From Mark Rittman's articles I learned that using these functions is not as straight forward as one might hink. Does anybody have a working example of this?
    Regards,
    Paul

    To reply to my own question. It appears I got it working, that is, the error message problem is solved, but I still have questions on how to use these functions.
    To get it to work, I added the primary key D_TIJD.TIJDKEY at the level of the lowest grain in my dimension (level tab).
    What I still wonder is how to make it select the right values. I have the following hierarchy: bookyear - bookperiod - week. A bookperiod contains 4 or 5 weeks (4,4,5 in a quarter), so 12 periods in one year. I defined a measure at period level and another at that level with the ago function, that should return the figures for that same period of the year before. My first question is, whether to go back 12 periods or 52 weeks (which is the lowest grain in my dimension)?
    The second question is how to use a combination of TODATE and AGO so that if I calculate the current period (of which only 2 weeks are passed), I also only want to include the same two weeks for that period one year ago in order to make a correct comparison. How do I do that???

  • Nested Ago and Todate function problem

    Hi,
    in my rpd i have following Time hierarchy:
    Year
    Quarter
    Month
    and a fact table Fact Shop which contains Monthly measure "Number of Hearing Aids Delivered".
    I must calculate PY_QTD, PY_YTD versions of above measure.
    I have tried to use built-in Time Functions Ago and ToDate in the following way:
    PY_QTD
    Todate(Ago("Number of Hearing Aids Delivered",1,"Time.Year"), "Time.Quarter")
    PY_YTD
    Todate(Ago("Number of Hearing Aids Delivered",1,"Time.Year"), "Time.Year")
    but when i check consistency i have error which says approximately "You can nest Ago and ToDate functions".
    There's another way, to calculate it? Can you help?
    Thanks
    Giancarlo

    So u r referring PY as previous year ;)
    Here u go;
    it’s a combination of AGO and TODATE.
    You create a value – let’s say Sales MTD by just following normal process…then you create a logical column with the following formula AGO (Sales MTD, Month Dim, 12)
    that should give you a MTD measure you’re looking for. I hope this is useful. Just dont use both function in single logical column....use seperate by first creating YTD n then AGO function to create previous year data.
    For ur case use to calculate PY_YTD use below:
    Create logical column
    Aids Delivered YTD with formula as TODATE("Number of Hearing Aids Delivered"), "Time.Year")
    and then create another logical column as
    Aids Delivered PY_YTD with formula as AGO("Aids Delivered YTD","Time.Year",1)
    This will work for sure....

  • Ago and Todate functions very slow

    I have been playing around with the Ago and Todate functions in BI EE (based on data from the Global schema which I imported into BI EE Administrator) but I find these functions very slow to return the data in an Answers report. Has anyone else found this?

    What's the size of the data set?
    Yes, I'm currently experiencing it. Running on a 600-700k rows tables...
    However, there're 2 things that might help:
    a) we're doing development with cache off - enabling cache - makes report come instantly...
    b) make sure the metrics have correct levels set up - i.e. it's sometimes advantageous to have several duplicates of 1 metric just for this purpose...with different levels....
    Please let me know if you find other ways to improve performance...

  • When using TODATE function MDX query is not correctly generated

    Essbase 9.3.1.2 and OBIEE 10.1.3.4.1.
    When using TODATE function MDX query is not correctly generated.
    This leads to unexpected values not only on cumulative columns in report (generated with TODATE), but also other columns (calculated with AGO function or directly read from cube) have incorrect values.
    The problem occurs when you filter on a column that is not in the select list. If you filter on just one level of dimension, results are fine. You can filter on multiple dimensions as long as you filter on just one level of each dimension.
    If you filter on two or more levels of one dimension, than results are not correct. In some cases results for TODATE column are all zeros, in some cases it is a random value returned by Essbase (same random value for all rows of that column), and in some cases BI Server returns an error:
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. Essbase Error: Network error [10054]: Cannot Send Data (HY000).
    Here is generated MDX code:
    With
    set [Grupe proizvoda2] as '{[Grupe proizvoda].[N4]}'
    set [Grupe proizvoda4] as 'Generate([Grupe proizvoda2], Descendants([Grupe proizvoda].currentmember, [Grupe proizvoda].Generations(4), leaves))'
    set [Segmentacija2] as '{[Segmentacija].[RETAIL]}'
    set [Segmentacija4] as 'Filter(Generate({[Segmentacija2]}, Descendants([Segmentacija].currentmember, [Segmentacija].Generations(4),SELF), ALL), ([Segmentacija].CurrentMember IS [Segmentacija].[AFFLUENT]))'
    set [Vrijeme3] as '{[Vrijeme].[MJESEC_4_2009]}'
    member [Segmentacija].[SegmentacijaCustomGroup]as 'Sum([Segmentacija4])', SOLVE_ORDER = AGGREGATION_SOLVEORDER
    member [Accounts].[MS1] as '(ParallelPeriod([Vrijeme].[Gen3,Vrijeme],2,[Vrijeme].currentmember), [Accounts].[Trosak kapitala])'
    member [Accounts].[MS2] as '(ParallelPeriod([Vrijeme].[Gen3,Vrijeme],1,[Vrijeme].currentmember), [Accounts].[Trosak kapitala])'
    member [Accounts].[MS3] as 'AGGREGATE({PeriodsToDate([Vrijeme].[Gen2,Vrijeme],[Vrijeme].currentmember)}, [Accounts].[Trosak kapitala])'
    select
    { [Accounts].[Trosak kapitala],
    [Accounts].[MS1],
    [Accounts].[MS2],
    [Accounts].[MS3]
    } on columns,
    NON EMPTY {crossjoin ({[Grupe proizvoda4]},{[Vrijeme3]})} properties ANCESTOR_NAMES, GEN_NUMBER on rows
    from [NISE.NISE]
    where ([Segmentacija].[SegmentacijaCustomGroup])
    If you remove part with TODATE function, the results are fine. If you leave TODATE function, OBIEE returns an error mentioned above. If you manually modify variable SOLVE_ORDER and set value to, for example, 100 instead of AGGREGATION_SOLVEORDER, results are OK.
    In all cases when this variable was modified in generated MDX, and query manually executed on Essabse, results were OK. This variable seems to be the possible problem.

    Hi,
    Version is
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
    PL/SQL Release 10.2.0.5.0 - Production
    CORE    10.2.0.5.0      Production
    TNS for 64-bit Windows: Version 10.2.0.5.0 - Production
    NLSRTL Version 10.2.0.5.0 - Production
    Sorry, in my last post i forgot to mention that i already created a function based index but still it is not using because, there is a UNIQUE constraint on that column.
    Thanks

  • Error While using ToDate Function

    Hi All,
    I am getting below error while creating one report in OBIEE. Please help me in this regard as this is bugging me from long time.
    View Display Error
    Odbc driver returned an error (SQLExecDirectW).
    <<Picture (Metafile)>> Error Details <javascript:void(null)>
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 435222656. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058]
    A general error has occurred. [nQSError: 22047] The Dimension used in TODATE
    function must be referenced in the query. (HY000)
    Kindly help me resolve this issue.
    Thank you,
    Yugendra.

    HI User,
    Refer this link
    http://siebel.ittoolbox.com/groups/technical-functional/siebel-analytics-l/nqserror-22047-the-dimension-used-in-ago-function-must-be-referenced-in-the-query-2692576

  • TODATE Function used on a dimension which is logically snowflaked.

    Guys,
    PLease help me to resolve the below error.Can anone explain why do we get this error and how to resolve it?
    Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 171039483. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 22045] TODATE function is used on a time dimension which is logically snowflaked. (HY000)
    SQL Issued: SELECT "Time"."Fiscal Quarter" saw_0, "Facts - Budget"."Total Operating Expenses" saw_1, "Facts - Actuals"."Total Operating Expenses" saw_2, "Facts - Budget"."Total Operating Expenses"-"Facts - Actuals"."Total Operating Expenses" saw_3, "Facts - Budget"."Total Operating Expenses YTD" saw_4, "Facts - Actuals"."Total Operating Expenses YTD" saw_5, "Facts - Budget"."Total Operating Expenses YTD"-"Facts - Actuals"."Total Operating Expenses YTD" saw_6, AGGREGATE(saw_1 BY ), AGGREGATE(saw_2 BY ), AGGREGATE(saw_3 BY ), AGGREGATE(saw_6 BY ) FROM "Financials - GL Budget and Expenses" WHERE ((Time."Fiscal Quarter" <= VALUEOF(NQ_SESSION."CURRENT_FSCL_QUARTER")) AND (Time."Fiscal Quarter" > VALUEOF(NQ_SESSION."FSCL_QTR_YEAR_AGO"))) AND (("WFS Segments".ORG_NUM = VALUEOF(NQ_SESSION."OU_ORG"))) AND ("GL Segment1"."Hierarchy ID" = 'TTTTT') AND (Time.Status = 'Closed') ORDER BY saw_0
    Thanks in advance...

    AGO and TODATE would only work with 1 physical time table..
    Re: TODATE and AGO function errors in OBIEE
    hope this link may helps you.
    Thanks,
    Chinna

  • TODATE function

    Hi,
    when i use todate function in the logical column TODATE(Core."Fact - HR - Payroll".PAY_ITEM_AMT, Core."Date"."Year") getting the following error.
    Query Status: Query Failed: [nQSError: 22046] To use TODATE function, the query level ('Year, Fiscal Year') must be a static level.
    using OBIEE 10.1.3.4.1 version.
    Please can you help me with this.
    Edited by: user6747370 on May 12, 2011 1:28 AM

    hi,
    Sorry yar !
    i thought of something else and typed wrongly its my mistake
    Refer : Using the Ago Function
    Thanks,
    Saichand.v

  • How to use todate function in JDBC adapter

    Hi All,
    How can we use the todate function to update a date field in Oracle database. I am getting a
    java.sql.SQLException: ORA-01858: a non-numeric character was found where a numeric was expected
    Exception, when I am mapping the date fields with  to_date('03/28/2009 18/43/19','MM/DD/YYYY HH24/MI/SS').
    Thanks,
    Yomesh

    The following is standard SAP document regarding this attribute, this attribute used to compose your SQL clause for string or non-string, for string, you need to put the "YES". in your case, you need to set set the value "NO"
    so create an attribute, pass a constant value "NO" to it, that is it.
    hasQuot= YES|NO During construction of the WHERE condition of the SQL statement, the table column type determines whether the default is to set the values in quotation marks (text column types) or not (numerical column types). In a few cases (for example, when using functions), it may be necessary to override this. This attribute enables you to do this. If YES, quotation marks are always set round the values for which this attribute is set in the SQL syntax. If NO, quotation marks are never set. Only use this attribute in individual cases.
    Regards.
    Liang

  • Problem with todate function in OBIEE.

    Hi,
    I have some data mismatch while using todate function. There is a measure GWP, and two logical columns MTD and YTD. MTD is todate(GWP, fiscal_month) and YTD is todate(GWP, fiscal_year). whereas sometimes MTD is displaying data and YTD doesn't. Probably it has to display, what is a problem with this? Can anyone help me out!!!
    Thanks,
    Anitha.B

    Hi,
    Thanks for your response.
    The requirement is, there is a date filter and measure GWP(sum) and when selecting a date it should ensure the following.
    1. Daily - GWP of the selected date
    2. MTD - GWP from first day of the selected month upto the selected date.
    3. YTD - GWP from the first day of the financial year of the date to the selected date.
    So created a time dimensional hierarchy fiscal_year, fiscal_month and date_time,date_key(chronological key).
    created a filter as
    date_time is equal to the date filter
    MTD - todate(gwp,fiscal_month)
    YTD - todate(gwp,fiscal_year)
    There is a discrepency in the result in which sometimes am getting the value for MTD and not for YTD like
    22/11/1986
    Product Daily MTD YTD
    A 0 100 0
    B 0 200 300
    C 0 350 0
    It may not be a problem with the data , then where am I doing mistake? help me.
    Thanks,
    Anitha.B

  • [nQSError: 22036] Level in TODATE function (Quarter) must be a rollup...

    Hi,
    i've following problem. I hope you can help. It's quite urgent.
    I have following TimeDim hierarchy, in my rpd:
    Logical Level: Total Time - Properties: Grand Total Level
    Child Logical Level: Year - Properties: Supports rollup to higher level of aggregation - Keys: Year Code (Cronological Key) - Logical Column: Year Code, Year Description
    Child Logical Level: Semester - Properties: Supports rollup to higher level of aggregation - Keys: Semester Code (Cronological Key) - Logical Column: Semester Code, Semester Description
    Child Logical Level: Quarter - Properties: Supports rollup to higher level of aggregation - Keys: Quarter Code (Cronological Key) - Logical Column: Quarter Code, Quarter Description
    Child Logical Level: Time Detail - Properties: Supports rollup to higher level of aggregation - Keys: TTPER (Cronological Key) - Logical Column: Desc Month, TTPER, Desc Month Short
    Then, i've defined my measures using TODATE Function:
    - Net Number of HA Units delivered Monthly
    - Net Number of HA Units delivered Qtd = TODATE("Net Number of HA Units delivered Monthly", "TimeDim"."Quarter")
    - Net Number of HA Units delivered Ytd = TODATE("Net Number of HA Units delivered Monthly", "TimeDim"."Year")
    - Ha Returned Quantity Monthly
    - Ha Returned Quantity Qtd = TODATE("Ha Returned Quantity Monthly", "TimeDim","Quarter")
    - Ha Returned Quantity Ytd = TODATE("Ha Returned Quantity Monthly", "TimeDim","Year)
    In my Report i've following columns:
    HA Deliveries Quantity Gross QTD: fx = Net Number of Ha Units delivered Qtd + Ha Returned Quantity Qtd
    HA Deliveries Quantity Gross YTD: fx = Net Number of Ha Units delivered Ytd + Ha Returned Quantity Ytd
    Column HA Deliveries Quantity Gross Ytd works. For first column i have following error:
    [nQSError: 22036] Level in TODATE function (Quarter) must be a rollup of (or equivalent to) the measure level (Year).
    Why?
    If i modify first column fx dropping sum, but selecting first or second addend separately it works. Sum not
    For example: HA Deliveries Quantity Gross Qtd: fx = Net Number of HA Units delivered Qtd OK
    or
    HA Deliveries Quantity Gross Qtd: fx = HA Returned Quantity Qtd OK
    Maybe there's something wrong in my hierarchy definition?. Please help
    Giancarlo

    Giancarlo,
    Can you try adding prersentation column "TimeDim"."Quarter" to your report and check ? Hide it if you don't require it. This shud solve your problem as the Time Hierarchy is defined correctly. Also, hope you have set the Chronological Key correctly at the last level.

Maybe you are looking for

  • Dual channel problems?

    Hi all, I purchased an 8GB set of 10666 GSkill memory for my dv7t-3300 CTO core i7 laptop in December of last year. I first posted in the G.Skill support forums and they recommended I try HP, I will copy over my entire post there as it is detailed as

  • What is the deal

    I read this post on Tom's hardware saying that with the Corsair memory with K8T neo system wont boot. http://www.tomshardware.com/motherboard/20040112/memory_performance-11.html I come on this forum and i read everyone is posting with the same exact

  • Standard Cost Analysis Report  (MCI3)

    Hi, On SAP standard Cost Analsys report, i have been unable to dig out the reason of not populating values in following few columns. - Int. wage costs - Int. Mat. Costs - Ext. Wage Costs - Extenal Mat Costs - Services Costs Can anybody guide me in po

  • How can you tell what resolution a movie is?

    How can you tell in iMovie 09 what resolution a movie is? The only two have used were HD and standard, but we are not sure which in our collection are which. Is there an easy way to tell? Thanks. mac

  • Home Page Question

    Hi Guys, Appreciate your help on what I assume is an easy solution and probably is a stupid question. There are items on the home page that I would like to delete or move from the 2nd page to the 1st (or vice versa). Can't figure out how to do that.