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

Similar Messages

  • How to get Current month last year sale in report

    HI,
              I would like to compare the sale value of a  month for any year.
    ie sale of the march month for this year ,previous year and a year before ..like that
    at least for two years..ie current and prvious year.
    how can i get it done in query?
    thnx

    Create three restricted key figures.
    In one restrict month by current month.
    In other use offset of -12 and -24 while restricting current month.

  • Sales report for current month and year a go month

    i could you please guide me builting report for current monthwise for current month and year a ago month
    report parameter month_year='06-2010'
    tables = sales and below are the table fields
    customer_id
    invoice_dt
    invoice_am
    thanks
    nhm

    Okay, Still you did not mention how you will pass value in report while generating.
    Anyway the query with UNION ALL will work. For Example.
    I am assuming that the parameter for date/month you will pass in range like 01-JUN-2010 to 30-JUN-2010
    SELECT customer_id, SUM(curr_value) curr_value, SUM(past_value) past_value
    FROM
    SELECT customer_id, NVL(SUM(invoice_amount),0) curr_value, 0 past_value
    FROM sales
    WHERE invoice_dt BETWEEN :P_FROM_DATE AND :P_TO_DATE  -- here P_FROM_DATE and P_TO_DATE will be the date range for current year as i showed above.
    AND  -- Any Condition goes here...
    GROUP BY customer_id
    UNION ALL
    SELECT customer_id, 0, NVL(SUM(invoice_amount),0)
    FROM sales
    WHERE invoice_dt BETWEEN ADD_MONTHS(:P_FROM_DATE,-12) AND ADD_MONTHS(:P_TO_DATE,-12) -- This add_months function for the previous year same month.
    AND -- Any condition goes here...
    GROUP BY customer_id
    GROUP BY customer_idNow using the above query you can design the tabular report as you showed the format.
    -Ammad
    Edited by: Ammad Ahmed on Jul 3, 2010 7:55 PM
    added GROUP BY

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

  • First day of current month, one year ago

    All,
    Does anyone have a calculation or know how I can calculate the first day of the current month, one year ago? I am trying to setup a filter criteria to show all records created >= 1st day of current month for prior year and <= the last day of the prior month. I have the second half of the equation for last day prior month but need some help on the first half.
    Thanks in advance for any pointers!
    D

    You can try:
    SELECT TRUNC(ADD_MONTHS(sysdate, -12), 'MON') FROM dual;
    Or
    SELECT TRUNC(sysdate-NUMTOYMINTERVAL(1,'YEAR'), 'MON') FROM dual;

  • UIX 2.1.21: Date OnBlurValidator automatically add current month or year?

    Would be nice if the OnBlurValidator for a UIX Date field could automatically add a missing month or year.
    e.g. Format dd.mm.yyyy
    When the user enters 01.01. the current year could be added automatically.
    Or when the users only enters 01. the current month and year could be added.
    Would be a nice feature additionally to the already existing lenient-date-formats = true.
    Really great would be to allow entering values like "now" / ".", "yesterday" / "-" or "tomorrow" / "+" that are evaluated to the according dates (of course internationalized).
    Thanks, Markus

    hey mill1640,
    Did you ever get your iPhone to register with iTunes? I just upgraded as well to Snow Leopard, and my my isn't recognized at all also.
    If you did get this resolved, I would appreciate a little suggestion in the right direction.
    Many thanks,
    Josh

  • Query for fiscal month till current month of year

    Hi,
    can you please help me to show only fiscal months till current month of year?
    e.g. Current month is Apr of 2012.
    I have to show the fiscal months till the Apr 2012 of year 2012.
    if the date is 24th of Apr then it would show May month also.
    Regards,
    Nilesh

    with t as (
    select to_date('04232012','MMDDYYYY') d from dual union all
    select to_date('04252012','MMDDYYYY') from dual)
    select
    d,
    case
    when to_char(d,'DD') >= 24 then
    to_char(trunc(add_months(d,1),'MONTH'),'MM-YYYY')
    else
    to_char(d,'MM-YYYY')
    end fin_month
    from t
    D     FIN_MONTH
    23.04.2012     04-2012
    25.04.2012     05-2012

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

  • Report on Current and Last Year Sales

    Hi ,
    I have a requirement to create a report which would display in one column sales from current fiscal year/period and 2nd column sales from last fiscal year/period at the same time
    Please guide.

    Hi,
    You can achieve this by creating two selections in columns in query designer.
    First one restrict the key figure with current Fiscal period.
    Second restrict the key figure with Fiscal year with customer exit and -1 as offset value.
    Hope this helps........
    Rgs,
    Ravikanth.

  • Current Month/Year to default in prompt

    Hello Friends I have 2 User prompts for report for which i created the filter. where I want to calculate the Month/Year TO value as default to current month/year.
    Can u Help me with the code  in OLAP SAP BI as backend Universe
    substr(TO_CHAR(current_date,1,7))
    Above does not work but if I hard code it works
    I am trying to default the current month and year
    Code that works with hard code 200906 but not with d efault the current month and year
    Please correct my code
    <OPERATOR VALUE="AND">
    <FILTER EXPRESSION="[ZFISCPER].[LEVEL01].[[2ZFISCPER]].[Value]">
    <CONDITION OPERATORCONDITION="Betweenl">
    <CONSTANT NAME="@Prompt('Fiscal Month start','A','Period\Fiscal Mth',mono,primary_key,not_persistent)"/>
    <CONSTANT NAME="@Prompt('Select Fiscal Month','A','Period\Fiscal Mth',mono,free,Not_Persistent,{ '2009/06' },User:0)"/>
    </CONDITION></FILTER>
    </OPERATOR>
    Soniya

    Hi Didier,
    Same comment here.
    Very interested to know what the plans are in this area and when it can be expected. This is a very important feauture.
    Are there documented best practises available for using user exit's?
    We've also been exploring the option to use operating system environment variables to work around the issue (combined with some scheduled scripting). No luck so far in web intelligence (which is needed for OLAP universes).
    Please see
    @variable and Operating system variables (Windows environment variables)
    Thanks in advance for your thoughts on this!
    Raf

  • Current date, first day of month, last day of month, current week, current

    Hi All,
    may be the question will sounds basic for your guys, I am connecting via MDX a cognos reportnet on a BW 3.0B..due to loads of limitations on filtering via MDX on 'business date/time functions' , I would need to create in the infoqueries that are my data sources, the following additionnal objects:
    - current date
    - first day of current month
    - last day of current month
    - current week
    - current year
    I do not want prefiltered infoqueiries but object with these single values so that from reportnet I can have something like: OCALDAY between 'first day of current month' and 'last day of curent month'
    Is there standard fonction for this under BW/BEX or if we need to developp functions has nayone some code examples.
    thanks a lot for your great input
    David

    Hi,
    In universe level if you want implement the requirede functions then you have to write custom sql and if you want to implement them in Reporting level then most of the functions are available to you. e.g. Quarter,Month, Year, Current Date....
    Cheers,
    Suresh A.

  • Customer exit in APO for current month in query

    Hi,
    I need to create a customer exit which automatically restricts 0calmonth on the current month in a query.
    How should I do this APO?
    Most important, Which table should I use to find the input, i.e current month and year?
    If possible please provide some code to show the solution.
    Best regards,
    Sebastian

    Use the standard SAP exit 0I_CLMTH.

  • Calc script for calculating current month data after loading

    Hi,
    I'm trying to write a script to do a calculation to all dimension after load current month data; it ran successfully but current month data is all zero; can someone tell me what i'm doing wrong?
    SET CACHE HIGH;
    SET UPDATECALC OFF;
    SET CALCPARALLEL 4;
    FIX (&CurMon, &CurYr)
    AGG (Sparse2, Sparse3, Sparse 4, Sparse 5, Sparse 6);
    ENDFIX
    Dense1 – Dynamic Calc
    Period: Dense – Dynamic Calc
    Year: Sparse – Dynamic Calc
    Sparse2 – Label Only
    Sparse3 – Label Only
    Sparse 4– Label Only
    Sparse5 – Label Only
    Sparse6 – Label Only
    Thanks!

    Natilie,
    If I understand you correctly, you are loading data, then clearing out the current month->current year, and then aggregating current month->current year? There isn't going to be any data there -- you've cleared it out in your second step.
    I think the order you want is:
    1) Clear out the current month->current year to be sure it's a good load
    2) Load the current month->current year
    3) Aggregate the current month->current year
    This could be done with a single Maxl that controls two calc scripts and one import database (clear, import, agg) or you could do it manually.
    The default calc is (generally) equivalent to CALC ALL using db properties (UPDATECALC, AGGMISSG, etc.). There shouldn't be practical difference between that and the AGG portion of your calc.
    I would again confirm that all of your data is at the lowest level, i.e., you can navigate to leaf level on all dimensions and pull a data value before you aggregate. Perhaps you are loading to upper level members and don't realize it. I often use the Excel add-in's Styles to tell me if I'm at the lowest level of a db or not.
    Regards,
    Cameron Lackpour

  • Can we modify the pnp selection screen and get only month and year?

    Dear Freinds,
                  I have requirement where i have to modify the PNP selection screen. So with the help of report category and coding in AT SELECTION-SCREEN OUTPUT  , i have modified all the fields relating to dates . i.e i have removed all the radio buttons (i.e Today, Current month,current year etc) and finally
    i have landed with only Period ( PNPBEGDA & PNPENDDA range) . But i dont want the PNPBEGDA & PNPENDDA range , but i want only is the month and year ( i.e just like the PNPPABRP & PNPPABRJ)
    on my selection screen along with the pernr .
    i have used the below code to close all the fields except pnpbegda and pnpendda.
    AT Selection-Screen output.
    loop at screen.
      IF screen-group4 = '098' .
          screen-input = '0'.
          screen-invisible = '1'.
        ENDIF.
        IF screen-group4 = '092' .
          screen-input = '0'.
          screen-invisible = '1'.
        ENDIF.
        IF screen-group4 = '094' .
          screen-input = '0'.
          screen-invisible = '1'.
        ENDIF.
        IF screen-group4 = '100' .
          screen-input = '0'.
          screen-invisible = '1'.
        ENDIF.
        IF screen-group4 = '104' .
          screen-input = '0'.
          screen-invisible = '1'.
        ENDIF.
        MODIFY SCREEN.
    endloop.
    i.e on my selection screen i want only  month & year combination and pernr -
    when iam using the logical database PNP . Could any one please let me know how can i get only mon & year only on my selection screen .
    If it is possible please let me know .
    Thanks & regards
    divya.

    Hi ,
       The requirement is that the user doesnt want to enter the date range i.e for ex:  01012008 to 31012008.
    As per the requirement the user will enter only the month and year only . so i on the selection screen
    i want only the month and year only . Is there any means i can modify the date period which is there by
    default (PNPbegda and PNPendda) on PNP selection screen. Instead of we givign to the user the
    PNPBEGDA and PNPPENDA i want is only month and year .
    AS already the code has already been written and now they have asked that they want only the month and year on the selection screen.
    Please suggest me in this regard.If iam hiding all the buttons relating the dates fields, and now if iam adding the parameters for the month and year  it is coming below below the fields pernr , personnel ara and subara , company code , payroll area, employee group of the standard fields of PNP selection screen , there by any body could please suggest me how to change.
    regards
    divya.

  • SQL select Statement -first day and last day of the month - 1 year from now

    Hi,
    I need to write a SQL to get the dates in between first day and last day of the month one year from now.
    SELECT last_day(add_months(sysdate,12)) as lastday from dual
    What could be the Query to get the first day of the month one year from now..
    ie ..Sysdate - 3-DEC-2009
    Result - 1-DEC-2010
    thank you

    Hi,
    You can use TRUNC with 2 arguments to get the first DATE in a month, year, quarter, week, hour, minute, ISO year, ...
    SELECT  TRUNC ( ADD_MONTHS ( SYSDATE
                               , 12
                  , 'MONTH'
                  )     AS first_of_month
    FROM    dual
    ;The DATE returned will be in the same month, year, quearter, ... as the first argument.
    \We convered the last day of the month in [your previous question|http://forums.oracle.com/forums/message.jspa?messageID=3942939#3942939].
    At that time, I warded about using LAST_DAY as a cutoff point; TRUNC is a much better way.
    For example, to find all appointment_dates in the current month next year:
    SELECT  *
    FROM    appointments
    WHERE   appointment_date >= TRUNC (ADD_MONTHS (SYSDATE, 12), 'MONTH')
    AND     appointment_date <  TRUNC (ADD_MONTHS (SYSDATE, 13), 'MONTH')Note that
    the first part of the WHERE clause calls for dates on or equal to the beginning of the 12th month in the future, but
    the second part of the WHERE clause calls for dates before, not equal to , the beginning of the 13th month in the future.

Maybe you are looking for

  • E-Recruitment and IBM portal integration

    Dear Experts, I am going to start working on new project. there they want to implement the E-recruitment. but they are not going to use ESS /MSS. they have their IBM portal in place. can some one tell me how to integrate the SAP ECC and IBM portal. t

  • Printing wirelessly with MacBook Pro?

    I'm sure this topic has come up before. Does anyone have any ideas how I can print wirelessly using my MacBook Pro? I'm trying to get Airport Express working but the 2 printers that I have are not on the list of compatible printers so I think that I

  • Playback in Premiere

    Ok, so I installed CS4 on my mac-mini with the following specs: 2.53 GHZ Intel Core 2 4GB 1067 MHz DDR3 at least 100GB free hard drive space And this is the strange thing, when I load a video into Premiere, I can drag my mouse through it to hear the

  • Print button in ABAP WebDynpro

    Hello all,   The client has requested a 'Print' button in our webdynpro application - ie a simple button that triggers the browser command Ctrl P. I have searched the forum, and it seems that this is not possible, because WebDynpro cannot execute bro

  • Vibrating icons with ipod touch

    Every now and then, my newly purchased ipod touch (32Gb) All icons vibrate, I don't know why they vibrate, the only way i know how to stop the icons from shaking is rebooting the ipod touch. When I look at the screen all icons vibrate/shimmer/shake.