Calculate a value for the years annually or monthly or quarterly

Hi gurus -.

I have a requirement to divide a given sum monthly/quarterly/annually in recent years, based on the date of departure. So I need the logic of pl/sql to achieve it. Please help me and let me know if the questions.

Here is my example:

Let's say amount = 240, date start = January 1, 2013, term = quarterly or annually / monthly, years = 5 years (so now I need to calculate the amount for five years from January 1, 2013 to 31 December 2017 and the output should like below)

MonthMonthly amountAmount quarterlyAnnually the amount
January 1, 132060240
February 1, 1320
March 1st, 1320
April 1, 132060
May 1, 1320
1 June 1320
July 1, 132060
1 Aug 1320
1-13-seven20
October 1, 132060
November 1, 1320
1st December 1320
1 January 142060240
February 1, 1420
March 1, 1420
1 April 142060
May 1, 1420
June 1, 1420
July 1, 142060
August 1, 1420
1 sep-1420
1st October 142060
November 1, 1420
1 December 1420

Thank you very much!!!

Hello

Maybe something like this:

WITH bs AS

(

SELECT 240 * 5 AS amt

, TO_DATE (JANUARY 1, 2013"

"LUN-DD-YYYY".

) AS special and differential treatment

12 * 5 AS total_payments

9 AS first_group

12 AS cycle_length

OF the double

)

SELECT TO_CHAR (ADD_MONTHS (special and differential treatment, level - 1)

"LUN-DD-YYYY".

) AS mnth

CASE

WHEN MOD (FLOOR - 1, cycle_length) = 0

THEN the LEAST (first_group

total_payments + 1 - LEVEL

) * amt / total_payments

WHEN MOD (FLOOR - 1, cycle_length) > = first_group

CAN amt / total_payments

Payment END AS

BS

CONNECT BY LEVEL<=>

;

Tags: Database

Similar Questions

  • How Iswitch my plan for a single payment for the year, rather than monthly?

    My subscription of the CC is to be renewed. I don't see how to change it for a plan with a payment rather than monthly. Where are these options and prices?

    I signed up for the plan of Ps and Lr.

    Hello

    You will need to contact support by calling/chat for this request.

    Contact the customer service

    * Be sure to stay connected with your Adobe ID before accessing the link above *.

    Kind regards

    Sheena

  • Values written with if &amp; if else for the year

    Hi all

    I am facing a problem with the below mentioned script. Please suggest where I am wrong of personal watercraft

    When I select yest 2010 is working well. But when I enter the data for the year 2011. It's even more written year 2010 "on data of Budget Total.

    Once again, when I erase the data and run new rule shows correct figures. I'm confused, so to get the rule, I need to release twice and run three times in the planning of the data forms.

    I have attached the rules in the planning of the data forms.

    DIFFICULTY (Jan:Dec,"Budget","initial",@DESCENDANTS ('entity', 0), @CHILDREN("New Employees") TBH1:TBH30)

    ('Total employee Budget'
    IF (("Year" == FY10))
    'Total employee Budget' = ("Base salary" + "The additional allocation" + "Social allowance" and "Children's allowances" + "equivalency") * 12.
    ElseIf (("Year" == FY11))
    'Total employee Budget' = ("Base salary" + "Additional Allowancel" + "Social allowance" and "Children's allowances" + "equivalency") * 3;
    ENDIF)
    ENDFIX;




    Concerning
    Krishna

    Two ways to achieve this:

    FIX(Jan:Dec,"Budget","initial",@DESCENDANTS ("Entity",0),@CHILDREN("New Employees") TBH1:TBH30)
    
    "Total Employee Budget"(
    IF (@ISMBR("FY10") )
    "Total Employee Budget"=("Basic Salary""Supplementary Allowance l""Social Allowance""Children Allowance""Pension")*12;
    Elseif(@ISMBR("FY11"))
    "Total Employee Budget"=("Basic Salary""Supplementary Allowancel""Social Allowance""Children Allowance""Pension")*3;
    ENDIF)
    ENDFIX;
    

    or

    FIX(Jan:Dec,"Budget","initial",@DESCENDANTS ("Entity",0),@CHILDREN("New Employees") TBH1:TBH30)
    FIX("FY10")
    "Total Employee Budget"(
    "Total Employee Budget"=("Basic Salary""Supplementary Allowance l""Social Allowance""Children Allowance""Pension")*12;
    )
    ENDFIX
    FIX("FY11")
    "Total Employee Budget"(
    "Total Employee Budget"=("Basic Salary""Supplementary Allowancel""Social Allowance""Children Allowance""Pension")*3;
    )
    ENDFIX
    

    I would go for the first, because it's only a single pass through the data.

    Kind regards

    Cameron Lackpour

  • [ADF, JDev12.1.3] (How to set values for the attributes 1) to create a file and 2) committing to the database?

    Hallo,

    in my tables and forms (created from VO istances) there are some areas for which, insert and update, I calculate and set the value programmatically when a record is created or updated.

    In some cases, I put the necessary values using the 'CreateWithParams' in the workflow diagram...

    In some other ones, I associate an action, a bean, a created button drag-and - drop operation 'CreateWithParams' of the istance VO...

      public String cwpButton_action() {
        BindingContainer bindings = getBindings();
        OperationBinding operationBinding = bindings.getOperationBinding("CreateWithParams");
        // here I calculate and set the needed params
        // ...
        Object result = operationBinding.execute();
        if (!operationBinding.getErrors().isEmpty()) {
          return null;
        }
        return null;
      }
    

    And is ok if I can calculate the values for the attributes before a new record is created.

    But the approach that I have used to define the attributes (for new and updated records) whose value should be caluclated after the user has filled in the fields, before committing to the database?

    Thank you

    Federico

    Federico,

    Let me first tell you that our code is activity masking errors (the cache instead of working on them).

    1. If (! operationBinding.getErrors () .isEmpty ()) {}
    2. Returns a null value.
    3. }
    4. Returns a null value.

    This means that you do not check the errors at all. You must at least print a log with the error message, you receive, if you get one!

    To solve your problem, you override the method prepareForDML() of the entity or entities in question. You can calculate and set the necessary attributes until they get engaged in the doDML(). Do not use doDML() because it is too late in the life cycle.

    Timo

  • Enter the value for the data files:

    Hi all
    I use 10.2.0.1.0
    I have a tablespace "hg" with two data files.
    whenever I use after an order to drop this tablespace I hv asked values for data files
    Welcome is:

    SQL > drop tablespace hg, including content and data files;

    SQL > drop tablespace hg, including content and data files;

    I have two data files to the tablespace named as hg.dbf, hg1.dbf

    now what I hv value to enter? or how to calculate the value.


    Thank you

    Honey says:
    Yes I know its 'AND' but when I using the '&' then oracle asked me of ' enter the values of the data files: "k".
    Please try first, then the calculation of the value.
    It can be a variable binding value.
    If you find the answer please suggest steps

    Simple words, the "DROP TABLESPACE" command does not support '&' character. & is a substitution of placeholder for SQL variable * more.

    Even if you provide the value for the "data files" prompt, the command does not work as it would lead to "drop tablespace including contents tsname *"details of your file *.

  • can I get 50 GB per month pour.99 but instead of monthly payments make one payment for the year?

    can I get 50 GB per month pour.99 but instead of monthly payments make one payment for the year?

    Only by buying a gift card iTunes Store and leaving enough of his balance to pay for storage.

    (138320)

  • Definition of default values for the inputs of button and the cursor?

    Hello

    I use Labview 8.5.1 and have a few entries button and zipper-type on my front. How can I set some of them having specific (as opposed to zero) default values when the VI is executed?

    Thanks for the help

    The default value for the type of slide of entry (or button).

    Right-click on the control.

    Select "Operations on the data" > "default to the current value of doing."

  • How can you specify the default value for the undefined array elements

    According to aid LV, the tables have two default values, the normal default value and the default value for the undefined array elements.

    I assume that there must be a way to specify the default value for later, but I can't find it anywhere.  Any ideas?

    I know that you can drag the item out of the table container.  Change the default value on this scalar element.  Then drag the item in table tank.

  • failed to create value for the message Analyzer "at line 54.

    I get the following error, can someone please?

    failed to create value for the message Analyzer "at line 54.

    Hi ejpeppjep,

    Check if this article helps you fix the problem: http://support.microsoft.com/kb/823768

    If the problem persists, we recommend that you try the following steps and check the result.
    Step 1: a. Click Start, click Run, type cmd and click ok.
    b. at the command prompt, type sfc/scannow and press ENTER.
    c. once the analysis is complete, restart the computer and check if the problem persists.

    Note: You will be asked to insert the Windows XP disk, if a file is missing.

    For more information, see Description of Windows XP System File Checker (Sfc.exe)

    Step 2: If the problem persists, restore the computer to an earlier time
    see How to restore Windows XP to a previous state .

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Search for XP Dskcache.exe tool. All I can find is for the year 2000.

    Search for XP Dskcache.exe tool. All I can find is for the year 2000.

    Hello

    1. were you able to use the Dskcache.exe tool earlier?
    2. did you last changes made on your computer before this problem?
    3. which edition of windows XP you are using?

    You can see the article below which might help you.
    Get the Dskcache.exe tool to configure the Write Cache option "Power Protection.
    http://support.Microsoft.com/kb/811392

  • where can I accept the terms of microsoft for the year, indicating 19 October 2012.

    where can I accept the terms of microsoft for the year, indicating 19 October 2012.

    Where this e-mail, or any other electronic mail, is not genuine - do not click on any of the links it contains.

    - - - - - - -

    Delete this mail.

    These links in the e-mail are not the same for all recipients and thus can confirm your email address to spammers.

    Personally, I think that the email is not authentic because of these custom links.  The privacy statement online MS [one of the supposed links in the email] is actually at a fixed location for each region, such as http://privacy.microsoft.com/en-us/fullnotice.mspx

  • Essbase Warning (1023135) skip certain values for the replication

    Hello

    When you replicate the complete data of a partition Essbase BSO in Essbase ASO (11.1.2.2),
    thousands of warning messages are logged in the application log:

    "Warning (1023135) skip certain values for the replication.

    The partition (data of level 0) valid and the counties of cells in each area are exactly.

    No idea of the possible causes and consequences?

    Thanks for your help.

    Philippe Cuisset

    Hello

    Thanks to the contributors.

    The contours of the source and the corresponding target, with the exception of 3 members with different names in the source and target.
    My score has 2 spaces for these 3 members. Mapping advanced between the names of source and target members has been set in a field, but it was missing in the other (not detected by the validation of the partition!). I don't set it too and now no more warnings.

    Philippe Cuisset

  • When you create a PDF from a scanner, is there a way to set the default value for the size of 8.5 x 11 letter custom every time I make a PDF from a scanner?

    When you create a PDF from a scanner, is there a way to set the default value for the size of 8.5 x 11 letter custom every time I make a PDF from a scanner?

    Hi kevin7frg,

    You can go to "file > create > scanner > configure presets PDF»

    The dialog box that appears, you can choose 8.5 X 11 as the default width and height of PDF pages to scan.

    Hope that helps.

    Kind regards

    Ana Maria

  • I have to cancel my subscription ExportPDF; I was charged for the year ahead, but I don't need.

    I have to cancel my subscription ExportPDF; I was charged for the year ahead, but I don't need.

    Go to Adobe Creative Cloud

    Hi Olga,.

    Please check the help below document:

    ICES.html https://helpx.adobe.com/x-productkb/Policy-Pricing/Cancel-subscription-Acrobat-Online-serv

    Kind regards

    Sheena

  • Hi, I got my subscription for the year running last for Photoshop and Lightroom. Because I had the good idea to download the 2015 CC of Photoshop, I return to the evaluation period. I would like to know, when this period ends, will I get my subscribed v

    Hi, I got my subscription for the year running last for Photoshop and Lightroom. Because I had the good idea to download the version of Photoshop CC 2015 (I thought it was just an update...), I get to the evaluation period.

    I would like to know, when this period expires, will I get my purchased version back or should I get a new subscription?

    If I get a new subscription, one is cancelled automatically, or do I have to do something else?

    Thanks a lot for the answers!

    If you are subscribed to the creative cloud, Creative Cloud 15 updates are included.

    If when you updated, all or part of the CC apps show 'trial start or buy now' in the creative cloud desktop application, please see this link:

    https://helpx.Adobe.com/manage-account-membership/CC-reverts-to-trial.html

Maybe you are looking for