Change Quarters to Months

Hello all,
Alright so I'm trying to change the quarters, to a set of twelve months.
I have data that looks like...
Date--------col2------col3---amount
2009Q1------22------33------100
2009Q2------55------66------200
I'm doing a substr and case to turn 2009Q1 into JAN-09 and so on for the other quarters. What I need to do is also create rows for the other months in the quarter, not just the first one.
So, using the example above, I need the data to look like this...
Date--------col2------col3---amount
JAN-09------22------33------100
FEB-09------22------33------0
MAR-09------22------33------0
APR-09------55------66------200
MAY-09------55------66------0
JUN-09------55------66------0
Q1 has been transformed into Jan/Feb/Mar and the amount only stays in the first month. The following 2 months should get a 0 for the amount.
Any help is appreciated!
Thanks
-Chris

Hi,
Solution with model (10g).
REgards salim.
SELECT to_char(dt,'mon-yyyy') dt,col2,col3,amount
  FROM t
  model
  return updated rows
  partition by (q qq)
  dimension by (1 rn)
  measures(col2,col3,amount,to_date( substr(q,1,4)||'-01-01','yyyy-mm-dd') dt, case when substr(q,-1)=1 then 1
                                    when substr(q,-1)=2 then 4
                                    when substr(q,-1)=3 then 7 
                                    else 10 end  start_month ,
                                    case when substr(q,-1)=1 then 3
                                    when substr(q,-1)=2 then 6
                                    when substr(q,-1)=3 then 9 
                                    else 12 end  end_month  )
  (dt[ for rn from start_month[1] to end_month[1] increment 1]=add_months(dt[1],cv(rn)-1),
  col2[ for rn from start_month[1] to end_month[1] increment 1]=col2[1] ,
  col3[ for rn from start_month[1] to end_month[1] increment 1]=col3[1],
  amount[ for rn from start_month[1] to end_month[1] increment 1]=case when cv(rn)=start_month[1] then amount[1]
                                                                       else 0 end )
  order by qq,rn
alter session set nls_language=english;
WITH t AS
     (SELECT '2009Q1' q, 22 col2, 33 col3, 100 amount
        FROM DUAL
      UNION ALL
      SELECT '2009Q2', 55, 66, 200
        FROM DUAL
        UNION ALL
      SELECT '2009Q3', 66, 88, 300
        FROM DUAL
        UNION ALL
      SELECT '2009Q4', 77, 99, 400
        FROM DUAL
        UNION ALL
      SELECT '2010Q1', 99, 11, 500
        FROM DUAL)
SELECT to_char(dt,'mon-yyyy') dt,col2,col3,amount
  FROM t
  model
  return updated rows
  partition by (q qq)
  dimension by (1 rn)
  measures(col2,col3,amount,to_date( substr(q,1,4)||'-01-01','yyyy-mm-dd') dt, case when substr(q,-1)=1 then 1
                                    when substr(q,-1)=2 then 4
                                    when substr(q,-1)=3 then 7 
                                    else 10 end  start_month ,
                                    case when substr(q,-1)=1 then 3
                                    when substr(q,-1)=2 then 6
                                    when substr(q,-1)=3 then 9 
                                    else 12 end  end_month  )
  (dt[ for rn from start_month[1] to end_month[1] increment 1]=add_months(dt[1],cv(rn)-1),
  col2[ for rn from start_month[1] to end_month[1] increment 1]=col2[1] ,
  col3[ for rn from start_month[1] to end_month[1] increment 1]=col3[1],
  amount[ for rn from start_month[1] to end_month[1] increment 1]=case when cv(rn)=start_month[1] then amount[1]
                                                                       else 0 end )
  order by qq,rn;
DT             COL2       COL3     AMOUNT
jan-2009         22         33        100
feb-2009         22         33          0
mar-2009         22         33          0
apr-2009         55         66        200
may-2009         55         66          0
jun-2009         55         66          0
jul-2009         66         88        300
aug-2009         66         88          0
sep-2009         66         88          0
oct-2009         77         99        400
nov-2009         77         99          0
dec-2009         77         99          0
jan-2010         99         11        500
feb-2010         99         11          0
mar-2010         99         11          0
15 rows selected.

Similar Messages

  • Changing from quarterly to monthly 'whole bill DD'...

    I currently pay by quarterly 'whole bill direct debit', and just pay the standard £11.54 a month (I only use the line for my broadband, I use my mobile for calls). I want to pay monthly instead, but still want it to be the whole bill DD rather than just setting up a fixed monthly payment plan, and it is not giving me the option to do this online. The help section mentions the option of a monthly whole bill DD, so I don't know why it doesn't offer it to me.
    My next bill is due out in a few weeks (I've already paid up until 11th August) but I have a credit of about £22 on my account due to a billing error last time. If another quarterly bill is produced I'll only owe about £13 for August-November's line rental, which is fine, but I'd rather get the monthly bills set up now if I can. Hopefully this will give me a zero balance on my next bill, a very small balance to pay on September's bill and then the normal monthly line rental will start from October onwards.
    How can I set this up? I also want to change the DD date to the 1st of the month in line with my other bills, because at the moment it comes off around the 27th, which isn't too bad for the quarterly DD but will be a bit of a pain for the monthly one. It'll let me specify the payment date if I set up a monthly payment plan, but I don't remember being given an option for the whole bill DD.

    Hi EHL123 and welcome to the forum!
    The Quarterly DD you are on at the minute is known as whole bill DD,you can change to standard monthly DD but this also means going to monthly billing aswell.
    Also you cannot choose what day the payment is taken on a standard monthly/Quarterly DD.
    If you choose MPP then you will receive your bill every Quarter but your payments will be taken monthly on the day you choose this option may be best for you if your payments never exceed 11.54.
    I have checked my own account and cannot see a option to change this either so give BT a call on 0800 800 150 and they can change/setup the required method.
    Inherent omniscience - the ability to know anything that one chooses to know and can be known

  • Change quarterly quotas to monthly in SAP Pipeline Manager

    Hello
    Is it possible to change quarterly quotas to monthly quotas in the SAP Pipeline Performance Management CRM module without using ABAP code? I have been looking for a solution but I can't find anything.
    Regards

    Although the path vary between release - webservices for Solution Manager are usually available in transaction SICF
    under the following path
                     /default_host/sap/bc/solman                      
                     /default_host/sap/bc/bsp/sap/solutionmanager  
    However I am not aware of an webservice/interface from CHARM to 3rd party service desk products
    What is provided as of Solman 7 is an interface between SAP Service Desk and other 3rd party service desk products
    - so if you setup Solution Manager Service Desk you can have a business process from
    Openview ---> SAP Service Desk ---> SAP Charm
    Best wishes
    Stuart

  • Change the way month or year page flips in Lion?

    As nits go, this is pretty nitty :-) In Lion, iCal changed the way month (and year) views changed the way they moved. Instead of just a straight transition to the next month or year, some wise guy decided to transition with a lovely (not) animation that sets off my vertigo whenever the darn page moves from month to month.
    Is there a way to revert to the previous behavior without any animation? I want a straight transition, with no flipping. I would love a classic view of iCal. I realize I am a traditionalist, a Luddite, if you will, but I dislike the colors and the current UI. I had more control over what I saw with the old iCal. I have less control now. I really dislike animation I can't control. Anyone know what I can do about that?
    Thanks, Johanna

    Those dates are read from the Capture Date filed that is in the acutal file. You can make the changes you want if you export those files to a folder on the desktop, run a 3rd party application on them and then reimport into iPhoto. Then delete the original, bad dated files.
    The application that I use to batch change the dates is PhotoInfo. It will allow you to change any one or more of the date and time values by a given amount.

  • Goods Issue after STO warning "Price change of  % in month / for mater"

    Dear all,
    This is my process for Inter-co plant stock transfer:
    1. Create STO via ME21N
    2. Raise Goods Issue from source plant via MIGO_GI
    3. I get this warning message "Price change of  % in month / for mater", details as below:
    Price change of  % in month / for material
    Message no. M7306
    Due to action taken the quantity and value of the material  are changed. This leads to calculation of a new moving average price: The new price deviates from the old one by .
    Procedure
    Before you carry out the posting, you should determine the reason for this difference.
    You could check the material line items to find out which postings have led to the current moving average price. If the action taken refers to a purchase order, you could contact Purchasing to find out whether a mistake was made when entering the order price.
    Has anyone seen this before and what should be the cause of action? Well, I was still able to proceed with the GI successfully but I'd like to know what has caused the message?
    Thanks.
    Steven

    Hi Manohar,
    My previous stock was 0.
    So i received material  100 qty at 20 INR.
    Total stock value = 2000
    Now as per you:
    2000 / ( 0 *6) * 100   =    33.33
    I am not getting 390,17 %
    Utsav

  • IPhoto 09/ SL Crashes every time I change number of months

    I am creating a calendar and wanted to change number of months from 12 to , say 14. iPhoto crashes every time.
    I have of course submitted crash reports.
    Any workarounds apart from starting from scratch?

    One thing to always try is renewing the iPhoto preference file - quit iPhoto and delete the preference file -- "your user name" ==> library ==> preferences ==> com.apple.iPhoto.plist -- restart your system and launch iPhoto - reset any user preferences you have changed and reset any personal preferences you have changed and if you have moved the iPhoto library repoint to it
    LN

  • To retrieve SCC4 changes for a month

    Hi,
    We need to retrieve SCC4 changes for every month.
    For this, we will have to run program RSVTPROT for table T000. Since we need this data on 1st calendar day of every month, we are scheduling a monthly job for the same.
    We are facing problem while giving 'variant' for this job. Our requirement is that the report should run against a dynamic variant where the SCC4 changes for the past month is retrieved. While creating this variant we can give a particular time period only.
    Please advise.
    Is there any way we can create such a variant or we will have to schedule a job manually on every last day of the month with a new variant for that time period.

    You can use selection variables which dynamically calculate the FROM and TO dates based on the current data or an option such as "First day of the previous month" etc.
    I don't see any problem, except that this is not specifically security related. Perhaps a "Did not read the documentation forum" is needed for it...
    Cheers,
    Julius

  • Changing Plans Mid-Month

    Is it possible to change my $35 prepaid plan to a $50 prepaid plan in the middle of the month and only pay the difference of $15?

        Surfratgary,
    Great question. I would love for you to get the correct answer on that. You are able to reach out to our pre pay department by dialing 888-294-6804 or dial *611 from your mobile device. We have representatives that are ready to take your call and answer any questions that you might have 24 hours a day, 7 days a week.
    KevinR_VZW
    Please follow us on Twitter @VZWSupport

  • Changing Plan Mid-month "pro-rated" unclear and deceptive practice. C.S. offers no help

    I recently found myself having to up my plan minutes for a family emergency. I went online and checked my usage I was at 394 minutes out of a 450 minute plan, so I elected to switch to the 900 plan minute for the month, ancipating I would go over in the next week. I was given options to back date it  or start on that day, as I had clearly not gone over my alloted minutes, I chose to start it as of that day.
    My Bill came and I received 69 dollars in minute overages. How was this explained, that by prorating the bill, they divide the cylcel in half, not only by "dollars" which seemed to be the explantion I received online, but by minutes. SO my minute alotment of 450 was reduced to 240 for those two weeks I oriignally had 450 minutes in. They billed as if that was my allowance therefore saying I now went over my plan by 154 minute which I was billed to the tune of 69.00 dollars, plus the addition of the monthly increase in plan.
    My question to any logical rational intelligent person would be, why would someone choose to up there minute plan, before they went over, just to then be charged for minutes they would not have been had they not upped there plan to the next level. This defies common sense and any explanation would as well.
    Customer service sadly would not even hear or understand this, only to say this is a valid "cost" and I should have read the "disclosure" statement or called if I had questions and not use online services. I asked both the operator and a supervisor for the terms of the disclosure agrement and neither could tell me what it said. However in reading  billing question answers they respond "For example, if you changed rate plans during the middle of your billing cycle, your statement should contain a charge for the old rate plan (according to the number of days in your cycle that you were on the old rate plan) and the new rate plan. " yes that makes sense but no where does it say your minutes may be reduced up until this point and you may occur additional charges not already used. by ironically "increasing your minute plan".
    I am waiting for a manager to return my call,  As a long time customer of verizon whom have promoted them and the new iphone all over facebook and such to my friends I am very discouraged by this practice, and the lack of resolve.

    Mike I appreciate that at least you are familiar with what the disclosure statement says, despite othert reps not being able to recite it. However the term "may" be in inself is Misleading, if "airtime" is  prorated the statement should read "YOUR airtime MINUTES will be prorated and reduced to this point, possibly resulting in overages and additional charges" The wording is intentionally misleading. If it weren't MIke, why would anyone KNowingly select an option that would then cause them to  owe an additional 69.00 dollars they didnt owe at the time, when UPPING their PLAN?
    The fact that Customer Service Can't see that as a very real possiblity and just is dissmisive saying You should have read the disclosure statement., and it is a valid charge tells, me they run into this frequently and they have a script to read from to cover themselves, leaving the HUman Element out of the equation. It is sad enough I had to Up my plan only temporarily while dealing with a tragic family situation, to add insult to injury. To me the term "may" be prorated and "may" result in additional overages meant, that if I had gone over my minutes prior to the change I would be charged, because MIKE that is COMMON SENSE. and a REASONABLE person May think that. Cutomer Service Reps could at least acknowledge that as a very real Understanding of how that line could be interupted, and that a reasonable person would not otherwise increase their plan only to be charge for something they would not have otherwise been charged.
    I am almost positive in the Future this wording will be Changed after the continued Myriad of complaints. From what I already understand the new "changing minutes and not plan" option already has changed it. SO why not make things right for long time loyal customers now. I actually want to reduce my plan back down now as it was a temporary emergency however I DONT dare do it mid month again, SO I will wait another 2 weeks and pay even more.
    This is NOT ME and my misunderstanding, just googling the topic comes up with tons and tons of complaints, articles written on the topic and so fourth. I have been waiting days for someone as promised to call me back as well and that hasnt happened. I have talked to so many friends about this many verizon customers and all say this can't be right, because it DOESNT MAKE SENSE, despite it being "valid" as you say.

  • Statistic report with figures that will not change when rerun months later

    Hi,
    Is there any good practices that we can follow to create statistic reports with figures that will not change even when rerun after few months later?
    My scenario is my statistic report is generated based on data that is "alive" which means the record will get change after a period of time. So, if you generate the statistic report in for January 2006 in the month of January and regenerate in May for the January 2006 statistic, the figure is different. But what I want is to be able to get the same figures.
    I know in this case looks like we need some sort of summary tables, so posting this to get advice on the best way to design such summary tables. Please comment if there is other ways of doing it.
    Summary tables may work for statistic report, but how to support detail report listing where the records are required to be the same when it was generated few months ago.
    Please advise.
    Thank you.

    What happens, when you execute a report today is the following: a select statement is fired at the data base and the result set is displayed in the report. The data can change after the moment you launched your report. What you could do to keep the result set the same, is implementing a user parameter that fills your date discriminator.

  • How do I change products on monthly payments ie. Muse to Fireworks ?

    I have Muse on monthly payments and found I don't need it, I would like to use Fireworks instead. How can I change it ?

    You have purchased the muse subscription on September6th 2014, you need to get it cancelled & refunded, you can buy the desired CC then.
    In case you need any assistance in cancellation & refund, please feel free to inbox me privately, I can get it done for you.
    Regards
    Rajshree

  • Calc Status doesn't change on Prior Months...

    After I load metadata I "consolidate all with data" for December of a given year. Once this consolidation is finished the Calc Status of Dec is "OK" but when I look at any Prior Month within the same year the Calc Status is "OK SC" It is my understanding that consolidating any given month would consolidate all prior periods within the same Scenario/Year. Is there a way to fix this so the prior periods are consolidated as well?

    It would consolidate prior months if there was some change in the data for those months. Here, you have changed metadata therefore the status is "OK SC" which means that it is calculated/consolidated but there is a System Change (SC) since the last calculation/consolidation. HFM has no way to know whether you wanted to keep the calculations according to the previous version of your rules, so it does not execute consolidation for those periods. Bare in mind that rules may change from period to period due to changes in regulation (or more generally in the client's business needs) in contrast to the reason that the system is not yet finalized, which is probably your case at hand. In this case you must manually execute the consolidation for those periods.

  • Consolidation on Quarterly and Monthly Frequency

    Hi Team,
    Can you suggest how to go about consolidation scenario, which has monthly and quarterly consolidation frequency. The scenario is whole group is consolidated on quarterly basis and sub group wants to be consolidated on monthly basis.
    Thanks in advance
    Regards
    Sreedhar

    In this case it may be necessary to consolidate all on a monthly basis.
    The tasks may differ between monthly and quarterly consolidation, but I am not aware of a way to consolidate different cons groups monthly and others only quarterly.

  • Find Change number to month?

    I've a bunch of dates like: 9/27, 10/15, etc., is there a way to replace the first (month) number to the abbreviated month followed by a hyphen then keep the date after the slash, that is; Sep-27, Oct-15...?
    TIA,
    Geoff

    Are you sure you put it into the GREP search panel, not the regular TEXT one?
    (I just tried, and it did work as I expected.)
    And just because I felt like it -- and have the time --: this one
    \b1/(?=(\d|[1|2]\d|3[01])\b)
    will find 1/1 to 1/31 but never 1/32 or beyond.
    Also (still some time left): this Javascript will find and change all valid dates but leave invalid ones as they are (30 Feb, 31 April, etc.):
    var months = { Jan:31, Feb:28, Mar:31, Apr:30, May:31, Jun:30, Jul:31, Aug:31, Sep:30, Oct:31, Nov:30, Dec:31 };
    app.findGrepPreferences = null;
    app.changeGrepPreferences = null;
    c = 1;
    for (a in months)
         switch (months[a])
              case 28: app.findGrepPreferences.findWhat = "\\b"+c+"/(?=([1-9]|1\\d|2[0-8])\\b)"; break;
              case 30: app.findGrepPreferences.findWhat = "\\b"+c+"/(?=([1-9]|[1|2]\\d|3[0])\\b)"; break;
              case 31: app.findGrepPreferences.findWhat = "\\b"+c+"/(?=([1-9]|[1|2]\\d|3[01])\\b)"; break;
         app.changeGrepPreferences.changeTo = a+"-";
         app.activeDocument.changeGrep();
         c++;

  • I do not understand the change to my monthly billi...

    This quarters bill was about £120 following a credit from the previous month of roughly £17. My phone usage is lower than ever with only a £1 worth of phone calls since the 23rd of December yet at the same time I have been asked to pay £192 this quarter. This will leave me with a credit of about £70 yet at the same time I was informed in December by BT staff that I would only be paying £44 a month. I have phoned bt and the telesales staff seem to be suggesting that I need to generate a credit on my account that is equivalent to the bill when it is issued. I do not understand this at all. When I agreed to a Monthly payment plan I was informed that all I would have to do was pay the debit owing every quarter and not have to seek to pay more to create a situation where my account is constantly in credit. Admittedly my patience is dwindling as I cannot understand why this is the case yet at the same time I have had staff refuse to clarify things for me. 

    Without details of how your bill is made up it's not possible to give precise advice, but problems of this nature often arise from a misunderstanding of how MPP works. That's not surprising since the call centre agents regularly seem to give inadequate or misleading advice.
    The monthly payment is calculated on the basis of any outstanding debit plus forward charges for the next quarter. It's not absolutely clear how BT arrive at the actual figure, but it's based on 6-monthly reviews. Here's a hypothetical calculation:
    Basic charges including line rental £40; approximate extras (eg call charges) £5; outstanding debit on last bill £30. Monthly payment will be (£40 + £5) x 6 = £270 + £30 = £300 ÷ 6 = £50. The effect is to recover the debit over the 6 months, resulting in a balance of roughly zero. Then the monthly payment can be adjusted again to align with the actual expected monthly cost.
    When my account fell behind due to one-off charges for new services, I adjsted the monthly payment myself in MyBT to bring the next bill to about zero. Then I adjusted it again to equal basic charges plus a bit for extras. The result has been that each of my bills since have been a pound or two either side of zero.
    Hope that helps. If you're still in doubt can you post the essential figures?
    You can click the white star next to this message if you think it was helpful.

Maybe you are looking for

  • How do I open up more room on my MacBook Pro?

    Getting notice that my disc is full and can no longer save anything so I need to open up some for room, in my download file, what can I delete, for example music, if I've added them to my iTunes can I delete them from my Download file? What other way

  • How do i set artist info on my movies?

    Since itunes 12, i cannot update ANY ACTUAL useful fields on my home movies, downloaded video tutorials, or generally ANYTHING ACTUALLY FUNCTIONAL for the movie/home video functions! *** did you do Apple?

  • Explain the logic in the code

    HI all, Can anyone explain the logic in the code ? This is to display the pages numbers in page 1 of 4                                                          page 2 of 4 format. i got this code in one of the forum. if the lineno is less then 64, th

  • Apple doesn't allow Mail users to open links with Chrome

    Apple doesn't allow Mail users to open links with Chrome, Chrome is the deafult browser and it seems that there is a blockage for 3rd party browser, not very nice !!!!!!

  • MacBook Pro will not detect displays. . .

    I found this link, and it best discribes what is happening on my macbook. I have a thunderbolt to cdmi cord that I use on my TV. Then all of a sudden, it just stopped working. . . My screen flashes black for about a second like its about to connect t