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....

Similar Messages

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

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

  • How Achieve timedseries calculations with out using AGO And ToDate function

    Hi,,
    1)
    How Achieve timedseries calculations with out using AGO And ToDate functionion
    this question asking in interview ..is it possible..?
    if yes please response as soon as possible..
    2) i have 2 cloumns Product and value...
    client requirement is they need ranks based on Value ..in dashboard .using dashboard prompt..edit box...if user enter any number (ex :5 ) report should show top 5 ranks if he enter 20 should be top 20 ranks..
    how to achive this ?
    thanks,
    raj

    Consider yor first question:
    1. Yes, we can create timeseries measures without using AGO and TODATE
    1. Create ALIAS of fact tabe in the physical layer
    2. Join the Time id from the ALIAS fact table with the YAGO_MONTH_ID column from your time dimension table (For calculating Year Ago variants) similarly join with MAGO_MONTH_ID column for Month Ago measures.
    3.Pull the ALIAS tables as an additional Logical table source in the Lgical layer
    4.Keep the mapping of the columns from the ALIAS table as its is
    5. For e.g If you pick Revenue from the Year Ago Alias table it will give you the "Prior Year Revenue"
    See if this helps you

  • Generic "AGO" and "TODATE" functions

    Hi, I'd like to find out if it's possible to have "generic" date functionality that applies at whatever date level the user chooses. For example, instead of having:
    Day Sales
    Prior Day Sales
    Year Ago Day Sales
    Week Sales
    Prior Week Sales
    Year Ago Week Sales
    Month Sales
    Prior Month Sales
    Year Ago Month Sales
    Quarter Sales
    Prior Quarter Sales
    Year Ago Quarter Sales
    Year Sales
    Prior Year Sales
    instead I'd like to have:
    Sales
    Prior Period Sales
    Year Ago Period Sales
    It looks like the "AGO" function, for instance, requires the time level to be put in. But I'd rather NOT put a specific time level in - and have that default to whatever the user asks for in the report. i.e. if they put "Jan 2009" in the report then it knows it's at the month level. If they put "Q3 2009" in it would know to do it at the quarter level, etc.
    Is there any way to do this?
    Thanks in advance,
    Scott

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

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

  • How to get Last Year Sales and YTD Sales without using AGO and TODATE?

    Hi all,
    I have got Company and Time dimensions and Sales Fact. My requirement is to get Last Year sales for each company without using AGO function and YTD without using TODATE function. (Due to performance issue as AGO and TODATE do not insert a Cache entry).
    Can someone please help me to achieve my requirement? Thanks in advance.

    Hi Satya,
    Thanks again for your reply. To start with I don't have data for the years 2012 and 2011 to test as I am using SH sample schema from Oracle. I have applied your solution but it does not seem to be working for the previous years like 2000, 2001. My requirement is to have a dashboard prompt "YEAR" and let the user choose whatever year he wants.
    Please have a look at the column formulas of my analysis (As per your solution) :
    ***here B_YEAR is replaced by CALENDAR_YEAR.  
    Amount: "F1 Sales"."Amount"
    AmountYTD:  FILTER("F1 Sales"."Amount" USING "D1 Time"."CALENDAR_YEAR" =YEAR(CURRENT_DATE))
    Amount LY: FILTER("F1 Sales"."Amount" USING "D1 Time"."CALENDAR_YEAR" =YEAR(CURRENT_DATE)-1)and the physical query generated by BI Server: (as you can see I have got a filter CALENDAR_YEAR= 2000)
    WITH
    SAWITH0 AS (select sum(T1074.AMOUNT_SOLD) as c1,
         sum(case  when T1035.CALENDAR_YEAR = TO_NUMBER(TO_CHAR(TO_DATE('2012-05-03' , 'YYYY-MM-DD'), 'yyyy'), '9999') then T1074.AMOUNT_SOLD end ) as c2,
         sum(case  when TO_NUMBER(TO_CHAR(TO_DATE('2012-05-03' , 'YYYY-MM-DD'), 'yyyy'), '9999') - 1 = T1035.CALENDAR_YEAR then T1074.AMOUNT_SOLD end ) as c3,
         T1035.CALENDAR_MONTH_DESC as c4,
         T1035.CALENDAR_YEAR as c5,
         T1035.CALENDAR_MONTH_ID as c6
    from
         TIMES T1035 /* D1 Time */ ,
         SALES T1074 /* F1 Sales */
    where  ( T1035.CALENDAR_YEAR = 2000 and T1035.TIME_ID = T1074.TIME_ID )
    group by T1035.CALENDAR_MONTH_DESC, T1035.CALENDAR_MONTH_ID, T1035.CALENDAR_YEAR)
    select distinct 0 as c1,
         D1.c4 as c2,
         D1.c5 as c3,
         D1.c1 as c4,
         D1.c2 as c5,
         D1.c3 as c6,
         D1.c6 as c7
    from
         SAWITH0 D1
    order by c3, c2 Thanks in advance.

  • 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")

  • TS2634 I bought my iPhone 4s 16gb just a week ago and Im having problems with the frontal camera.. is blurry...

    I bought my iPhone 4s 16gb just a week ago and Im having problems with the frontal camera.. is blurry... anyone has experimented this issue too?  please let me know!

    Did you put a screen protector on the phone or did you pull the protective film off the phone?

  • I just bought a new iMac 27'' a week ago and been having problems every morning when i come to the office with turing the system on.  I have to unplug the power cord for 10 secs and replug for it to turn on.  Kindly pls advise

    I just bought a new iMac 27'' a week ago and been having problems every morning when i come to the office with turing the system on.  I have to unplug the power cord for 10 secs and replug for it to turn on.  Kindly pls advise
    Anyone having the same problem?

    Makes no difference if anyone is having the same problem.  The important thing is that it's happening to YOU!
    You have 14 days to return the computer w/no questions asked. 
    Strongly suggest that you take FULL advantage of the above before it runs out.  Let Apple deal w/the problems.

  • Start up and basic function problems

    My computer has been running abnormally slowly recently. For example, it will take about 30 seconds to start apps such as ichat, mail, or safari. Occasionally, my computer will just freeze and i won't be able to switch spaces, applications, windows or open the dock or force quit menu. Usually 30 seconds later it will do all of those functions at once. I also have applications such as ichat announce when buddies come online, but the delay is usually 5-10 seconds. Furthermore, when my clock hits the hour, my menu bar will reset and all items will disappear and all of my apps will freeze for about 15 seconds. Also, when I tried to install the latest apple updates and selected restart, my computer would not install anything. Instead, Finder quit but my computer did not shut down. I was staring at my background with no icons. My dock was hovering at the bottom of my screen and I could restart Finder from it, but when I tried to shut down again, my computer would not. It would simply quit finder then show an error saying that either software update or finder did not quit. I eventually forced a shut down and started back up, but the software update window came up with the same software that I just updated. I repaired permissions and the disk through disk utility, ran the maintenance scripts, and re-updated. This time, my computer would shut down, but would not start back up. I could tell that my disk was running because it got really hot, but the screen never started and the latch light on the front would glow, but i could not wake it. I forced a shut down and restarted, but it stalled at the grey/white screen and the apple logo never appeared. I forced shutdown again, and this time it booted up, but it took 5 minutes to get to the login screen.
    Does anyone have any suggestions? Or, is my only option (as i had feared) to backup and reinstall (i didn't bring my install disk with me to school, so I'm going to need temporary fixes for now).
    Thank you,
    Hobbesocrates

    I found someone with an install disk and ran Repair Disk. It said that the disk was ok. I also ran repair permissions and one of the lines was a warning and said: SUID file System/Library/Coreservices/Finder.app/Contents/Resources/OwnerGroupTool" has been modified and will not be repaired. After fixing all that I could with that, I restarted and my computer showed minor improvements, but is not functioning anywhere near the optimal speed it was a while ago.
    However, I did download iDefrag and checked the defragmentation of the disk. Over 50% of the disk was fragmented. I'm thinking of burning a bootable cd and running idefrag demo or drive genius 2 demo off of that. would that be a good plan
    thank you

  • Object view  with nested table and member functions????????????????

    HI frds:)
    I need some help regarding writeing soem queries..
    I have to use view in retreving data and by useing member functions of object.
    1) i have to create a nested table by useing type object.
    2) i have to create a object wtih member functions inorder to create view of taht nested table,.
    3) by useing this objectt view and by useing methods i have to write soem queries ...
    If any one know or any information regarding this please reply me... as i have searched in net alot but i was unable to figure out..
    Thanks....

    // first createing object
    create type emp_det as object
    (empname varcahr2(20),start_date date,end_date date);
    // creating table of that object
    create table emp_detai_table as table of emp_det;
    // creating nested table
    create table empl (emp_no number,emp_detail emp_detail_table,dep_no number)nested table emp_detail store as s;
    //now i want to create view.. inorder to create view i need to create object. in that object i want to create methods.. these methods should work with date attributes..
    after creating object view i need to select or write some queries by useing member methods..
    This is the tast i have to perform.,. i have no materials ...if u have any link ..forward me..
    i have to do it as soon as possible..
    waiting for your reply...

  • How do I burn a DVD R disc with Windows Movie Maker?  It indicates disc error on my DVD player.  Someone thought it had something to do with Itunes?  I reloaded Itunes 1 month ago and had no problem creating this disc then.  Help

    I have made several DVD+R discs in the past using Windows Live Movie Maker sucessfully.  I made one about one month ago for my son's b-day.  I am using the same discs as I had then.  When I tried to burn the disc, it indicates that it is burning, however, when I insert it into the DVD player at home on our TV (like I"ve always done), it indicates disc error.  Someone mentioned that the burner goes out every now and then when Itunes is uploaded?  When I burn the disc, I can pull it up on my home and work computers, so I know that it is there.

    Yes, you can distribute a burned disk of the project to those who can create duplicate disks.  Or create a disk image of the iDVD project using the File ➙ Save as Disk Image menu option.
    Then you can distribute the disk image to those who will burn the disks.  For PCs you'll have to convert the .dmg file to a .iso file so they can burn it.  This website describer how: Mac Help - Convert and Burn Mac .dmg or .img to .iso Windows PC-Compatible Disk Image
    Suggest to them to burn to disk with Disk Utility or Toast at the slowest speed available (2x-4x) to assure the best burn quality.  Always use top quality media:  Verbatim, Maxell or Taiyo Yuden DVD-R are the most recommended in these forums.
    It would be prudent to rest your optical drive for about 30 minutes after burning 3 disks in a row. That will give the laser time to cool down before you start another batch.
    OT

  • I buy an iphone 4s sience 6 months ago and i have problems with the battery what can i do ???

    i have problems with the battery of my iphone4s i have it sience february 17 of this year and i the time life of my battery i compare the lifetime of the battery of my iphone 4 with the iphone 4s and i look that the iphone 4 has long a long lifeime i can use  it like 2 days without charge and whit my iphone 4s like only 12 hrs what can i do?? i have the guarrantie help me =)

    Contact Apple Support.  Here's how:
    http://support.apple.com/kb/HE57

  • UC560 and SPA504 - functionality problems

    Cisco SPA 500 IP Phones do not allow a transfer of calls coming from PSTN to another internal destination. Phones are registered to SPA 560 using SPCP protocol. Scenario: Incoming call from PSTN to DN 1000, transfered to 1001. When the transfer button on DN 1000 is pressed for the second time, the call is dropped. Transfer system full consult. MTP and transcoder available, however not used during this session at all. Connectivity to the PSTN is through SIP trunk with g711alow only.
    The second problem: Czech localization on these phones is completely useless, since it displayes Czech special characters in wrong charset, resulting in total nonsence. Czech char set should be UTF-8. The customer demands right czech characters, as promissed by Cisco, optherwise, they are not going to accept the project at all.

    Issue 1, would need to see SIP traces, etc.
    Issue 2, Cisco is know to do bad localization, if they do it at all. You can contact them but I would not expect a real resolution.

Maybe you are looking for

  • ITunes crashing during manual sync/update requiring use of "Apply" button.

    My iTunes will sync new music just fine via the "Recently Added" smart playlist (to my 16GB iPod Nano Touch), but anything else I do that requires me to lock in changes by hitting the "Apply" button immediately locks up iTunes. If I try to manually s

  • Destructive and non-destructive buffer reads on branch wires

    I was asked this morning what are "Destructive and non-destructive buffer reads on branched wires" are. I was at a loss at first and the I thought some and read a posting by Jim that inspried me. My first thought was the case of an array wired to a r

  • Problem with my website in Safari

    My web site page (http://www.ciblindsdirect.com/cleaning.html) looks ok and centered in IE but when i view it in  Safari it goes to the left. Can this be fixed?

  • Infotype

    hi.. wt r the salary processing infotype? wt r the 2 important field reruired to fill 2 run payroll. Please read the forum rules before posting the Questions

  • Problem occuring with photoshop compressing an image as it opens the file

    I am attempting to have photoshop open a 16bit grayscale ramp that I generated in matlab, but a problem is occuring with mach banding still occuring eventhough photoshop is setup to be working in 10bit images right now. Are there other settings that