Any alternative to ago function

Hello,
I am using obiee 11g.Trying to use ago function at quarter level with the date prompts as filter
instead of year prompt but somehow the data is not matching properly.
Would like to know if there is any alternative to ago function?
I just want to calcultate the count(distinct(id)) for current and previous quarter,where the report gets filtered by date fields.
The report has user column,quarter column and the currrentcount and previous count.
like
user1->Q1->10->19
user1->Q2->20->10
User3->Q1->11->26
Any help on this please?
Thanks

Hello,
Thanks for reply.
Is the grain below quarter level?
------> Calc date is below quarter level in the time dimension,Time dimesnion has FS Year(level1)->FS Quarter(level2)->Cal Date and Time key(Time key is the primary key with the combination of cal date and the pk of some other table (level3))
Does quarter exists as a field in your date dimension?
--------->Yes Fs Quarter is a field/column in the table and in the dimension
check if quarter is a chronological key, does your quarter contain year in it(2011-02)?
-------->In each level i have key defined, also in the FS Quarter i have.
In the level3 i have both the key defined as key but cal_date as pk.
Yes, Data of the qtarter is in the form 2012-01.
Do you have quarter in your report, without date field?
--------->yes, the report has FS_qtr,count for current qtr,count for previous qtr using ago function
and the filter used is cal_date>='01-JUN-11'
facts->
There is a view in the database which is being created for time dimesnion.
The view has
FS_Year , FS_Qtr , Calc_Date ,Cal_month , cal_qtr, TimeKey(PK) , Pk_from someother_table_acting_as_fk.
Please let me know where i am going wrong?
One more thing i would like to add if i use the filter as FS_YEAR>=2011 then the counts comes perfectly.Problem is with cal date field.Just not bale to understnd where i am i going wrong?
Please help
Thanks
Edited by: user123 on Feb 10, 2012 11:00 AM

Similar Messages

  • Is there any alternative for Evaluate function

    Hi all
    Can anybody tell me the alternative for evaluate function. i have to use a SQL Function and execute it from obiee

    Agreed with John. You best create a view in the DB or - if you don't have the rights - you can just put this SQL code in the physical layer as a physical table object of table type "Select".
    In UDML:
    DECLARE TABLE "ABC".."SH"."test" AS "test" UPGRADE ID 1 NOT CACHEABLE NO INTERSECTION
         TABLE TYPE SELECT DATABASE MAP (
               {DefaultMulDB}  AS {select a.job_id,
         a.name title,
         flsa.meaning flsa,
         eeo.meaning eeo_category,
         a.attribute1 job_family,
         c.name grade
    from per_jobs a,
         (select * from per_valid_grades where sysdate between date_from and nvl(date_to, sysdate + 1)) b,
         (select * from per_grades where sysdate between date_from and nvl(date_to, sysdate + 1)) c,
         (select lookup_code, meaning from hr_lookups where lookup_type like 'US_EXEMPT_NON_EXEMPT') flsa,
         (select lookup_code, meaning from hr_lookups where lookup_type like 'US_EEO1_JOB_CATEGORIES') eeo,
         (select lookup_code, meaning from hr_lookups where lookup_type like 'ALB_HR_JOB_FAMILY') jf
    where sysdate between a.date_from and nvl(a.date_to, sysdate + 1) and
         b.job_id (+) = a.job_id and
         c.grade_id(+) = b.grade_id and
         flsa.lookup_code (+) = a.job_information3 and
         eeo.lookup_code (+) = a.job_information1 and
         jf.lookup_code (+) = a.attribute1}  )
         PRIVILEGES ( READ);Cheers,
    C.

  • Problem with AGO function in OBIEE

    Hi I am new to OBIEE,
    I am working on Trend Analysis of ETL Mappings,
    I am using AGO Function to get the Previous day Elapse Time of a mapping but while generating the report its behaving in a strange way.
    like
    AGO("BI Performance"."Map Val Fact"."Elapse Time Minutes","BI Performance".ETLStartDim."Day",1) -- Day Ago Elapse time
    AGO("BI Performance"."Map Val Fact"."Elapse Time Minutes","BI Performance".ETLStartDim."Day",2) -- Two Day Ago Elapse time
    For example, in database there is date like
    Date Elapse Time
    2nd June 10 min
    1st June 11 min
    30th may 10 min
    My date in Report should be like
    Date Elapse Time Day Ago Elapse Time Two Day Ago Elapse Time
    2nd June 10 11 10
    But the date coming over here is
    Date Elapse Time Day Ago Elapse Time Two Day Ago Elapse Time
    2nd June 10
    3rd June 10
    4th June 10
    So if any one could help me out of this, it would of great help.
    With Regards
    Chaitanya

    This is posted to the incorrect forum. Please post to an OBIEE forum.

  • Level based measure and AGO function

    Hi,
    I've a TIME fact table with a single dimension (TIME_DIM) and a single measure (WORK_DAY).
    WORK_DAY is 1 if the day is a working day, otherwise it is 0.
    This way I can get the number of working days by month, quarter and year.
    (TIME is a logical fact table. WORK_DAY is phsical stored inside the physical TIME_DIM).
    To have WORK_DAY work correctly when used with others fact tables, I've defined it as a level based measure, where all the dimensions are set to the "total" level, apart TIME_DIM.
    So far so good.
    Then I created a new calculated measure WORK_DAY_PREVIOUS_YEAR.
    I used the AGO function this way: AGO (TIME.WORK_DAY, TIME_HIERARCHY.YEAR, 1)
    No complains by OBIEE, but this column always returns 1...
    I've no trouble using level based measures.
    I've no trouble using AGO.
    But if I mix them together they no longer work.
    Do you experience this issue? Any workaround?
    I'm using OBIEE 11.1.1.5
    Regards,
    Corraod

    What is the month level key column functionality in your time dimension?
    it should be in format of yyyymm but not in just mm ..

  • Using text in AGO function

    Hi guys,
    I have a factless fact (indicator and some textual field) that I need to display for previous year.
    I need somehow to use it in AGO function - I'm getting error message that AGO can only accept aggregated measure.
    Any ideas?

    Great tip! I'll try...Mma - nice to see you back in action :-)...Worked like a charm!
    Message was edited by:
    wildmight

  • Does OBIEE 11.1.1.7 support AGO function at Week level

    Hi,
    I have a time dimension with Year,Quarter,Month,Week and Day Levels.
    Year - 2013,2012...
    Quarter- Q1,Q2,Q3,Q4
    Month - 1,2,3..12
    Week - 1,2,...52
    Day - Date_id (20130101...(YYYYMMDD).
    My Keys are : Year Level(Year_Number)
    Quarter Level (Year+Quarter Number)
    Month Level(Year+Month number)
    Week Level(Year+Week number)
    Day - Date_id(also defined as chronological keys)
    I am creating a AGO(Measure,Level,1) in answers for Year and Week Level and they don't render correct results.
    I started building the hierarchy with only Year and Day levels..verified the results - Looks Ok.
    Similar fashion proceeded with Year,Quarter,Month and Day - Looks OK.
    When I introduce Week level - All the AGO values are incorrect.
    Any help on this is really appreciated.
    Regards,
    Swetha

    Thanks Srini Veeravalli for your reply.
    Yes I have verified it thoroughly.I have implemented this before on 10G for other customers and I don't feel that something is wrong with it .
    I found this link on AGO Function in OBIEE 11G:
    =======================================
    https://forums.oracle.com/message/9323083
    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
    ============================================
    OBIEE 10G/11G - How to set up the time dimension (for time series functions Ago, Todate, ...) ? | GerardNico.com …
    In the above post also, Time dimension configuration for AGO/TODate ( Time series) are set up with 4 levels: Year,Quarter,Month and Day.
    So Just needed a confirmation  if week level shouldn't be in the hierarchy in 11.1.1.7.
    Regards,
    Swetha

  • Any alternative to the BADI for scaled pricing in CCM catalogs

    Hi,
    We are not able to use the scaled pricing functionality in CCM. When the item is added to the shopping cart from the CCM catalog the highest price gets chosen by default irrespective of the quantity ordered.
    I understand that this can be solved by activating the BADI /CCM/CSE_ENRICHMENT and Implementation /CCM/CSE_OCISCALEPRI
    IS THERE ANY ALTERNATIVE TO THIS. CAN THIS FUNCTIONALITY OF SCALED PRICING BE ACHIEVED WITHOUT THIS BADI.
    Regards,
    Srivatsan

    Hi Srivatsan,
    you could use the BADI BBP_CATALOG_TRANSFER to amend the price, in order to do this you would need to pass the lower bound to one of the OCI custom fields in order to pick up this avlue and determine the correct price.
    Why do you not want to use the standard implementatiom though?
    Regards
    Chris

  • Alternative for STRING_CENTER function module

    Hi,
    Can any one give me the Alternative for STRING_CENTER function module.
    it is there in 4.7 when i am using the same  in ecc 6.0 it is giving as absolute statement .
    Please give the solution for this.

    Hi,
      C147_STRING_SPLIT_AT_POSITION
    STRING_SPLIT
    STRING_SPLIT_AT_POSITION
    check this sample code
    DATA: text(10) TYPE c VALUE '0123456789',
    text1(6) TYPE c,
    text2(6) TYPE c.
    PARAMETERS position TYPE i.
    CALL FUNCTION 'STRING_SPLIT_AT_POSITION'
    EXPORTING
    string = text
    pos = position
    IMPORTING
    string1 = text1
    string2 = text2
    EXCEPTIONS
    string1_too_small = 1
    string2_too_small = 2
    pos_not_valid = 3
    OTHERS = 4.
    Regards

  • Time series questions - how to do AGO function for prior year end

    Question on how to perform the following calculation in OBIEE:
    I need to create a time series calculation that will calculate a metric as of Dec prior year. For example, my users will select Mar 2010. I want to show the amount for Mar 10 as well as the amount for Dec 09. If the select Jun 10, I will show them the amount for that month as well as Dec 09.
    Is there a way to do an AGO function that will give me this value? I can't use a filter calculation on my column because filter on the period will exclude these records

    Thanks John. Your suggestions seems promising but I'm having issues when I tried it out. I am receiving the following error message:
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 22046] To use AGO function, the query level ('Fiscal Period, Prior Fiscal Year End Date') must be a static level. (HY000)
    What I did was create a new level off my Fiscal Time dimension which is a child of Total. I tried creating my AGO calculation using this level but received that error message in Asnwers. Any ideas on what I may be doing wrong?

  • OBIEE 11.1.1.7-Ago Function Error-[nQSError: 46008] Internal error: File server\Query\Optimizer\SmartScheduler\PhysicalRequestGenerator\Src\SQOSPMarkMultiTargetSupport.cpp

    Hi All,
    I was performing the steps mentioned in Oracle Tutorial"http://www.oracle.com/webfolder/technetwork/tutorials/obe/fmw/bi/bi11115/biadmin11g_02/biadmin11g.htm#t10"-BI RPD creation.
    After Using the AGO function data in the Time series metric(Month Ago Revenue) was null always. I updated the DB features in RPD physical layers by selecting support for time series functions.
    After that report started to fail with below error. Please let me know if its a bug and any option to fix it.
    Thanks,
    Sreekanth
    Error
    View Display Error
    Odbc driver returned an error (SQLExecDirectW). 
      Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P 
    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: 46008] Internal error: File server\Query\Optimizer\SmartScheduler\PhysicalRequestGenerator\Src\SQOSPMarkMultiTargetSupport.cpp, line 1680. (HY000) 
    SQL Issued: SELECT 0 s_0, "Sample Sales"."Time"."Year-L1" s_1, "Sample Sales"."Revenue"."Ago-Year Revenue" s_2, "Sample Sales"."Revenue"."Revenue" s_3 FROM "Sample Sales" FETCH FIRST 65001 ROWS ONLY
      Refresh

    I know that there is no relation between "SampleApp Lite"."D3 Orders (Facts Attributes)"."Order Date", "SampleApp Lite"."D0 Time"."Calendar Date", it's also the same thing in my own RPD.
    But as it's working with the 11.1.1.6.2 BP1 version I don't understand why it's not working with 11.1.1.6.9.
    Implicit fact column is not set on my repository, but I don't have any request with only dimensional column, so if my understanding is correct I don't need to use it. Also, the problem appears during the check of the repository not in answers.
    thanks anyway

  • Ago Function

    Hi all
    I upgraded from 10g to 11g and now my Ago function seems to not be working but i have no idea why.
    The data is basically coming from a table like so:
    AcctNbr EffDate Balance
    12345 01/01/2010 $200
    12345 01/02/2010 $205
    12345 01/01/2011 $206
    12345 01/02/2011 $207
    So you can see that I have a balance amount for each day of the year.
    So What I am trying to do is get the Year Ago amount.
    I have this table joined to a basic time dimension table. Year > Quarter > Month > Week > Day.
    In 10g I created a logical column using this and it worked fine:
    AGO("LDW"."FA_ACCTBAL"."NOTEBAL", "LDW"."DimTime"."Year", 1)
    In 11g I get no results. The log file says it my YAGO Measure is being converted to a null. (converted to NULL because its grain is below query's grain.)
    SELECT s_0, s_1, s_2, s_3, s_4, s_5, s_6 FROM (
    SELECT
    0 s_0,
    "LDW"."FA_ACCTBAL"."EFFDATE" s_1,
    CASE WHEN "LDW"."FA_ACCTBAL"."MAJOR" ='CK' THEN 'Chequing'
    WHEN "FA_ACCTBAL"."MAJOR" ='TD' THEN 'Term Deposit'
    WHEN "FA_ACCTBAL"."MAJOR" ='SAV' THEN 'Savings'
    WHEN "FA_ACCTBAL"."MAJOR" ='MTG' THEN 'Mortgage'
    WHEN "FA_ACCTBAL"."MAJOR" ='CNS' THEN 'Consumer'
    WHEN "FA_ACCTBAL"."MAJOR" ='CML' THEN 'Commercial' END s_2,
    "LDW"."FA_ACCTBAL"."% Chg YAGO Notebal" s_3,
    "LDW"."FA_ACCTBAL"."Chg YAGO Notebal" s_4,
    "LDW"."FA_ACCTBAL"."NOTEBAL" s_5,
    "LDW"."FA_ACCTBAL"."YAGO Notebal" s_6
    FROM "LDW"
    WHERE
    ((FA_ACCTBAL.MAJOR IN ('CML', 'CNS', 'MTG')) AND (((FA_ACCTBAL.EFFDATE IN (current_date-1)) OR (FA_ACCTBAL.EFFDATE IN (current_date-366)))))
    ) djm ORDER BY 1, 3 ASC NULLS LAST
    [2011-03-23T21:51:55.000+00:00] [OracleBIServerComponent] [TRACE:7] [USER-23] [] [ecid: 0000Iv^gxcn99hWjLxMMOA1DX^y9000GDt] [tid: 1b6c] [requestid: 5df40012] [sessionid: 5df40000] [username: Administrator] -------------------- General Query Info: [[
    [2011-03-23T21:51:55.000+00:00] [OracleBIServerComponent] [TRACE:7] [USER-52] [] [ecid: 0000Iv^gxcn99hWjLxMMOA1DX^y9000GDt] [tid: 1b6c] [requestid: 5df40012] [sessionid: 5df40000] [username: Administrator] -------------------- Expression 'Ago(NOTEBAL:[DAggr(FA_ACCTBAL.NOTEBAL)], [Level Year], 1)' converted to NULL because its grain is below query's grain.
    [2011-03-23T21:51:55.000+00:00] [OracleBIServerComponent] [TRACE:7] [USER-52] [] [ecid: 0000Iv^gxcn99hWjLxMMOA1DX^y9000GDt] [tid: 1b6c] [requestid: 5df40012] [sessionid: 5df40000] [username: Administrator] -------------------- Expression 'Ago(NOTEBAL:[DAggr(FA_ACCTBAL.NOTEBAL)], [Level Year], 1)' converted to NULL because its grain is below query's grain.
    [2011-03-23T21:51:55.000+00:00] [OracleBIServerComponent] [TRACE:7] [USER-52] [] [ecid: 0000Iv^gxcn99hWjLxMMOA1DX^y9000GDt] [tid: 1b6c] [requestid: 5df40012] [sessionid: 5df40000] [username: Administrator] -------------------- Expression 'Ago(NOTEBAL:[DAggr(FA_ACCTBAL.NOTEBAL)], [Level Year], 1)' converted to NULL because its grain is below query's grain.
    [2011-03-23T21:51:55.000+00:00] [OracleBIServerComponent] [TRACE:7] [USER-52] [] [ecid: 0000Iv^gxcn99hWjLxMMOA1DX^y9000GDt] [tid: 1b6c] [requestid: 5df40012] [sessionid: 5df40000] [username: Administrator] -------------------- Expression 'Ago(NOTEBAL:[DAggr(FA_ACCTBAL.NOTEBAL)], [Level Year], 1)' converted to NULL because its grain is below query's grain.
    [2011-03-23T21:51:55.000+00:00] [OracleBIServerComponent] [TRACE:7] [USER-52] [] [ecid: 0000Iv^gxcn99hWjLxMMOA1DX^y9000GDt] [tid: 1b6c] [requestid: 5df40012] [sessionid: 5df40000] [username: Administrator] -------------------- Expression 'Ago(NOTEBAL:[DAggr(FA_ACCTBAL.NOTEBAL)], [Level Year], 1)' converted to NULL because its grain is below query's grain.
    [2011-03-23T21:51:55.000+00:00] [OracleBIServerComponent] [TRACE:7] [USER-52] [] [ecid: 0000Iv^gxcn99hWjLxMMOA1DX^y9000GDt] [tid: 1b6c] [requestid: 5df40012] [sessionid: 5df40000] [username: Administrator] -------------------- Expression 'Ago(NOTEBAL:[DAggr(FA_ACCTBAL.NOTEBAL)], [Level Year], 1)' converted to NULL because its grain is below query's grain.
    Any idea what has happened here?

    Hi,
    I'm facing the same issue. Did you find a solution for this problem?
    Thx
    Jan

  • Ago function not working properly with time dimension

    Hi all,
    In OBIEE 11g we have the following issue:
    We have a fact which contains transaction's sum for the last day of each month.
    We use ago function like this : ago(<fact.column>,1)When we want to see the result from the time hierarchy the fact with the ago function works properly for quarters and half years but for the months shorter than the previous one can't take the right value /equals to NULL/.
    For example :
    sum for YEAR: 10000
    sum for Half Year 1 : 4000
    sum for Half Year 2 : 6000
    sum for Quarter 1: 1000
    sum for Quarter 2: 3000
    sum for Quarter 3: 2000
    sum for Quarter 4: 4000
    sum for month... - here the ago function is confused with the last day of previous month if it's shorter than itself: For example - for march it cannot take value for end of February ..etc.
    Any ideas?
    Thanks in advance,
    Alexander.

    Hi,
    I faced some issues previously with month, so I used month+year as id instead of month id. Instead of tragging month id 1-12 into your hierarchy, create another column into your table like month+year - 201201, 201202 which creates unique month_year_id and drag this column into month level instead of month_id. So the problem might be solved.
    Regards,
    Anitha.B

  • Last argument in AGO function

    Hi Everyone...
    Hope everyone is good .
    So we have this requirement where user want to see selected quarter last month, then previous quarter last month and previous year last month based on Year and Quarter selection. for example.
    Prompts: Year - 2013; Quarter - Q2
    Selected Month (1)
    Last Qtr Last Month (2)
    Diff of 1 - 2
    Last Yr Last Month (3)
    Diff of 1 - 3
    Country
    Jun-13
    Mar-13
    Qtr Diff
    Dec-12
    Yr Diff
    USA
    1000
    500
    500
    700
    300
    UK
    1500
    900
    600
    1200
    300
    Now if user select Quarter as Q3 then report will show:
    Selected Month (1) - Sep-13
    Last Qtr Last Month (2) - Jun-13
    Last Yr Last Month (3)- Dec-12
    So the idea is to take always last month of selected last month, last qtr last month and last yr last month.
    Now I am using AGO function to get the Last Yr Last Month (3) where I need to pass the last argument as a dynamic value.
    AGO("measure","month","month Number")
    But OBIEE say that the last argument should be a consistent integer. So is there any way where we can pass dynamic value of "Number of Period". For example
    for Q1 : AGO("measure","month",3)
    for Q2 : AGO("measure","month",6)
    for Q3 : AGO("measure","month",9)
    for Q4 : AGO("measure","month",12)
    I can use CASE statement for this but will it not create performance issue, just curious?
    Please help me if we can do this in this way or can you please suggest me any other way to do this.
    Thanks,
    Suhel Dayer

    Any thoughts here.... Need help..
    Appreciate your time and efforts.
    Thanks....
    Suhel

  • AGO Function in Times Hirerachy

    Hi Guys
    i am able to create multiple hirerachy in time dimension and assigned time_id as chronological key which is at the dimension detail level and acting as shared child level for both of them......
    I have created AGO function for calendar year as
    AGO(Test."Fact".amount_sold, Test."Time Dim"."Calendar Year", 1)
    but when i have used AGO column in answers i am getting below mentioned error:-
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 22046] To use AGO function, the query level ('Calendar Year, Fiscal Year') must be a static level. (HY000)
    any suggestion would be appreciated to solve this.
    thanks & regards

    Split your time dimension in one for calculations and one for "regular" use.
    regards
    John
    http://obiee101.blogspot.com/

  • AGO function in  11g

    Hi,
    Can any one have idea about AGO function in OBIEE 11g in Answers area?
    Please share the links regarding this topic.
    Thanks
    Arvnd

    Yes, it will work. Just double click the Time level (say year/month/week), mark it as a chronological key (on keys tab). Use that in your AGO function

Maybe you are looking for