Baseline calculation

Hi all ,
I have a table that holds data about dates ..
Table :
MonthYear
2011/12
2011/01
2010/08
I need to get the baseline of each row as below
Baseline
2011/06
2010/07
2010/02
ie Baseline=Monthyear - 6 months
Create table mon(monthyear date);
I am using Oracle 11g
select monthyear-6 as baseline from mon;
I used the above query but I think days are getting subtracted .
Please Help
Regards,
Sana .

Hi, Sana,
If monthyear is a DATE, then just use ADD_MONTHS:
SELECT     monthyear
,     ADD_MONTHS (monthyear, -6)
FROM     table_x
;Information about dates belongs in a DATE column, even if you're only interested in the year and month.
If monthyear is a VARCHAR2, then use TO_DATE to create a DATE from it, and then use TO_CHAR to convert it back, if necessary:
SELECT     monthyear
,     TO_CHAR ( ADD_MONTHS ( TO_DATE (monthyear, 'YYYY/MM')
                      , -6
          , 'YYYY/MM'
          )          AS baseline
FROM     table_x
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using.
Edited by: Frank Kulash on Feb 24, 2012 10:03 AM

Similar Messages

  • FI posting baseline calculation is wrong.

    HI expart.
    in userexit_fill_xkomk1how to imlplennt for sap note -112385 for baseline calculation is wrong.
    What i will do for baseline calulation is coming as creation date.
    Thanks
    Dhirendra.

    Hi,
    By any chance, did the user enter march date in FB08 screen ?
    Best Regards,
    Madhu

  • CCMS threshold Value baseline calculation

    Hi Guys,
    I am looking CCMS threshold value baseline calculation for ECC, BW, XI, SRM, CRM, APO & Solman systems. Many portals are provided the description of each MTE class , but not provided baseline calculation.
    Please let us know some expertise advice
    Thanks.
    Manjunath

    Dear. Marc P. Gilomen.
    I totally understand what you are written above.
    The threshold value shouldn't be changed until I change the rule related to the product.
    However, after I changed the rule, I have expected the threshold value should be changed according to the rule.
    But, it's not.
    This is the point.
    After I change the rule, for example 35% to 45%, the threshold value of GTS preference determination transaction '/SAPSLL/PRECA01' is changed. But, The replicated sales order's threshold value is not changed. And delivery, billing is the same with salesorder also.
    It's not changed whatever I do.
    So, I want to solve this problem. But until now, I didn't find the answer.
    Thank you for reading.
    Best regards,
    Jong Hwan

  • New payment terms with Due December 15th 2011

    Dear All,
    My business requirement is to create new payment terms with due date upto December 15th 2011 from the using of that payment terms,
    Please suggest the step by step to create this kind of payment terms,
    Thanks in advance,
    Sridhar

    Dear Sridhar Alleni,
    For your requirement, i strongly feel that we will have to use more than one payment term.
    Make following payment terms
    (CLICK ON NEW ENTRIES OR COPY EXISTING PAYMENT TERMS AND MAINTAIN THE SETTINGS AS MENTIONED BELOW.)
    PAYMENT TERM Z001 -  DESCRIPTION : JULY TO DEC
    Baseline calculation date
    Fixed day : 15
    Additional months : 5
    Z002 - AUG TO DEC
    Baseline calculation date
    Fixed day : 15
    Additional months : 4
    Z003 - SEPT TO DEC
    Baseline calculation date
    Fixed day : 15
    Additional months : 3
    Z004 - OCT TO DEC
    Baseline calculation date
    Fixed day : 15
    Additional months : 2
    Z005 - NOV TO DEC
    Baseline calculation date
    Fixed day : 15
    Additional months : 1
    Z006 - DEC TO DEC MID
    Baseline calculation date
    Fixed day : 15
    Additional months : 0
    Instruct the users/business to use the corresponding payment term during each month.
    i.e, If its oct month, ask them to use Z004 and likewise.
    Please check and revert back.
    Also if you are able to solve this in someother way, please update.
    Thanks & Regards,
    Hegal K Charles

  • Baseline date calculation

    Hi,
    We have a requirement to exclude non-Business days while calculating Baseline date(for the Accounting Document created on saving the Billing document)
    Currently the Baseline Date being populated in the Accounting Document is Document date + 5days(including Holidays).
    For eg
    Current Scenario
    Document Date: 12th Feb 2008
    Baseline date: 17th feb 2008.
    Requirement:
    Document Date: 12th Feb 2008
    Baseline date: 19th feb 2008(Excluding Sat & Sun).
    Request you to share useful info in this regard.
    Thanks
    Binu

    Hi,
    Use user exit RV60FUS5 for these base line date calculations.
    Thanks
    Krishna.

  • Baseline date calculation excluding non-Business days

    Hi,
    We have a requirement to exclude non-Business days while calculating Baseline date.
    Currently the Baseline Date being populated in the Accounting Document is Document date + 5days(including Holidays).
    For eg
    Current Scenario
    Document Date: 12th Feb 2008
    Baseline date: 17th feb 2008.
    Requirement:
    Document Date: 12th Feb 2008
    Baseline date: 19th feb 2008(Excluding Sat & Sun).
    Request you to share useful info in this regard.
    Thanks
    Binu

    Hi,
    Use user exit RV60FUS5 for these base line date calculations.
    Thanks
    Krishna.

  • Baseline date calculation in Invoice verification (MIRO)

    Dear experts,
    I need to set baseline date after 40 days from document date in MIRO.
    Baseline date calculation of "Terms of Payment" in IMG has two parameters:
      ・Fixed day
      ・Additional months
    We cannot set 40 days in these parameters.
    Can anybody tell me how to set baseline date not month but date(not fixed day) ?
    Please advise me on the settings SPRO>MM>Purchasing>Vendor Master>Define terms of Payment.
    Thanks & Regards
    Ken

    Hi,
    You can't do this.
    The baseline date is the date on which the calculations are made.
    So if you have 40 days to pay, this will be 40 days from the baseline date.
    This will either be the document date or another date, but you can't (in standard SAP) have the baseline date as "X" days after "Y".
    So the baseline date is the date of an event (e.g. the date that the Invoice was posted) not a calculation.
    Is it possible that you have misunderstood the use of this date?
    If you just want to ensure that the payment date is 40 days after invoice recipt, then set you just have to enter the number of days in the payment terms and the baseline date stays as the invoice date (etc.)
    Steve B

  • Baseline Date for Due Date Calculation required for S/L indicators

    Hello,
    Iu2019m facing the following problem
    Iu2019m trying to insert an invoice (using a customer master record) but the system blocks me because the field ZFBDT (Baseline Date for Due Date Calculation) is a Required entry.
    The strange thing is  that if I use a S/L indicators the field is mandatory, if not the date may be defaulted.
    I checked in OB41 but there are non differences between Special PK and normal PK.
    Any ideas?
    Thanks in advance
    Alberto

    Dear Alberto,
    the field "Due On (BSEG-ZFBDT)" cannot be controlled with field status.
    It is controlled by field attribute of screen painter (Tcd: SE51).  If
    you look at element attribute for "Due On" field, a flag for required
    entry is activated.  In this case, field status has no control over
    the field.
    As of release 3.1G, field BSEG-ZFBDT is hardcoded in most FI screens
    to be mandatory and cannot be influenced by any field status
    changes. This situation is only valid when posting with special G/L
    indicator (ie PK 29/39).
    SAP development team has determined that this is a critical field.  The
    reason behind this is that this special GL screen and the data entered
    here are very important to many other programs. This data affects
    liabilities and receivables where due date is necessary almost
    everytime. Thus, we changed this field in this screen in order to
    prevent problems in many other areas. The reason is explained further
    in note 95079.
    I hope this helps You.
    mauri

  • Baseline Duration custom field not calculating duration properly

    Hi,
    I am using MS Project server 2010. In it, I created one custom field named 'Baseline_Duration' similar to 'Baseline Duration' & applied the formula 'ProjDateDiff([Baseline Start], [Baseline Finish], "Standard")'. In Baseline_Duration
    & Baseline Duration columns, values should be same. But for some tasks, values in Baseline_Duration column is different from Baseline Duration column, & for other tasks, both are same.
    Please suggest me why values in both columns are different for some tasks?
    Thanks & Regards Pradeep Gangwar

    Pradeep,
    It sounds like the issue might be within the setting for that 'Baseline_Duration' field and calculations
    for summary rows.
    In cases where Baseline Duration was saved for individual tasks without rolling up to summaries rows - you may have deviations. Applying "Use Formula"
    for summary rows should do the trick.
    Regards,
    Alex

  • Calculation of FontFamily.Baseline in WPF

    Hi,
    I'm trying to reproduce in WPF the behavior of a Silverlight TextBlock, but the baseLineOffset is giving me problems.
    The formula used by Silverlight looks quite easy:
    max height of the characters in the font (aka Win Ascent) / Units per em * font size.
    For example the Arial font have a Win Ascent of 1854 and is defined at 2048 units per em. So for a FontSize of 1 I get
    1 * 1854 /2048 = 0.9053
    But in WPF for the Arial font the FontFamily.Baseline is 0.9217
    "Magically" in WPF the Arial font have an Ascent of 0.9053, but it doesn't work for all fonts. For example I'm often using a font called Tina Black.
    In Silverlight it's BaseLineOffset is calculated as 1 * 800 / 1000 = 0.8
    In WPF the FontFamily.Baseline is 0.8 also but the Ascent is 0.921875
    Another example with the font "Salsbury" :
    In Silverlight it's BaseLineOffset is calculated as 1 * 957 / 1000 = 0.957
    In WPF the FontFamily.Baseline is 0.9706 and the Ascent is 0.921875
    So my question is : What is the formula to calculate FontFamily.Baseline in WPF and/or calculate the BaseLineOffset found in Silvrlight ?
    Thanks for your help.

    Hello Sovitec,
    Since .NET is now open source we can search for the result from this site:
    http://referencesource.microsoft.com/
    So when searching for FontFamily.Baseline
    We can see this property:
    /// <summary>
    /// Distance from character cell top to English baseline relative to em size.
    /// </summary>
    public double Baseline
    get
    return FirstFontFamily.BaselineDesign;
    set
    VerifyMutable().SetBaseline(value);
    And for BaselineDesign, we can see some related code and I think you can take them as your reference, for example:
    /// <summary>
    /// Distance from character cell top to English baseline relative to em size.
    /// </summary>
    public double Baseline(double emSize, double toReal, double pixelsPerDip, TextFormattingMode textFormattingMode)
    if (textFormattingMode == TextFormattingMode.Ideal)
    return ((IFontFamily)this).BaselineDesign * emSize;
    else
    // If the composite font has a pre specified Baseline then we respect it in calculating the
    // baseline but we round it since Compatible metrics are pixel aligned.
    if (_fontInfo.Baseline != 0)
    return Math.Round(_fontInfo.Baseline * emSize);
    // If the composite font has no specifed Baseline then we get the compatible font metrics of the
    // first fontfamily in the composite font.
    else
    return GetFirstFontFamily().Baseline(emSize, toReal, pixelsPerDip, textFormattingMode);
    http://referencesource.microsoft.com/#PresentationCore/Core/CSharp/MS/Internal/Shaping/CompositeFontFamily.cs,177
    But actually I think you may interested in the formula about FormattedText.Baseline:
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/4ea51d1b-84fb-42d3-ada3-afb776bd38d9/how-to-determine-the-baseline-of-a-formattedtext-object?forum=wpf
    Best regards,
    Barry
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Bapi_acc_document post is not calculating baseline date based pymnt terms

    Hello friends,
    Im using bapi_acc_document_post to post db and cr note and i m passing payment terms in the input file but the bapi is not calculating baseline date .
    pleasee let me knw the solution.
    Regards,
    Sunny

    that's the disadvantage of bapis and direct input in opposite to BDC. So use "old" rfbibl00 with batch input!
    A.

  • Payment terms - Baseline date calculation.

    Hi
    In payment terms configuration, we have option "No Default" for determining Base line date.
    If we have payment terms with above configuration.......
    In Fi, Baseline field will be blank while posing Customer Invoice, in which case We can enter baseline date manually. However If Invoice is generated from SD-billing document, we dont have any field "Baseline date" while posting billing doc. In such case how system determines Baseline date. When I checked few billing documents, Baseline date is defaulted with BIlling date even "No default" option is selected.
    Is there any configuration in SD that prompts this action. or is it always billing date is defaulted ?
    Please clarify

    Hi !! Madhu,
    There is a way, but not exactly what u require! You can check while maintaining the condition records in t.code VK12, observe the last two columns available, one is called a 'Fixed Value date' & the other is called 'Add Val Days'.
    If you make any entry in the field 'Fixed Value date' this will be the date from which the payment terms start taking effects. Or if you make an entry in Add Val Days' in this case the payment terms start taking effect from billing date + the no. of days mentioned in this column.
    You cannot make a entry in both 'fixed value date' & 'Add Val date'  fields at one time.
    Give your feedback if this has worked for you.
    Regards,
    PATHIK

  • Baseline date calculation from the terms of condition

    Dear,
    I need to calculate baseline date from the delivery date of the last consignment date of the GR. It means if there are 3 goods receipts for the purchase order then the due date should be = Last GR date + number of days in the terms of payment.
    Is it possible in Standard SAP? I have tried using the Base line date and document date in the terms of payment. It is not working
    Please help

    Hi,
    This requirement can't be fulfilled in standard SAP. Give logic coding in the program and can print the document for only sales order and not for cost center and Asset. You can custamize interactive report according to your requirement.Give the inputs to ABAPer and get it done. I hope this will help you. Thanking you.

  • The difference between how PV is calculated if lag or delay is used in scheduling

    When scheduling tasks, it is possible to add lag from the predecessor (which is useful for an amount of time which must pass before the next task (paint drying, for example), or to add delay (task form\schedule\delay).  Delay seems to be useful for
    adding slack into your project in planning, as it is time that could pass before the next task, but doesn't necessarily have to.
    First - do I have this assessment correct?
    Second - does MSP calculate PV based upon when tasks appear in the schedule regardless of whether they are there due to lag or delay, or do tasks presented with delay assume that they will start straight away, without the delay?
    An aside - the reason that I've been playing with this is because of a bug in the previous version of MSP where an EV graph could not be generated if EV was calculated using physical % complete.  Has this been fixed in MSP 2013?
    Thanks for your help!

    First, the lag (and not delay) in the task form is to be entered in the Predecessors/successors form and not the schedule form. The delay in the schedule form is the delay on an assignment, meaning the delay a resource has on a assignment. And indeed it
    is not required but just an option given to the scheduler.
    The PV (or
    BCWS) is calculated based on this formula:
    timephased baseline costs of the task up to the status date. The lag just implies that the task will occur later in the project, thus the PV will take into account the lag.
    AS per the bug, I couldn't experience it, thus I'll let you or others folks give a feedback on it.
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • Cash Discount Calculated for One Line Item and not for Other

    Hi All,
    We have devloped a Z program which is used to Write of InterCompany AR and AP recon Account to another GL Account. In this program to clear line item we have created a BDC which calls t-code FB05. Thsi program is running perfectly fine for all company codes.
    There is new company code SG20 for which it is not clearing the line items. It has created a Session in SM35, when we analysed the seesin we found that for some line items system is calculating Cash Discount and for some other line items it is not but the payment Term is same for all the douments with 3% 14days.
    I need your help in understanding that why for some line items system calculates the Cash Discout where as for others it is not calculation..also the Posting Date is same for all the documents.
    Please advise what could be the reson for this.
    Thanks!
    Regards,
    VIvek Srivastava

    Hi
    Cash discount is calculated based on the combination of baseline date and payment term conditions.
    Hence please check the baseline date for all the documents, in which the cash discount is not appearing.
    In your case, the possible reasons could be that 1) baseline date is different between these documents or 2) payment terms cash % is manually modified in the line item of the documents.
    Regards

Maybe you are looking for

  • Is it possible to have a oversea's number which ca...

    I need to set up a skpe phone number for an oversea's country but it then needs to be answered in the UK which out the caller knowing - is this possible and if so how do i go about doing it

  • ClamAV version conflict

    Has anybody else noticed, after using Alex's OS X TopicDesk tutorial, issues w/ the Apple-installed ClamAV and the updated ClamAV competing? I have set the Apple-installed version not to launch via the command: launchctl unload -w /System/Library/Lau

  • ~ javax.ejb.ObjectNotFoundException: no such entity ~

    Hi all, When I deploy my own app into OC4J, the cmp beans get deployed properly (w/o any error messages). But when the client tries to access the bean through the findByPrimaryKey method the following exception is prompted: javax.ejb.ObjectNotFoundEx

  • Cant fix these errors!

    Could someone please help me out in figuring what I am doing wrong to keep getting these errors? Here is some of my code and the errors that I have been working on the past few days and unable to figure out: import java.io.*; import java.text.Decimal

  • Proxy Rotator

    In my bash scripts I am able to cycle through proxies with something simple like: for line in $(cat $PROXY) do export http_proxy="http://$line" However, this type of loop will freeze the script if any of the proxies go off. Is there a proxy rotator p