Reporting on Previous Month/Current Year - Jan 09 fix

I currently have about 10 reports that are being filtered to only show data on the repository variables for :
PreviousMonth and Current Year.
When Jan 1, 2009 comes around, these reports will be kicked off to show Decemeber of the Current Year, so December of 2009.
What is the best/easiest way to fix this problem for the future?

What Shiva meant was to let YEAR be a Presentation Variable that the user can select from, say a drop down list of "years."
But consider this. Whenever the month of the "system date" is January, you want the year to be one less than the "current year." For all other months, you want the year of the "system date."
PrevYear = CASE WHEN MONTH(Calendar."System Date")=1 THEN YEAR(TIMESTAMPADD(SQL_TSI_YEAR, -1,Calendar."System Date")) ELSE YEAR(Calendar."System Date") END
And since you weren't sure about how to do the previous month...
PrevMonth = MONTH(TIMESTAMPADD(SQL_TSI_MONTH,-1,Calendar."System Date"))

Similar Messages

  • 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.

  • Calculating previous month and year of the previous month

    Hi frenz,
    Can anybody know FM to calculate the previous month and year of the previous month.
    are there any standard FMs existed to achieve this?
    br,
    anil.

    hi,
    lv_period gives the month and year which is two months earlier now as we have specified lv_months as -2.
        DATA: LV_PERIOD LIKE S001-SPMON,
              LV_MONTHS(2) TYPE C VALUE '2-',
              LV_DATUM LIKE SY-DATUM,
              LV_NEWDT LIKE SY-DATUM,
            P_SPMON LIKE S001-SPMON VALUE '200601'.
        CONCATENATE P_SPMON '01' INTO LV_DATUM.
        LV_PERIOD = P_SPMON+0(6).
        CALL FUNCTION 'MONTH_PLUS_DETERMINE'
             EXPORTING
                  MONTHS  = LV_MONTHS
                  OLDDATE = LV_DATUM
            IMPORTING
                 NEWDATE = LV_NEWDT
             EXCEPTIONS
                  OTHERS  = 1.
         IF SY-SUBRC = 0.
           LV_PERIOD = LV_NEWDT+0(6).
         ENDIF.
    WRITE :/ LV_PERIOD.
    Regards,
    Sailaja.

  • How to show a report for 'Previous Month' Data

    Hi Gurus,
    I have a requirement, where i have to default my report to show previous month data.
    Scenario:
    My prompts by Default are set to CURRENT (current year,quarter,month). once the user logs in, the report should display data for month 'Nov' instead of 'Dec'.
    I tried using TIMESTAMPADD() in the formula , but it didn't work, though i don't see any error. Not sure if i 'm missing something.
    Is there a way to achieve this.I 'm using OBIEE 11.1.1.6.
    Any help is highly Appreciated ! Please.
    Thanks,
    Ramya

    From what you wrote I am assuming the user can manually save the report results to the Excel file.
    If your report uses ALV Grid it is possible to export the data to a spreadsheet (one of the functions available in the ALV tool bar).
    If you have used WRITE statements it is also possible to save the output as a spreadsheet (menu System -> List -> Save), but the latter will not produce as nice a spreadsheet if the data don't form a matrix. In other words, some work may be necessary in the spreadsheet afterwards before it has the format your user wants.

  • Current Month & Current Year Sales

    hi,
      How to get current month sales & previous month sales if sales measure is available for 2 years. I would like to display current month sales in one column and previous month sales in the second column and difference in the next column. For example, if i take this month as the current month, i have to display march sales in first column, february sales in second column and difference in third column. If you take a query designer, we restrict by month and display that month's value. Please advise.
    Thanks in advance.

    Hi
    create two variables in your WebI report containing if then clauses which restrict your key figures to the actual (or previous) month. Use those variables instead of your key figure directly.
    (NOTE: THIS IS PSEUDO CODE):
    if [0CALMONTH]=CurrentMonth then [KeyFigure1] else 0
    if [0CALMONTH]=PreviousMonth then [KeyFigure1] else 0
    The third column can contain the difference between the first two variables.
    Regards,
    Stratos

  • Current Month, Current Year Variable on Posting Date

    Hi,
    I need to construct a BEx variable that will return the Current Month of the Current Year based on Posting Date. I want to be able to compare Current Month of the Current Year with Current Month of the Prior Year. I know SAP delivers variables for this based on 0CALMONTH. Is there any way to create the variable off Posting Date without having to write a customer exit?
    Thanks,
    C

    I guess you could use replacement path variables for the same. No need to write customer exits.
    Create 2 variables, one on calmonth and the other on calyear.
    Variable on Calmonth -
    type - replacement path.
    Replacement path tab - repace with variable, give variable name into which user enters the posting date, replace with key, offset start 2 and offset length 2.
    Variable on calyear -
    type - replacement path.
    Replacement path tab - repace with variable, give variable name into which user enters the posting date, replace with key, offset start 4 and offset length 4.
    to get key figures for current month and previous year, restrict the key figure with calmonth variable created above and use offset on the calyear variable created above, like zcalyear - 1.

  • Previous Month, Current Month, Percent Change

    Post Author: lcrawfor
    CA Forum: Formula
    I need to create a report which shows the count of orders for the previous month, the current month and the percent change. An example follows.I suspect I need to use sql expressions but I can't figure it out. Anbody else know how to do this?Crystal Reports X1, SQL  Server 2005Orders tableCUSTNUMB       VARCHAR(15)ORDER_DATE    DATETIMEREGION             VARCHAR(10)ORDER_NUMB   INTOrders Monthly Summary ReportRegion                     2007 - 07                           2007-08                Percent ChangeEast                           3,478                                 4,568                         31%North                          2,364                                 2,578                          9%South                         7,634                                 7,189                         -6%West                         1,891                                  2,231                        18%Total                        13,665                                16,566                          21%

    Post Author: Jagan
    CA Forum: Formula
    Simplest way would be to use a Command or view to return the count grouped by region,month and just report off that.
    Another way I think will work is:
    Group on Region (group 1) then Date (group 2).
    As you've only got two months of data, presumably restricted by the record selection formula, implicitely ordered by the grouping, in the group 1 header you'll be 'looking' at the 1st month's 1st record so use a formula to calculate and store the count for the 1st month:   count({table.x}, {table.date}, "monthly")
    In group 1's footer you'll be 'looking' at the 2nd month's last record; that month's count is also  count({table.x}, {table.date}, "monthly");Suppress the details etc., print these in group 1's footer and use to calculate the %change
    Of course, this assume that there's always data for both months, but it's not too tricky to account for this if necessary.

  • How to get the previous month and year accordingly

    Hi friends,
    I wanted to select month as number like 4 and year as 2011
    but I want to select the previous month as of sysdate
    like if the sysdate is 10-jun-2011
    it should give me 5 as month and
    in the year it should give as 2011
    if the sysdate is 01-jan-2012
    the month should be as 12 and year should be as 2011
    thanks

    Hi,
    776317 wrote:
    thanks a lot I just dont need the 0 being prefixed... can you pls tell how to avoid that as well pls
    TO_CHAR ( ADD_MONTHS (SYSDATE, -1)
            , 'FMmm yyyy'
           )For details about how the FM modifier works, wee the SQL Language manual:
    http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/sql_elements004.htm#sthref456

  • Same date of previous month / Leap year

    In my requirment , I am passing a date, I want a function module which will return me the same date of last month. I have found a function HR_PSD_DATES_ADD_MONTHS , but it is not giving output if I pass date as 31st March 2000 , as previous month is February and its a leap yr.
        If you know  function module which could help me , pls help me.

    Hello,
    Try this way :
    REPORT ZTEST_NP .
    parameters: p_dt type d.
    data:
    lst_dt type d,
    l_dt type d,
    days type i,
    prv_dt type d.
    l_dt0(4) = p_dt0(4).
    l_dt4(2) = p_dt4(2) - 1.
    if l_dt+4(2) le '00'.
    l_dt+4(2) = '12'.
    endif.
    l_dt6(2) = p_dt6(2).
    CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
      EXPORTING
        DAY_IN                  = l_dt
    IMPORTING
       LAST_DAY_OF_MONTH       = lst_dt
    EXCEPTIONS
       DAY_IN_NO_DATE          = 1
       OTHERS                  = 2
    if lst_dt ge l_dt.
      prv_dt = l_dt.
    else.
      prv_dt = lst_dt.
    endif.
    write: prv_dt.
    regards,
    Naimesh

  • Sceduling of report of previous monthe in background job

    Hello Techies,
    I have  2 issues.
    1. i want to scedule bacground job of some previous months dates . How to do that?Please tell me step by step. And also i want content of that report should be visible to me.
    2. I want to do some chanes in Single Role which has been assigned to various user. That role containes the profile which is copy of SAP_ALL profile. Now i want to remove some specific Transactions from itlike CJ20N,VA02,FB08 ETC.
    NOTE: Menu tab is unmainted int it. And I also gone with Tcode Ranges BUT ITS NOT WORKING.
    Expecting reply on early basis.
    Renu.

    Answer for the first point
    1.Make a transaction which fetches the required data from ECC(O any data source), i suppose you must be having some data source where the past records are stored.
    2.In this transaction you must be using some Action Block to fetch the data (Eg BAPI or FM), this BAPI or FM must have some input on which you want to fetch the data , and i guess there must be some start and end date i/p field on which you want the data.
    3. In this start and end date field map two transaction variable like Start_Date and End_Date.
    4. Now from the schedular you can pass the start and end date to this BLS and in the BLS before mapping these dates you can use date functions which converts the date passed by you to one month back or so according to your requirement.
    I guess this will resolve your first query.

  • HP Officejet G85 - how do i print a fax report for previous month?

    When I select "Print Fax Report" from menu, prints only last 30 faxes. Can I print fax report of a longer period, such as the previous month?

    Hi there,
    Unfortunately I do not see any options availble like that for the G85. There does not seem to be a readily available option sorry.
    Best of Luck!
    You can say thanks by clicking the Kudos Star in my post. If my post resolves your problem, please mark it as Accepted Solution so others can benefit too.

  • Report Issue: Previous Weeks, Current Week and Next Week Values

    Hello Folks,
    this is a typical requirement...at-least typical for me..
    we have 20 weeks of data at weekly level. we have four Metrics out of which two are coming from Database and rest two are calculated metrics.
    Metric0: On Hand Qty
    Metric1: Past Qty
    Metric2: sell Qty
    Metric3: unsell qty
    Metric4: Total Qty
    the report will always be shown for 20 weeks, but depending on whats my current week, all the past weeks should be flagged as Past Week. (so i wrote a case statement for this). for Instance: I am in Week11, so my weeks in should be Past Week, Wk11, Wk12.........Wk20.
    Metric 1 is always dependent on result of Metric4 (This is the Complexity) per week basis
    Metric1 for Past weeks value in Week Column will be wk1 to wk10 On Hand Qty (fox ex: 80)
    Metric4 for Pass Weeks Value in Week Column will be Metric1 for Pastweeks + Metric2 for Past Weeks (For Ex: 20) (Past weeks mean wk1 to wk10)
    value of Metric4 is now 100
    Metric1 for Week11 Now should 100 (From Past weeks Calculation)
    Metric4 for Week11 will be Metric1 for Week11(100) + Metric2 for Week11(10) + Metric3 for Week11 (10)
    Now...Metric1 for Week12 will be 120 which is wk11 total (100+10+10) and goes on Until Week 20
    Any Ideas how to achieve this in obiee 10g
    Thanks
    Rake

    Please try out in this way....
    Database level --Create opaque view & procedure or function  to get the week total,week ago total, current week , Past week ,future week & do rpd modelling and use PIVOT VIEW.
    At answers:
    1.Here Previous week M4 is the current week M1 which means it is a cumulative value carried forward week by week.
    2. M2 & M3 are direct database columns.
    3. You have time hierarchy with WEEK Level.
    M1 - ago(rsum(m2+m3),weeklevel)
    M4- RSUM(M2+M3)
    week -AGO(RSUM(M2+M3)- M2-M3-RSUM(M2+M3)
    w1-0-10-20-30
    w2-30-11-21-62
    w3-62-12-22-96
    Now you can PIVOT IT to get in
    W1-W2-W3
    M1 0 - 30-62
    M2 10-11-12
    M3 20 -21-22
    M4 30 - 62-96
    NOW PASTWEEK (W1-W10), CURRENT WEEK(W11)-W12
    1.as you see cumulative here you need to use BINS.means ( case when week <= currentweek(maybe variable) then prior) else week)
    2. UNION - combine similar request - First cirteria week <= w11 and second criteria week > week 11 --combine pivot it. Use sum agg in fx criteria1.
    Hope this should solve your pblm at answers.
    Edited by: MK on Oct 27, 2011 12:48 PM

  • Set Parameter to pick up previous month and year unless first month of the year

    Hi,<o:p></o:p>
    I have a start and end date set to the same format (CCYYMM) and date.<o:p></o:p>
    I am running a report each month using the below expression.<o:p></o:p>
    =Year(Today()) * 100 + Month(Today().AddMonths(-1))<o:p></o:p>
    This functions correctly except when the report is run in January where the date returned is 201512 instead of 201412.<o:p></o:p>
    Can someone advise of how i can get this expression to show the correct month when i run this in January?
    M Stoker

    =Format(DateAdd(DateInterval.Month,-1,Today()),"yyyyMM")
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Help with Setting Previous Month Date Parameter for SSAS via SSRS

    Hi All,
    Firstly, any assitance is greatly appreciated.
    Now, I am working on developing a report for a business area that will be sent on the first of every month. The report will contain data for all records created in the previous month, current year.
    I have been able to successfully implement a default year parameter, which will default to current year-
    ="[REFERRAL LODGEMENT DATE].[CAL YEAR].&["+CSTR(Year(Today))+"]". However, when I attempt to set a previous month paramater it is not setting when the report is generated. The code I have used
    is as follows: 
    ="[REFERRAL LODGEMENT DATE].[CAL MONTH NAME].&["+CSTR(Month(Today)-1)+"]"
    Cheers

    Before you spend more time trying to fix the parameter, let me suggest that you can write MDX to come up previous month data.
    if you can't go that route, couple of things to consider for your approach:
    1) don't subtract 1 from January that won't work. you'll need to handle it using the ssrs expression.
    2) when you use the month function it's going to return a month index so effectively you are passing something like [REFERRAL LODGEMENT DATE].[CAL MONTH NAME].&[7] to SSAS, is that the current format?
    you can use the MonthName function to get month names but again make sure that the formatting is right.
    to see the parameter value, you can display it on the ssrs report and see if it's the right format.
    Paras Doshi (Blog: ParasDoshi.com | Twitter:
    @Paras_Doshi )

  • How to find current month, previous month Net Sales by means of formula?

    Hello Gurus,
    I need my crystal report to display data as below:-
                                            Net Sales
    PG1         Current month      Previous Month     Prior year-month    %Variance
    Panels      $                          $                          $
    Frames
    Can anyone kindly suggest formula for generating these values?
    I have already formulated current, previous, prior year months' start dates and end dates.
    Further details:-
    Data filters are requested for Company-->Region-->Customergroup-->All Product group
    Datasource is Universe
    Reporting for 2 years data
    Your suggestions and help will be much appreciate.
    Thanks,
    Prarthana

    hi Prarthana,
    there are a couple of different ways of doing this...one way is to create formulae similar to below...
    1) formula for current month sales
    if month({your date field}) = month(currentdate)
    and year({your date field}) = year({your date field})
    then {your sales field}
    2)  formula for previous month sales
    if month({your date field}) = month(dateadd("m", -1, currentdate))
    and year({your date field}) = year(dateadd("m", -1, currentdate))
    then {your sales field}
    3) formula for 2 months ago
    if month({your date field}) = month(dateadd("m", -2, currentdate))
    and year({your date field}) = year(dateadd("m", -2, currentdate))
    then {your sales field}
    put those formulas on your details sections and then right click on them and choose Insert > Summary and choose Sum as the summary type and change the Summary Location to match the appropriate groups.
    cheers,
    jamie

Maybe you are looking for