This of calculating a given date + 6 months or any given number

currentdate = document.wk.emp_datejoiningx.value (here the value stored is 08/10/2007)
// This is the Joining Date.
day = parseInt(currentdate.substring(0,2)); (problem here is that here the value is stored as 0)
let me tell you am facing this problem only with 08/10/2007 and 09/10/2007 in rest of the case my value is stored properly in substring
if i put the date as 07/10/2007
day = parseInt(currentdate.substring(0,2)) (value stored here is 7).
Can any one please guide me why this error is.... as this error has to be rectfied ASAP.
regards
sreekant nair

Thank you evnafets
For your educative response, well the problem is resolved 've made small changes in the code.
var delimChar = "/";
var delim1 = currentdate.indexOf(delimChar);
var delim2 = currentdate.lastIndexOf(delimChar);
// This is the Joining Date.
day = parseInt(currentdate.substring(0,delim1),10);
month = parseInt(currentdate.substring(delim1+1,delim2),10);
year = parseInt(currentdate.substring(delim2+1),10);
this has solved the problem of zero.
Am sorry for registering at the wrong forum.
Thank you ev

Similar Messages

  • Max date by month in expression builder

    Hello
    I'd need to create a new logical column and use the expression builder to make this column return only the last day of each month. I know at answers level I can write something like this in the formulas: Max(Date by month). However I can't do that in expression builder as it doesn't like the word 'by'..
    Is there a way to get it done?
    Thanks in advance!

    Hello,
    The max(date) should work in logical layer. As when you pull in month it automatically groups by month.
    thanks,
    deep

  • First Date of the Given date and month

    Hi Evryone,
    I want to extract first day of the given date.
    For Ex: i aam giving date "30-jan-2013" but i want to show "01-jan-2013".
    In Oracle, Trunc function behaving mentioned above. So i need appropriote function in HANA to get the FIRSTDATE....
    I observed HANA Given last_date function but what about First_Date function? can i use it?
    Regards,
    Chandrakanth

    Hi Chandrakanth,
    Did you have a look on this blog:
    SAP HANA: Get the First Date and the Last Date of Month from a Given Date | WuaWua
    There is LAST_DAY in HANA but not FIRST_DAY.
    Since last day of the month may vary but first day of the month will always be '01'. Hence they may not have added that function.
    So either you can follow that approach in the blog or you can simply replace the day '01'.
    Regards,
    Krishna Tangudu

  • Stock report with value and qauntity for given date not month wise

    Hi gems,
    can any body give me the standard report for Stock value and qauntity for given date not month wise at storage location level

    Hi
    check the report S_P00_07000139 with the option inventory and raw material report- detail and selection date (from, to date same). List will give opening & closing balances with goods movment and their values.
    Thanks

  • Dynamic Calc processor cannot lock more than [100] ESM blocks during the calculation, please increase CalcLockBlock setting and then retry(a small data cache setting could also cause this problem, please check the data cache size setting).

    Hi,
    Our Environment is Essbase 11.1.2.2 and working on Essbase EAS and Shared Services components.One of our user tried to run the Cal Script of one Application and faced this error.
    Dynamic Calc processor cannot lock more than [100] ESM blocks during the calculation, please increase CalcLockBlock setting and then retry(a small data cache setting could also cause this problem, please check the data cache size setting).
    I have done some Google and found that we need to add something in Essbase.cfg file like below.
    1012704 Dynamic Calc processor cannot lock more than number ESM blocks during the calculation, please increase CalcLockBlock setting and then retry (a small data cache setting could also cause this problem, please check the data cache size setting).
    Possible Problems
    Analytic Services could not lock enough blocks to perform the calculation.
    Possible Solutions
    Increase the number of blocks that Analytic Services can allocate for a calculation:
    Set the maximum number of blocks that Analytic Services can allocate to at least 500. 
    If you do not have an $ARBORPATH/bin/essbase.cfg file on the server computer, create one using a text editor.
    In the essbase.cfg file on the server computer, set CALCLOCKBLOCKHIGH to 500.
    Stop and restart Analytic Server.
    Add the SET LOCKBLOCK HIGH command to the beginning of the calculation script.
    Set the data cache large enough to hold all the blocks specified in the CALCLOCKBLOCKHIGH setting. 
    Determine the block size.
    Set the data catche size.
    Actually in our Server Config file(essbase.cfg) we dont have below data  added.
    CalcLockBlockHigh 2000
    CalcLockBlockDefault 200
    CalcLockBlocklow 50
    So my doubt is if we edit the Essbase.cfg file and add the above settings and restart the services will it work?  and if so why should we change the Server config file if the problem is with one application Cal Script. Please guide me how to proceed.
    Regards,
    Naveen

    Your calculation needs to hold more blocks in memory than your current set up allows.
    From the docs (quoting so I don't have to write it, not to be a smarta***:
    CALCLOCKBLOCK specifies the number of blocks that can be fixed at each level of the SET LOCKBLOCK HIGH | DEFAULT | LOW calculation script command.
    When a block is calculated, Essbase fixes (gets addressability to) the block along with the blocks containing its children. Essbase calculates the block and then releases it along with the blocks containing its children. By default, Essbase allows up to 100 blocks to be fixed concurrently when calculating a block. This is sufficient for most database calculations. However, you may want to set a number higher than 100 if you are consolidating very large numbers of children in a formula calculation. This ensures that Essbase can fix all the required blocks when calculating a data block and that performance will not be impaired.
    Example
    If the essbase.cfg file contains the following settings:
    CALCLOCKBLOCKHIGH 500  CALCLOCKBLOCKDEFAULT 200  CALCLOCKBLOCKLOW 50 
    then you can use the following SET LOCKBLOCK setting commands in a calculation script:
    SET LOCKBLOCK HIGH; 
    means that Essbase can fix up to 500 data blocks when calculating one block.
    Support doc is saying to change your config file so those settings can be made available for any calc script to use.
    On a side note, if this was working previously and now isn't then it is worth investigating if this is simply due to standard growth or a recent change that has made an unexpected significant impact.

  • When I look up the creation date for files on my Macbook I get the date and month in brackets, but not the year.  Why is this and how can I look up the year?

    When I look up the creation date for files on my Macbook (using "get info", or the information window in Iphoto) I get the date and month in brackets, but not the year.  Why is this and how can I look up the year? 

    Does the Date Modified column in a window set to List view show the date correctly, or does it also display it incorrectly?
    To add additional columns to a Finder (folder) window, with that window open and active open the View Options for it. You can do that by pressing Command-J or by selecting View Options from the View menu in the main menubar.

  • Scheduling Agreement –delivery date in month format -  MD04

    Dear experts,
    Scheduling Agreement, forecast delivery schedule.
    When I enter a delivery date in month format, the system, during processing, automatically checks the factory calendar and proposes the first valid working day as the delivery date. ( Yes. I know it is a SAP standard )
    My requirement is automatically checks by the system  the last  working day as the delivery date.
    Could you tell me what are the settings i need to check to resolve this issue?
    Thanks in advance
    artur

    As pointed out already above you need to use a periodic lot sizing procedure.
    Use Lot sizing procedure P, Lot size indicator K and Scheduling =2
    As per your requirement, you need to create a calendar using MD25 with Months (Workdays) as a calculation rule with 1 as the period in the box provided.
    After a MRP run the delivery date would point to the last day of the month.
    But the requirement is a bit surprising as say for a requirement on the 1st of the month you will have the delivery showing up on the last day of the same month. Under what circumstances do you have this requirement as a valid one in your business case?

  • How to add a date(Year, Month, Day) table in OBIEE Administrator

    Hi,
    I am new to this tool, we are developing a HR report for emp on leave or absentees. we have data since 1982 in our tables. we want to have a date table and dimension where we can give have a hierarchy for year, month, day, so that we can design our dashboards based on time. how we can do that in OBIEE Administrator and can we do it in warehouse builder as well, if so, how. ( we have a column for date in the table by name 'leave start date' and 'leave end date', can we use this and create our own table with year month and day as separate columns).
    Thanks.

    hi,
    Using date column u can create time dim in BMM layer
    Create a new logical table and pull your date column to this table
    Next,create following columns
    Refer http://www.rittmanmead.com/2007/04/30/obi-ee-time-dimensions-and-time-series-calculations
    leave start date
    Year level :Extract(year from date_column)
    Month and year level:CAST (Extract(month from fact_date_column) As CHAR(5) ) || CAST (Extract(yearfrom fact_date_column) As CHAR(5) )
    Mon-YYYY: EVALUATE('TO_CHAR(%1,%2)' AS CHARACTER ( 30 ), "Development".""."sample sales"."Dim - leave Date"."REPORT_DATE", 'MON-YY')
    YYYY-MM : CAST ( EXTRACT( YEAR FROM "sample sales".""."sample"."Dim - Report Date"."LEAVE_DATE") AS CHARACTER ( 4 )) || '/' || CASE WHEN EXTRACT( MONTH FROM "sample sales".""."sample"."Dim - Report Date"."LEAVE_DATE") BETWEEN 10 AND 12 THEN CAST ( EXTRACT( MONTH FROM "sample sales".""."sample"."Dim - Report Date"."LEAVE_DATE") AS CHARACTER ( 2 )) ELSE '0' || CAST ( EXTRACT( MONTH FROM "sample sales".""."sample"."Dim - Report Date"."LEAVE_DATE") AS CHARACTER ( 1 )) END
    Year Quater :: EVALUATE('TO_CHAR(%1,%2)' AS CHARACTER ( 6 ), "sample sales".""."sample"."Dim -Leave Date"."REPORT_DATE", 'YYYY') || '0' || EVALUATE('TO_CHAR(%1,%2)' AS CHARACTER ( 6 ), "sample sales".""."sample"."Dim -Leave Date"."REPORT_DATE", 'Q')
    Day: EXTRACT(DAY FROM DATE_COLUMN)
    Thanks,
    Saichand.v

  • Power Pivot - Calculating Exchange Rates depending on MONTH

    Hello everyone, I have a question, would like to know if someone can help me figuring out a solution. I have created a spreadsheet using powerquery and powerpivot. Loading the data on powerquery from different spreadsheets was a charm, the problem is calculating
    the exchange rates per month. Let me try to explain better;
    The structure is as following:
    I have 3 tables, they are:
    Dates– Just a dates (loaded directly on PowerPivot).
    Invoice – Details of invoices for all customers, gross totals are in different rates (loaded through power query)
    Customer – Detailed information of customers (loaded directly on PowerPivot).
    Currency – exchange rates (loaded directly on PowerPivot).
    Note: I mentioned where they were loaded because I do not know if that really matters, I guess it does not... but extra information will not hurt. Now, let's go to how these tables are connected between each other and their key columns:
    The Invoice table has information on invoices dates, invoice gross total and customer code. This table is related to Customer table, which has the actual name of customers and other details. This link is done through the Customer Code column. The Currency
    table have a relationship with the Customer Table through the Country Column.
    What I want to achieve is a formula to do the exchange rate based on the Invoice Date column present on the Invoice Table. So I have created a column on the Currency Table named at each month of the year and populated it with the exchange rates for all countries
    (countries listed using ISO3 format).
    My problem is while I am able to select a column from the Currency table to do the exchange rate calculation using the below formula, I fail to realize how to do it per month:
    =CALCULATE(sum(invoice[Gross Value])*SUM(Currency[Reverse]))
    *Reverse is the column with the exchange rate for the country money to USD
    What I am failing to do is how to make that calculation to also consider the month of the invoice and pull the exchange rate for the same month from the Currency table… something like:
    Get the invoice date then find the column on Currency[Month] and multiply, providing me the USD amount.
    I was unable to figure out a solution using the filters parameters from Calculate. If some of you ask why I am using SUM inside Calculate, is because if I only use SUM and try to do the math between the two tables I get an error saying that it was not possible
    to determine the value on Currency[Reverse]. Same happens with SUMX. It worked out with Calculate, but then I cannot create other formulas using CALCULATE on that table because it will give that error on redundancy, unless I add a filter on it, which worked
    last time (but I do not remember which thing /parameter used to filter, so do not ask it right now :D)
    To be honest… I do not really need that level of accuracy, but my Virgo perfectionist side demands me to find a solution to that, that will not use a single exchange rate, but consider which is the correct exchange rate for the month of the invoice and calculate
    it correctly for all invoices. Just so you know, the Invoices tables has more than 1million lines.
    Anyone know how to crack this problem or can point me to some site where I can learn how to do it?
    Thanks for the time reading all of this, even if you cannot help, I really appreciate it ;)

    Hi Estevao,
    Having problems to understand how you managed to combine your currency table with the customer table by Country ID. Where’s the 1-side of this relation (many customers in the same country and many months for the same currency)?
    Anyway: Seeing that you already use Power Query, I’d suggest that you prepare your data in a way that you can connect your currency table with your invoice table instead of with your customer table. Create a field in your Invoice Table
    that concatenates Customers CountryID&Month.
    Imke

  • Workday calculation for specified date range

    Hi All,
    How to count number of workdays available for given date range. And I tried below statement which is
    not working.
    SUM(CASE [Calendar].[Calendar Date]
        WHEN [Calendar].[Calendar Date].[Year] = '2005' AND [Calendar].[Calendar Date].[Month]
    = 1
        THEN [Calendar].[Calendar Date].CURRENTMEMBER.CHILDREN
        END
    , [Measures].[Work Day Flag])

    Hi bpbhhaskar,
    According to your description, you want to count the weekdays in MDX. Right?
    In this scenario, we can just aggregation days from Monday to Friday. The key should be 2 to 6. Please use the expression below:
    with
    MEMBER [Measures].[DayCount] AS
    Count
    Descendants
    [Date].[Calender].CurrentMember
    ,[Date].[Calender].[Date]
    * {[Date].[Day Of Week].&[2]:[Date].[Day Of Week].&[6]}
    Best Regards,
    Simon Hou
    TechNet Community Support

  • Routine to convert the date into month/year

    Hi friends,
    I have requirement like I have 0billdate, but i want only month and year in that.  So i have created a z object  for that taking reference as 0calmonth.  I think the format is yyyymm.
    So now I want to write a routine which converts the date to month/year.  If anybody know this please let me know.
    Regards
    San Reddy

    Hi
    in the trnasfer rule or in the update rule select the Zinfo object to which you need to do conversion
    in details select formula and create.
    Select all functions and follow the steps below.
    use the conversion function DATE_MONTH( )
    Short Text
    Function: Date -> Month
    Functionality
    Calculates the month from a specified date.
    Requirements
    The date must appear in the format yyyymmdd.
    Parameters
    DATE_MONTH (date)
    Result
    The result is calculated in the format yyyymm.
    Regards
    RaM

  • Date into month

    Hi All,
    I calculated  opening stock,closing stock based on the date,now I need to calculate based on month also,
    Is any functionmodule is there to convert date into month.
    Thanks@regds,
    Sree.

    hi
    list of FM try
    A
    CALCULATE_DATE : Calculates the future date based on the input .
    v  DATE_TO_DAY : Returns the Day for the entered date.
    v  DATE_COMPUTE_DAY : Returns weekday for a date
    v  DATE_GET_WEEK : Returns week for a date
    v  RP_CALC_DATE_IN_INTERVAL : Add days / months to a date
    v  DAY_ATTRIBUTES_GET : Returns attributes for a range of dates specified
    v  MONTHS_BETWEEN_TWO_DATES : To get the number of months between the two dates.
    v  END_OF_MONTH_DETERMINE_2 : Determines the End of a Month.
    v  HR_HK_DIFF_BT_2_DATES : Find the difference between two dates in years, months and days.
    v  FIMA_DAYS_AND_MONTHS_AND_YEARS : Find the difference between two dates in years, months and days.
    v  MONTH_NAMES_GET : Get the names of the month
    hope this willl solv ut problem
    Amit

  • Return the end of week date using month and week number

    Hi all,
    I am trying to find the date for end of the week using given month (201401, 201402...i.e, 2014 is year and 01,02 are months) and week number (01,02,03...) for the year. For example if my month is 201402 and week_number is 06 then it return the week_date
    as 2014-02-08. Can you please help me in writing a sql statement for this scenario.
    Thanks in advance,
    Nikhil

    Current month is irrelevant
    with dt as (
       select dateadd(day, (6-1)*7, '2014-01-01') as xwk
    select dateadd(day, 7-datepart(weekday, dt.xwk), xwk)
    from dt;
    Change the "6" in the with statement to the week of interest and 2014 to the year of interest...

  • Split Data from Month to Days in the Bex Report

    Hi Gurus,
    I have a Actual and Plan data. Actual data is on daily basis and Plan data is in monthly basis.....
    Requirement is : User will be entered Calendar Day ( any day of the month for example : 06/18/2010)  to bring Month to date on both Actual and Plan data. Like for example if user enters the date 18th June 2010. Then I need to pull from the beginning of the month to date up to that selection day( in our case 18 days).
    Actual : I don't have issue getting the Month to date and Year to date because I have data on daily basis.
    Plan : As I said data is on monthly basis. I want to break this data up to the day selected ( from 1st of the June month to 18th as given in example) by user. Like if you have amount is $5000 then my logic will be
    CKF  =  (5000 * 18) / total number days in the month
    Please provide help on this how to bring the data for Plan...
    Thanks
    Ganesh Reddy.

    ganesh,
    in your data model convert date field to calander period and calander year .
    once that is done
    create restricted key figures
    1) month to date
    2) year to date
    month to date - key figure is restricted to custom variable ( which populates calander period based on the date user enter)
    year to date - key figure is restricted to custom variable (which populates calander year based on the date user enter )
    hope you got it .
    Thanks,
    pk.

  • HT1689 since doing the 7.0.4 update i notice that my mobile data has doubled and i am running out of data mid month.  I've disabled apps s not many running.  Any suggestions?

    since doing the 7.0.4 update i notice that my mobile data has doubled and i am running out of data mid month.  I've disabled apps s not many running.  Any suggestions?

    I am having the same issue even with the newer 7.1. I have a 1-100 KB data push on both my husdand's and my phone every hour on the hour (i.e. my will be at :23 of the hour and his will be at :13 of the hour and it will change). This is whether we are on a WIFI and with all apps, background refreshes, push notifications, etc turned OFF.

Maybe you are looking for

  • Automatic Creation of PO by workflow once PR is released.

    Hi All, Can anybody explain the details steps for creation of workflow template if PR is released then automatic creation of PO needs to be created with reference to PR.? Thanks, Ravi

  • Voice memos from iPhone4 won't transfer to iTunes

    I cannot move the voice memos on my iPhone 4  into iTune (10.7).  I have recently upgraded to my operating system to Mountain Lion so that I can use iCloud, but this was happening before that. 

  • Dataload from legacy system to BW Server

    Requirements: We have different kind of legacy systems and SAP BW server. We want to load all legacy system data into SAP BW server using BAPI. Before loading we have to validate all data. If there are bad data, data missing we have to let the legacy

  • Why won't Photoshop CC or CC (2014) update?

    I uninstalled and reinstalled, but the latest version still will not update. Gives error U44M1P34

  • Can I Install Khmer Keyboard On iPhone 4S?

    I just know that we can install Khmer unicode and keyboard only if we jailbreak and use cydia. But iPhone 4S couldn't be jailbroken. Thus, is there way to install it? Thank in advance, mates for giving helps!