Calculation with Dates

I have one date called Registration Date which will be input into the planning as string in dd--mm-yyyy format. Now I am capturing current date which should pickup from system(By @Today Function).
I know that these dates are now in different formats. I need to calculate difference between these two dates.. I have tried many ways using datediff functions etc. But its not working. please Help me out on this

Hi
Try using @HspDateDiff
You will need to convert the current date into the planning version of the date. You can do this with this formula
(@DATEPART(@TODAY(),DP_YEAR)*10000) + (@DATEPART(@TODAY(),DP_MONTH)*100) + (@DATEPART(@TODAY(),DP_DAY));
This will take the current date and put it into the YYYYMMDD format.
You can then use @HspDateDiff(NewCurrentDate,RegistrationDate);
You can use this link to help you with the use of @HspDateDiff Calculating the difference between dates within Hyperion Planning - Absolute EPM
In later versions of Hyperion Planning there are many more functions for Dates within Calculation Manager
Hope that helps.
Anthony
Home - Absolute EPM

Similar Messages

  • Formula variable for date calculations with date-characteristics (2004s)

    Hi SDN,
    I'd like to calculate the number of days between to date-characteristics. In 3.5, I was used to create 2 formula variables of the type 'replacement path', with 'date' as the dimension indicator. In my formula, I used the 'proces value as date' function for each variable, and I could perform calculations with them.
    I'm trying to do the same in 2004s. However, I can't create replacement path's with 'date' as a dimension indicator. So I use 'number' instead, but it doesn't work: my query shows 'x'.
    I can use the variables that I created using the 3.5 query designer as a workaround. But I hope there is a better solution.
    If other people experience the same problem, please respond. Then I know it's probably a bug.
    Kind regards,
    Daniel

    Daniel,
    Try to look at the formula variables defined before the upgrade and see what is different to the newly defined. I am guessing just the terminology used is different.
    If not the date value might be blank or something for one of the f-variables used. Try to display the formula variable values as KF in the query results and check what it is showing.
    I hope this helps.
    -Bala

  • Calculations with date fields

    I'm trying to do a basic calculation with a CRM date form in BC.
    I have a form field 'dateJoined' (though this could easily be the standard DOB field for the sake of this exercies) and I need to use javascript to calculate how many days have passed between today's date and the date in 'dateJoined'.
    The {module_customerfield} outputs a string, not a date object, which would be fine but the format of the string is not compatible with the .date object.
    I started down the path of lengthy substrings > variables, then linked variables > date object but after lines and lines of code, wondered if there was a simpler way that I was overlooking??

    I'm trying to do a basic calculation with a CRM date form in BC.
    I have a form field 'dateJoined' (though this could easily be the standard DOB field for the sake of this exercies) and I need to use javascript to calculate how many days have passed between today's date and the date in 'dateJoined'.
    The {module_customerfield} outputs a string, not a date object, which would be fine but the format of the string is not compatible with the .date object.
    I started down the path of lengthy substrings > variables, then linked variables > date object but after lines and lines of code, wondered if there was a simpler way that I was overlooking??

  • Average calculations with dates

    Hi,
    I have a problem with calculating the average time a call lasts. I have a start and finish time to a call that are stored in a database in datetime format. How do i find out the time of the call and then get an average over the number of calls made in a month. I have to hold the time format and show the result in the same time format that is in the database. How do you do this? I know how to do it with decimals but how to manipulate time confuses me.
    Cheers
    Niall

    You can use the method getTime() of the class java.sql.Timestamp, which returns milliseconds in the long type, and toString() method of java.sql.Time may serve your aim here.

  • Calculations with dates

    Hi,
    We need to do some calculations based on the dates. But as essbase doesnt store dates we are having a problem. Can anybody suggest a solution for this.

    You would store the dates as numbers in Essbase. It's pretty common in a Capex or Workforce application.
    Presuming you are using monthly dates Jan 2007 would be 200701 and December would be 200712 etc.
    You can use math and functions such as @TRUNCATE, @INT, and @MOD functions to determine the number of months between dates.
    If you are looking to store dates and do daily calculations that will of course be more complex.
    Here is a sample of some code I have sitting around:
    start_year = start_date - @INT(start_date / 100) * 100; /* gives 200700 from 200701 */
    start_months = start_date - start_year; /* gives 1 */
    add_years = @INT((start_months + num_months) / 12) * 100; /* determine number of years to add */
    add_months = @MOD(start_months + num_months,12);
    end_date = start_year + add_Years + add_months;
    Basically it's all math.
    Regards,
    -John

  • *Urgent* Query with dates

    Hi Gurus,
    I am having problem in developing such a query which has calculations with dates. The problem is:
    I have
    base date for example 26-feb-2006
    statring day: 4
    interval: 5
    input date: 15-mar-2006
    Now the problem is I want to get the results from the query which will start 26-feb-2006+4 which is 02-mar-2006 and calculate the interval which is 5 days from '02-mar-2006' and run it every 5 (interval) days
    02-mar-2006
    07-mar-2006
    12-mar-2006
    I hope I have cleared everything.
    Please let me know as soon as possible.
    Thanks in advance.
    Aqil

    Where is the base_date coming from?
    declare
    v_jobno number;
    dbms_job.submit(v_jobno, 'SCHEMA_NAME.sp_my_proc();',
    -- first time running I schedule for 11 pm staring in 4 days
                              trunc(sysdate+4)+23/24,
    -- here the interval
                              'trunc(sysdate+5)+23/24' );
    end;

  • Dealing with dates

    This is more an ActionScript 3 issue, but... is there any
    good library that allows to do calculations with dates? Like dateB
    = dateA + 1 month (taking into account that dateA could be a
    december day and then a year should be added and the next month is
    january, etc...).
    thanks in advance,
    Marc

    From what i've seen online in examples is to convert the date
    into it's numeric representation. That representation is in
    milliseconds past a low date, something like jan 1. 1901, but i
    don't remember. Then add or subtract milliseconds from the value.
    Then take the result and create a new date object.
    I have not needed to do this yet, so if anyone has a better
    solution that would be awesome.

  • Sales Order : Calcul delivery date with only working days

    HI,
    When I create sale order, the delivery date is calculed with the number of days mentionned in type of sale document. SAP add this number of days into the day's date.
    Is it possible to calculate this delivery date only with working days in the corporate calendar ???
    Thank's

    HI
    Delivery date in the Sales order will be calculated the calender only basedon the Transportation lead time and Pick/Pack time and excluding the holidays
    Please cross the same in your instance
    Regards,
    Ram.

  • Problem with date calculation

    I am a rookie in SAP i have a small problem with date.Do we have any function module to find out the first day in a month if we give out the system current date ?? Pls help me out.

    Hi,
    As Ganesan told,you can do.
    Here is the sample code.
    data v type sy-datum.
    data d type DTRESR-WEEKDAY.
    v+6(2) = '01'.
    v4(2) = sy-datum4(2).
    v0(4) = sy-datum0(4).
    CALL FUNCTION 'DATE_TO_DAY'
      EXPORTING
        date          = v
    IMPORTING
       WEEKDAY       = d.
    write d.

  • Plannned Delivery time not considered while calculating delivery date

    Hi PP Gurus,
    We have a situation is that after MRP run system is not taking into account planned delivery time while calculating delivery dates in schedule lines
    It is taking into account GR processing time.We have GR processing time of 3 days.requirment date is 13.10.2011 & delivery date created by the system is 10.10.2011.
    We have maintained correct master data i.e.Materail Master , Info record & Scheduling agreement.
    Please advice why it is happening & what is the significance of planned delivery time in externaly procured materail with scheduling agrement schedule lines?
    Thanks & Regards,
    Sandesh

    Hi Sandesh,
    Is this happening for particular materials or for all materials
    Couple of checks -
    1) Check with material master changes, might be after MRP run PDT is updated in material master etc ..
    2) Check in OPPQ, for option external procurement , whether scheduling info records/agree is marked or not
    Best Regards
    K.Madhu Kumar

  • Adding fields with data type "TIMS" to the BP transaction

    hi all,
      This  is Anil regarding the addition of fields to the BP transaction.
    here my problem is for BP transaction I could not find any BADI or screen exit  to add the fields. Even EEWB tool does not allow us to cretate the fields with data type "TIMS". so could you please suggest any other way to add these fields to BP?
    when I enter the values to the time fields in BP transaction, they must reflect in
    BUT000 table also?
    Regards,
    Anil .

    In the physical layer, Column Properties change the data type to int.
    If still problem exists, In the Business Model, write a case statement like
    case when column1=1 then 1 end
    and apply count aggregation on the new calculated column,add the column to presentation table, use that new calculated column for report.
    - Madan

  • MDX Filter with date range

    Hi,
    my requirement is to create a calculated member to calculate Total unique customers who has sales > 0 within the date range.
    Below mdx works normally with single date
    DistinctCount(FILTER([Customer_Sales].[Outlet ID].[Outlet ID].members,
    ([Measures].[distribution],
    [Date].[CalendarWeek].CurrentMember
    )=1))
    I'm looking for something like below with date range,
    DistinctCount(FILTER([Customer_Sales].[Outlet ID].[Outlet ID].members,
    ([Measures].[distribution],
    WTD([Date].[CalendarWeek].CurrentMember
    ))=1))
    Above MDX fails with the error: String of numeric expression expected, Tuple set expression was used.
    Appreciate your immediate response.
    Thanks in advance

    Hi Chandima,
    Thanks for the response.
    I tried your code, it works but the results are not correct.  As per manual calculations, there are 28 unique customers who has positive sales on Week to date (2014-11-03), but result shows only 19.
    For the first day of week (2014-11-01), there are 9 unique customers, which is correct. But for the following days it is not giving correct result.
    Further, performance of this approach is very poor
    Thanks,

  • Working with dates

    hello,
    I am working with dates. It looks like so:
    1st I want to calculate a time span for example calculate cell A2 - cell A1. In cell A1 it is written 01.01.2010 (so first of January) and in cell A2 01.02.2010 (so first of February). I wrote the dates in letters, too, to avoid misunderstandings due to different national date formats.
    Since January has 31 days, the obvious result thereof is "31D". So far so good.
    but now I want to multiply the 31 with a numeric value, but not the 31D, because if I do so, and let's say the numeric value is 3, then my result is 93 DAYS rather than just 93.
    So my question is, is there any possibility how I can further calculate with a result coming from date calculations without having the new result also in the date format? Anything that escapes the "DAYS" in further calculations??
    Thx

    mac-a-rooney wrote:
    I am working with dates.
    1st I want to calculate a time span for example calculate cell A2 - cell A1. In cell A1 it is written 01.01.2010 (so first of January) and in cell A2 01.02.2010 (so first of February). I wrote the dates in letters, too, to avoid misunderstandings due to different national date formats.
    Since January has 31 days, the obvious result thereof is "31D". So far so good.
    but now I want to multiply the 31 with a numeric value, but not the 31D, because if I do so, and let's say the numeric value is 3, then my result is 93 DAYS rather than just 93.
    Are you sure you're asking in the right forum?
    Using Numbers '08, with the following entries:
    B2: Jan 1, 2010
    C2: Feb 1,2010
    D2: =C2-B2
    E2: =3*D2
    I get 31 (not 31D) in D2 and 93 (not 93 DAYS) in D2.
    From your description, I think you're actually using Numbers '09, and Jerry's advice above applies.
    Regards,
    Barry

  • Email Notification with date field

    Hi,
    i marked the a field as Display field this way it is displayed in the Email notification. (%Records%).
    But i can see the letral date field displayed in email as 2010:03:09:00:00:00:000
    Why is the ''00:00:00:000'' displayed when i have a date field??
    Did anyone face this issue..
    KR
    John

    HI John,
    Date field in MDM is 18 characters long and has date as well as time component to it.
    You can use assignment to trim this and transfer its value to another field and make that field as DF,so that it is displayed in the mail as date.
    Otherwise you can also create a calculated field for this purpose.
    Please go through this very useful link to create expressions/validations with dates:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b025fab3-b3e9-2910-d999-a27b7a075a16?quicklink=index&overridelayout=true
    Thanks,
    Ravi

  • Very Important Scenario - Filling Tables with Data

    Hi,
    For my current project, the custom (z) staged table will be filled every night with data, based on data and calculations on the previous day's material movements, for the company code selected on the selection screen (via a scheduled job that runs by using a variant.)
    My question is this: Say the process is executed for one company code. Then an hour later , or at the same time, another process for a different company code is executed? What if the company code is entered twice?
    What should i do in such situations? Where do the i fill the data for another company code? What if the company code is entered twice?
    Points will be rewarded and all responses will be greatly appreciated.

    Do you want the duplicate company code to overwrite the first one?  If you want to do that then just do a read on the table for the company code.  If it exists (sy-subrc) then you can overwrite the data.  If not then you could always use a timestamp and the company code as the key.  That would allow for multiple records of the same company code.
    Regards,
    Davis

Maybe you are looking for