Current Month vs. YTD

I am wanting to show account balances for the Current Month vs. Year to Date. I am using a BSO cube and have heard that Dynamic Time Series don't work in OBIEE, which is where we're going to be building reports off this data. We want this calculation to be available from multiple front ends so we need to do the calculation in the cube.
I followed the following two suggestions to form a hybrid approach:
http://www.intellientblog.co.za/index.php/tag/essbase-ytd-calculation/
http://www.network54.com/Forum/58296/thread/1147201898/YTD+variance+calc
I created a new dimension with two members - Current Month (just a stored member) and YTD (dynamic calc) with the following formula: @SUMRANGE("Current Month",@CURRMBRRANGE ("Date", LEV, 0, -(@count (skipmissing, @lsiblings (@currmbr ("Date")))), 0));
At first I thought this was working great, I filtered down to a month in the Date dimension and everything looked good. However, my Date dimension (which is my time dimension) is set up like so:
Year
--Quarter
----Month
Which made it so my formula gave me QTD. I modified my formula to: @SUMRANGE("Current Month",@CURRMBRRANGE ("Date", LEV, 0, -(@count (skipmissing, @lsiblings (@currmbr ("Date")))+@count(skipmissing,@lsiblings(@parent(@currmbr("Date"))))*3), 0));
This doesn't work though - it always gives me quarter to date. When I have -(@count (skipmissing, @lsiblings (@currmbr ("Date")))+@count(skipmissing,@lsiblings(@parent(@currmbr("Date"))))*3) as the formula for a member it gives me the correct number, but as part of the YTD formula it always gives me 0.
Any ideas why this would be happening?

Ah apologies, had forgotten to ask if year and period are in the same dimension. So your Date dimension actually looks like:
2011
- Qtr1
-- Jan
-- Feb
-- Mar
- Qtr2
-- Apr
-- etc
2012
- Qtr1
-- Jan
-- etc
If this is the case then I think you have two options:
1. You set up an IF statement where the step back varies by period, e.g.
IF(@ISMBR (Jan))
YTD = @SUMRANGE("Current Month", @CURRMBRRANGE ("Date", LEV, 0, 0, 0));
ELSEIF(@ISMBR(Feb))
YTD = @SUMRANGE("Current Month", @CURRMBRRANGE ("Date", LEV, 0, -1, 0));
ELSEIF(@ISMBR(Mar))
YTD = @SUMRANGE("Current Month", @CURRMBRRANGE ("Date", LEV, 0, -2, 0));
etc
ELSEIF(@ISMBR(Dec))
YTD = @SUMRANGE("Current Month", @CURRMBRRANGE ("Date", LEV, 0, -11, 0));
ENDIF
If you have multiple Jan's e.g. Jan2011, Jan2012 you may want to assign a UDA and change the above to be IF(@ISUDA(Date, Jan)) and so on
2. Set up a member to store the offset value as a dynamic calc, lets call it OffsetYTD, you would need to have a similar IF, ELSEIF, ENDIF formula but no need to repeat all the range bits, e.g.
IF(@ISMBR(Jan))
0;
ELSEIF(@ISMBR(Feb))
-1;
etc
then your YTD formula becomes simpler:
YTD = @SUMRANGE("Current Month", @CURRMBRRANGE("Date", LEV, 0, OffsetYTD, 0));
If the offset is something you can re-use in other formulae / reports then I like option 2 (WFP and CapEx modules for Hyperion Planning use similar concepts for TP-Index and NumPeriods)
Hope this helps
Stuart

Similar Messages

  • Can one Crystal Report could contian Current Month, YTD and ITD data?

    Hi,
    I am trying to build a crystal report and be able to show data in summarized format on single report containing data for the current month, year to date and Inception to date.
    The difficulty that I find is the date ranges. Current month date range is different from YTD and ITD date.
    what would be the best way to show such data on crystal report? is there a sample report available that can help me to produce such report?
    your help will be highly appreciated, thanks!
    regards,
    Mansoor

    Hey Joe,
    if you have CRXI, take a look at the sample reports
    Record Selection on Date Range has some good examples
    you can do this with multiple Groups
    create a formula
    in to currentdate
    ( this group will cover your inception date to currentdate)
    second group will be a date group also, select year as your print by option for this group.
    3rd group also by date,
    select month.
    add fields to your details section, select the field, right click and select summary location,
    (add to all groups)
    you can then supress footers and headers as needed.
    Hope this helps.

  • To Display two previous months YTD-Actual columns from the current month

    Hi All,
    i want to create a FSG report in which i require three columns describing months one for the current month and two for the previous months in order like if i run report in Oct 06 then other columns will be Sep 06, Aug 06 is this possible?
    if yes then how ??
    i m using POI-2 and POI-1 which is giving wrong results.
    thanks.

    i got the solution:)
    i was just assigning an offset to the cumulative column as well.

  • How to get the current month for a variable based on info object 0FISCPER3

    Hie Gurus
    I am working on the financial reports i am failing to derive the Current month from the variable based on infobject 0FISCPER3 PERIOD .
    I would also like to get the same month from the prevoius year. Any ideas?

    If I understood correctly, you need in your repot
    Current Month Plan This year || YTD Plan This Year || Current Month Plan Last Year || YTD Plan Last Year
    Your variable 0I_FISCPER3 must be on the object 0FISCPER3 which is nothing but just the Fiscal Period. This variable is a user entry mandatory Interval variable.
    if you are entering a range in the input screen for this variable, you will get cumulative values. If you just need to get the value for a month in first column your report, you will have to create another variable of type Customer Exit which will read the "To value" entered for the variable 0I_FISCPER3 and columns for Current Month should be restricted on this variable.
    if you are entering a single value in the selection screen of this variable, current month column should be restricted on this variable with "Equal To" operation and YTD colmns should be restricted to "Less Than Equal to" operator with this variable.
    0FISCPER3 just have posting period and not year, so you will have to use varialbes for 0FISCYEAR separately.
    Please let us know if it helps or if you are using some other variable based on 0FISCPER3 or 0FISCPER.
    Regards,
    Gaurav

  • Running Sum on column total minus current month

    Hi all,
    Is it possible to get the running sum total value of all the months minus the current month value in the column function,as I need to display the same in the narrative view.
    Like RSUM(YTD(M-1)Value)...
    Presently this RSUM is not giving me the right value.
    I can also do the total for all the months minus the current month value.Can it be done at the column funtion?
    Regards
    Ashish

    Hi
    Can you elaborate a little..Did you mean I need to create one variable in the repository?
    YTD (M-1 Value) / (YTD Last Year M 0 Value)
    where M0 is current month and M-1 is previous month and value is a measure.
    Regards
    Ashish
    Edited by: Ashish21473 on Jan 7, 2011 3:38 AM

  • Current Months Data - Automatic

    How to run a YTD report which will automatically show the current months data with no variable prompt for the same...?
    Is there any such variable which will run a report only for current months data.

    I dont think there is a std variable for current period. rather you can use fiscalyear/period time char and use 0FPER to derive current fiscalyear/period

  • SQL Query to add previous month amount to current month amount

    Beginner - Using SQL 2008 R2 - Having a difficult time adding previous month amount to current month amount on a continual running basis. Table fields and example data are:
    FunctionID    
    UnitID     
    Dateof           
    Result       YTD
    A                   AA           01/01/2014    10             10
    A                   AA           02/01/2014    10            
    20
    A                   AA           03/01/2014     15           
    35
    B                  BB            01/01/2014     20          
    20
    B                  BB            02/01/2014     10           30
    The YTD field would be a calculated field. I would need to be able start a new YTD in Jan of the next year. Really could use some help and direction on this one. Easy to do in an Excel spreadsheet. Can't seem to get it in SQL. Thanks in advance.

    As of 2008 R2 the choices are:
    - Self join
    - Correlated subquery (in the SELECT or APPLY clauses)
    - Cursor
    - SQLCLR aggregation function (winner)
    The first two options yield a poor performance for tables with considerable number of rows.
    Example:
    select
        A.*, 
        select
            sum(B.Result)
        from
            T as B
        where
            B.FunctionID = A.FunctionID
            and B.UnitID = A.UnitID
            and B.Dateof >= dateadd(year, datediff(year, '19000101', A.Dateof), '19000101') --bofyear
            and B.Dateof <= A.Dateof
        ) as YTD
    from
        T as A;
    Check these old but very interesting posts from Adam Machanic.
    http://sqlblog.com/blogs/adam_machanic/archive/2006/07/12/running-sums-redux.aspx
    http://sqlblog.com/blogs/adam_machanic/archive/2006/07/12/running-sums-yet-again-sqlclr-saves-the-day.aspx
    The things get easier from SS 2012 with the enhanced OVER clause (introduction of window frame extent).
    select
        sum(Result) over(
        partition by FunctionID, UnitID, year(Dateof) 
        order by Dateof
        rows between unbounded preceding and current row
        ) as YTD
    from
        T;
    http://sqlmag.com/sql-server-2012/sql-server-2012-how-write-t-sql-window-functions-part-3
    AMB
    Some guidelines for posting questions...
    AYÚDANOS A AYUDARTE, guía básica de consejos para formular preguntas

  • Report for current day and current month

    Hi gurus,
    i 've a report, where i 've to display the values for qty and cost of the material for the current day and current month
    HOw can i do this in BEx Query designer..If any document plz share
    thanks
    rakesh

    hi Kolli
    here i want to filter the data on system date,
    i wnt the report to pick the date dynamically based on the system date.
    but i think restricting on calmonth and calday is not going to solve my scenario..
    rakesh

  • Calendar to get week number of current month

    Hi All,
    Description: Currently I am working on an application which require to calculate some data for current month from a database where I have the data of all the previous and current month of that year, I can take week number as criteria.
    Help Required: I can find week of month or year using Calendar methods but how to find the first week on the current month only.
    Lets suppose the current month is April so when I use, int weekofmonth = cal.get(cal.WEEK_OF_MONTH);
    it will return me the number of present week however I want to get what would be the week number at the start of the month (April).
    Hope I am able to describe my query properly.
    Thanks in advance.
    Amit

    / ====================================================
    Method: Get the desired Date format for the date
    Developed By: Sandip Waghole [29-Jan-2010]
    ==================================================== /
    public String getWeekNo(String strDate)
    // input Date Format : M/dd/yyyy
    int weekNo=0,i=0;
    String strWeekNo=null;
    int noOfDaysInTheYear=365;
    int WEEK_STARTS_ON = 1; // Define the day on which week starts Sunday/Monday 1:Sunday 2:Monday
    int firstDayNoInFirstWeekOfPresentYear=0; // Inititalize teh day on which week is starting in present year
    int firstDayOfPresentYear=0; // Inititlize the 1st day of the present year whether Sunday/Monday/.....
    int[] monthDaysArray = {31,28,31,30,31,30,31,31,30,31,30,31}; // Define array of the days as per months
    int todaysDayNoInPresentYear=0;
    int daysLateByFirstWeekStartedAfterYearStarted=0;
    int intTemp=0;
    //strDate="08/24/2000"; // For test purpose
    StringTokenizer strDateTok = new StringTokenizer(strDate, "/ ");
    int month = Integer.parseInt(strDateTok.nextToken());
    int day= Integer.parseInt(strDateTok.nextToken());
    int year = Integer.parseInt(strDateTok.nextToken());
    GregorianCalendar cal = new GregorianCalendar();
    // Check if present year is leap year
    boolean boolIsLeapYear = cal.isLeapYear(year);
    // If it is boolean year then add 1 to total days in the year & add one more day to february
    if(boolIsLeapYear)
    noOfDaysInTheYear=noOfDaysInTheYear+1;
    monthDaysArray[1]=monthDaysArray[1]1;
    // Find the 1st day of this year
    Calendar calObj = new GregorianCalendar(year, Calendar.JANUARY, 1);
    firstDayOfPresentYear = calObj.get(Calendar.DAY_OF_WEEK);
    int intRemoveNoOfDaysFromWeek=0;
    // # Find the day no of prsent day
    for(i=0;i<month;i+) // get no of days till present year
    intTemp = intTemp monthDaysArray;
    todaysDayNoInPresentYear = intTemp - (monthDaysArray[month-1]-day);
    if(firstDayOfPresentYear==6 || firstDayOfPresentYear==7) // If first Day is Friday or Saturday then it is week
    // Identify the the day no on which 1st week of present year is starting
    firstDayNoInFirstWeekOfPresentYear = 7 - firstDayOfPresentYear WEEK_STARTS_ON 1;
    // Find delay in the 1st week start after r=the year start
    daysLateByFirstWeekStartedAfterYearStarted = firstDayNoInFirstWeekOfPresentYear - 1;
    // Now week is starting from Sunday
    weekNo = (Integer)((todaysDayNoInPresentYear-daysLateByFirstWeekStartedAfterYearStarted)/7);
    // Find the day no of today
    intTemp = (todaysDayNoInPresentYear-daysLateByFirstWeekStartedAfterYearStarted) % 7;
    if(intTemp > 0)
    weekNo=weekNo+1;
    else
    weekNo=weekNo;
    else
    // 1st week is starting on 1st Of January
    firstDayNoInFirstWeekOfPresentYear=firstDayOfPresentYear;
    // Remove no. of days from the 1st week as week is starting from odd Sunday/Monday/Tuesday/Wednesday/Thursday
    intRemoveNoOfDaysFromWeek = 7-firstDayOfPresentYear 1; // 1 added as include start day also
    // So one week will be added in no. of weeks
    weekNo = (Integer)((todaysDayNoInPresentYear-intRemoveNoOfDaysFromWeek)/7);
    // Find the day no of today
    intTemp = (todaysDayNoInPresentYear-intRemoveNoOfDaysFromWeek) % 7;
    weekNo = weekNo +1; // As 1st weeks days are reduced from the todays day no in the year
    if(intTemp > 0)
    weekNo=weekNo+1;
    else
    weekNo=weekNo;
    // Remove the no. of days from the week 1
    strWeekNo=Integer.toString(weekNo);
    return strWeekNo;
    // Any issues please mail on [email protected] or [email protected]

  • Expression - First date and last date of current month, current year

    Hi
    I need to have 2 ssrs expression as I can use  as default parameters in my report where I can -  out from my Time dimension, get the
    first date of the current, current year - and one where I get last date, current month, current year.
    My data source is a SSAS cube and my timedimension is structured like this:
    [Time].[Days].&[2009-01-16T00:00:00]
    Any suggestions how to solve this ?

    Hi ,
    You can use below in Default Values in ssrs ;
    for first Day of current month and year
    ="[Time].[Days].&[" +Format(dateadd("m",0,dateserial(year(Today),month(Today),1)), "yyyy-MM-dd")+"T00:00:00]"
    output will be ;
    [Time].[Days].&[2014-09-01T00:00:00]
    For last day of current month and year
    ="[Time].[Days].&[" +Format(DateSerial(Year(Now()), Month(Now()), "1").AddMonths(1).AddDays(-1), "yyyy-MM-dd")+"T00:00:00]"
    output will be ;
    [Time].[Days].&[2014-09-30T00:00:00]
    Please correct me if I misunderstood your requirement.
    Thanks
    Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem.

  • SSRS Date parameter - current month from SSAS cube

    I have a SSAS cube with a date dimension called Posting Period and now I would like to have my report parameter using this date dimension to show the current month.
    So far I have worked out the following expression which are working(Fiscal year calendar going from May to May) for the year component - but I can't figure out how to get it to work on Quarter date part (and the month) so as you can see
    the Quarter and month is hardcoded in the below expression:
    ="[PostingPeriod].[Posting Period].[Year].&[" + CStr(Year(Today())-1) + "].&[Q4].&[10]”
    Any help would be appriciated.
    Tx

    Hi HCMJ,
    In your scenario, you use the expression
    ="[PostingPeriod].[Posting Period].[Year].&[" + CStr(Year(Today())-1) + "].&[Q4].&[10]”
    to set the default value of the parameter and then use it in the MDX query, right?
    If in this case, you can use the expression below
    ="[PostingPeriod].[Posting Period].[Year].&[2013].&[Q" & DatePart(DateInterval.Quarter,today()) & "].&[10]”
    to set the value on Quarter date part.
    And it returns:
    If I have anything misunderstood, please point it out and elaborate the meaning of "but I can't figure out how to get it to work on Quarter date part (and the month) so as you can see the Quarter and month is hardcoded
    ", so that we can make further analysis.
    Regards,
    Charlie Liao
    TechNet Community Support

  • SSRS Matrix report. Variance expression by Month. Need to compare month from prior year to current month of current year VS2010

    Please help.  I have a matrix report.  In the report I have row group  PO Type.  One the Column groups I have a parent group by Fiscal Year, and then a child group by Month.  When I run the report, I get two years of data back broken
    out by month.  Please see below.
    Now here is where I am getting stuck.  I need to take the variance between the current month of the current year, from the same month of the prior year.  So I need to show the difference between Oct , 2014 from Oct, 2013. November, 2014 from November
    2013... etc. etc.
    In the example below, how do I create a column or row showing the variance for Contracts for October 2014.  I need to take the contracts for October 2014 which is 3 and subtract that from October 2013 which is 8.  Any suggestions? How do I do that
    for each month?  Then I need to do it for the quarter... then the year?  But I'll be happy if I can just get the month working first.
    Any help will be appreciated. 
    here is what my rdl file looks like.
    Here is what my report looks like when I render it.

    Hi Adrian_s2012,
    According to your description, you want to compare values for the month of current year with the month of prior year and get the variance. Right?
    In Reporting Services, we don't have any function to get this "Year to Year" Growth. In this scenario, if you data source is a cube, we suggest you use Analysis Services to achieve your requirement. If this data source is just from database, it will be hardly
    to calculate the variance because we need to compare the values within every two different column group and matrix generate adjacent columns one by one. Even we make it by using custom, every time executing the long code when generating result
    in a cell will reduce a lot of performance, we really don't suggest to do that in SSRS. Here is a thread with much easier requirement, please take a reference of that:
    http://social.msdn.microsoft.com/Forums/office/en-US/842e2dcb-d949-4297-9d91-eac989692cb5/difference-between-the-grouped-column?forum=sqlreportingservices
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • FR : How to change from monthly to YTD or quarter data in the same report

    Hi,
    We have several basic reports with 12 month in columns with monthly figures. We would like to try to improve these reports with 2 options (and not creating new reports):
    - For each month, we would like to choose between monthly & year to date figures. (we do not have a view dimension with YTD member)
    - In our period dimension we also have quarter members. How to choose between displaying month or quarter with the prompts ? (ie without having to select each month one by one)
    Does it is possible to do this with FR without adding a new dimension for monthly or YTD data?
    thanks!
    Tipiak

    Hi Tipiak,
    In order to show YTD Actual figure for the selected month, I was doing something like that
    - Add a hidden col from Jan to Run Time period selected.
    - Add a visible formula col and add the formula showing the total of the hidden col.
    Your requirement seems more complex but you might meet some part as an initial step maybe...
    Regards,
    Ahmet

  • Default value in a variable - current month

    Hi!
    I have a infoobject called CREATE_MONTH. My queries divides the result based on this month. If there are several month it summarize the result. The CREAT_MONTH is a free characteristics, and not defined in the main table.
    I want the current month value as a default. Is this possible?

    Hi.....
    As already told......You have to use an Offset for the variable...
    Check this :
    Re: How to create a variable in Bex Query Designer
    This will help you.........
    Regards,
    Debjani.........

  • Current month open sales orders

    Hello Experts,
    I have requirement to build a custom report to calculate open sales order quantity and its count for current month. I know we can use VBBE for open quantity and VBUP for the status to capture the count, however how can i add the logic to get the required information for the current month. Is there a function module or BAPI available which can be of any help, i have to consider the performance issue too, if i were to use multiple tables. Please advise
    Thanks
    Rahul

    HI Rahul,
    There is a standard BAPI available for listing Sales Orders.
    <b>BAPI_SALESORDER_GETLIST</b>
    However to meet your requirement of <b>OPEN sales orders</b>, you will have to modify this BAPI to suit your purpose. You can give appropriate logic to you ABAPer with reference to tables VBUK,VBUP, etc. This means that you will have to create a new Z-BAPI, keeping the above BAPI as the core.
    Once this is done you can wrap Z-BAPI in a transaction code or a program/ report, so that it is ready to use by business.
    Selection Variants can be used to default the date range as 01/MM/XXXXX to 31/MM/XXXX.
    Hope this will prove of some help to you..
    if yes then ..pls reward liberally
    Sachin Bhonsle

Maybe you are looking for

  • Office 2013 hangs when saving files to local profile locations on Windows 2012 server

    We installed Office 2013 a few weeks ago instead of Office 2003 on a Windows 2012 standard terminal server. We installed the last updates and Office is up-to-date now, but we experience problems with saving word, excel and powerpoint documents when w

  • Net price in sales order

    Hi, The Net price which displays in my sales order conditions on top is wrong . Where is the calculation done for this in pricing procedure.Kindly let me know how to calculate the net price.

  • The format of XML file returned from web service

    Hi everyone, My web service (build in asp.net 2.0 with C#) returns the following xml file which is not what I want. <Root> <Root2> <Person> .... </Person> <Person> .... </Person> <Person> .... </Person> </Root2> </Root> But I want my web service to r

  • Application Runs, Won't Quit Or Force Quit... Ideas?

    Issue: My computer has been running slow and now I have been having issues with the applications. I will launch an application (such as Firefox or Mail) and it runs fine. I then try to quit the application and the window will close. The application d

  • ORA-00932 Error using 11g and the SDO_RELATE function. Works fine in 10g

    Hello, If I run this query in Oracle 11g: SELECT M.FID, MAX(M.VERSION) AS VERSION FROM SW_PB.A_ROADNODEINFORMATION M, SW_PB.ROADNODE N WHERE M.REFERENCETOROADNODE = N.FID AND M.NODEVERSION = N.VERSION AND M.CATALOGUEID <= 477 AND MDSYS.SDO_RELATE( N.