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
Similar Messages
-
Hi
I'm trying to use the 'AGO' function to have The sales of one year ago
My time dimension is a normal table imported from the database and has one hierarchy:
Year Level
--Week Level
I defined the week date as a chronological key and made a the new calculated column:
AGO(salesMeasure, DWH_TIME_DIM.WEEKS, 12)
Then In Aswer I get This Error
*[NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 22040] To use AGO function, the storage level of the query ('[DWH_TIME_D.Dimension Key]') must be a static level. (HY000)*
Any one knows why???
RegardsNaresh
I don't see any *(use existing columns as source)* In the creation window of the repository variable I only have a default Initializer.
What I manged to do also is to write this formula in the default initializer : ADD_MONTHS("orcl".."DWH"."DWH_TIME_D"."YEARIW_TIMEDATE" ,-12)and after to use it in a new calculated column with your expression :
case when times.year=valueof(previousyear) then salescolumn end
But I had a syntax error I think I can't use Add_months for this.
Regards -
TODATE and AGO function errors in OBIEE
I have aggregated time dimension. The time calendar comprises of the following structure with a physical table for each level in the Physical Layer -
Year -> Half Year -> Quarter -> Month -> Week -> Day
These tables form the calendar. The RPD works fine until I use the TODATE and AGO based fields in the query.
When I use the AGO and the TODATE time series function to generate the YTD and PY YTD calculations in the Business Modelling Layer. The system gives the following error on Answers -
Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 22045] AGO function is used on a time dimension which is logically snowflaked. (HY000)
SQL Issued: SELECT "- Retail Calendar"."Year Identifier" saw_0, "- Sales"."Gallons Sold" saw_1, "- Sales"."Profit Amount" saw_2, "- Sales"."Sales Quantity" saw_3, "- Sales"."Retail Sales Amount" saw_4, "- Sales"."Licensee Sales Amount" saw_5, "- Sales"."% Retail Sales Amount" saw_6, "- Sales"."% Licensee Sales Amount" saw_7, "- Sales"."Store Average Profit" saw_8, "- Sales"."Sales Amount - Last Year" saw_9 FROM "Reporting Objects" ORDER BY saw_0
Let me know what I am doing incorrect here?
I have checked all the joins to see if the time calendar has been incorrectly joined, but I can't find anything. Please help.Below are the physical tables involved -
Year - TIME_YEAR_DM
Half Year - TIME_HALF_DM
Quarter - TIME_QTR_DM
Month - TIME_MTH_DM
Week - TIME_WK_DM
Day - TIME_DAY_DM
Each of these tables has an Identifier key (for example, YR_IDNT, HALF_IDNT, QTR_IDNT, etc.) that uniquely identifies the rows. I am using these IDNT fields as my hierarchical keys. -
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 Shi,
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 -
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,
CorraodWhat is the month level key column functionality in your time dimension?
it should be in format of yyyymm but not in just mm .. -
LAST Aggregation and AGO Function in OBI Administration Tool
I'm struggling a bit with the AGO function and LAST aggregation. The problem is when I try to compare balance from the last day from last month compared with last day of this month.
To get the balance of the last day of this month, I'm using based on dimensions LAST aggregation in the logical column KNSALDOPROMEDIOlast (avg balance).
KNSALDOPROMEDIOlast:
Dimension Formula
Other SUM(BWM.DWH_FTASA.KNSALDOPROMEDIOlast)
DTIEMPO_Dim LAST(BWM.DWH_FTASA.KNSALDOPROMEDIOlast)
To get the last day of last month I’m using the existing logical colum KNSALDOPROMEDIOlast applying the AGO function over the time dimension Month -1.
KNSALDOPROMEDIOlast-1:
AGO(BWM.DWH_FTASA.KNSALDOPROMEDIOlast, BWM.DTIEMPO_Dim.MES_Dim,1).
The problem is when the last month has more days than the current month.
Example:
Month Last Day KNSALDOPROMEDIOlast KNSALDOPROMEDIOlast-1
JAN 2010 JAN 31 437,880,393 0
FEB 2010 FEB 28 484,804,165 442,880,934
MAR 2010 MAR 31 562,201,480 484,804,165
APR 2010 APR 30 583,255,351 570,661,690
MAY 2010 MAY 31 663,660,138 583,255,351
1. The balance of last day of previous month of February is 442,880,93, is wrong this amount, is from Jan 28th, the real is 437,880,393 from last day of January, Jan 31st. January has more days than February.
2. The balance of last day of previous month of March is 484,804,165, is correct this amount is from last day of February, Feb 28th. March has less days than February.
3. The balance of last day of previous month of April is 570,661,690, is wrong this amount, is from mar 30th, the real is 562,201,480 from last day of March, Mar 31st. March has more days than April.
4. The balance of last day of previous month of May is 583,255,351, is correct this amount is from last day of April, Apr 30th. April has less days than May.
Edited by: user10541559 on Aug 18, 2010 1:44 PMHi,
I'm not sure about your issue.
The aggregation option "LAST" is used when you need the last value, the most typical example of this is inventory, if you want the inventory quantity of a product in a month, you don't sum the value for each day in the month, you only get the value of the inventory in the last day of required month, right?
Have you tried using session variables?
You can get the last day of the last month from Oracle DB with the function "LAST_DAY". For example:
SELECT LAST_DAY(ADD_MONTHS(CURRENT_DATE, -1)) from DUAL
I know that is not exactly what you need, but I hope I gave you an idea what other things you can try.
Regards,
Jorge. -
Ago function and BI server crash
Hi All,
I intercepted a wierd issue and have been searching web since two days with no helpful outcome. I have a logical column which uses Ago function to calculate the cost in the previous month. As soon as the report runs with the same logical column, the BI server crashes.
The logical column has the following calculation: AGO("ABC"."Fact"."Cost", "ABC"."Time Dim"."Month", 1)
I have used the similar calculation in my other fact for calculating Year ago measure. The report having that column works very well.
Please let me know why should the BI server fail. What can be the possible reasons and if possible, let me know the workaround for the same.
Your help wil be appreciated..
Thanks in advance.
SumitaI'll tell the whole sad story:
Our BI was happily connected to an SQL server 2005 Data warehouse.
For deployment reasons we decided to move this DW into the oracle 10gR2 DB that comes with the BI package.
When we remapped the business models to table sources from the Oracle DB the whole thing started crashing - first the BI server, then the Presentation services.
We've now reduced the connections to one schema, it's still crashing. -
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 & regardsSplit your time dimension in one for calculations and one for "regular" use.
regards
John
http://obiee101.blogspot.com/ -
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.
AnandHi 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 -
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,
SwethaThanks 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 -
AGO function problem 10.1.3.4
Hi,
Anyone have any suggestions on this please???
Still hoping for suggestions from anyone who has had similar problem with AGO function yielding strange results at certain levels of hierarchy??
I have a facts folder with both AGO and 'regular' columns of data.
I create a simple query with filters on period name and expense type.
When I add 'regular' columns (default aggregate SUM) - it works okay.
I then remove all 'regular' facts columns.
When I add AGO based columns - it works fine.
When I try any combination of AGO and 'regular' suddenly a lot of my data disappears.
I have tried experimenting with report based totals off and setting the function aggregation to SUM for the AGO columns, but nothing works.
i.e. AGO is pointing at previous period, so I have Yr, Qtr, Period in my time dimension and the AGO is linked to Period level (like a calendar month, but financial) and the AGO is -1.
Filter is on period name - so for example "PERIOD NAME" is equal to / is in 'NOV-11'
Any suggestions please??
thanks,
Robert.
Edited by: Robert Angel on 08-Dec-2011 06:02 to clarify ago usage
Further information; -
I have just discovered that this strange behaviour only manifests when the 2nd segment of our five segment chart of accounts structure is present.
I have checked the properties of this field and can see nothing strange, when compared to its (working) peers.
Could it be a problem related to the dimension hierarchy that is associated with this chart of accounts dimension>??
thanks for your input,
Robert.
Edited by: Robert Angel on 08-Dec-2011 07:30 additional detail
Edited by: Robert Angel on 12-Dec-2011 07:33
Edited by: Robert Angel on 19-Dec-2011 08:07To explain the structure first; -
Chart of Accounts Dimension
Trust Id
Cost Centre
Expense Type
Sub Expense Type
External Organisation
Each level of the hierarchy is from the same phyical table 'Chart of Accounts'. The dimension references the underlying field as the Key at each level.
Financial Periods Dimension
Year
Quarter
Period
Again all are from the same physical table, again all use the underlying field as the key at each level.
FACTS table has; -
Actual in Month, Budget In Month, Month Ago Actual in Month
Working scenario ; -
Add; -
Cost Centre, Actual in Month, Budget In Month, Month Ago Actual in Month
Filter on period_name = 'NOV-11'
Cost Centre in ('801040','801041')
results; - (works fine!)
Cost Centre, Actual in Month, Budget In Month, Month Ago Actual in Month
801040 50000 65000 55000
801041 15000 18000 19000To the above scenario I can add any of the other Chart of accounts segments and it works.
When I add Expense Type I get
Cost Centre, Expense Type, Actual in Month, Budget In Month, Month Ago Actual in Month
801040 3001 50000 65000 55000i.e. I still get results, but less cost centres than I had when only cost centre was included.... all other things being equal??!!
I can workaround this by pulling my concatenated version of all codes to get the full chart of account 'string' and then use substring to pull expense type only out of it, but this is less than ideal to suggest to a user community when it should work as is...
Anyone seen anything like this before, can give me anything to investigate that might be making the difference??
Edited by: Robert Angel on 13-Dec-2011 02:20
Edited by: Robert Angel on 14-Dec-2011 08:28 -
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?
ThanksHello,
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 -
Hi,
I have a time dimension with levels AllTime, Year, Month, Week, Day. I set the chronological key to the day and created an Ago Measure in my fact. The repository global consistency was successful. However when I used it in answers, I got the following error message:
State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 22040] To use AGO function, the storage level of the query ('[DIM_DATE.DIMENSION_KEY]') must be a static level. (HY000)
SQL Issued: SELECT DIM_DATE.CALENDAR_YEAR_NAME saw_0, F_TEST.MEASURE saw_1, F_TEST.YearAgoMeasures saw_2 FROM WMS ORDER BY saw_0
Does anyone have any idea please? Note that the DIM_DATE.DIMENSION_KEY is the primary key of the time dimension table.
Thanks a lot
MarijaHi Wildmight,
I restarted everything and got the "must be a static level. (HY000)" error fixed. Then I checked the chronological key in the level "year" but it seems not to be working. It's taking a long long time to show the results (I finally cancel it).
Reviewing the nqquery log file, I don't really get how obi retrieves the todate info, it uses the analytic function: ROW_NUMBER() OVER (partition by....), do you get the same?
Thanks again. -
Unable to create time series ago function
Hello guys
I am running into a problem about time series function, ago function
I have a simple schema, fact <---->Time dimension
I have created time dimension hierarchy where month is the lowest level, I have also made it "time dimension" and month is the "chronogical key"..
When applying ago function, I am putting my measure from the fact table, level as "month" from time dimension table, and 1 meaning 1 month ago, when I complile it, I get the following error:
[nQSError: 27009] Unresolved identifier: "FTTNBILLSUM"."FTTNOBIEEBILLTIME"."Month".
Could anybody help me out as what the system doesn't like about this column?
ThanksThanks Maden
I did the correction and now it's giving a different error: [nQSError: 22038] Function AGO requires at least one measure attribute in its first argument.
My code is:
Ago("FTTNBILLSUM"."F_Bill_Sum"."ATM_UNITS_Sum" , "FTTNBILLSUM"."D_Time"."Month" , 1)
I have time hierarchy that names: D_Time with Month at the lowest level with Chrono keys, there is no level above it except grand total level, so only 2 level hierachy
I have a fact table that is F_Bill_Sum, which is join to D_Time... I made the D_time both the name of table and hierarchy
Please let me know what this error is coming from
Thanks -
AGO function an date parametar in request
Hi all,
I have problem with this calculation that I had created in Admin.
*1. Mesure*
ToDate(sum(ifnull(TABLE.COLUMN1 , 0)), [Level Month])
*2.Mesure*
nullif( ifnull(Ago(sum(ifnull(TABLE.COLUMN2 , 0)), [Level Year], 1) , 0) , 0)
Calculation
+ToDate(sum(ifnull(TABLE.COLUMN1 , 0)), [Level Month]) / nullif( ifnull(Ago(sum(ifnull(TABLE.COLUMN2 , 0)), [Level Year], 1) , 0) , 0) * 100+
In Answers I have pivot table that has parameter date (ex. 11.08.2009) that user define in prompt (date filter in request is set to promted). When I use *1. Mesure* and *2.Mesure* it works fine, but when I use calculation I am getting error The Dimension used in AGO function must be referenced in the query. . I am able to fix it by adding Year and Month filter. Why it is not working just with Date?What is the pivot report structure, culumns?
How did you create these three logical columns?
Measure 1 -> ToDate(sum(ifnull(TABLE.COLUMN1 , 0)), Level Month)
Measure 2 -> nullif( ifnull(Ago(sum(ifnull(TABLE.COLUMN2 , 0)), Level Year, 1) , 0) , 0)
Calculation -> ToDate(sum(ifnull(TABLE.COLUMN1 , 0)), Level Month) / nullif( ifnull(Ago(sum(ifnull(TABLE.COLUMN2 , 0)), Level Year, 1) , 0) , 0) * 100
By use existing logical columns as the source?
You put ifnull(TABLE.COLUMN2 , 0) in the expression instead of TABLE.COLUMN2 and then set aggregation to SUM in the logical column?
Regards
Goran
http://108obiee.blogspot.com
Maybe you are looking for
-
IPod Touch 4G Not Turning On or Connecting to iTunes
I have no idea why, but my iPod Touch will not turn on. When I press the Home button, it will show the low power screen (but only when connected to a USB cable). Holding Home does nothing. Holding Home and whatever the button on the top is results in
-
Compare Date in Expression Builder
Hallo, I'm trying to build the following sql: select * from (select * from TABLE1 where CODE =#myCode AND EFFECTIVE_DATE <=#myDate AND EFFECTIVE_DATE >= ADD_MONTHS(#myDate,(-1)*#ageMaxMonth) ORDER BY EFFECTIVE_DATE DESC ) WHERE ROWNUM < 2 Vector args
-
BI SDK/XMLA (MDX) - Does the query execution go through SAP BI Accelerator?
Environment : Portal - EP7.0 SPS 14, BI 7.0 SPS17 I have written customer report views which uses the BI SDK to execute BI querries through the portal. Following link provides the detail about configuring the portal to access the BI system and execut
-
Unable to install DPM2012R2 on remote SQL 2012SP1
Hello, I am trying to upgrade my DPM2012SP1-UR3 to 2012R2. The current version is running on a remote SQL default instance. The prerequisite check fails because it can't find the remote SQL Instance. Looking at the logs, i found out that the Prerequi
-
WINDOWS ADOBE X i get Error message 523;523 during download, then grey screen
I try and download a PDF file and during process I get message "There is a problem with Adobe reader. If running, please exit and try again. (523;523)" I shut down computer and restart and still get same message?? Anyone know how I can resolve.Thanks