Line Chart to Compare Current Year vs Last Year

I am on BI 7 SP9. I need to create a line chart that shows 2 lines to compare  revenue for the current year against last year. The first line should show the revenue for the current year. The second line should show the revenue for last year. In my BEx query, I have the fiscal period values in the row and the revenue key figure in the column. Questions:
1. How can I show 2 lines in the chart to compare revenue for the current year vs last year?
2. There are 2 variables for the fiscal period - one for current year and one for last year. The user can enter any value range in the fiscal period variables at query runtime, but the fiscal periods for each of the 2 years must be the same. This means the number of fiscal periods that appear in the query result rows will vary (e.g.. 3 periods for a quarter or 12 periods for a full year). The user has to enter the same fiscal periods for the current year and last year variables. How can I determine the fiscal period values to plot in the line chart for the current year and then last year when the number of rows in the query results will fluctuate?
The legend at the bottom of the chart should show JAN, FEB, MAR...DEC instead of the fiscal period values like 001/2007, 002/2007. Is there an exit I have to change to get this to work?
Thanks for any help you can give!

You can do it in multiple ways
1.
SELECT COALESCE(t1.Company,t2.Company) AS Company,
COALESCE(t1.Sales2015,0) AS CurrentYearSales,
COALESCE(t2.Sales2014,0) AS PriorYearSales
FROM Sales2015 t1
FULL JOIN Sales2014 t2
On t2.Company = t1.Company
2.
SELECT Company,
MAX(CASE WHEN YearVal = 2015 THEN Sales ELSE 0 END) AS CurrentYearSales,
MAX(CASE WHEN YearVal = 2014 THEN Sales ELSE 0 END) AS PriorYearSales
FROM
SELECT Company,Sales2015 AS Sales,2015 AS YearVal
FROM Sales2015
UNION ALL
SELECT Company,Sales2014 AS Sales,2014
FROM Sales2014
)t
GROUP BY Company
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

Similar Messages

  • Line Chart - Current Year Sales, Current year Returns, Last year Sales, Last Year Returns

    We have a report that summarises monthly sales & credits for 2 years in a group footer.   The footer is a sum of a formula in the detail section that calculates the monthly sales at the Item code level
    Item 1
    Group Footer 1     July     Aug     Sept     Oct          
    Sales Last Yr     @July_LY_Sales @Aug_LY_Sales     @Sep_LY_Sales  @Oct_LY_Sales          
    Credits Last Yr @July_LY_Credits @Aug_LY_Cred     @Sep_LY_Cred   @Oct_LY_Cred          
    Sales This Yr @July_CY_Sales @Aug_CY_Sales     @Sept_CY_Sales @Oct_CY_Sales          
    Credits This Yr @July_CY_Cred @Aug_CY_Cred     @Sep_CY_Cred @Oct_CY_Cred          
    <Curr Yr Graph1>
    <Last Year Graph2>
    Item 2
    Group Footer 1     July         Aug           Sept                               Oct          
    Sales Last Yr  @July_LY_Sales   @Aug_LY_Sales @Sep_LY_Sales @Oct_LY_Sales          
    Credits Last Yr @July_LY_Cred  @Aug_LY_Cred     @Sep_LY_Cred @Oct_LY_Cred          
    Sales This Yr   @July_CY_Sales  @Aug_CY_Sales     @Sept_CY_Sales @Oct_CY_Sales          
    Credits This Yr    @July_CY_Cred   @Aug_CY_Cred     @Sep_CY_Cred @Oct_CY_Cred          
    <Curr Yr Graph1>
    <Last Year Graph2>
    In the footer under the data, we want a 4 line graph (or 2 x 2 line graphs for this year & last year).  One line for sales for the current 12 months, and with it, a line plotting the credits, so as to see the trend over that year.  And then we want a line graphing the previous years sales and a line graphing the previous year credits for the 12 months. 
    On the data tab in chart expert, we selected the Place chart for each SHDOC.ITEM (Item number) in the footer and this is positioning correctly.  We have tried selecting "On change of shdoc.item and we have also tried For each record.  We selected on change of shdoc.item to generate the graph for each item.  We then added the 12 formula for the current year in the Show Value panel  
    In the show value panel we tried using the detail formula, the Report Area: Sum of <formula> and the Group 1: Sum Formula.  They all display as @July or @Aug which is a dependent formula used to identify the month
    We have added the above formula for each month and each value, but we can't work out how to group the monthly data into the 4 series of 4 lines (1 colour each) - Current Year Sales, Current Year Returns, Last Year Sales, Last Year Returns for the charting.  We have tried to create a graph with only 1 set of monthly data (viz, just 12 months current year sales) But no matter what options we take, we seem to get 12 line chart representing each month rather than 1 line representing 12 months.
    Can someone point us in the right direction?

    Please re-post if this is still an issue but search forums first, lots of chart questions have been answered.

  • Help with report that shows Year and Last Year

    Hello!
    I want to view in a report some KPIs (Rows) and Years(Columns) but I want a specific report with a prompt, I mind, at top of my dashboard there is a Year prompt that it contains (2001, 2002, 2003….,2010) and I want to see in a report when I chose in prompt 2008 for example that my report shows me 2008 Year and Last Year (2007) and another column that indicate Diference between these years. Is that possible? Can u explain me the process to get it?
    Thank you very much!

    If you get access, create a duplicate of the Measure you wish to use in the Business Model.
    Once you have a duplicate rename to say $ Revenue Year Ago and then from the properties of the Measure, General click on Use existing logical columns as the source.
    Then select function>Time Series> Ago
    Ago has 3 inputs, select the column you want to base the measure on, the TIME SERIES Dimensions for year, and then 1 for 1 year ago.
    So your formula will look something like:
    Ago("Human Resources"."Fact - Absence"."# Days" , "Human Resources"."Time"."Year" , 1)
    Save this and copy into your Presentation layer available for use.
    Hope this helps

  • Sales Summary - Compare same weekday sales last year.

    Post Author: geoffh
    CA Forum: Formula
    I have a table storing invoices going back several years. I wish to calculate the total sales for yesterdays date, & compare it with total sales for the same weekday in the previous year. For example if it is Tuesday today, I need to calculate Mondays total sales (yesterday) & also Mondays total sales for the same week period last year.
    Date fields I have available are 'history.date_invoiced' (invoice date) , history.week_invoiced , history_year.invoiced. Sales values are history.sell_account & history.sell_cash.
    I'm new to crystal.......Using V 11.0.0.1282 . Any help would be greatly appreciated.

    Post Author: yangster
    CA Forum: Formula
    create a formula with the following informationnumbervar weeknumber_curr_year := datepart("ww", dateadd("d", -1, ));numbervar weekdaynumber_curr_year := datepart("d", , 1);  //assuming sunday is the start date of the week, change to 2 if monday isthose 2 variables will tell you the current week number and what day of the week you are after for the current yearnumbervar last_year := dateadd("yyyy", -1, currentdate);if year() = last_year and datepart("ww", ) = weeknumber_curr_year anddatepart("d", , 1) = weekdaynumber_curr_year then amt_field else 0put that in the details section and create a summary of the formula and you should have the total sum of sales for exactly the same week and day of week one year prior to yesterdaymaybe kai has a more simplified solution but that's what comes off the top of my head

  • How do I create a new calendar for the current year, using last years calendar's birthday's/photos and comments from the lower pages?

    Each year for the past 5 years I make a family calendar and send copies to all he family members around the globe.  I hate that I have to recreate all the birthdays and special occasions from scratch, and re-drag all the photos onto these dates, in the lower half of the page of each month on the new calendar.  How can I create a new calendar for the current year and port all of these photos/comments into the new calendar from last years calendar, to save having to redo all this work!!  I am not talking about the upper half page of the photos only...I am referring to the calendar page of each month.
    Thanks in advance. 
    Colin

    Welcome to the Apple Discussions. Open iWeb so you see your original site in the left hand pane. Use the File->New Site menu option to create a new site. Give it the name you want.
    Now select a page in your original site and type Command+D. That will duplicate the page. Drag the duplicate page down to the new site and rename it as needed. Do that for the other pages you need in the original site.
    OT

  • How to show current year and last year sales in a WEBI Report

    Hi Guys
    How can show current YEar Sales in one column and Last YEar Sales in the other column based on a user prompt for the Current YEar Column.
    For Example is user enter 2010 for Year how can i show a Column for Sales-2010 and Sales 2009.
    Thanks

    If you can modify your Universe add an object named New Object Last Year whose SQL is:( yourTableName.Year + 1)
    Then in WebI create two distinct queries in your query Pane. In the first one you could do this:
    Query 1:
    objects: Year, Sales ... etc.
    filters:   Year Equal to '1. Prompt Year'
    Query 2:
    objects: Year, Sales ... etc.
    filters:    New Object Last Year Equal to '1.Prompt Year'
    Then in your report you can drag each object on their respective columns.
    If you don't want to use two distinct queries, use one like this:
    Query 1:
    objects: Year, Sales ... etc.
    filters:        Year Equal to '1. Prompt Year'
                 Or
                      New Object Last Year Equal to '1.Prompt Year'
    Edited by: PadawanGirl on Jun 23, 2011 6:28 PM

  • How to compare this week with last years week sales ?

    Hi all,
    I have a table called Sales with two columns  Date and UnitsSold
    Date is of type smalldatetime   and will have the date of the sales
    while UnitsSold is type int and will have the number of units sold
    I need to write a stored procedure that will compare between a week's sales from last year with a week sales from this year and show the percent in sales difference
    Thanks

    DECLARE @thisYearThisWeekStart DATETIME = DATEADD(DAY,1-DATEPART(weekday,'2014-01-01'),DATEADD(WEEK,DATEPART(WEEK,GETDATE())-1,'2014-01-01'))
    DECLARE @thisYearThisWeekEnd DATETIME = DATEADD(DAY,0-DATEPART(weekday,'2014-01-01'),DATEADD(WEEK,DATEPART(WEEK,GETDATE()),'2014-01-01'))
    DECLARE @lastYearThisWeekStart DATETIME = DATEADD(DAY,1-DATEPART(weekday,'2013-01-01'),DATEADD(WEEK,DATEPART(WEEK,GETDATE())-1,'2013-01-01'))
    DECLARE @lastYearThisWeekEnd DATETIME = DATEADD(DAY,0-DATEPART(weekday,'2013-01-01'),DATEADD(WEEK,DATEPART(WEEK,GETDATE()),'2013-01-01'))
    DECLARE @thisYear INT, @lastYear Int
    DECLARE @salesTable TABLE (date DATE, unitsSold INT)
    INSERT INTO @salesTable (date, unitsSold)
    VALUES
    ('2013-07-07',10),('2013-07-08',9),('2013-07-09',8),('2013-07-10',7),('2013-07-11',6),('2013-07-12',5),('2014-07-13',4),
    ('2014-07-06',12),('2014-07-07',13),('2014-07-08',14),('2014-07-09',15),('2014-07-10',16),('2014-07-11',17),('2014-07-12',18)
    SET @thisYear = (SELECT SUM(unitsSold) AS tUnitsSold FROM @salesTable WHERE date BETWEEN @thisYearThisWeekStart AND @thisYearThisWeekEnd)
    SET @lastYear = (SELECT SUM(unitsSold) AS tUnitsSold FROM @salesTable WHERE date BETWEEN @lastYearThisWeekStart AND @lastYearThisWeekEnd)
    SELECT @thisYear AS thisYear, @lastYear AS lastYear, CONVERT(float,ROUND(((@thisYear+.0)/@lastYear)*100,2))
    You should really use a calendar table.

  • BI Query Monthly (this year and last year) vs YTD (this year and last year)

    I have a query requirement in BI to create a Query which will give me
    Sales Monthly (this year and last)  vs YTD Sales (this year and last).
    Here is an example of how the query would look:
    01/2007     01/2008     02/2007     02/2008     03/2007     03/2008     YTD 2007 YTD 2008
    Above would represent CKF's by month and YTD with Text Variables.
    Is this possible?  Obviously my problem is the number of columns that I would need, since I would not always be reporting on the same month(s).  Any suggestions (if this is possible).
    Thanks

    Hi,
    You can do it, see the following code and change as per your requirement...
    FMYEAR and LMYEAR Customer Exit variables on 0CALMONTH.  If you have any input variable then link it.
    Note:  Use Offsets for the following Variables to get 2007,2008,2009 results...
    * First Month Of Current Fiscal year comment*
        WHEN 'FMYEAR'.
          CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
                 EXPORTING
                   i_date               = sy-datum
    *         I_MONMIT             = 00
                   i_periv              = 'V3'
                IMPORTING
                  e_buper              =  zbuper
                  e_gjahr              =  zbdatj.
          CLEAR: l_s_range.
          l_s_range-low+4(2) = '04'.
          l_s_range-low+0(4) = zbdatj.
          l_s_range-sign = 'I'.
          l_s_range-opt = 'EQ'.
          APPEND l_s_range TO e_t_range.
    * Last Month of Current Fiscal year*
        WHEN 'LMYEAR'.
          CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
                 EXPORTING
                   i_date               = sy-datum
    *         I_MONMIT             = 00
                   i_periv              = 'V3'
                IMPORTING
                  e_buper              =  zbuper
                  e_gjahr              =  zbdatj.
          CLEAR: l_s_range.
          l_s_range-low+4(2) = '03'.
          l_s_range-low+0(4) = zbdatj + 1.
          l_s_range-sign = 'I'.
          l_s_range-opt = 'EQ'.
          APPEND l_s_range TO e_t_range.
    Thanks
    Reddy

  • HUGE files this year versus last year to burn

    Last year I made my husband a CD for Christmas and had 1.1 hours of music on it. This year the 1.1 hours of music from 2009 is a HUGE file and it won't burn. Why are this year's downloads so big and is there a way I can filter out extraneous info to just burn a CD of the music?? Thanks for any help!!

    1.1 hours of music should burn to a normal audio CD without a problem, no matter what the sizes of the underlying files are. Pls explain what you are doing, and somebody here will try to help.

  • How can I jump ahead to a specific date? (without having to keep clicking every month to get to next year or last year)

    Maybe it's the way I have it displaying? (left pane shows a small calendar of the current month, on the right is a full size of the current month). Other options of displaying are: day & week, but chose month because wanting more of an overview. Any suggestions would be appreciated. Thanks!

    tried clicking on the year in the calendar?

  • Query for 'User Activity' Webi Line Chart using BO4.0 Auditor

    Need to create a webi line chart to measure  ‘user activity’ per month, year or day using BO4.0 Auditor on Oracle.    
    This question raises two sub-questions:
    What actions constitute user activity?  Is it concurrent logins by users?   I am confused if that would really give a true picture of user activity as users can log in and do nothing on the BO system.  
    If concurrent logins do in fact give a true picture of user activity then how do I go about creating a chart? What objects do I need to include in query?
    Please provide feedback?
    Thank u.

    Hi Ramil,
    Follow below steps to create a webi report for your requirement, launch Webi rich client and create a new webi report by selecting "BOEXI40-Audit-Oracle" (Audit universe)
    1) Select below objects in 'Result Objects' pane
    [Event Year], [Event MonthName],[Event DayofMonth], [Event Type], [User Name], [Total Event Count]
    2) Define below conditions in "Query Filter" pane
    [Event Type Id] In list 1015 AND [Event Year] In list "Select Year" (Prompt)
    3) Run query
    4) At report level create a new variable of type measure with the name "User Activity" with below formula
    =Count([Total Event Count]In([User Name];[Event MonthName];[Event DayOfMonth]) )
    (This formula will track  logout event of a each user in a day as well as in a month, it will take/count only one log out event of the user in a day as you desire)
    5) Create a table block as well as graphs as you desire
    i) For day wise user activity create a table/graph using: [Event DayofMonth], [User Activity]
    ii) For month wise user activity create a table/graph using: [Event MonthName], [User Activity]
    Let me know if you have any questions
    ~Manoj

  • To find last year's data / a particular year's data

    Hi ,
    How to find out the data for the entire last year , i tried like
    entered_date between to_char( '12/31/2008 11:59:59', 'MM/DD/YYYY HH12:MI:SS')
    and to_char('01/01/2010 00:00:00', 'MM/DD/YYYY HH12:MI:SS' ) , but it is an invalid number error.
    thanks.

    Hi,
    If you want something that doesn't require hard-coding a year, but automatically figures out what year it is:
    WHERE   entered_date     >= ADD_MONTHS ( TRUNC (SYSDATE, 'YEAR')
                                              , -24
    AND     entered_date     <  ADD_MONTHS ( TRUNC (SYSDATE, 'YEAR')
                                              , -12
                                    )There are a couple of things to notice about the expression you posted (besides using TO_CHAR instead of TO_DATE):
    WHERE  entered_date     BETWEEN TO_DATE ('12/31/2008 11:59:59', 'MM/DD/YYYY HH12:MI:SS')
                          AND       TO_DATE ('01/01/2010 00:00:00', 'MM/DD/YYYY HH12:MI:SS')BETWEEN includes both endpoints, so the expression above covers a tiny bit more than one year. It includes one second from 2008 and one second from 2010, as well as all of 2009.
    Currently 2010 is the last year, so the expression you posted (as well as my suggestion) is actually for the year before last year, but it can easily be changed for any year.

  • Sales Last Year

    Hi,
    I need to calculate the sales last year.
    I have a month and year.
    And measure_sales
    for example, i have this sales:
    Year Month measure_sales
    2011 1 14,40
    2011 2 23,40
    2011 3 5,40
    2011 4 44,40
    2011 5 38,40
    2011 6 19,40
    2011 7 3,40
    2011 8 60,40
    2011 9 40,40
    2011 10 30,40
    2011 11 56,40
    2011 12 60,40
    2012 1 40,40
    2012 2 30,40
    2012 3 56,40
    2012 4 60,40
    Now, i show the sales of 2012 and the last year
    Year Month measure_sales last_year??
    2012 1 40,40 14,40
    2012 2 30,40 23,40
    2012 3 56,40 5,40
    2012 4 60,40 44,40
    Thanks !!

    Benito Camelas wrote:
    Hi,
    I need to calculate the sales last year.
    I have a month and year.
    And measure_sales
    for example, i have this sales:
    Year Month measure_sales
    2011 1 14,40
    2011 2 23,40
    2011 3 5,40
    2011 4 44,40
    2011 5 38,40
    2011 6 19,40
    2011 7 3,40
    2011 8 60,40
    2011 9 40,40
    2011 10 30,40
    2011 11 56,40
    2011 12 60,40
    2012 1 40,40
    2012 2 30,40
    2012 3 56,40
    2012 4 60,40
    Now, i show the sales of 2012 and the last year
    Year Month measure_sales last_year??
    2012 1 40,40 14,40
    2012 2 30,40 23,40
    2012 3 56,40 5,40
    2012 4 60,40 44,40
    Thanks !!Do this:
    1) For your report, you need 4 columns: Year, Month, two instances of your measure_sales column.
    2) Click on the fx button of the first measure_sales column.
    3) Click on the Filter button. Navigate to your Year column in the left pane of your workspace.
    4) When the filter window appears (automatically after you select the Year column), set it equal to 2012.
    5) Click "OK." This column column will represents sales when the year is 2012.
    6) Do the same thing for the second instance of your measure_sales column, except this time, set the year = 2012.
    This will give you your report of this year and last year's sales.
    Test this to see that it works.
    Your next question will be, "How do it make it generic so the user can choose what "this year" means?
    For that, build a dashboard prompt on Year and set it equal to a presentation variable called pv_year.
    Now go back to your two columns and replace 2012 with @{pv_year} and 2011 with @{pv_year}-1
    That's it.

  • Posting Depreciation for last year in the current year

    Hi,
    We have a situation in which we have to book depreciation for assets that were put into service since last year in the current year. The depreciation expense was accrued and reported when the year was closed out. However SAP wouldnt allow us to calculate the depreciation for anything before 01/01/2009. The assets were put into service in July of last year and hence we need to post 6 months of depreciation that we accrued last year in this posting period (when we will be capitalizing those assets). How do we go about doing this?
    Here is what we tried:
    1. Manual Depreciation: Doesnt work. The depreciation key we are using (LINA) doesnt allow manual depreciation
    2. Changing the ordinary dep start date: You can change this date to last year but it wont calculate the depreciation from last year. It just starts the useful life from last year. The depreciation that is being caught up starts from 01/01/2009
    3. Unplanned Depreciation: This is not an option because it goes to a different G/L account. The client wants it to be in the regular depreciation expense account only.
    Any suggestions?
    Thanks!

    Hi,
    So far my knowledge goes there is no way wherein you can capitalise assets in currnet year and account for dep from the previous year unless you go for post capitalisation vide ABNAN.Let me try to explain it by the following example.
    FY: April to March
    APC 10000/
    Rate od dep   10%
    Ord dep Start   01.10.08.
    Asset capitalisation date 01.10.08 but posted in the system on,  say   01.04.09.
    Line items for ABNAN
    70   Asset A/c     10000
    75   Acc Dep                          500(on 10000 @ 10% for 6 months)
    50 Rev for post capitalisation 9500.
    FB60 Line items.
    31   Vendor Account       10000
    40  Prior per dep                   500
    40  Rev from post capitalisation  9500.
    I do hope you will be able to clear your confussion.
    With best wishes
    Monoj
    Edited by: MONOJ SARKER on Aug 5, 2009 12:11 PM

  • Current year /last year in reports

    I need to report summarised data for range of periods and I need to compare the current year results with last year.
    For example I need to report Jan to June of current year and compare in the same reports the results of last year.
    How to select the last year? I tried with offset (year-1) but it does not work.
    Since I am giving the range of period( 1 to 6) in selection the period , hence the offset does not populate.
    Sure mark for helpful answers.

    Mani,
    as with your other topic in the BCS forum, there are ways to use the offset for this, but it all depends what variables you use for the period/year derivation.  It also depends if you are using BCS and need the YTD values.
    so, here are a couple of options:
    if you are using the fiscal year/period variable, then you will be restricted by what your FY variant is. (thus the value of your offset).  I think even if you use K4, taking -12 from your value will get you to the same period prior year.
    as with other recommendations here in the forum, you can offset just the year variable if your are using two separate ones (one for posting period one for fiscal year).  As BCS doesn't have the cumulative KF's, this is pretty much the only option that you have if you need to get the YTD values (since you need period 00 for the YTD values in the BS)
    You mentioned that the offsets don't work for you - double check that by using the text variables in the column headers, and you should see what data is being pulled in there.  Also, make sure that you are restricting the variables (fiscal year) on each column.  If you put the restriction on the entire query, it will only give you one value, so instead you need to put the fiscal year variable in each column (with appropriate offsets)
    let us know if that worked

Maybe you are looking for

  • Sudoku help needed

    Complete newcomer to java!! I want to create a sudoku java game using a gui. How do i go about this?? Whats the best way to start??

  • Can't close web pages.

    After just doing the ios 5 update, i no longer have web pages button on my navigation bar so I cannot close web pages. Anyone else have this problem?

  • Can't view .key package content

    Tonight I needed to view the package content of a saved Keynote 09 .key file. Right clicked on the file and the feature is no longer in the drop down menu. So I tried an 08 file using 09 and the feature is there. The work around was to save the file

  • Satellite L455-S5975 - Powers Up but can't open any programs.

    Computer powers up.  Everything looks fine but you can't open any programs.  You get an hourglass and then eventually it just says the program isn't responding.  I can't even shut it down correctly.  It is my son's computer and worked fine then he sa

  • Is it possible to produce HDR from one image in LR?

    I have been shooting a lot of images from inside a vehicle and using flash to fill in inside and ballance with the light outside.  The images are pretty well ballanced but have some dynamic range issues.  I am able to get a better output by tweaking