Previous month sales against each date

Hi all,
I am working on Bo XI 3.0.
I have a requirement where i need to display in table  -"Date" then "sales" and against that in the same table "previous month's sales"
For e.x
date              sales            previous month's sales
01/04/08        45637            63536
02/04/08          73565           78556
and so on..
Any one having any clue please reply .
Thanks in advance,
Gaurav
Edited by: Gaurav Gayawar on May 22, 2009 7:23 PM
Edited by: Gaurav Gayawar on May 22, 2009 7:43 PM

Hi,
Can you go through the forum which has been answered:
How to calculate "Last Month Sales revnue"
Let me know if this works.
-Madhu.

Similar Messages

  • I need to display all the previous months sales.

    Hi Gurus,
    I have a requirement were i need to display all the previous months sales.
    i.e if a user enters sept 2011, then in report it should display from April 2011(which is the first month of fiscal year).h
    and also it should display total sales in another column till that month.
    Regards
    Arun

    Hi,
    Part 2 and Part 3 of the document.
    Link: [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f002c608-2533-2c10-25a1-d0e7f7b5b662?QuickLink=index&overridelayout=true]
    Link: [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/10fc4382-afa6-2c10-1380-fa224fe4324f?QuickLink=index&overridelayout=true]
    Documents by 'Surendra Kumar Reddy Koduru' are always useful. Try to go through all of them.
    All the best!!!

  • Need reporting logic for Previous months sales compared to current month

    Dear Folks,
    I need to design a report that  should give cumulative sales for the month compared with cumulative sales for the same date for previous months e.g. Sales upto 21st May should be compared with sales from 1st to 21st April, from 1st March to 21st March and so on.
    Can anyone provide me a logic or CMOD code how to develop this report.
    Will be great helpful.
    Thanks in Advance.
    Rakesh

    Hi Rakesh,
         To accomplish the required output, you need to create variables that are input enabled and of processing type user eixt in the columns of your report in the query designer. I am assuming that, you would have atleast one variable which is input enabled and of processing type manual entry.
    The user would input a date ( for example may 21) in this variable. You need to capture this value in the user eixt in I-STEP 2. From this value you need to calculate the previous month and pass it to the user exit variable. Below is a sample code,
    ----variable ZPREVDATE:pass the to value from variable ZCURRDAT -
    DATA : LV_CALDAY TYPE SY-DATUM,
               LS_T_VAR_RANGE TYPE i_t_var_range,
               LV_YR(4), LV_MN(2), LV_DY(2).
    WHEN 'ZPREVDATE'.
    IF i_step = 2.
          READ TABLE i_t_var_range INTO LS_T_VAR_RANGE
          WITH KEY vnam = ZCURRDAT'.
          LV_CALDAY = LS_T_VAR_RANGE-high.
          LV_YR = LV_CALDAY+0(4).
          LV_MN = LV_CALDAY+4(2).
          LV_DY = LV_CALDAY+6(2).
    LV_MN = LV_MN - 1.
    CONCATENATE LV_YR LV_MN LV_DY INTO LV_CALDAY.
          ls_range-low = LV_CALDAY.
          ls_range-opt = 'EQ'.
          ls_range-sign = 'I'.
          APPEND ls_range TO e_t_range.
    ENDIF.
    The above code is a rough code that would help you to acheive your logic
    Regards,
    Prem

  • Calculating Previous Month(s) From Current Date

    Greeting JavaScripting Gurus!
    I would like to ask for some assistance on Date Calculation.
    Here is my current scenario:
    The user inputs a date mm/dd/yyyy ("DateField")
    The powers that be over here are asking for the "DateField" to then calculate these items:
    "DateField" minus(-) 12 months = mm/yyyy ("12MonthsAgoDateField")
    "DateField" minus(-) 18months = mm/yyyy ("18MonthsAgoDateField")
    "DateField" minus(-) 36 months = mm/yyyy ("36MonthsAgoDateField")
    and so on...
    I've read some of the Date Calculation posts, but could no seem to find anything that fit this scenario.
    I freely confess my javascripting ability is very minor.
    I would greatly appreciate any help in scripting this.
    Thank you!

    Unfortunately the numbers of days in a month or year are not the same for all months or years, so the get and set date methods might not work. Fortunately there are the getMonth() and setFullYear() methods for getting or setting the month or year for a given date.
    For the "On Blur" action for the "DateField" you can use:
    function GetField(cName) {
    // get a field object with error catching;
    var oField = this.getField(cName);
    if(oField ==  null) app.alert("Error accessing field named: " + cName, 0, 0);
    return oField;
    } // end GetField function;
    function AddMonths(oDate, nMonths) {
    // add nMonths to oDate object;
    oDate.setMonth(oDate.getMonth() + nMonths);
    return oDate; // return adjusted date object;
    } // end AddMonths;
    function Scand(cFormat, cDate) {
    var oDate = util.scand(cDateFormat, event.value);
    if(oDate == null) app.alert("Error converting " + oDate.valueAsString + " with format: " + cDateFormat, 0, 0);
    return oDate;
    } // end Scand functon;
    var cDateFormat = "mm/dd/yyyy"; // format for date strings;
    // event value is the start date string;
    // 12 months ago;
    var o12MonthsAgo = GetField("12MothsAgoDateField")
    var oDate = Scand(cDateFormat, event.value);
    oDate = AddMonths(oDate, -12) // subtract 12 months;
    o12MonthsAgo.value = util.printd(cDateFormat,oDate);
    // 18 months ago;
    var o18MonthsAgo = GetField("18MothsAgoDateField")
    oDate = Scand(cDateFormat, event.value);
    oDate = AddMonths(oDate, -18) // subtract 18 months;
    o18MonthsAgo.value = util.printd(cDateFormat, oDate);
    // 36 months ago;
    var o36MonthsAgo = GetField("36MothsAgoDateField")
    oDate = Scand(cDateFormat, event.value);
    oDate = AddMonths(oDate, -36); // subtract 36 months;
    o36MonthsAgo.value = util.printd(cDateFormat, oDate);
    // and so on;
    Since getting a field object, converting a date string to a date object and adjusting the date object using the getMonth and setMonth methods are repeated several times I have used functions so the repeated code could be reused.

  • 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

  • Set default value for date/time to previous month

    Hi All
    I have two date/time parameters in my report and I want to set the default value for both the parameters
    For start date parameter I want the first date of previous month and for end date parameter I want the last date of previous month.
    Can someone please point me to the right direction
    Thanks
    Rone

    Hi Rone,
    These links can be helpful for you:
    http://www.bidn.com/blogs/hardikabhavsar/bidn-blog/1639/default-date-parameters-in-ssrs
    http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/584a98ae-bb75-4740-9198-e6be3c1aec12/
    Regards,
    Manoj
    *Happy to help
    http://experiencingmsbi.blogspot.com/

  • Month end accrual posting date- Last day of the month

    Hi Experts,
    I have set up month end accruals for PY US by configuring posting dates, LDCD, WageType accrual processing class, Schema changes. I have also set the closing dates as the end of the month.
    Now after I do the posting , there are three documents getting generated.
    1. Accrual posting document with first day of the current month
    2. Normal Payroll posting  document with payroll period posting date
    3. Accrual reversal document with first day of the following month.
    My Question is:  As per standard SAP configuration, the month end accrual will have first day of the month. Can we customize this to end of the month for doc#1 - accrual document?
    Please do let me know your suggestion and ideas.
    Thanks,
    Amosha

    Hello,
    I have a similar question and I hope to have more details on how to change the posting date.
    The point is that I have an amount of 1200 and I have to post 100 for each month.
    Key Date for Accruals: 31.01.2011
    I posted 100 with Document date: 31.01.2011 and Posting date 31.01.2011
    Key Date for Accruals: 28.01.2011
    I posted 200 with Document date: 28.02.2011 and Posting date 28.02.2011
    Also I reversed the amount posted in the previous month (100) with Document date: 31.01.2011 Posting date 28.02.2011
    And so on...
    The problem are the dates because I need to post the amount at the end of each month (28/02) and to reverse the previous amount at the beginning of the next month (01/02).
    How can I change these dates?
    Thanks a lot in advance
    Kind Regards,
    E.

  • Help With Monthly Sales Query

    Hello All -
    We use the below Query to find monthly sales for each of our stock units.  However, it only provides the current year -- so for 2010, all our 2009 data is gone and the query just shows Jan 2010.
    Is there any way to adjust this Query so that we can select the year we want to see?
    Thanks!
    Mike
    SELECT T0.ITEMCODE,
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 1 AND T1.ITEMCODE
    = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'JAN Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 2 AND T1.ITEMCODE
    = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'FEB Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 3 AND T1.ITEMCODE
    = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'MAR Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 4 AND T1.ITEMCODE
    = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'APR Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 5 AND T1.ITEMCODE
    = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'MAY Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 6 AND T1.ITEMCODE
    = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'JUN Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 7 AND T1.ITEMCODE
    = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'JUL Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 8 AND T1.ITEMCODE
    = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'AUG Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 9 AND T1.ITEMCODE
    = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'SEP Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 10 AND T1.ITEMCODE
    = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'OCT Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 11 AND T1.ITEMCODE
    = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'NOV Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with
    (NOLOCK) WHERE MONTH(T1.DOCDATE) = 12 AND T1.ITEMCODE
    = T0.ITEMCODE AND YEAR(T1.DOCDATE) = YEAR(GETDATE())) AS 'DEC Amt'
    FROM dbo.OITM T0
    LEFT JOIN dbo.INV1 T1 ON T1.ItemCode = T0.ItemCode
    WHERE T0.SellItem = 'Y'
    GROUP BY T0.ItemCode,YEAR(T1.DOCDATE) HAVING YEAR(T1.DOCDATE) = YEAR(GETDATE())
    ORDER BY T0. ITEMCODE

    /*Hello there!!
    you should try this code*/
    SELECT T0.ITEMCODE, (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 1
    AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1)) AS 'JAN Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 2
    AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1)) AS 'FEB Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 3
    AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1)) AS 'MAR Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 4
    AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1)) AS 'APR Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 5
    AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1)) AS 'MAY Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 6
    AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1)) AS 'JUN Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 7
    AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1)) AS 'JUL Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 8
    AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1)) AS 'AUG Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 9
    AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1)) AS 'SEP Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 10
    AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1)) AS 'OCT Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 11
    AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1)) AS 'NOV Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 12
    AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1)) AS 'DEC Amt'
    FROM dbo.OITM T0 LEFT JOIN dbo.INV1 T1 ON T1.ItemCode = T0.ItemCode WHERE T0.SellItem = 'Y'
    GROUP BY T0.ItemCode,YEAR(T1.DOCDATE) HAVING YEAR(T1.DOCDATE) = (YEAR(GETDATE())-1) ORDER BY T0. ITEMCODE
    thou i suggest that its more practical for you to use a variable to enter the year, for example like this.
    declare @year as char(4)
    set @year = '2009'
    SELECT T0.ITEMCODE, (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 1
    AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = @year) AS 'JAN Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 2
    AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = @year) AS 'FEB Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 3
    AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = @year) AS 'MAR Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 4
    AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = @year) AS 'APR Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 5
    AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = @year) AS 'MAY Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 6
    AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = @year) AS 'JUN Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 7
    AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = @year) AS 'JUL Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 8
    AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = @year) AS 'AUG Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 9
    AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = @year) AS 'SEP Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 10
    AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = @year) AS 'OCT Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 11
    AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = @year) AS 'NOV Amt',
    (SELECT SUM(T1.QUANTITY*T1.PRICE) FROM INV1 T1 with (NOLOCK) WHERE MONTH(T1.DOCDATE) = 12
    AND T1.ITEMCODE = T0.ITEMCODE AND YEAR(T1.DOCDATE) = @year) AS 'DEC Amt'
    FROM dbo.OITM T0 LEFT JOIN dbo.INV1 T1 ON T1.ItemCode = T0.ItemCode WHERE T0.SellItem = 'Y'
    GROUP BY T0.ItemCode,YEAR(T1.DOCDATE) HAVING YEAR(T1.DOCDATE) = @year ORDER BY T0. ITEMCODE

  • 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

  • My iCal has deleted previous months .any ideas?

    My iCal on iPhone and iPad has deleted all previous months and some future dates . If anyone has any idea what to do all help would be greatly appreciated.
    Leo

    My iCal on iPhone and iPad has deleted all previous months and some future dates . If anyone has any idea what to do all help would be greatly appreciated.
    Leo

  • Show data of last day of previous month against any day of current month

    Hi,
    I have fact table which contains data at date level (we have data for oct-2009 to april-2010). Our requirement is to show data of last day of previous month against any day of current month in obiee 11g. I am facing problem in Feb 2010 its picking data of 28-Jan-2010 instead of 31-jan-2010 and for April its picking data of 30-mar-2010 instead of 31-mar -2010.
    Any suggestion ???

    You're asking to filter your data set to only include rows between:
    1) last day of the previous month
    2) any day of the current month
    This can be achieved with prompting in OBIEE Answers.
    last day of previous month = TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE)) . The problem is you need to make query work within Oracle's Answer syntax.
    In the prompt, select the operator type for your date dimension as 'between' and default to 'SQL Results'.
    For the 'last day of previous month' , use the query:
    SELECT
    case when 1=0 then Time."Fiscal Date" else TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE))
    end
    FROM ENTER_YOUR_PRESENTATION_FACT_FOLDER_HERE
    For the current date, use the query:
    SELECT
    case when 1=0 then Time."Fiscal Date" else CURRENT_DATE
    end
    FROM ENTER_YOUR_PRESENTATION_FACT_FOLDER_HERE
    Another option is to create a last_date_pervious_month variable in the RPD and have that as the default value in your prompt.

  • To get previous month's data

    Hi
    My report requirement:
    Display current month and previous month's data (sal) next to each other based on the month selected as a current month.
    Expression I'm using at the moment:
    case when trunc(lag(dt,1,dt) over (partition by ename order by dt),'MM') = trunc(add_months(dt,-1),'MM')
    then lag(sal,1,sal) over (partition by ename order by dt)
    However, instead of 'dt' I'm trying to use a parameter (dt as a current month's dt).
    This gives me an error message.
    Can anyone guide me on this?
    Thanks and regards,
    Aparna

    Why not simply join the table with itself? I.e. join the two months data sets and have a single row containing current and previous month results
    Simplistic example. We have a YEARLY_TOTALS table where the primary key is MONTH in the date format YYYY/MM. You can then compare the sales totals per month of this year with that of last year using the following type of SELECT construct:
    SELECT
    cur.month,
    cur.sales as CURRENT_SALES,
    prev.sales as LAST_YEAR_SALES
    FROM yearly_totals cur
    JOIN yearly_totals prev
    ON ADD_MONTHS(prev.month,12) = cur.month
    WHERE cur.month >= TRUNC(SYSDATE,'YY')

  • Getting data in a query on last date of all previous months

    Dear Experts,
    I need your help with a query.
    I am trying to create a query which when run should pick the number of Open Sales Order on the last date of all the previous months from the start of company.
    I could create the query for fetching the required data on last day of the previous month, say today is 25th June 2014, so my query only fetches data for May 31st 2014 but I need data for all previous month, May 31st 2014, April 30th 2014, March 31st 2014 & so on.
    Please advise how to achieve this is SQL query.
    Thanks & regards,
    Nitin

    Hi,
    Try this:
    Select *
    from(
    SELECT T0.[DocNum] as #,t0.cardcode as C, t0.docdate
    FROM ORDR T0
    WHERE T0.[DocStatus] = 'o' and T0.[DocDate]  = CONVERT(VARCHAR(10), DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,getdate())-1,0)),10) OR T0.[DocDate]  = CONVERT(VARCHAR(10), DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,getdate())-2,0)),10) or T0.[DocDate]  = CONVERT(VARCHAR(10), DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,getdate())-3,0)),10) or T0.[DocDate]  = CONVERT(VARCHAR(10), DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,getdate())-4,0)),10) or T0.[DocDate]  = CONVERT(VARCHAR(10), DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,getdate())-5,0)),10) or T0.[DocDate]  = CONVERT(VARCHAR(10), DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,getdate())-6,0)),10) or T0.[DocDate]  = CONVERT(VARCHAR(10), DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,getdate())-7,0)),10)
    group by t0.cardcode,docdate,T0.[DocNum]) S
    pivot
    (count(#) for c in([cvt01],[cvt02],[cvt03],[cvt04],[cvt05],[cvt06],[cvt07],[cvt08],[cvt12])) P
    Note: Replace Cvt01,02...with your customer code.
    Thanks & Regards,
    Nagarajan

  • How to get previous month data from current month values

    Hi Experts,
    I have made one universe from BW Query in which Fiscal year period is entered in interval.
    I have made a universe from that and want to develop webI reports on top of that.
    In my webI reports, i have used one cross tab. In Rows section i have added Company Code and in Column section i have used Fiscal Year/Period and in Value section i have added Sales Value. I want this value of previous month.
    Requirement:
    Ex.
                            Feb'09          Mar'09     and so on...
    Comp_code1   Sales of Jan'09         Sales of Feb'0f         and so on....
    I am getting this.
    Ex.
                            Feb'09          Mar'09     and so on...
    Comp_code1   Sales of Feb'09         Sales of Mar'09         and so on....
    I hope i have clear my requirements.
    Please help as soon as possible.
    Thanks in Advance,
    Rishit

    Hi Rishit,
    Follow the below steps to get the desired result.
    Step1: Convert your fiscal year period from char to a date in your database or in your designer however its feasible.
    to_date('substr('009.2009',2)','mm.yyyy')
    you will get the result 01 sep 2009
    Step2: Convert this format to 01/09/2009 by using date functions.
    Step3: Create a Detail associated to the 'date' field (typically your fiscal period).
    Step4: Create a cross tab Like : Rows section should have Company Code and in Column section should have 'date'(created detail) and in Value section should be Sales Value.
    you should get the following result.
    01/02/2009 01/03/2009 and so on...
    Comp_code1 Sales of Feb'09 Sales of Mar'09 and so on....
    Step5: Use the following formula in your Column (date) formula bar.
    =(<date>-1)-DayNumberOfMonth(<date>-1)+1
    You will get the following result:
    01/01/2009 01/02/2009 and so on...
    Comp_code1 Sales of Feb'09 Sales of Mar'09 and so on....
    Format the cell according to your reruirement.
    Let me know if you will get any break in the above steps.
    Regards,
    Swati.

  • How to show Increase/Decrease of Sales Amount compare to Previous Month.

    Hi,
    My users need to view the percentage decrease/increase of Sales $ compared to previous month, for each Month.
    How can I create a Restricted Key Figures that show Sales $ Amount as of Previous Month (take note it is not just Previous Month from Current Month, but each Month's Previous Month). i.e
    Nov 06  - Sales $ = 1000
    N0v 06 - CKF_A - Variance Compare to Prev. Month: 100%
    Dec 06 - Sales $ = 800
    Dec 06 - CKF_A - Variance Compare to Prev. Month: -20%
    (800-1000/1000)
    Jan 06 - Sales $ = 1000
    Jan 06 - CKF_A - Variance Compare to Prev. Month: 25%
    (1000-800/800)
    How can I create CKF_A and achieve similar result?
    Most of the variables for 0CALMONTH or 0FISCPER seems pointing to one value only.
    I don't want to create Restricted Key Figures for each and every month.
    Please help.
    Thanks,
    Sean Yit.

    Sean,
    You don't have to create RKFs for each and evry month. But you need to create just two RKFs.
    Lets say that you want to display the months in rows and Sales in the first column and the variance in the second column. Just restrict Sales by the month characterstic with a user entry variable (range if it is more than one month the user wants to display), then in the next column create another RKF by restricting Sales with the same month characterstic. This time offset the first varaible by minus one (-1). In the properties of this RKF, select always hide option.
    Now create a CKF (calculated key figure), by using the variance% formula option.
    CKF = RKF2 "%" RKF1.
    I hope this helps..

Maybe you are looking for

  • Diagrama de Entidade e Relacionamentos (E/R)

    Olá a todos, Alguém tem ou sabe se existe um modelo de entidades e relacionamentos das tabelas do banco de dados do SAP Business One ? O que facilitaria em muito a identificação dos relacionamentos entre as informações. Preciso de uma documentação ma

  • What is a really good and affordable HD Camcorder?

    I am looking for a Christmas present for my mother. She has always wanted a nice camcorder and she wants a HD one. She would love to either be able to record it right to a DVD or be able to put it on her computer and convert it to a DVD. So does anyo

  • Runtime error when testing function module 'RSWR_RFC_SERVICE_TEST'

    Hi, I'am integrating BIW 3.5 with EP 6.0 according to the report 'RSPOR_SETUP'.I've carried all the steps,but an error on step 12 : system failure during call of function module 'RSWR_RFC_SERVICE_TEST' is there .When I test the connection with functi

  • Conform clip: where can I find a clip?

    Hello, All. I am a new user of FCP. I have a question about conform clip/reverse telecine. My dailies were xfered from 24P 35mm film in 29,97 NDF with 2:3 pull down, and I have a ale file. I imported ALE into Cinema Tools and imported in the FCP proj

  • Filter Multicast

    Modem: WRT310N Firmware: 1.0.9.0 Build 4 (Latest) 192.168.1.1 > Security > Firewall > Filter Multicast If I want to allow Multicast traffic on my network, does this box need a "Check Mark" or does it need to be "Unchecked" Thank you for your help! He