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

Similar Messages

  • How to find last date of month

    Dear  All,
    Can anybody tell me how to find last date of month I need it to check some validations
    helpful answer will definatly rewarded
    Regards
    Shashikant

    Hi,
    RP_LAST_DAY_OF_MONTHS Determine last day of month
    HR-D: Payroll Germany code
    RP_LAST_DAY_OF_MONTHS
    HR-D: Determine last day of month
    DATE_CONVERT_TO_FACTORYDATE
    Returns factory calendar date for a date Calculates and returns factory calendar date for a date (if CorrectOption = '+');
    Checks if the date is work day (if CorrectOption = '-').
    HOLIDAY_CHECK_AND_GET_INFO Useful for determining whether or not a date is a holiday. Give the function a date, and a holiday calendar, and you can determine if the date is a holiday by checking the parameter HOLIDAY_FOUND.

  • How to find current user name on a LAN machine....

    how to find current user name in a remote machine in LAN .
    how to find current user name on a local machine in LAN .

    how to find current user name in a remote machine in
    LAN .Many users may be logged on concurrently on the remote machine.
    how to find current user name on a local machine in
    LAN .The user who is running the code in the process would be obtainable via:
    System.getProperty("some property goes here");
    I leave it to you to look at the API documentation for System.getProperties() to see what property name you would retrieve.

  • Can anyone tell me how to find and restore previously purchased OS updates to my iMac?

    Can anyone tell me how to find and restore previously purchased OS updates to my iMac?

    Please go to the Apple (upper left corner) and click on About this Mac. In the resulting window, click on the numbers underneath until they display the OS version.
    Snow Leopard, Lion, and Mountain Lion are all OS X - they are 10.6, 10.7, and 10.8 respectively. After you get the OS version, click until you get the "Build" number and post that as well.
    If your Mac is from 2010, it most likely came with Snow Leopard. If you purchased Lion, then you should be able to see it under your Purchases in the App Store (not iTunes). But, first, we need to figure out what was installed on your machine after the hard drive replacement.
    Not sure about iPhoto at this point - may have to do with whaever OS version is installed. Check in Applications folder in column view and post back which version of iPhoto you have installed.

  • How to find current ocfs verison in wondows 2003

    Hi
    how to find current ocfs verison in wondows 2003

    Hello,
    See the Metalink note 749006.1
    You can use ocfscollect
    The output file will show u the information like Volume was formatted with OCFS 9.2.0.6 format
    Cheers,
    Rodrigo Mufalani
    http://mufalani.blogspot.com

  • How to find out Inquiry  document number in sales quotation

    Hi all
    my client have requirement that while creating quotation with reference to inquiry number the system should copy inquiry number in sales quotation it should be save into any particulates field so base on that  he can configure  output determination can any one help me how to find out Inquiry  document number in sales quotation and what are the config step i need to do
    Thanks and regards
    rajesh

    Hi raj
    Firstly  , In Sales header data you can see the preceding document feild but i am not sure in which tab .
    Secondly, As far as document flow is concerned go to VA22 and then you will get the document number of the quotation and at the top you will get one small icon which is document flow , but i am, not sure with the shortcut but just check with  Shift +F2. then you can see the flow
    Regards
    Srinath

  • How to find the size of the pipe. I mean the total number of bytes/messages available in the named pipe?

    How to find the size of the pipe. I mean the total number of bytes/messages available in the named pipe?
    NAVEEN

    I'm afraid this forum for Microsoft Project Customization and Programming  is not the correct forum for your question. Please Choose correct forum in order
    to get help from experts. I think your question is more relevant to SQL server
    kirtesh

  • Any fiscalyear select varible screen current month-previous month less all

    Hi,
    1 My requirement is end user will enter fiscal year e.g 2009-2010  (all fiscal year periods come  ) and in report my requiremnt is to
    show data
    2.  april to march
    3.  current month  minus  previous month  billing qty
    e.g    april  may june july  august ............................
    may - april billibg qty = variation
    june -may = var
    july - june ....= var
    thanks
    sai.
    Edited by: solv_ti on Jun 30, 2010 11:59 AM

    You can user customer exit to restrict the report for required month from the input year.
    Find the currect and previous month . Then you can also restrict the bill qty with the difference between current and pervious month.
    Hope this helps.

  • How to display Current Year and Month in Drop Down list

    Hi Dear friends,
    I am devloping a report. It has got 2 pages--input and output(Report) page.
    IN input page, user will select Month and Year from drop down list as one of the input parameters. (seperate drop down list 4 month and year)
    Now, my problem is:
    HOw to display current month and year by default in the dropdown list...........
    I hope my question is clear.
    Please help.
    Regards,
    ASh

    NO da,
    it is not working.
    First i tired with for-loop. I initialized variable "i" to -2 (i=-2) I would get the year drop down list from 2003 but, by default 2003 would come.
    So, i posted the question.
    I tried your code. It is giving following error.
    A Servlet Exception Has Occurred
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occured between lines: 122 and 127 in the jsp file: /test/inpt.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:182: Invalid type expression.
    first.set(Calendar.YEAR, 2003)
    ^
    An error occured between lines: 127 and 131 in the jsp file: /test/inpt.jsp
    Generated servlet error:
    C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:186: Invalid declaration.
    out.write("\r\n \r\nYear : \r\n \r\n"); ^ An error occured between lines: 198 and 203 in the jsp file: /test/inpt.jsp Generated servlet error: C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:282: Invalid type expression. first1.set(Calendar.YEAR, 2003) ^ An error occured between lines: 203 and 207 in the jsp file: /test/inpt.jsp Generated servlet error: C:\Program Files\Apache Tomcat 4.0\work\localhost\general\test\inpt$jsp.java:286: Invalid declaration. out.write("\r\n \r\nYear :\r\n \r\n");
    ^
    4 errors
    Pls. Help.
    Regards,
    Ashu

  • Display current and previous months records only

    Hello gang,
    My selection criteria looks like this:
    not ({HRDEPBEN.PLAN_CODE} startswith ["C", "EAP", "HMIL", "V", "W"]) and
    (month({hrdepben.Creation_date}) = month(currentdate)) and
    {HRDEPBEN.PLAN_TYPE} = "HL"
    I modified it to this in order to pull in previous month's data too:
    {HRDEPBEN.PLAN_TYPE} = "HL" and
    not ({HRDEPBEN.PLAN_CODE} startswith ["C", "EAP", "HMIL", "V", "W"]) and
    (month({hrdepben.Creation_date}) = month(currentdate) or month ({hrdepben.Creation_Date})= month (currentdate)-1)
    However, it's still pulls the same record count and only January records, not Decembers'.
    Where am I going wrong?
    Thanks

    Looks like you're reporting against Lawson?  What database are you using?
    There are a few issues with the record selection criteria as it's written:
    1)  Month(CurrentMonth) - 1 = 0 when the current month is January.  That's why your not getting any records from December.
    2)  The  monthly criteria won't be passed to the database for processing, which is a huge performance issue when you're reporting against a system like Lawson.  You're basically telling the report to bring back all records that don't start with an array of values, irrespective of the date.  Only after all the possible records are returned across the network will the extraneous records be filtered out on the client side.  That's bad.
    3)  It's easy to use StartsWith or Like, but it's also pretty inefficient, since it forces a full table scan of the underlying table
    Personally, I'd do one of two things in order to both fix the query and optimize it:
    1)  Write the underlying query in SQL as either a View or SQL Command object
    or
    2)  Keep the current report, but make use of SQL Expression fields in order to optimize the query.
    Here are some examples of SQL Expression fields against Oracle (PL/SQL) that could be useful:
    /*{%PLANCODES}*/
    /*This SQL Expression evaluates whether or not a Plan Code starts with the specified values*/
    /*"HRDEPBEN"."PLAN_CODE" is selected directly from the Field Tree in the SQL Expression Editor*/
    CASE
      WHEN SUBSTR("HRDEPBEN"."PLAN_CODE",1) IN ('C','V','W') THEN 'Y'
      WHEN SUBSTR("HRDEPBEN"."PLAN_CODE",3) = 'EAP' THEN 'Y'
      WHEN SUBSTR("HRDEPBEN"."PLAN_CODE",4) = 'HMIL' THEN 'Y'
      ELSE 'N'
    END
    /*{&CREATEDATEMONTH}*/
    /*This SQL Expression returns the month of the Creation Date field*/
    /*"HRDEPBEN"."CREATION_DATE" is selected directly from the Field Tree in the SQL Expression Editor*/
    TO_NUMBER(TO_CHAR("HRDEPBEN"."CREATION_DATE",'mm'))
    You could also create formula to return the Month value for last month and then use it in your record selection:
    //{@LASTMONTH}
    //This formula returns the Month value for Last Month
    //IIF statements can be passed to the database for processing
    IIF(Month(CurrentDate) = 1, 12, Month(CurrentDate) - 1)
    With expressions and formulas like these in place (this code is Oracle and DB2 compatible, it would be different for T-SQL), you could then modify your record selection criteria to be something simpler, like this:
    {HRDEPBEN.PLAN_TYPE} = "HL" and
    {%PLANCODES} = 'N' and
    {%CREATEDATEMONTH} IN {@LASTMONTH} TO MONTH(CURRENTDATE)// MONTH(CURRENTDATE) is passed to the DB
    By laying the groundwork, you'll have a much more efficient report and, in the case of the @LastMonth, more accurate! Hope this helps!
    p.s. a disclaimer on using SQL Expressions in this manner - it's not officially supported, although it's worked since Version 7 (when SQL Expressions were introduced) and there will be support for them in various 2011 versions. As such, they'll work for years. I use them all the time and they're fantastic for optimizing reports.

  • How to get Current day and month value in Stk applets

    Friends please provide me the hint to get the Current Value of month and date from the Mobile equipment(ME).
    please send feedback to [email protected]

    Use "PROVIDE LOCAL INFORMATION" command as per GSM 11.14. This however queries the handset date and time, and hence depends on the handset clock (which may not always be reliable).

  • Reg : Curr Month,Previous Month,Curr Month Previous Year

    Hi all ,
                 I have a req where I have to display the sales for
    Current Month               Sales value
    Previous Month             Sales value
        Curr Month                Sales 
    Previous Year
    Curr Month and Previous Month I got it with Time Series AGO Function .
    But current month for the Previous Year , I am not able to proceed .
    Kindly help.
    Reg,
    Niv D

    Hi NIV,
    You can use the same time series function to calculate current month of last year values.
    Ago (measure column , year , 1)
    it describes the last year sales of current month
    OBIEE -Time Series in OBIEE
    Regards,
    VG

  • How to find current demand qty wise

    Hi Gurus,
    How to find each material have how much demand  for qty wise currently (free stock, Project stock and sales order stocks) ? and it's there any standard report available? or  how can i do it use with SQVI transaction code?
    Thanks and regards,
    Deethya.B

    Hi,
    demand for the material can be found from the stock requirement list.MD04.
    Run an mrp for the material then the system will calculate the demand and the available qty and the differrance.
    Regards,

  • How to find list of previously Instances

    Hi All,
    How to find the list of proviously installed instances and delete them.
    I installed obiee 11.1.1.5 and found it to be the 4th instance. So how could i clear all the previous instances
    in my system.
    Any help appricated.
    Thanks
    Jaan

    Jaan,
    You should be able to locate the instances via Enterprise Manager fusion control. Depending on how you scaled for these instance you may also be able to view the servers listed in WebLogic Admin Console under Environment > Servers.
    As far as deleting the instances you should use the OBI deinstall command for removing the instances so that the instances are removed cleanly. Run the deinstall from the machine where you scaled the base Oracle BI system.

  • How to find current database name i am using

    what is the command to find current database name i am using

    Dear user!
    SELECT name
    FROM   v$database;Yours sincerely
    Florian W.

Maybe you are looking for

  • How do I put my ical on my iphone into 24hr clock?

    I recently reset my iphone and lost the 24 hr clock on my ical when creating a new event.  I have the standard 12 clock with no way to differentiate between am and pm. I have gone into settings/general/24-hour time but this has not changed the clock

  • Can i use anything else to sync my ipod?

    i keep having the message that my ipod cannot be updated as there is a missing file. I've followed the guide on here and have reinstalled it etc and followed advice on here, but it still doesn't work. I'm sick of i-tunes, can I use anything else to p

  • SQLException Calling Stored Procedure

    Hello all, I'm getting the following exception when calling a stored procedure from Java. Maybe someone can help me out here. See details below. Exception java.sql.SQLException: ORA-01747: invalid user.table.column, table.column, or column specificat

  • Working with illustrator

    I am working with a graphic designer to make a website and wanted to learn of a good workflow for handling this. I wanted to use dreamweaver but the designer does a lot of text alterations like leading, kerning etc is there an easy way to import the

  • Regd. Optional Public Holidays Configuration - SAP HCM.

    Hello SAP HR Experts, Please help me with the below query: In the holiday calendar, i have entered 9 public holidays. I've 3 optional holidays to be entered in the holiday calendar. Employees are eligible for ANY 1 holiday out of the 3 optional holid