Next quarter function

Hello,
Please let me know the date functions which can be used to obtain the last day of the current quarter dynamically.
e.g. If I pass 18th January the result would be 31st March For 1st April the result would be 30th Jun
Thanks in Advance!!!
Edited by: user610910 on Jan 18, 2012 2:26 AM

Amrutha wrote:
TIMESTAMPADD(SQL_TSI_DAY,-1,TIMESTAMPADD(SQL_TSI_QUARTER,1,TIMESTAMPADD(SQL_TSI_DAY,(EXTRACT(DAY_OF_QUARTER FROM CURRENT_DATE)*-1)+1,CURRENT_DATE)))Am I missing something?
Being unfamiliar with the TIMESTAMPADD I looked it up in the online docs. Only 1 hit on a "TIMESTAMPADD" search in the 11gR2 docs for a single TimesTen In-Memory Database SQL Reference which in turn lead to a "page not found" error. A google search for "TIMESTAMPADD Oracle" found syntax on a third-party BI reference page suggessting that this is a very specialized function supported by only a single tool (?). I did not see anything special about the OP's run environment or an indication of BI use.
Like BluShadow I got the "(" not found error. Substituting a literal '18' for the nested EXTRACT operation then indicated TIMESTAMPADD did not exist in my 11gR2 database (11.2.0.1.0). A simpler SELECT from dual using only that function without nesting yielded the same error - ORA-00904: "TIMESTAMPADD": invalid identifier
BluShadow's answer is simpler, more elegant, and presumably will work (pending testing of course) in any Oracle environment. Nested functions can be used when necessary but they are hard to work with (I perpetually find getting the parenthesis and arguments right a challenge) and alternatives (when available) are usually better

Similar Messages

  • Sort order issue in with Evaluate function ( Next Quarter measure)

    Hi All,
    I have report requirement where I have to show measures for a particular geography for previous, current and next quarters in a pivotal view.
    ---------------Previous Quarter| Current Quarter|     Next Quarter
    Geography               
    ABC|xx|xx|xx
    PQR|xx|xx|xx
    XYZ|xx|xx|xx
    Next quarter values are displayed for other geography like
    ABC value is shown for XYZ and XYZ value is shown for PQR
    I have derived measure for pervious quarter using Time Series Function > Ago function,
    However the problem is with next quarter. I used following Evaluate Function to derive measure for next quarter.
    EVALUATE ('LEAD(%1,1) over (order by %2)' AS DOUBLE PRECISION , X, Y)
    Here X = Measure and Y = Level (Quarter)
    X is delta of two other measures A and B.
    X = (A- B)
    Thanks,
    SMA

    Hi user10300020,
    That's a fairly common problem with months that happens regardless of database source.
    In the logical layer of OBIEE you can specify the sort order on the month name column. Just double click on the month name column and look for the option to set sort order based on a different column. I typically sort the month name based on the month number.
    Give that a shot and tell me if it works.
    -Joe

  • Regarding SAP SCRIPTS - NEXT PAGE FUNCTIONALITY

    Hi all,
    Can anybody tell me how to get NEXT PAGE FUNCTIONALITY   in SAP SCRIPTS. Means if Data in 1st page does not fit it should go to next page and print.
    I had declared 2 PAGES already in my LAYOUT SET.
    How can i achieve above functionality.
    Thanks in advance.
    Thanks & Regards,
    Rayeez.

    Hi Rich heilman,
    I had declared first page as PAGE1 & its Next Page attribute as PAGE2 which is also declared already.
    But still it is not showing second page when there is over flow of data.
    does we need to write following code any where in layout.
    IF &PAGE& EQ = 1
    NEXT-PAGE
    ENDIF
    please solve my issue.
    Thanks & Regards,
    Rayeez.

  • Question about the Wait Until Next ms Function

    Hello,
    I met a problem when I tried to use wait until next ms function to control the period of the loop.
    I use Labview2009 now. I wrote a VI to sample the current values at 100Hz and then store the samples in a text file. The currents are sampled once in a loop and then wait for next 10ms to begin the next loop. After 360,000 loops (should be an hour), it will creat a new file to store the new samples in the following an hour.
    I left the VI runs on CompactRio for the whole weekend. The result I got is shown in the picture below:
    24 files should be created in one day. While there were only 3 files created in the firest 24 hours ( from Fri 16:00 - Sat 16:00). And after that it worked very well.
    When I checked the first three files (created from Fri 16:00 - Sat 16:00), I found that it didn't sample at 10Hz. It sampled at the frequency of about 20Hz (sometimes 18Hz, sometimes 19Hz).
    I am confused by the problem a lot. What may cause it didn't work in the first 24 hours and worked after 24 hours? And How could I fix this problem?
    Thank you very much!

    You need to show us some code!
    This cannot happen in a single loop, but can easily happen if you have e.g. stacked loops or sequences containing multiple wait statements.
    Also have a look at these old threads:
    Synchronization problems during measurements (using while loop)
    accurate timing between events
    If accurate timing is important, use a timed loop. Your incorrect times are faster, so I don't think there is a problem with the inner code taking too long.
    LabVIEW Champion . Do more with less code and in less time .

  • Additional Next Button Functionality

    I would like to see some additional next button functionality.
    For example when I am in Residential Products and Services I will read each of the sections.  if I am in Fios Internet and which to go FIOS TV Programming I wish there was a next button that would take me to Fios TV Programming (which is the next topic) instead of having to go back to Residental products and services and then choose Fios TV programming.  I read each section so having that next button functionality would help moving around here a bit quicker.
    Jim
    Solved!
    Go to Solution.

    Jim,
    Thanks for your suggestion. Have you tried using the "Go To" menu, which is just beside the board search button? It allows you to jump to another board fairly easily.
    Not exactly what you ask for, but maybe it will help in the interim?
    Becky

  • Next quarter to the selected quarter

    Hi Experts,
    Our requirement is to show the data in the report for the next rolling up quarters to the selected quarter in the prompt.
    Ex. If user has selected 2010-Q2 then report should show the data for 2010-Q3, 2010-Q4,2011-Q1 and 2011-Q2.
    Please suggest, how to implement as we are just aware of AGO function in OBIEE.
    Thanks
    Meera

    You see, if course, that your first issue is that 2010-Q2 is a CHAR field and to apply time functions, you need to work with actual dates. So you will need to map the dates to the appropriate quarter and year. Once you have that, here is how to build it:
    1) TIMESTAMPADD(SQL_TSI_QUARTER,-1,TIMESTAMPADD(SQL_TSI_DAY,-(DAY_OF_QUARTER(yourdatecolumn))+1,yourdatecolumn))
    As I mentioned in the other thread that Kart quoted, the formula above will give you the first day of the quarter in which the date column exists. The date column is the one your user will pick. Now, to get the 4th quarter after this, use this SQL:
    2) TIMESTAMPADD(SQL_TSI_QUARTER, 4,TIMESTAMPADD(SQL_TSI_QUARTER,-1,TIMESTAMPADD(SQL_TSI_DAY,-(DAY_OF_QUARTER(yourdatecolumn))+1,yourdatecolumn)))
    The above SQL will give you the 4th quarter after the one in 1)
    Now you have your two endpoints. Build your filter on the time column in your report and it should be between 1) and 2).

  • Adding "next chapter " functionality to menus ?

    Is there a way direct the next and previous chapter buttons on a MENU to another menu or track? (not the arrow keys!)
    WMP dosent seem to recognise transparent buttons with the mouse, and it dosent include arrow keys for navigation..
    Its tough as Im building a "power point style" presentation and trying not to junk it up with buttons.
    Oddly enough, Apple's DVD player seems to have simmilar problems, even though they work fine in the simulator.
    Personaly I think it would be nice to add this functionality, as on many dvd players the chapter forward and back buttons are more easily found than the arrow keys. So if nothing else, just used for redundancy and added functionality.
    Thanks!
    - Ty

    The problem occurs when invisible buttons are not detected by software players. (WMP) Visible ones seem to work.
    So, "Click anywhere on the screen to proceed" does not work. And it looks like the answer is to just add visible buttons to everything. If chapter forward worked, it would solve this. Is there any way it run using a script?
    This works great on a $30 hardware dvd player, just wish I could get everyone to use it on one. But that just isnt going to happen.

  • Prior, Next, Shift functions return type?

    I can not point out what is the return type of these functions? numeric value or member?
    And if they return a member would this fomula be valid (i need to take avg value of march and june):
    avgppl = @avgrange("HRsummary" -> "territory",@list(@currmbr("YearTotal"),@shift(@currmbr("YearTotal"),-3)))
    Thanks in advance!

    just use simple arithmetic combined with other functions
    e.g.
    If you want sum of base time periods underneath a summary time period, and make the formula generic to work on base time periods:
    @SUMRANGE(@CURRMBR(Account),@Relative(@CURRMBR(Period),0))/@COUNT(SKIPNONE,@Relative(@CURRMBR(Period),0))
    or, instead if you want the quarter averages at base time periods...
    @SUMRANGE(@CURRMBR(Account),@Relative(@Relative(@CURRMBR(Period),-1),0))/@COUNT(SKIPNONE,@Relative(@Relative(@CURRMBR(Period),-1),0))

  • Quiz next button function?

    Hi, I'm creating an "educational tool" about geography, its essentially a quiz, i show 3 pictures relating to a particular continent and they enter what they think the answer is in the text box, then it tells them if their correct or not,
    what im looking for is a way to move on to the next question, and how I do it, im a novice in flash so go easy on me haha.
    this is all the script i have so far:
    australiaTxt.addEventListener(Event.CHANGE, testAustraliaText);
    function testAustraliaText(evt:Event):void {
        var answer:String = "Australia";    
        if(australiaTxt.text == answer.substr(0,australiaTxt.length)){
            resultTxt2.text = "Come on you can do it!";
            if(australiaTxt.length == answer.length){
                resultTxt2.text = "That's correct!!";
        } else {
            resultTxt2.text = "Wrong :(";
    so the answer to this was australia, the next question answer will be asia
    oh and im using AS3 on CS4
    thankyou!

    I havent created it yet, I didnt know how it would affect any future actionscripting, I figured I would just be able to change the answer box to recieve different answers, but im honestly not sure how to go about it.

  • Play/Pause/Next/Previous functionality doesn't work using keyboard/remote

    I have recently upgraded my 24'' iMac to a 27'' i5 iMac and migrated my information via the Migration Assistant using a gigabit peer-to-peer (crossover cable) ethernet connection. Since then or shortly after the play, pause, next and forward buttons on the keyboard stopped working (or they never worked, I am unsure).
    Moreover, the same functionalities when accessed using the Apple remote also does not work, note that the volume up and down buttons do work from the Apple remote.
    I am also having difficulty getting my digital camera identified using the USB interface but that is another show. The camera is not even seen by the Image Capture tool in the Utilities, note that I succeeded once in getting it identified but not since then. The only change I can remember was installing the MouseWizard tool for extending gestures of the magical mouse, which is probably the finest thing I have got from the whole upgrade (the most easily appreciable). Please ignore the matter of my digital camera, for me mentioning it only for the slight possibility that it may be connected. To this humble users they are two things that are not working at all. Some of the applications I have installed is Parallels Desktop 4.0, which seems to identify the camera once connected but not the Mac OS X system.
    Thanks in advance for your generous help.

    Today I made a brave international call to Apple in the USA, realising that less than 90 days has passed since I purchased my new iMac. The phone call lasted for 62 minutes and was utterly embarrassing and genuinely awkward for me as it was totally unhelpful and very, very costly. The guy on the other side was very unable to provide any meaningful help and it was not easy for me to tell him that he was not, so I had to go on with the costly call which was mostly filled with moments of silence and contemplation (and forgetting -for the thousandth time, that my keyboard is wireless, telling me one time after the other to try to unplug it from the USB and connect it again).
    Anyway, I am delighted to have discovered the problem myself, which is amazingly simple, and unbelievably responsible of both of the two (seemingly unconnected) problems I was having (the problem with the functional keys on the keyboard and the identification of my digital camera).
    The problem was simply solved by deleting a textual file from the root of the home folder which is the file called ".CFUserTextEncoding". I have no idea what this textual file stores (a string of the form "X:XX") and how could the four bytes in it be of so much annoyance in my case, but deleting it can bring the media control keys back to life and make the digital camera identify effortlessly. Quite puzzling I would say.

  • OBIEE  webservice,The "next page" function failure

    hi all,
    I use webservice access OBIEE,When I click ”next page “ icon, js error:'Action' is empty or is not an object.
    I have edit the file OracleBIData\web\config\instanceconfig.xml , add this code:
    <URL>
    <ForceAbsoluteCommandURL>true</ForceAbsoluteCommandURL>
    <ForceAbsoluteResourceURL>true</ForceAbsoluteResourceURL>
    </URL>
    thanks for your help!

    Thank yoy try67 !
    I am trying this way, now I am creating a new button, and I am trying to put, all the code of the original button in one function.
    And, when I am creating de new button  btn:
    var btn = this.addField(name, type, page, newAddRect)
    btn.setAcion("MouseUp","myFunction()");
    this not works...
    the function is in one file in:
    C:\Documents and Settings\user\Datos de programa\Adobe\Acrobat\9.0\JavaScripts\myFile.js
    and the contains of the function is a simple alert.....
    Any idea...¿?
    Thank you!
    Regards,
    Xavi Marín.

  • Previous Page and Next Page functions lost

    The Previous Page and Next Page icons suddenly vanished with only the Reload Page and Add Bookmark icons showing. The only way I am able to return to a previous page is through History. Will I have to reintall Safari? and, if so, can I just install Safari without jeopardizing my data not only in Safari but other applications? I have original OS X 10.2 and 10.3 discs. Can I reintall over the existing Safari app?
    Thanks much.
    TeddyZ
    G4   Mac OS X (10.4.3)  

    Sorry, but this didn't work at all. I think Safari has been corrupted and think I'll have to reinstall.
    Do I deinstall? or can I reinstall over the existing Safari? And can I isolate Safari with my existing OS discs (I have both OS 10.2 and 10.3.5)?
    I have an external hard drive. Could that be helpful in this process?
    (I suspect that all my bookmarks will be lost, but can compensate by printing them out in hard copy).
    G4   Mac OS X (10.4.3)  

  • Translate and next day function

    hi everybody, i am trying to learn how translate and next_day function works in oracle.
    i have the following query
    select translate(to_char(sysdate,'yyyy/mm/dd'), 'A0123456789','A') FROM DUAL;
    when i execute it, the result is //
    my question is why is that, i thought it suppose to be AAAA/AA/AA
    translate suppose to replace any character in the string 'A1234...' with A
    but this is not happening. can somebody explain how is this working?
    also i have this query
    select next_day(to_date('06/23/1998','mm/dd/yyyy'), 'friday') from dual;
    when i execute it, it gives me 6/26/98 which is a thursday and not a friday. again why is this?
    when i execute this query, select next_day(to_date('07/10/2000','mm/dd/yyyy'), 'friday') from dual;
    i get 7/14/2000 which is correct. any ideas on this?

    Hi,
    Whenever you have a question about a function, start by looking at the [SQL Language manual|http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/functions204.htm#sthref2476].
    Under "Translate", the very first paragraph looks like it was written in response to your question:
    "TRANSLATE returns expr with all occurrences of each character in from_string replaced by its corresponding character in to_string. Characters in expr that are not in from_string are not replaced. The argument from_string can contain more characters than to_string. In this case, the extra characters at the end of from_string have no corresponding characters in to_string. If these extra characters appear in expr, then they are removed from the return value."
    I find it helpful to write the 3rd argument of TRANSLATE directly under the 2nd argument, to make it clear with what each character of the 2nd argument is being replaced:
    select  translate ( to_char (sysdate, 'yyyy/mm/dd')
                , 'A0123456789'
                , 'A'
    FROM      DUAL;makes it clear that (for example) '5' will be replaced with nothing (that is, removed) because there is nothing directly below '5'.
    On the other hand:
    select  translate ( to_char (sysdate, 'yyyy/mm/dd')
                , '0123456789'
                , 'AAAAAAAAAA'
    FROM      DUAL;makes it clear that '5' will be replaced with 'A', because there is an 'A' directly below '5'.
    Notice in the last example, there's no need to include 'A' in the 2nd argument.

  • Ecsallation of Complaint - Assign to next Partner function

    Hi,
    I want to escalate the complaint to the concern person if it is not taken over by the responsible person within time limit. I just have 5 statuses and if transaction exist in the particular status more than the specified time limit it should get assigned to partner function defined in partner determination procedure. So that the transaction will fall in my work list of the higher authority.
    My one more concern is how to configure condition for this. I know configuration of condition but not exactly for this scenario.
    Please suggest.
    Regards,
    Nikhil

    Hi Nikhil
    Lets say you have status - A,B,C,D,E,F and you have responsible persons X, Y, Z identified in your complaints
    Now when the complaint is created it can be directly assigned to X via action mail ( condition - status A, Action condition partner dependent and partner X)
    Now the second action will be on a batch report (lets say the date type ZDate = todays date + 2 hours) (Start Condition will be when date type todays date and time = Zdate) (action def. partner depepndent Y)
    The batch program will continuosly check for the date and time and when the condition is met it will execute a mail to  Y ( it can be a smart form mail with the details that it is an escalated mail as it was not done in status A and specfied SLA)
    Hope this addresses your concern
    Regards
    Raj

  • Next Image functionality

    I'm wondering how to do sort of an image gallery effect --
    where you stay on a single web page and keep clicking a "next"
    button and a new image keeps appearing in a fixed location.
    Here's an example -- except I don't need it to appear in a
    pop-up window as this does:
    http://www.visualurbanabstracts.com/
    Click on Gallery1.
    I looked at the source code for this site's home page and see
    this involves something called an array, but I'm not familiar with
    the code. I'd like to learn more about this -- is there an
    extension that does this, or can anyone point me to a tutorial or
    similar resource?
    Thanks very much.
    Rosemary

    You can do this with javascript.
    Paul Whitham
    Certified Dreamweaver MX2004 Professional
    Adobe Community Expert - Dreamweaver
    Valleybiz Internet Design
    www.valleybiz.net
    "imrosemary" <[email protected]> wrote in
    message
    news:e67rau$eb$[email protected]..
    > I'm wondering how to do sort of an image gallery effect
    -- where you stay
    > on a
    > single web page and keep clicking a "next" button and a
    new image keeps
    > appearing in a fixed location.
    >
    > Here's an example -- except I don't need it to appear in
    a pop-up window
    > as
    > this does:
    >
    > <a target=_blank class=ftalternatingbarlinklarge
    > href="
    http://www.visualurbanabstracts.com/
    > Click">
    http://www.visualurbanabstracts.com/
    > Click</a> on Gallery1.
    >
    > I looked at the source code for this site's home page
    and see this
    > involves
    > something called an array, but I'm not familiar with the
    code. I'd like
    > to
    > learn more about this -- is there an extension that does
    this, or can
    > anyone
    > point me to a tutorial or similar resource?
    >
    > Thanks very much.
    > Rosemary
    >

Maybe you are looking for

  • MacBook Pro 13" 2010 won't move past grey screen

    Hi was restarting my MacBook Pro 13" 2010 yesterday and the screen turns on, I hear the chime, and then nothing. No apple logo, no response to anything I do on the keyboard (safe mode, recovery, holding option). I've tried to reset the pram but holdi

  • Region id in a path

    Hi all, Has the following XML, how do I specify the path for code under rowset3_row ? I typed in the following ( to specify code is qual to variable v_code1 ) but getting xpath error. thx <?for-each:/DOCUMENT/'REGION ID="0"'/ROWSET3/ROWSET3_ROW[CODE=

  • Having trouble opening my videos app. Just black screen. Help pls!

    For a while now, I've been unable to open my videos app. I've tried shutting down and turning it on again but then same thing. What can I do to make it work?

  • Anti-glare film for 27" display

    Folks, Do you know of any decent anti-glare film for the new 27" Apple Cinema Display? I got a this new monitor 2 days ago and I am starting to get headaches because of the glare... no matter how/where I position the screen in my office. I really wis

  • How can i set up lightroom for tethered shooting with an eithernet cable

    So I have my Nikon d4 set up with Nikon Picture control so that it will download to my laptop with an Ethernet cable but it downloads to a file on the hard drive - I can choose what file, etc but what I want to do is take advantage of Lightrooms teth