Ago function with full past year

I want to create an ago function. But if the ago function is for the full past year and not only for the same current period.
Example:
Period ||YEAR || Amount
1 || 2008 || 10
2 || 2008 || 10
3 || 2008 || 10
4 || 2008 || 10
5 || 2008 || 10
6 || 2008 || 10
7 || 2008 || 10
8 || 2008 || 10
9 || 2008 || 10
10 || 2008 || 10
11 || 2008 || 10
12 || 2008 || 10
1 || 2009 || 5
2 || 2009 || 5
3 || 2009 || 5
4 || 2009 || 5
Report for year 2009 period 4 should be
YEAR || TODATE || AGO
2009 || 20 || *120*
Does somebody has a solution for the result 120, Thanks

Hi Jim,
In your BMM layer create a duplicate column for the amount and name it as ago.
double click that and make the source expression as AGO(amount, year,-1) like that.. i dont remember the exact synatx. but the point is give the column name for which year ago value needs to be calculated, parameter to be taken into account eg year or month or week and no. of year or month.
and in the aggregate column use sum.
use this column in your report it will give 120.
if it doesn't work please tell us.
Thanks,
karthick

Similar Messages

  • How can I use AGO function with 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)
    SORRY - THE QUESTION IS IN THE WRONG FORUM
    Edited by: ishaq12 on Nov 19, 2008 12:21 PM

    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

  • Using AGO function with partitions

    I have a situation where we have logical sources with the same repository folder that are partitioned. We would like to use the AGO function but are getting the following error:
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 22042] AGO function may not be used on '# Applied Invoices' because its source is horizontally partitioned. (HY000)
    Has anyone had success using the AGO function with partitions? If not, do you have an alternate solution to the problem?

    AGO doesn't work with partitions - it's documented on metalink....there's an enhancement request , but that's it - no work-around provided....I'd suggest creating a common view for that particular report

  • Ago function with offset parameter dynamic

    Hi,
    I need to calculate a measure in rpd or answer that simulate the behavior of ago function with the offset parameter dynamic.
    i.e.
    ago(total_quantity, month, offset), where offset is a number provided by a logical column.
    Is it possible?
    Thanks.

    Hi,
    The problem is that I only know the offset values at row level, i.e., when I run my answer report some records use a certain offset value (offset1) while others use another offset value (offset2)
    The offset value can be determinate by a logical column.
    Is it possible?
    Thanks.

  • Ago function with two dates

    I use OBIEE and I got some difficulties with the times dimensions and the function AGO because I used two differents dates for my measure.
    My fact table:
    Ordered ||Delivered||Amount
    12/21/2008 ||1/20/2009||30000
    1/1/2009 ||2/1/2009 ||20000
    1/1/2009 ||3/1/2009 ||10000
    2/1/2009 ||2/1/2009 ||50000
    2/1/2009 ||3/1/2009 ||50000
    12/25/2009||1/15/2010||10000
    1/1/2010 ||2/1/2010 ||25000
    1/1/2010 ||3/1/2010 ||20000
    1/1/2010 ||2/1/2010 ||20000
    1/1/2010 ||3/1/2010 ||15000
    I have two Times Dimensions (Ordered Times AND Delivered Times) and one fact table. I already tried with 2 facts table and 1 time table without success too cause they not link the value for delivered and ordered
    I want to compare the delivered situation (Amount Qty) for the same ordered day last year
    I created a prompt with a date (ex.: Ordered date <=1/1/2010 AND Delivered date >=1/1/2010) and I want to compare one year ago with 1/1/2009 (Ordered Date situation…)
    I wish the results below:
    Delivered Month||Amount||Previous Amount Year Ago
    1 || 10000 || 30000
    2 || 45000 || 20000
    3 || 35000 || 10000
    I got some problem cause I had the 100 000 in my previous year (Ago) and I don’t want it because it was ordered after 1/1/2009 (Previous year). I know that the ago function concerns the Sum of Amount by Delivered Date, Year -1 ...
    Does somebody has a solution for this ? Thank you

    Hi,
    The problem is that I only know the offset values at row level, i.e., when I run my answer report some records use a certain offset value (offset1) while others use another offset value (offset2)
    The offset value can be determinate by a logical column.
    Is it possible?
    Thanks.

  • AGO functions with diferent time attibutes

    i have problem! i have too columns Year ago and month ago. When i take these columns with Month i can see only results from Month Ago (Year ago is no results), but when i take year and year ago i can see results from year ago. How can ia see year ago results with month column?????
    My Ago functions :
    Month ago: Ago("RU"."FSG fact - Budget"."Budget sum" , "RU"."WH Dim - TimeDim"."period" , 1) period is like (2008.01; 2010.02; ....)
    Year ago: Ago("RU"."FSG fact - Budget"."Budget sum" , "RU"."WH Dim - TimeDim"."Year" , 1) year is like (2008; 2010;....)
    please help !!!!!

    For Month_Ago column i set level Period and for Year_Ago level Year! but i still get problem - when i take fact column with MonthAgo and YearAgo columns and Month column from time dimension, MonthAgo works fine, but YearAgo shows '0' in all months and in the end of table after last moth shows all sum by year !
    and i have also Time dimension made from 2 Logical source tables!
    when i use grand total level i get error massege:
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 22047] The Dimension used in Ago function must be referenced in the query. (HY000)

  • Ago Function with multiple Facts

    Hi,
    I have two fact tables that are coneccted to the same time dimension. One of this fact has a column that uses the AGO function. In Answers when I select the column with the function and any other from the other fact, I get the following error:
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14026] Unable to navigate requested expression: Ago(VAL_PUBLICIDADE:[DAggr(F_PUBLICIDADE_MENSAL.VAL_PUBLICIDADE by [ D_CANAL.COD_CANAL, D_CANAL.NOME_CANAL, D_TEMPO_MES.Mes, D_TEMPO_MES.Ano, F_PUBLICIDADE_OBJECTIVOS.VALOR_BRUTO_OBJECTIVO] )], [Level Ano], 1). Please fix the metadata consistency warnings. (HY000)
    The metadata is consistent, there are no errors on the Administrator... Is it possible to do?

    Hi,
    The problem is that I only know the offset values at row level, i.e., when I run my answer report some records use a certain offset value (offset1) while others use another offset value (offset2)
    The offset value can be determinate by a logical column.
    Is it possible?
    Thanks.

  • Ago Function with Select Table--HELP!

    When my physical layer was setup using all 'Physical Table' types, my time series functions were working.
    I had to modify my fact table to be of a 'Select' type (using SQL). When I remap my data, my time series functions fail with the following message:
    "[nQSError: 22038] Function AGO requires at least one measure attribute in its first argument."
    We have to be able to use select tables with time serious functions--what am I missing!?
    Thanks!!

    does your new 'select table' contain the same number of columns with same datatypes?
    did you restart the services (if developing in online mode- which is not recommended)
    Lastly, if all fails,can you create those views on the database rather than in the physical layer?

  • 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

  • Nested AGO function in OBIEE

    Hi ,
    I am not able to understand the reason behind using Nested AGO functions.
    In one of the logical columns (Sales LastYear LastWeek) the mapping was in the following fashion:
    Ago(Ago("Core"."Fact - Retail Inventory Receipts"."Receipts Retail" , "Core"."Date Retail Fiscal Calendar"."Fiscal Week" , 1) , "Core"."Date Retail Fiscal Calendar"."Fiscal Week" , 52)
    Is it the same as writing a ago function with period of 53?
    Like this:
    Ago("Core"."Fact - Retail Inventory Receipts"."Receipts Retail" , "Core"."Date Retail Fiscal Calendar"."Fiscal Week" , 53)
    Please help me understand.
    Thanks for your help.
    Anand

    Hi Anand,
    This is how I interpret the function:
    Display the fact 'Receipts Retail' for the current fiscal period minus one fiscal week minus 52 fiscal weeks. So basically: Display the fact for the current fiscal period minus 53 fiscal weeks.
    However, since the column is named 'Sales LastYear LastWeek', this definition is a bit tricky. The formula is only true, if the fiscal year consists of 52 fiscal weeks (most of the time this is correct, but you never know!). I would prefer changing the second part of the forumula to Fiscal Year, 1:
    Ago(Ago("Core"."Fact - Retail Inventory Receipts"."Receipts Retail" , "Core"."Date Retail Fiscal Calendar"."Fiscal Week" , 1) , "Core"."Date Retail Fiscal Calendar"."Fiscal Year" , 1)
    This will substract a fiscal week and a fiscal year.
    I hope this helps.
    Regards,
    Marco Siliakus

  • How to find the year ago measure with out using time series functions

    hi all
    is there any way to find year ago sales with out using time series functions like ago
    Thanks
    Sreedhar

    Hello Madan,
    Thanks for the reply.
    It still doesn't consider the product into account.
    My columns are as below
    Prod Week End DATE Current Sales Prior Sales % Change
    A 12/4/2010 100 0
    A 12/11/2010 200 100
    A 12/18/2010 300 200
    B 12/4/2010 400 300(this value is not for prod B, i want this to b 0 aswell. But we get product A's last sale amount)
    Is there any way this can be done. I have tried evaluate,MSUM.
    I cannot build a time dimension as all I have is a view.
    Thanks,
    Deep

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

  • 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

  • Todate and AGO function in both Fiscal yer and Calendat year

    I want to create report having column with Todate and ago function formulas. I have to display the facts both in fiscal year and calendar year... how to do this? What value shall i choose in the content tab for the time dimension in this case? My fact table has values for each day...
    I am able to display only columns with fiscal year in time series function with timeDim.fiscal_year... similarly only calendar year with time seriese with calendar year columns... In my hierarchy, I have two branches for Time Dim...one is Fiscal and other is Calendar... and they both are at same level
    Help!

    I have an answer for you...Since you have a correctly defined time dimension (with branches - Fiscal Year->Fiscal Qtr ->Fiscal Month->Fiscal Week and Calendar Year->Cal Qtr->Cal Month->Cal Week->Cal that I assume have the common Child level - Day...) - you should have no problem building time-series logical columns
    In TODATE and AGO you must use relevant Time Dim Level - for example:
    AGO (Column, TimeDim.FiscalYear, 1) = would give you data for previous fiscal year
    AGO (Column, TimeDim.CalYear, 1) = would give you data for previous calendar year
    same goes for qtrs, months, weeks
    If you want to take it to the lowest level Day - it won't matter if you pick Fiscal or Calendar since it's essentially the same.
    I hope this is helpful

  • AGO Function doesn't use full previous period

    Hi,
    I am using ago function in obiee 11.1.1.6. If my current period is April, AGO (quantity, MONTH, 1) only returns the data from 1 to 30th of March and not the full month. Seems it's trying to match the number of days in the current month and uses the same number of days in the previous month. Is this the known issue? Is there any workaround? I want full month data for the previous month using AGO function.
    TIA

    HI,
    Obviously it must use all the dates from the previous months, just check with dimension hierarchy you created.
    Take a look @ this mkashu.blospot.com/2013/08/obiee-model-time-series-in-obiee.html
    Regards,
    VG

Maybe you are looking for