Prior Year Sales vs. Prior Period Sales

Using Crystal Reports XI, connecting to an Access Database.
I have a report that compares 2007 to 2008 sales for the most recent 4 weeks.  It summarizes sales first by Item Class (group 3), then by Item Type (group 2), then by Region (group 1).  Some Classes of items have sales in both 2008 and 2007, but some don't.  For those Item Classes that have no 2007 sales, I want to show the most recent 4 weeks in 2008 vs. the 4 weeks just prior to that.  In other words, if the report is showing week 10 to 13 in the 2008 column, I want to show weeks 9 to 12 in the 2007 provided that there are no 2007 sales for that item class.
I can do this easily enough for Item Class, however I am having trouble getting accurate sub-totals for Item Type and Region.
What I have now is this formula to show Net Sales for "2007".  {Command.class} is Item Class.  @PriYr4wkSale is the real 2007 gross sales.  @Prev4wkSale is the week 9 to 12 gross sales.  @PriYr4wkSpl is the spoils, which I add to gross sales to get net.
if Sum ({@PriYr4wkSale}, {Command.class}) > 0 then
    Sum ({@PriYr4wkSale}, {Command.class}) + Sum ({@PriYr4wkSpl}, {Command.class})
else
    Sum ({@Prev4wkSale}, {Command.class}) + Sum ({@Prev4wkSpl}, {Command.class})
If I change this to summarize over {@ItemType} I get erroneous data because {@PriYr4wkSale} is always positive, so the formula doesn't pick up sales for the Previous 4 wk period.
Does anyone have any ideas for a formula I can place in the details section (and then subtotal by group) that will show the sales amount conditionally, based on whether or not an item has prior year sales?  The problem I've run into with this approach is that any given detail record (say in 2008) doesn't know if there were prior year sales or not).
Edit: How can I make the post narrower, so it fits within one browser window, width-wise?
Edited by: M Anderson on Jun 3, 2008 1:12 AM
Edited by: M Anderson on Jun 3, 2008 1:13 AM

Hi "M",
I know when I've tried something similar, the problem was that the formula didn't work because it wasn't getting a result of "0" (i.e. no sales) but "null".
Try:
if not isnull(Sum ({@PriYr4wkSale}, {Command.class})) then...
Heather

Similar Messages

  • Cant change delivery date on Sales Order posted in prior period

    Hello All,
    Scenario: A sales order which was processed in prior period but since then delivery date had changed due to request from our customer. When we try to go back and change the delivery date, we find it greyed out. To get around this, we have to open the period again, change date and then close the period. Problem is that not all dates get changed, so our late delivery report look bad, shows that 90% of our deliveries are late, when in fact they are on time, the new time which we could not record on the Sales Order. We have similar problem with our purchase Orders.
    Is there anything in Administration we can do to enable us to easily chnage delivery dates on Sales order and purchase orders?

    Hi,
    Welcome you to post on the forum. What is your B1 version and PL?
    Thanks,
    Gordon

  • Calc with Current and Prior Periods Data

    <p>Hi Everyone -<br><br>I would like to come up with two types of calculations usingamounts from prior periods (dynamically)<br><br>1. "Net Sales" (current period) + "Net Sales"(current period - 3 months) + "Net Sales" (current period- 6 months) + "Net Sales" (current period - 9 months)i.e. If current period = June ... Net Sales Amount in June + NetSales Amount in March + Net Sales Amount in December of the yearbefore + Net Sales Amount in September of the year before.<br><br>2. Sum "Cash" for the past 12 months (current period tocurrent period - 11)<br><br>In both cases, we'll need to handle getting amounts from the prioryear, as well.<br><br>I can feed the "current period" in thru a sub var, yet(assuming that is the correct function, I am not sure how to set up@PRIOR with Current Period - n Periods...<br><br>I appreciate your help. Grazie ...lb<br></p>

    Hi David,
    I'd suggest you use a Query filter (or a report filter) to retrieve only rows that match this criteria on years. Since you need two values, I may have to use the filtering operator 'in list'
    Difference between those two is query filter will only retrieve to values where year = 2008 or 2009 from the datasource (so if you want to change the year values, you will have to refresh document), while report filters are active on the query output (which means that no refresh from the DB is required if you need to change values), which might bring a better experience if you need interactivity in the report. Moreover, if interactivity is important and you are working with WebI XI 3.1 SP2, you can embed these report filters into Input Control, and command the filter from a graphical widget like check boxes, to let user control which years he wants to view/ compare in the table (or chart).
    Hope that helps,
    David.

  • What is the earliest prior period that you would like to enter into SAP B1

    Can anyone please explain the need of gathering the following information in a BBP for SAP B1 2007B?
    "What is the earliest prior period that you would like to enter into SAP Business One to allow for Comparative Financial Statements?"

    If you want to be able to create year over year reports, create budgets based on history, etc. you can't just start with opening balances for your GL accounts. You need to create past periods and load history amounts. That's all.
    My clients typically want to be able to answer questions like 'How much higher (or lower) are sales this month than sales in the same month last year?' So for a client who 'went live' with SAP on January 1, 2009, I would create 12 periods for 2008 and enter their monthly balances for their GL accounts.

  • Date issue in processing billing documents that shipped in a prior period

    Date issue in processing billing documents that shipped in a prior period that is now closed:
    SAP values those deliveries with the current document date in A/R when it should be the original delivery date.  Baseline date needs to stay the delivery date, but is getting copied from the billing date in the new period.  A user exit exists (& needs to be applied) to manipulate the baseline date when the accounting document is being created.
    Any input is appreciated.

    Hi
    Try with Invoice Correction Request concept
    Sale document Type: RK
    Reference Document Type : Billing Number
    for Understanding the Invoice Correction request check below link
    [Creating Invoice Correction Requests|http://help.sap.com/saphelp_46c/helpdata/en/dd/55feeb545a11d1a7020000e829fd11/content.htm]
    Regards,
    Prasanna

  • Profit Center Group Organization Change - Effective for Prior Periods

    Hi Experts,
    A client wants to perform a horizontal organization change (profit centers) and see the effects retroactively to the prior periods.  To achieve this, they plan to re-execute the consolidation tasks going back two to three years once the org change is made, so that they have comparative financial statements that take into account the change.  The requirement is to re-post the group level postings to the updated profit center group after the change.  For example, Italy related postings would occur under the group Central Europe instead of Western Europe as before.  All the group level postings previously booked to Western Europe would now need to recorded under Central Europe going back prior periods.
    Does anyone have any ideas as to how to meet the requirement without re-consolidating?
    One option was the restatement feature but based on the SAP help description of the monitor required, it does not take into account consolidated postings, only uploaded PL00-10 data and translation.
    Another option is to copy the version but then the results is in another version rather than the original 'actual' "100" version.
    Any ideas would be appreciated.
    Thanks
    Eyal Feiler

    Eyal,
    I know of no other way to accomplish this than to re-execute the consolidation for the prior periods after the hierarchy has been changed.
    I have used the restatement feature and like you have found it very limited.
    The copy to another version would only work if you copied the existing data to the new version before re-executing the consolidation. The the version 100 can be re-consolidated for the previous periods and the existing reports do not have to be changed for a new version.
    However, with the copy, it is important to set the cons group and cons unit hierarchies to be version dependent so the changes are only good for the version that is to be re-consolidated for previous periods. This allows you to report on the data before the change where the logic will read the old, unchanged version of the hierarchy.
    Dan

  • FI-SD data-BEx Query Logic for Amount received for the Lasts F.Year Sales

    Hi Friends,
    Need your assistance in designing one BEx Query,
    We have Two cubes...one is sales ZSALES01 and Account Receivables ZFIAR01. On top of these cubes e built Multiprovider.
    In the sales cube (ZSALES01)., we have calender day, Financial year , Fiscal period characteristics as time characteristics and Net Values as key figures. And Same way in the Account recievable cube (ZFIAR01) we have calender day( Which is mapped with Posting date), Financial year , Fiscal period characteristics as time characteristics and Credit/Debit amount as key figure.
    My requiremnt is that i have to show in BEx with below scenarios.......
    1.Amount received for the sales occured till Last Financial year
    2. Amount Received for the sales occured in this current financial year
    We have two show these values for company code wise , we have company code in both cubes nad we  have financial year...and some other common fields there in both cubes.
    Can you please guide me how to design the same in BE query.
    Thanks & Regards,
    Anand

    are you saying that in your query you need to have 4 columns;
    - Sales Last Year
    - Sales Current Year
    - AR for Sales (LY+CY)
    - AR for Sales Current Year
    If yes, getting Sales Information is easy. You need to use customer exit variable to get the current year (calendar or fiscal)
    - for Sales Last Year, use customer exit variable for current year with a offset of -1
    - for Saels Current Year, use customer exit variable for current year
    For AR columns, as I said in my earlier post - use a lookup while loading data in AR cube. Use the Sales Doc Number and get the year information (calendar, financial or fiscal - whatever you want to use depending on your requirement) from Sales flow. This way you can tell if a particular FI doucment is for this year's sales or last year's sales.
    Now, you can use another customer exit variable for AR column depending on the "Sales Year" infoboject. Customer exit variable shold be populated with the current Sales Year.
    - for AR for Sales CY, use this customer exit variable
    - for AR for Sales LY, use this customer exit variable with offset of -1
    - AR for Saels (LY+CY), add both the columns above
    Another way of achieving AR for Sales (LY+CY) is to restrict the RKF or value range using customer exit variable for Sales year with BETWEEN operator (From var1 to (var1-1)).
    You can also use the option of replacment path variable as Durgesh mentioned. but in that case you will have to create two addition queries based on sales data which will return:
    - sales documents for last year
    - sales documents for current year
    then you need to create two replacement path variables for AR columns which will get values from these two queries.
    I hope it helps.
    Regards,
    Gaurav

  • Last year sales calculation in calculated column

    Hi everybody!
    Please help me to solve issue with last year sales calculation in calculated column. I have 'Fact' table with sales for every period in it and related table 'Time' with 1, 2, 3 'PeriodID' column for string MAT 2011, MAT 2012, MAT 2013.
    I know the solution for measure:
    =CALCULATE ( SUM(Fact[Sales]); FILTER (ALL ('Time'); 'Time'[PeriodID] = MAX(Time[PeriodID]) - 1))
    But for the purpose of my analysis I need to make a calculated column. What I want to see looks like this table:
    Product
    Period
    Sales
    SalesLY
    A
    MAT 2013
    17
    10
    B
    MAT 2013
    20
    23
    C
    MAT 2013
    45
    33
    D
    MAT 2013
    13
    16
    A
    MAT 2012
    10
    8
    B
    MAT 2012
    23
    31
    C
    MAT 2012
    33
    5
    D
    MAT 2012
    16
    22
    A
    MAT 2011
    8
    0
    B
    MAT 2011
    31
    0
    C
    MAT 2011
    5
    0
    D
    MAT 2011
    22
    0

    Thanks for the idea!
    It's an option. I slightly modified expression to make it more generic:
    =CALCULATE
          SUM (Fact[Sales]);
          FILTER (
                        Fact; Fact[Product] = EARLIER (Fact[Product]) && Fact[PeriodID] = (EARLIER(Fact[PeriodID]) -1)
    Where Fact[PeriodID] is calculated column with '=RELATED (Time[PeriodID])' formula. To my opinion this is more universal approach.
    But it has the cons. EARLIER is memory demanded function. In case of 32-bit OS or numerous nested EARLIER error might occur.
    Is there any alternative solution?

  • Last year sales volume report

    Hi BW Expert,
    I have sales report  the  current primary volume is the CKF dispalying and i have problem last year primary volume is not dispalying . i tried using offset -1(fiscal year period) the values are not diplaying .Can any one suggest how to dispaly the last year values.
    Regards
    sivaraju

    Hi,
    As you have mentioned in post, there is problem with pervious year sales volume report. Are you looking data for entire year, in that case you should offset for fiscal year -1.
    Also you are looking only for one period of pervious year, offset with -12 not with -1. If those restrictions are correct, check if you have fiscal year variant included in query. For offset to work proper you should have the fiscal year variant field in the query.
    only then offset will work fine.
    Hope this helps
    Regards
    Akhan

  • 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

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

  • How to create logical columns for current period and prior period

    Hello all.
    Is there any way in obiee to create a new logica column in BMM layer that says "CURRENT PERIOD" AND "PRIOR PERIOD" OR ONE SINGLE COLUMN THAT SAYS "PERIOD".
    In those columns what I need is if it a current period column it shoould have 03/01/2012-03/31/2012 (this month date range)
    and in prior period column I shouldhave 02/01/2012 -02/29/2012(which is previous month date range).These columns I will be using in my reports.
    Please help me if we can create any such columns with these conditions/requirements

    Hi,I have already created he dynamic variables.But I am not getting how to use those variables and create the new logical columns in bmm layer.
    this is what I am trying
    case when VALUEOF("Current Month begin date"."Current Month begin date") ='..' and VALUEOF("Current Month end date"."Current Month end date")
    ='..' then 'current period' end
    I don't really understand what I should write case when VALUEOF("Current Month begin date"."Current Month begin date") ='..'??

  • Customer Statement - PLD - Prior Period Balance

    When one uses the standard Customer Statement, the prior period balance shows up. It is a field defined as TEXT field, Free Text and the text value is 9999999999.
    When I copied (save as) this standard customer statement, the prior period balance no longer shows up. Further more, if I copy this field from the customer statement (F_033) to my new copy it doesn't work and if I manually create a new field it doesn't work either on the new statement.
    How does one get a prior period balance to show when the field is a text field and not a formula field.
    Any help would be greatly appreciated.

    Hi Marli,
    This is the norm of B1. Your client should be able to get used to it soon.
    Thanks,
    Gordon

  • Calculate gross profit, yearly sales,monthly sales,weekly sales?

    hi all
    i try to create procedures according to these conditions 
    What are my yearly sales?
    What are my monthly sales?
    What are my weekly sales?
    What are my daily sales?
    What is my Gross Profit?
    What is my Gross Sales?
    this is star schema
    now how i calculate yearly sales, monthly sales, and also gross profit.
    create procedure spgrossprofit
    as
    select as grossprofit from dimfact
    now which aggregate function i use for calculate above conditions?
    any help?

    Sorry(ETC) is a Spanish expression = the same for the next option
    The correct query:
    Year/Month
    create procedure spyearlysales
    as
    select sum(totalsales),Year(Dimtime.date) from Dimtime
    inner join Dimfact on Dimtime.Time_Key=dimfact.Time_Key
    group by Year(Dimtime.date)create procedure spmonthsales
    as
    select sum(totalsales),year(Dimtime.date),Dimtime.Month from Dimtime
    inner join Dimfact on Dimtime.Time_Key=dimfact.Time_Key
    group by Year(Dimtime.date),Dimtime.Month
    JM Claudio Dba/Consultor SQL/BI Pasiona - Spain

  • How to post prior period depreciation into the current period

    We accidentally missed a depreciation run in a prior month and so cannot move ahead until this is posted.  We do not reopen prior periods once the GL is closed.  Is there a way to post the prior month's depreciation into the current month?  We are on ECC so I understand depreciation no longer posts via SM35.  I have seen other posts that discuss similar issues but haven't seen this exact issue.  I've been told there is no way to do this, our only option is to reopen the periods.  Hoping that is not the case. Thanks.

    Hello,
    Since the depreciation didn't run in the previous month, the depreciantion of last month and current month to be booked in current period is possible. For example period 06 was the previous month, then in current month depreciation run AFAB > select 'Unplanned posting run' in the 'Reason for posting run' only for current month for e.g. period 07. From next month onwards, select 'Planned posting run' as normal.
    Kind regards,
    John Chin
    Edited by: chinks on Jul 20, 2011 12:43 PM

Maybe you are looking for

  • How to create a blank field parameter for lenth 400 char

    hi, in my coading i want selection-screen skip 1. selection-screen begin of line. parameters:select1 like dd02l-tabname ,             a(400) . selection-screen end of line. but in selection screen the lenth of a coming only up to 45 char. i want at l

  • JDBC Type 3 driver problem with WLS 6.1 SP4

    We have Oracle 8.1.7.4 client running on WebLogic 6.1 SP4 on Solaris 2.6 connecting to Oracle OPS 8.1.7 running on Solaris 2.6. We are getting core dumps while running stress testing using Load Runner for 100 concurrent users. The performance is very

  • Report with cumulative balance

    Hi! There is a FI report for vendor ledger based on multiple profit center where a column is there for cumulative balance in the output. Now when the user makes a subtotal on profit center the output generates based on multiple profit center but in t

  • Creating of incoming invoice automatically when documen info record created

    Hi all, I apologize because I am asking many questions on this forum during the last few weeks, but I have some problems which I can't solve by myself in one project. So, this time the question is about incoming invoices. Here is the situation: When

  • Ora-00932 inconsistent data type expected date got number

    Hi all, I have got an error ora-00932 inconsistent data type expected date got number in the below part of query. NVL (TRUNC (wdj.date_completed), '14-NOV-2012') BETWEEN NVL (TRUNC(:p_wo_completion_date_from), NVL (TRUNC(wdj.date_completed), '14-NOV-