Date Difference Calculation in BSO Cube

Hello,
need help with Date Calc
I have a Dim. Called Inv Date and another Dim. Check Date( which is Time Dim.)
I will like to do this calculation Inv Date - Check date and store the difference in a Measure member called days outstanding
This should return how many days difference between both dates.
will really appriciate if some one could help.
thkx
mits
Edited by: user12527998 on Jan 28, 2010 1:43 PM

Hi,
I always find a post by John Booth's a useful guidance when you are wanting to run calculations with dates, have a read at :- Calculations with dates
If you are using Version 11 you also have a look at the new date functions e.g. @DATEDIFF - http://download.oracle.com/docs/cd/E12825_01/epm.111/esb_techref/calc_datediff.htm
Cheers
John
http://john-goodwin.blogspot.com/

Similar Messages

  • Date Difference Calculation in BW3.5

    Hi
    We are calculating date differences between 2 dates i.e. Delivery Date - System Date.For System date we used variable exit to derive the value.But when we create CKF on Delivery Date,we necessary have to keep date field in Drilldown(in rows).But reports needs to give Overview while including date field in rows removes the granularity.
    Is thier any other way we can handle this situation.
    Regards
    Praveen

    You have to put ur delivery date in Rows if u r doing the Formula variable with replacement path. There is no option.
    Khaja

  • Date difference calculation - help!

    hey people, i've got the below method, i'm trying to calculate the difference between two dates. the calculation is wrong as it is outputing the wrong duration... can anyone help?
    public int getDuration(Date startDate,Date endDate)
    GregorianCalendar start = new GregorianCalendar();
    start.setTime(startDate);
    GregorianCalendar end = new GregorianCalendar();
    start.setTime(endDate);
    long diff = 0L;
    if(start.getTime().before(end.getTime()) == true)
    diff = end.getTimeInMillis() - start.getTimeInMillis();
    diff = diff/(24*60*60*1000);
    Long L = new Long(diff);
    return L.intValue();
    THanks, Ian

    In the mean time, a couple of stylisitc suggestions:
    if(start.getTime().before(end.getTime()) == true)
    // == true is redundant and cluttersome
    if(start.getTime().before(end.getTime()))
    Long L = new Long(diff);
    return L.intValue();I'd suggest returning a long, rather than an int. If you insist on returning an int, because you're sure that the number of days will never be more than Integer.MAX_VALUE, then add an assertion that its not.
    assert diff <= Integer.MAX_VALUE : diff + " too big";The Long is overkill. If you do have a small enough value, just do return (int)diff;

  • Date difference calculation with user input variable

    Hi,
    I have the following requirement in BEx:
    The user inputs a date value and I have to calculate the difference between the date entered by the user with the Due Date in the cube, to determine the number of backlog days. Basically, I need to calculate Past Due in number of days.  I need to display the Amount due for the Time buckets like 1 -10 days, 11 -30 days.
    The report output has to be in the format below:
    Columns:
    1 u2013 10 days Past Due      $100.00
    11 u2013 30 days Past Due    $15.00
    Rows:
    Customer#    
    The cube has data from Jan 2005 to June 2008.
    For Eg:   User Input Date =   04/30/2008.
    It should compare the input date to the due date for each record in the cube.
    Any suggestions are appreciated.

    Hi Kumar,
    We have developed simar reports in our previous projects.
    You need to follow the following steps.
    1. Create a new restricted key figure globally on Past Due $100. Restriction details I will let you know in the ensuing steps.
    2. Create another restricted key figure globally on Past Due $15. Restriction details I will let you know in the ensuing steps.
    3. Create a Z varuable on Calday and offset it -1 (use the button next to exclude button).
    4.Create another Z varuable on Calday and offset it -10 (use the button next to exclude button).
    5. Create another Z varuable on Calday and offset it -11 (use the button next to exclude button).
    6. Create another Z varuable on Calday and offset it -30(use the button next to exclude button).
    7 Restrict the RKF past due 100$ (defined in sl 1)between the variable range defined in 3 and 4.
    8. Restrict the RKF past due 15$ (defined in sl 2) between the variable range defined in 5 and 6
    Now drag and drop those two RKF to column and you will get the desired result in C1 and C2 as follows:
    Columns:
    C1 :1 u2013 10 days Past Due $100.00
    C2 :11 u2013 30 days Past Due $15.00
    If the above info serves your purpose, please reward me with the point.
    Regards,
    Subha

  • Date difference calculation

    Hello Everyone,
    We need to calculate a day difference between two days. There is many suggestions about using the following approach:
    (date1.getTime() - date2.getTime())/86400000.
    This seems to work until we hit a Daylight Savings Time issue and nobody seems to talk about that. When in April, for example, we get 1 hour less then the result of the calculation above will not be the whole number. Well, we can use Math.ceil() function for that. Then, in October, we get 1 hour back so now we have to use Math.floor() function to get the right result.
    Does anybody have any idea as to when to use one or another. I was thinking of using modulus division. If the result is not equal to zero then we have to apply one of those functions. The question now is, how to identify which function to apply? Or is there any other, less cumbersome way to properly get day difference between two dates?
    Any help will be greatly appreciated.
    Thanks,
    Yourii

    I think i figured out how to calculate the difference in days with Daylight Savings Time changes. Here is the code:
         * This method returns difference in days between two Dates passed in.
         * It identifies Daylight Savings Time changes and automatically
         * adds or substracts one hour when needed ...
         private int dayDifference(java.util.Date date1, java.util.Date date2) {
         final long M_SECS_PER_DAY = 24*60*60*1000;
         final long M_SECS_PER_HOUR = 60*60*1000;
         long days = (date1.getTime() - date2.getTime());     
         if (days%M_SECS_PER_DAY != 0) {
         if ((days + M_SECS_PER_HOUR)%M_SECS_PER_DAY == 0) {
         System.out.println("Adding one hour ...");
         days += M_SECS_PER_HOUR;
         } else {
         System.out.println("Substracting one hour ...");
         days -= M_SECS_PER_HOUR;
         } else {
         System.out.println("No alterations made ...");
         return (int)(days / M_SECS_PER_DAY);
    Let me know what you think ...

  • Date Difference Calculation problem

    I am creating a form which should calculate the number of days between two calender dat
    es using the Date2Sum expression but my result cell gives me
    zeo despite setting the locale and the calculation correcttly. Where could
    my problem be?
    Darlington Sakwa

    Validate the date patterns on the date fields match the date patterns used in Date2Num. For example, the attached has a start date with the display date pattern date{YYYY-MM-DD} and that matches the date pattern in my Date2Num function call.
    // form1.page1.startDateNum::calculate - (FormCalc, client)
    if (form1.page1.startDate.isNull) then
      $.rawValue = ""
    else
      $.rawValue = Date2Num(form1.page1.startDate.rawValue,"YYYY-MM-DD")
    endif
    Steve

  • Date difference calculation help needed

    Hi,
    I have a form with a date field and one text field which is hidden..in case the date field value is less than the current date minus 3 years then the text field should display else not. Please advice what logic/code can be used.
    Any suggestions would be highly appreciated !!
    Thanks
    Kapil

    In the mean time, a couple of stylisitc suggestions:
    if(start.getTime().before(end.getTime()) == true)
    // == true is redundant and cluttersome
    if(start.getTime().before(end.getTime()))
    Long L = new Long(diff);
    return L.intValue();I'd suggest returning a long, rather than an int. If you insist on returning an int, because you're sure that the number of days will never be more than Integer.MAX_VALUE, then add an assertion that its not.
    assert diff <= Integer.MAX_VALUE : diff + " too big";The Long is overkill. If you do have a small enough value, just do return (int)diff;

  • Xcelsius doesn't display the date difference in Preview

    Hi,
    Im using the Xcelsius Enterprise 2008 and I use XML connectivity for the source. I would like to do some date difference calculation on my spread sheet. But the result of the date difference does no appear on the Preview for some reason. My XML file has got the date format dd/mm/yyyy hh:mm. I tried to convert the date to number format by multiplying the date by 1. When I do this the result appears correctly as I want on the Preview, but the problem is when there is a first refresh, the date difference shows a error value "#Value". I tried to enable XML Map Properties -> When refreshing or importing data:
    1. Overwrite existing data with new data
    2. Append new data to existing XML lists.
    But still not of any use. Could any one please give me a tip to resolve my problem.
    Many thanks in advance.
    Priya

    Hi Priya
    Can you please tell me what formula are you using to take difference in dates?
    Just to tell you as a point of information, Xcelsius is capable to handle very limited set of formulas. In spreadsheet you will see the formula working perfectly fine but right after hitting preview button you wont be able to see values calculated by certain formulas in Excel. So, its always good to use less and very basic formulas.
    Regards,
    Waqas

  • Date difference based on the conditions is giving wrong values

    Hi,
    In creating the formula for conditional date difference calculation,
    i.e.,
    if (sto date is 0) then (act date - mat rel date) else (sto date is not equal to 0) then (sto date - mat rel date)
    So I tried with,
    (sto date == 0) * (act date - mat rel date) + (sto date <> 0) * (sto date - mat rel date)
    But I am getting a wrong value even with decimals as days can't be in decimals. Please suggest where I am going wrong in calculation.
    Thanks,
    Best Regards,
    Darshan MS

    Hi Darshan,
    First of all, were the dates converted already to keyfigure?
    If not, please check:
    Convert a Characteristic into a Key Figure (BEx)
    If they were already converted, try this:
    (sto date == 0) * (act date - mat rel date) + (sto date - mat rel date)
    Regards,
    Loed

  • Data is not getting cleared in BSO cube.

    Hi Gurus,
    I am facing issue with one of my BSO cubes(Target) which is in transparent partition with the ASO cube(Source). Earlier the data was double the input and when i cleared using maxl script the data is halfed but as per my script values should be zeros. I need the values in the BSO cube to be zeros but not able to make it and the values halfed are present and i tried different ways. Please help me how to resolve this issue.
    script used is very simple in this way:
    FIX(Account, Year)
    Cleardata "Scenario";
    ENDFIX
    Thanks in Advance.
    regards,
    902970.

    Hi Brian,
    Thanks for your quick reply, Actually we load the input to a static scenario and then the data is copied to the relevant scenario(Actual/Forecast) and need this to be cleared.
    Scenario Dimension:
    Scenario(Label only)
    Static Scenario(~)
    Plan(~)
    Actual Scenario(~)
    Forecast Scenario(~)
    Thanks,
    902970.

  • Date to Date Report For BSo Cube

    Hi All,
    We are plan to create one bso cube. we want to build time dimension include dates,I want to load data and generate reports date wise.I know its full difficult to get the reports date wise.please help me out.

    You could use relative names for the MEMBERS and then change the aliases each month:
    Member CM-0 Alias Sep 2012
    Member CM-1 Alias Aug 2012
    Member CM- ...
    You would have to reload all data each month but you could load to the alias names so the input files would not have to change.
    Then just build your reports with the member names and have Essbase respond to the query with the Alias.

  • Conditions Need to decided for ASO or BSO cube?

    Hi
    Could you please tell me on what conditions or business needs we need to decided whether we need to build an ASO or BSO cube?,
    which dimension needs to be Label only or Stored or Accounts or Multiple Hierarchy Enabled property?
    Which needs to be Dense & which needs to be Sparse if it is BSO cube?
    Could you please let me with an example with above question that would be helpfull.
    Thanks,
    Raj

    For dense data sets and Analytic databases ( databases with complex calculations ) and read/write databases we will go for BSO.
    In BSO we can load high and apply the pushdown calculations.
    For large dimensionality and sparse data sets and for read only database we will go for ASO.
    In ASO we can load at leaf level only.

  • Export - import between ASO and BSO cubes of different structure

    Hi everybody!
    I have a 'large' ASO cube with information for a period of several years.
    I need to be able to load a smaller slice (e.g. one quarter) from the 'large' cube into a BSO cube with a different (simpler) structure , perform calculations and then load the updated data back to the 'large' ASO cube.
    What's the best way to approach this (import - export)?
    Thanks in advance,
    Alex

    Hi GlennS,
    Hello and thank you again for the help.
    I'm running version 9.3.1
    The ASO cube has 12 dimensions plus 8 attribute dimensions.
    The BSO cube - 8 dimensions plus 2 attribute dimensions.
    Data size:
    The ASO cube is about 1 GB, about 16 M input level cells. Only about 10 % of it will be extracted and loaded into the BSO cube.
    The BSO cube is ~ 300 MB fully calculated. 300,000 existing blocks
    I prefer not to load the BSO cube from the same source as because ASO cube contains not only the source data, but also modifications - for example - allocations etc. I would like to keep these modifications and to be able to load (modified) data to BSO, make additional modifications and then 'save' the modified data back to the ASO.
    How should I approach loading data back to the ASO? I will need to 'replace' a slice of ASO cube - delete the 'old version' cells and load new version from the BSO cube.
    Thanks,
    Alex

  • Data load in Essbase ASO cube

    Hi,
    I have not been using ASO cube before and had worked only on BSO cubes. Now I have a requirement to create a rule file to load data in to an ASO Essbase cube. I have created a data load rule file as I was creating for a BSO cube which is correctly validating. However when I am doing the data load I am getting following warning:
    "Aggregate storage applications ignore update to derived cells. [480] cells skipped"
    I have investigated further and found that ASO cube does not allow data loading at upper levels & on members calculated through formulas. After this I have ensured that I am loading the data in to zero level members and members which are not calculated through formula. But still I am not able to do the data load & getting the same warning.
    Could you please help me and let me know if there is anything else which I am missing here?
    Thanks in advance...
    AKW

    Hi AKW,
    "Aggregate storage applications ignore update to derived cells. [480] cells skipped"This is only a warning message that means only those many cells were skipped might be for some reasons like any member pointing to those cells will be missing.
    If you want to copy the Data of your BSO cube to an ASO Application why dont you use an PARTIONING it will copy your whole data from BSO to ASO (If Outline is common in both then copy any member of Sparse dimension like "Scenario 1" from Source i.e. BSO, to same member like "Scenario 1" in Target i.e ASO ),
    This is only an alternate wayThanks
    Avneet Singh Bhatia

  • Which is the maximum allowable size of a BSO cube?

    Hi Experts!
    Can anyone tell me if it is possible to have a BSO cube of between 1 and 4 Terabytes_ and if it can be tuned for acceptable performance with about 100 concurrent users?
    Sorry if I look stupid with this question but this is my real important question now! Thank you so much in advance!

    The largest BSO cube I have seen is 400 GB. I was just at the Kscope conference speaking with one of the long time Oracle Essbase support reps and asked her the largest BSO cube she had seen and it was 500 GB. I would not advise doing anything beyond 1 TB even on modern hardware.
    Anyone else have opinions on largest supportable BSO cube?
    One thing to understand on huge cube sizes is when/if you need to do a dense restructure it will take a long long time which leads you into a process of exporting level 0 data, clearing the cube, updating the hierarchy, loading level 0, re-calcing the cube which again on a large cube can take a lot of time.
    Data of this size is many times better placed in a ASO cube presuming it can meet the business requirements.
    Regards,
    John A. Booth
    http://www.metavero.com

Maybe you are looking for