Formula to subtract current month from previous month

Hi
I would like to how to subtract current month from previous month in Crystal 10.  Basically am looking at the variations that between the two month .   I would also like to know the 12 m onth rolling data formula.  Using the same formula, you need to get the difference between the two month.
Any help on this is very much appreciated.
Thanks
Regards
Cauvery

Hi Thanks for reponding.
Though the formula is correct, I don't think it will work out in that way because I have a 12 months rolling data  formula and using this formula  I have to subtract the current month from previous month.
This the formula that am currently using for 12 months rolling data
{HPD_HelpDesk.Arrival Time} >= DATEADD ("yyyy", -1, CURRENTDATE)
Please advise.
Regards
Cauvery

Similar Messages

  • Parameter for Current Month and Previous Month

    I'm trying to create a parameter for current month and previous month based on the ex_date, but not sure what i'm doing wrong. 
    where ex_date = @SelectDate
    I created a second dataset below for the values in the parameters.
    SELECT Month(CURRENT_TIMESTAMP) AS 'Month', 'Current Month' as 'Current Month'
    union all
    SELECT Month(CURRENT_TIMESTAMP)-1 AS Month, 'Previous Month' as 'Previous Month'
    Results
    Month Current Month
    3 Current Month
    2 Previous Month
    Once I preview it I get "Conversion failed when converting date and/ or time from character string" I changed the data type to "date/Time" but that did not make a difference. The date is convert (varchar(10), ex_date, 101) so looks like
    11/12/2014. 
    I've also tried expressions like =month(now()) to pull current month with same error so i'm not sure what i'm doing wrong. Any ideas?

    i tired this real simple report
     in the first dataset - my main report query - select name from sysdatabases where month(crdate())=@month
    in the second dataset - select month(getdate()) as Month1
    in the parameters - choose int data type and available values - select the second data set
    in the first data set- add this parameter..( i am assumming you know this, since you have done)
    in the preview you should get the drop down with current month number - 3
    and if you run the report, it will display the database names that were created in march. remember we are no checking year, so will get all that were created in march across the years.
    Hope it Helps!!
    I'm looking to have the dropdown say "Previous Month" and "Current Month" as a option. I know how to get the information in SQL, but not sure how this translates or put into a parameter.
    Current Month
    list_date BETWEEN
    DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()), 0)
    AND
    DATEADD(MONTH, DATEDIFF(MONTH, 0, GETDATE()) + 1, 0)
    Previous Month
    list_date between
    CONVERT(varchar,dateadd(d,-(day(dateadd(m,-1,getdate()-2))),dateadd(m,-1,getdate()-1)),106) /* Last Month */
    and
    CONVERT(varchar,dateadd(d,-(day(getdate())),getdate()),106)

  • TS4036 I added Icloud to join my calendar to another person. It erased all history date from previous months. how do I get that data back?

    I added Icloud to join my calendar on my phone to another person. It erased all history date from previous months. how do I get that data back?

    i found the answer to the first part: reboot and keep hold of command+r
    this gave me a list of options
    one of them was to reinstall lion from fresh
    i went for this
    dont know why... but all forum posts i read said u should delete hard disc? theres an option for this
    which is the right option?
    any suggesstion where i go to register new mac would be great
    thanks

  • TAX SUMMARY REPORT: Credit from previous months

    Dear experts, I have a problem in the Tax Summary Report. In this report there is a wrong value in the fiel "credit from previous months". The correct value is "0" but in the report I find another value.
    I print the report of the previous months and there is the same problem (wrong value of credit from previous months)
    SAP B1 A SP00 PL42.
    Thanks
    Paolo

    Create a new user is not a solution to my problem.
    There is a configuration file where SAP B1 stored the data of each user?
    Thanks.
    Paolo
    Edited by: Paolo Orlando on Aug 25, 2009 5:06 PM

  • A day from previous month

    Hi,
    Is there any function module to get a day from previous month? I tried FM 'CCM_GO_BACK_MONTHS', but it is not working correctly.
    If I give the sy-datum input as '03/30/2007', it is giving the previous month date as '02/30/2007'
    Thanks,
    Uma.

    Try.....
    report zrich_0001 .
    data: day_from_previous type sy-datum.
    call function 'RE_ADD_MONTH_TO_DATE'
      exporting
        months        = '-1'
        olddate       = sy-datum
      IMPORTING
        NEWDATE       =  day_from_previous.
    write:/  day_from_previous.
    Please be sure to award points for helpful answers to all your threads today, and mark as solved when answered completely.  Thanks.
    Regards,
    Rich Heilman

  • Wagetypes /561(Claim) and /563(Claim from Previous month

    Hi,
    Please explain the wagetypes /561(Claim) and /563(Claim from Previous month). and thier relevance.
    I know that the difference between /561 and /563 shows the net amount that SAP has reclaimed from the overpayment in a single month.
    What in case these wagetypes occur in case of a LEAVER? Then how this should be dealt with.

    Hi Srijit,
    Thanks for replying.
    My case is of an employee who left the company in June08. His last payroll was run in June.
    Now when the salary of february was processed it came to notice that  Rs388/- was posted into employee suspense account. His salary statement shows Take Home pay as Zero.
    The posting shows the following:
    /552 ( stat net adj)  ( amount)388.00 (credit)
    /561 (claim) (amount)50,390.00 ( debit)
    /563(claim from prev month) (amount) 50,002.00( credit)
    This is the scenario.
    Edited by: dips on Feb 27, 2009 7:32 AM
    Edited by: dips on Feb 27, 2009 7:33 AM
    Edited by: dips on Feb 27, 2009 7:36 AM

  • Data being removed from previous months calendars.

    My
    Data is being removed from previous months calendars

    Go to settings>mail,contacts, and calendars. Make sure the settings for Sync under calendars is set to all events to sync all past events.

  • Can someone please help - I want to sync my icloud calendar with my iphone calendar.  All of my entries from previous months are on my icloud calendar but not my iphone.  How do I get them back on there?

    Can someone please help - I want to sync my icloud calendar with my iphone calendar.  All of my entries from previous months are on my icloud calendar but not my iphone.  How do I get them back on there?  I have corrected my settings for future entries (I think/hope) but want to put the old stuff back on.

    Try this...
    Settings > Mail, Contact, Calendars.  Scroll down to Calendars and set "Sync" as desired.

  • Why has my calender lost past inputs from previous months?

    Why has my calendar lost inputs from previous months?

    Hi, Shirvinhurst
    Thank you for visiting Apple Support Communities. 
    This sounds like the days to sync are limiting the past events.  I would recommend changing the days to sync to your preference by going to Settings > Mail, Contacts, Calendars > Sync.  Just in case you need to reference this information, it is located on page 61 of the user guide below. 
    iPad User Guide
    Cheers,
    Jason H. 

  • Records for parameter month and previous month

    Hi,
    I have a request where the user parameter is calender year month (YYYYMM).I need to show the records of both the entered month and previous month.
    For ex: if the user enters 201107, I need to show the records of 201107 and 201106.
    Also,I am not using dashboards.
    Any suggestion...
    Thanks

    No, I don't see this as a solution. A session prompt can only be overridden by using a Request Variable, but they are found in Dashboard prompts which you have excluded as a solution. Therefore, any session variable you set would be "hard-coded" eliminating end-user interaction. Sorry.
    You will need to deploy dashboards for this. I will also add this: eliminating dashboards really restricts the power of OBI because it makes it difficult to implement interactive reports such as the one you are building. Perhaps you should use this example as a push to consider adding the value of dashboards to your environment.
    As this is useful information to others, please mark applicable posts that resolved your question. Thanks.

  • How to get last week of the month from a month

    Hello,
    I want to get last week of the month from a month. For example: If Input = April then Output = Week17. Is there any function module? Or what should be the logic inorder to meet such requirement?
    Thanks in advance for your answers.
    Nitin.

    Hi,
    Just cpoy and past this program, and see the result and apply for you requirements.
    Data: ZSCDATUM TYPE SCDATUM,
          ZKWEEK TYPE KWEEK,
          ZDAY TYPE SY-DATUM,
          ZLDAY TYPE SY-DATUM,
          ZWK(3) TYPE N,
          ZM(2) TYPE N.
          ZDAY = SY-DATUM.
          ZM = ZDAY+4(2).
          CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
            EXPORTING
              day_in                  = ZDAY
            IMPORTING
             LAST_DAY_OF_MONTH       =  ZLDAY
    *       EXCEPTIONS
    *         DAY_IN_NOT_VALID        = 1
    *         OTHERS                  = 2
          IF sy-subrc <> 0.
    *         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          ZSCDATUM = ZLDAY.
          CALL FUNCTION 'DATE_GET_WEEK'
            EXPORTING
              date               = ZSCDATUM
           IMPORTING
             WEEK               = ZKWEEK
    *       EXCEPTIONS
    *         DATE_INVALID       = 1
    *         OTHERS             = 2
          IF sy-subrc <> 0.
    *         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          ZWK = ZKWEEK+4(2).
          WRITE: ZKWEEK.
          WRITE: ZWK.
    Thanks
    Reddy

  • Calculating receipts from previous month based on the sales of current mont

    Hi Gurus,
    I have a requirement where i need to display sales for a quarter and need to display receipts from the previous quarter. For example consider that i am displaying sales from week1-Aug to Week4-October, I need to display receipts ( R_Net_RCPTS) from Week1-july to Week4-September. In that way If i select Wk1-Aug for sales it should display Wk1-july receipts. i need to do this in Webi by creating appropriate variables.
    I have got prompts on year and Fiscal Week
    I have given year as 2011 and The "08: Fiscal Week From:" as "Wk1-Aug" to "08: Fiscal Week To:" as "Wk4-Oct"
    I HAVE GONE THROUGH ALMOST ALL RELATED THREADS, BUT COULDN'T FIND ANY SOLUTION. ITS REALLY URGENT. PLEASE HELP ME AND I WILL FOR SURE GIFT POINTS.

    HI
    Your explanation is not clear whether u want to display current quarter data or you would like to see only previous month data ?
    Which dimension you are taking for week ? how data would be like ?
    Edited by: K.sunil on Nov 21, 2011 9:14 AM

  • Delete overlapping request in PC - Request from previous month got deleted

    Hi Everyone,
    We are using a 'Delete overlapping request' step in a process chain. Under the Deletion Selections, we have checked the following options:
    1) Only Delete Requests from Same DTP
       |_ Selections are - Overlapping
    2) Request Date - Is in the Current Month
    3) Exceptions:
       |_ New Request will be loaded on - 1st Day of a Month
    The datasource in this case is used for a Full update into a Cube everyday. We've used the above selections so that the request loaded on the last day of a month is not deleted by the subsequent load. We need this to retain a snapshot of the data for each month.
    This month, when the process chain executed on 1st Feb, the request loaded on 31st Jan was not deleted. However, on 4th Feb, the Process chain deleted the request loaded on 3rd Feb and also the one from 31st Jan. There seems to be no reason at all for the 31st Jan request to get deleted. We've made sure of that by choosing the option 'Request Date - Is in the Current Month' in the Deletion Selections.
    Is there any explanation why the request was deleted?
    Thanks,
    Ram

    Hi,
        If you dont have any selections , it will delete the previous request. Based on the selections only overlap will work.  For your scenario , it wont delete previous month request after changing it to current Fiscal period. Once check the selection options , is it displaying month wise or empty selections.
    Regards
    Pcrao.

  • MDX dimension formula in BPC to get the previous month failed with parents

    Hi,
    I'm working on a proof of concept and I need to create a formula with the following requirement:
    Requirement               
    Account2 = Account2 (Previous Month) + Account 1               
    Accounts -Jan-Feb-Mar-Q1
    Account1_____15___25___45____85
    Account2_____15___40___85___140     <== OK
    Now, I was thinking of applying this formula within Dimension, using MDX. Then I tried with these two examples, but they didn't work when rolling up to parents. I mean, the calculation for every month works fine, but, the Total Quarter or the Total Year are wrong:
    Attempt 1:
    Account2.Formula = (ParallelPeriod([Time].[Month], 1, [Time].CurrentMember), Account2) + Account1
    Accounts -Jan-Feb-Mar-Q1
    Account1_____15___25___45____85
    Account2_____15___40___85____85     <== WRONG
    Attempt 2:
    Account2.Formula = (Account2,[Time].PrevMember) + Account1
    Accounts -Jan-Feb-Mar-Q1
    Account1_____15___25___45____85
    Account2_____15___40___85____85     <== WRONG
    How can I solve this ? Should I use Script logic instead of MDX to perform this calculation ?
    Thanks!
    Diego.

    DON'T use MDX script logic.  It does not perform well under high data volumes or concurrency.
    You're calculation can be done easy enough in SQL logic provided you scope the code correctly.  Based on what you have given as requirements, the basic code would be something like:
    *XDIM_ADDMEMBERSET TIME = PRIOR
    *XDIM_ADDMEMBERSET ACCOUNT=A2
    *WHEN ACCOUNT
    *IS "A1"
        *REC(EXPRESSION=%VALUE%+GET(ACCOUNT="A2",TIME=PRIOR),ACCOUNT=A2)
    *ENDWHEN
    *COMMIT
    The first two lines make sure you have the prior period values for A2 in the scope of exection.  Then when a record for A1 comes through, it would take that value and add it to A2's prior value for the exact same intersection of all other dimensions.  You would separately have to deal with moving forward values of A2 if there were cases where you could have a value for A2 in a prior period but not have a value in A1 for the current period.
    Edited by: James Sharrett on Apr 14, 2008 9:51 AM

  • Current month and Previous Month

     Hi, I have the table shown above. I m trying to get output something like I need current month total amount and the total of the previous month. Can someone please help on this?  THank you
    ID           PreviousMonthTotal        CurrentMOnthTotal      
    1              3000                                3000                   

    Please say your @@version,
    on
        Microsoft SQL Server 2012 (SP1) - 11.0.3412.0 (X64)
        Mar  2 2014 01:25:09
        Copyright (c) Microsoft Corporation
        Standard Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: )
    query show ZEROS.
    DECLARE  @TEMP as TABLE
        id int,date_t datetime,amount int
    INSERT @TEMP (id,date_t,amount)
    VALUES   (1,'20150112',1000)
            ,(1,'20150212',1000)
            ,(1,'20150122',2000)
            ,(1,'20150202',200)
            ,(1,'20160112',41000)
            ,(2,'20150112',1001)
            ,(2,'20150212',1003)
            ,(2,'20150122',2004)
            ,(2,'20150202',205)
            ,(2,'20160112',41020)
            ,(2,'20160212',11200)
            ,(2,'20140122',201)
            ,(2,'20140202',20)
    SELECT ID as [Cust Ref]
    , SUM(CASE WHEN Date_t = dateadd(MM,-1,getdate()) THEN Amount ELSE 0 END) as [Total LAST Month]
    , SUM(CASE WHEN Date_t = getdate()  THEN Amount ELSE 0 END) as [Total This Month]
    FROM @temp
    GROUP BY ID

Maybe you are looking for

  • HP LaserJet 4200 Duplexing Issue

    I have a LJ 4200 with the duplexer. I can to long-edge duplexing without a problem, however, when I try to do short-edge duplexing the image on the page gets cut off 2/3 the way across the page. All of my software is up to date, and I have the latest

  • How to declare local variables in PL/SQL stored programs

    Where do I declare local variables in a PL/SQL stored program? I get compiler errors with either of the options below: FUNCTION GET_PRINCIPAL_BALANCE (CUT_OFF_DATE IN DATE, TITLE_SN IN DATE, TOTAL_BALANCE OUT NUMBER) RETURN NUMBER IS TOTAL_BALANCE NU

  • HT1454 How do I set TV out on the ipod touch with the latest software

    How do I set TV our on the ipod touch with the latest software

  • Deleted release code appearing in PO

    Hi all, i had a release code SE with PO value limit from 0-10000 and another release code SM with PO value limit from 10001 - 50000. now the business decided to remove SE from the release process. So i deleted SE and changed PO value limit for SM fro

  • Storage location mandatory

    Dear Experts, Could you please inform to make Storage Location field has mandatory in Purchase Order for the User ID. Since it is a Client level I do not want to disturb for any other company code or plants. And also I want to make Plant mandatory wh