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

Similar Messages

  • 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

  • Purge Data #error when UserResponse and ToDate function is used in same formula

    Hi,
    I have a formula which works well when there is data but when I purge the webi report I get #Error for the cells wherever I have used UserResponse and ToDate function in the same formula.
    Ex: =FormatDate(ToDate(UserResponse("Enter Modified Date:");"M/dd/yyyy hh:mm:ss a");"MM/dd/yyyy")
    I tired in multiple reports. I get the same error in all reports when i purge the data but when i unpurge and show the reports with data, I won't get any error.
    Is this known issue? If anyone knows the solution. Please answer it.
    (FYI, I am using BO4.0 SP5)
    Thanks.

    Thanks a lot for all your efforts in trying to find the solution to my question but the formula that you had has a error, as you were using commas instead of semicolon. If you want I can change it & it's not a big deal.
    By the way, I have found even better solution.
    Substrings will kill the processing time and we should try to avoid string functions as much as possible. So I used IsError function instead.
    =If IsError(FormatDate(ToDate(UserResponse("Enter Modified Date:");"MM/dd/yyyy hh:mm:ss a");"MM/dd/yyyy")) Then "" Else FormatDate(ToDate(UserResponse("Enter Modified Date:");"MM/dd/yyyy hh:mm:ss a");"MM/dd/yyyy")

  • 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

  • Query not using aggregate when written against multiprovider

    We have a multiprovider that contains one infocube. The infocube has aggregates defined to it. When writing a query against the infocube, an aggregate is used. However, when writting the identical query against the multiprovider, an aggegate is not used. We are running BI 7.0, Netweaver 2004s, patch set 10. Is there something that needs to be done to the multiprovider to get it to recognize the aggregate?

    We have determined the issue to be one of the navigational attributes. It is not used in our query and is not in our aggregate. For some reason, the query against the multiprovider wanted it to be there. After adding it to the aggregate, we were fine. We found this using RSRT and specifying the 'Select Aggregate' option. This gave us a good message as to why the aggregate was not being used. Thanks to everyone for their suggestions.

  • ToDate() function not working

    I need to convert string to Date type and use it in the DaysBetween function. 
    Created a variable =ToDate("01/10/2010"; "dd/mm/yyyy"). 
    The output for this becomes 01/01/2010.
    What can I do to make the ToDate() function work?

    I guess the date format in BO is "dd/MM/yyyy".  mm represents the minutes in web-I.
    Hope this helps you.
    Regards,
    Rohit

  • Hash function not use MessageDigest

    Anyone knows which implementation method of SHA Hash function does not use MessageDigest?
    Thanks

    If you don't want the MessageDigest interface to a JCE provider, you'll need to reference instead a class based on MessageDigestSPI.
    Sun currently allows using directly the "SHA" class in the "sun.java.security" package (as it is based on MessageDigestSPI, you already have a documented API for it:
    public class SHA extends MessageDigestSPI
        implements Cloneable {
        public SHA();
        public int engineGetLength(); // returns 20
        public void engineUpdate(byte value);
        public void engineUpdate(byte[] buffer, int offset, int length);
        public byte[] engineDigest() throws java.security.DigestException;
        public void engineReset();
    }Also this class implements Clonable, meaning that you can preserve its internal state before calling engineDigest() that will (before returning the final value) reset the internal state and clear the internal "evidence data" in the instance.
    To use it:
    import java.security.*;
    SHA state = new SHA(); // pass argument (0) if you want the deprecated SHA-0 algorithm instead of SHA-1
    byte b = ...;
    state.engineUpdate(b);
    byte[] buffer = ...;
    state.engineUpdate(buffer, 0, buffer.length);
    byte[] digestBytes = state.engineDigest(); // implicitly calls state.engineReset() before returning

  • Trying to upgrade from snow leopard to lion. Father already purchased Lion online a few months ago but did not use upgrade (did not know cmp was already running on lion). How can I use his upgrade on my computer without having to buy another Lion upgrade?

    Hi,
    Basically my computer is running on Snow Leopard. My father bought the Lion upgrade to install on his computer, however, it ended up being that his newly purchased lap top already came running with Lion -- thus, he never ended up using the Lion upgrade he purchased. Now, I would like to use the Lion upgrade he purchased but did not use to upgrade my computer to Snow Leopard. The information he gave me for this was the Web Order Number, Part Number, and Content Code for the Lion upgrade. How do I redeem/use his upgrade to update my computer to Lion without having to purchase another copy of the Lion software from the App store? Is that possible?
    Thank you so much!!!

    Unless he controls your machine (same household), you can't. At $30 USD, pop for your own copy.

  • Report not using aggregates

    Hi,
    I have a Crystal report based on BW query.  When I run the query its using the aggregate and getting me the result with in a minute.  But when i run the same query through CR its taking more than 15 mins to complete and its not hitting the aggregate.  I am using MDX driver.  No free characteristics are used in the report.  Kindly help me in this regard to optimize it.
    Regards,
    Subbu S.

    Hi ,
    IF the query is not hitting the aggregate then from which infoprovider does the OLAP PROCESSOR taking the data . Either the query o/p is getting data from the another aggregate or from parent infocube.
    THanx & Regards,
    RaviChandra

  • Query does not use aggregate ?

    Hi,
    how can I check if a query uses an aggregate ?
    How can I force a query to use an aggregate ?
    ThanXs
    Martin

    Hi,
      You can check in RSRT whether a query is hitting aggregate or not. Otherwise you run the query and go to aggregate maintanence and see the last used date. In order to make the query hit the aggregate all the fields in query including filters should be in the aggregate.
    Regards,
    Raghavendra.

  • 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

  • Getting an error - group function not allowed here

    Below is the merge statement...
    getting an error - group function not allowed here
    WHY????
    merge into summary
    using
    (select
    a.user_id,
    min(a.start_time_utc),
    max(a.end_time_utc),
    sum(a.duration_seconds),
    /*total_upload
    total_download
    total_traffic,*/
    max(r.package_id),
    last_usage_charge, -------hard coded
    max(r.peak_rate),
    max(r.bst_plantype),
    max(r.free_value), ---for free value
    a.IsPeak,
    sum(a.TotalDiscount)
    from aaa_sessions a,rate_plan r,subscriber_info si
    where
    si.EXTERNAL_ID=a.USER_ID
    and
    si.PACKAGE_ID=r.PACKAGE_ID
    group by
    user_id,bst_plantype,ispeak)t ------do we need to use alias here
    on
    (summary.user_id=t.user_id
    and
    summary.type_of_summary=t.bst_plantype
    and
    summary.ispeak=t.ispeak)
    When matched then
    update
    set
    start_date =decode((t.start_time_utc-summary.start_date)-abs(t.start_time_utc-summary.start_date),0,summary.start_date,t.start_time_utc),
    end_date=decode((t.end_time_utc-summary.end_date)-abs(t.end_time_utc-summary.end_date),0,t.end_time_utc,s.end_date),
    total_duration=summary.total_duration+sum(duration_seconds),
    total_upload=summary.total_upload+sum(upload_bytes),
    total_download=summary.total_download+sum(download_bytes),
    total_traffic=summary.total_upload+sum(upload_bytes)+summary.total_download+sum(download_bytes)
    When not matched then
    INSERT
    (user_id ,
    start_date,
    end_date,
    total_duration,
    /*total_upload
    total_download
    total_traffic,*/
    rate_plan_id,
    last_usage_charge,
    peak_rate,
    type_of_summary,
    IsPeak,
    TotalDiscount)
    VALUES
    (t.user_id,
    t.start_time_utc,
    t.end_time_utc,
    t.duration_seconds,
    /*t.output_bytes,
    t.input_bytes,
    t.output_bytes+aa.input_bytes,*/
    t.PACKAGE_ID,
    1, ---hard coded the value
    t.PEAK_RATE,
    t.BST_PLANTYPE,
    t.ispeak,
    t.free_value);

    This is the query,...
    Its giving no complilation errors..
    I have not used aggregate functions in the insert/update..
    have used only decode...
    and nowhere i found that aggegate functions not allowed in the insert/update stmts of merge..
    Can u please post a link where it is mentioned...
    MERGE INTO summary
    USING (SELECT a.user_id, MIN (a.start_time_utc) stc,
    MAX (a.end_time_utc) etc, SUM (a.duration_seconds) ds,
    SUM (a.download_bytes) download,
    SUM (a.upload_bytes) upload, MAX (r.package_id) pkg_id,
    MAX (r.peak_rate) p_rate, MAX (r.offpeak_rate)
    ofp_rate,
    MAX (r.bst_plantype) plan_type,
    SUM (r.free_value) free_val, a.ispeak,
    MAX (r.peak_pulse) p_pulse,
    MAX (r.offpeak_pulse) ofp_pulse
    FROM aaa_sessions a, rate_plan r, subscriber_info si
    WHERE si.external_id = a.user_id
    AND si.package_id = r.package_id
    GROUP BY user_id, bst_plantype, ispeak) t
    ON ( summary.user_id = t.user_id
    AND summary.type_of_summary = t.plan_type
    AND summary.rate_plan_id = t.pkg_id
    AND summary.ispeak = t.ispeak)
    WHEN MATCHED THEN
    UPDATE
    SET start_date =
    DECODE ( (t.stc - summary.start_date)
    - ABS (t.stc - summary.start_date),
    0, summary.start_date,
    t.stc
    end_date =
    DECODE ( (t.etc - summary.end_date)
    - ABS (t.etc - summary.end_date),
    0, t.etc,
    summary.end_date
    total_duration = summary.total_duration + t.ds,
    total_download = summary.total_download + t.download,
    total_upload = summary.total_upload + t.upload,
    total_traffic =
    summary.total_upload
    + t.upload
    + summary.total_download
    + t.download,
    last_usage_charge =
    DECODE (t.plan_type,
    0, (t.ds - t.free_val)
    / DECODE (t.ispeak, 0, t.ofp_pulse, p_pulse)
    * DECODE (t.ispeak, 0, t.ofp_rate, t.p_rate),
    ((t.download + t.upload) - t.free_val
    * DECODE (t.ispeak, 0, t.ofp_rate, t.p_rate)
    WHEN NOT MATCHED THEN
    INSERT (user_id, start_date, end_date, total_duration,
    total_download, total_upload, total_traffic, rate_plan_id,
    last_usage_charge, peak_rate, type_of_summary, ispeak,
    totaldiscount)
    VALUES (t.user_id, t.stc, t.etc, t.ds, t.download, t.upload,
    t.download + t.upload, t.pkg_id,
    DECODE (t.plan_type,
    0, (t.ds - t.free_val)
    / DECODE (t.ispeak, 0, t.ofp_pulse, p_pulse)
    * DECODE (t.ispeak, 0, t.ofp_rate, t.p_rate),
    ((t.download + t.upload) - t.free_val
    * DECODE (t.ispeak, 0, t.ofp_rate, t.p_rate)
    t.p_rate, t.plan_type, t.ispeak, t.free_val);
    COMMIT;

  • 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

  • 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???

  • Using aggregates in AGO function

    Hello!
    I want to use AGO function that would use aggregates.
    Requirements:
    I want to be able to make year-to-year comparision, where I compare period based on specific dates
    This same year-to-year comparision I want to speed up using aggregated fact tables grouped on months level.
    I created aggregated SALES table and aggregated time table (group by month) and it works OK with normal queries. It uses aggregated tables when apropriate (possible)
    When I use AGO function it always goes to fact table, which time dimension is at lowest level (i.e. date). How can I force BI server to use monthly aggregated tables in AGO function?
    Any tip, workaround?
    BI server 10.1.3.2.1
    Thank you,
    Gorazd
    Message was edited by:
    gor
    Message was edited by:
    gor

    I tested it and in case of AGO function it goes to detailed fact table SALES instead on agg_sales. Any tips?
    Gorazd
    Message was edited by:
    gor

Maybe you are looking for

  • 2 tab canvasses on a single window (form)

    Hi ! Does anybody know of a way to put 2 tab canvases on a single window. I would like to place 2 tab canvases, each holding 2 tab pages, on 1 window. However, from the moment you use "new tab canvas page" he directly puts the page behind the other t

  • Regarding FM used in Transaction

    Hi guys, Do anybody know how to find the Functional modules used in particular transaction. Any standard FM/Report exists for this ? Suggest me please. Thanks Kumar.

  • Financial And Capacity Planning Charts

    Hi folks, In 4.5 version, wWithin Financial And Capacity Planning when I click on View Chart, no chart is displayed. Error - NO Items to display. There are plenty of items with correct financial info. Any specific note or config/service to be made fo

  • Authentication Failed - newbie

    I am managing 4 other systems, which all have the same admin user name and password. 2 of the systems I cannot Observe/Control/Curtain. I can chat, message, install etc... Each time I double click on them I get 'Authentication Failed to "X Machine"'.

  • Icloud contacts missing from outlook

    iCloud really messed up my contacts, now I can't even find them. When I click on iCloud Contacts nothing comes up. Wish I had never gone to iCloud.