Stock Calculation Problem

Hi All,
I was setting up the  inventory cube 0IC_C03. I was getting negative values after data load. Below are the procedures I followed.
Loaded 2LIS_03_BX and compressed with Marker update (on 07.10.2009).
Loaded 2LIS_03_BF and compressed without marker update.
Now in the report, for the Total valuated stock, I am getting the correct value for the date 07.10.2009. For dates on and before 06.10.2009 I am getting wrong values, zero values and negative values.
I was not able to find the error. So I created a sample non-cumulative cube and loaded some sample data from flat file. Same problem I faced here also.
datasoures:
TEST_BX :
PLANT     MATL     CALDAY          RECVD     UNIT
61     12914     20091007     100     EA
TEST_BF :
PLANT     MATL     CALDAY          RECVD     ISSUED     UNIT
61     12914     20091001     50     20     EA
61     12914     20091003     110     20     EA
61     12914     20091005     20     40     EA
LISTCUBE Output:
MATL     Site     0RECORDTP     0CALDAY     UOM     ISSUED     RECVD
12914     61     1     31.12.9999     EA     0     100
12914     61          01.10.2009     EA     20     50
12914     61          03.10.2009     EA     20     110
12914     61          05.10.2009     EA     40     20
12914     61          07.10.2009     EA     0     100
Report Output:
Site     MATL     CALDAY          TOT STK     RECVD     ISSUED
61     12914     30.09.2009     -100          
61     12914     01.10.2009     -70     50     20
61     12914     02.10.2009     -70          
61     12914     03.10.2009     20     110     20
61     12914     04.10.2009     20          
61     12914     05.10.2009     0     20     40
61     12914     06.10.2009     0          
61     12914     07.10.2009     100     100     0
Here in the LISTCUBE if you see, the record on 07.10.2009 (From BX) is having a Qty Received of 100 EA. The same record has become the reference point (31.12.9999) after compressing BX. I think this could be the reason why I get these values in the output.
Pls help me to solve this issue,
Regards,
BIJESH

Hi Anil,
Thanks for the reply.
The compression was done properly as I had mentioned in the previous post. Also, in the LISTCUBE, 0REQUID = 0 for all the records. That means all the requests are compressed. Also, the record with 0RECORDTP = 1 (Reference Point) has the value ISSUED=0 and RECVD=100. That means only the BX has been compressed with marker update.
And in the document http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/93ed1695-0501-0010-b7a9-d4cc4ef26d31  on page 61, the formula for calculating stock is:
Sum(Records with 0RECORDTP=1 & 0REQUID=0 & CALDAY=31.12.9999)
        + Sum (Records which are not compressed)
        - Sum(Records which have 0CALDAY>Ref Date)
As per formula, the report calculation also seems ok. i.e.,
Stock for 07.10.2009 = 100 + 0 - 0 = 100
Stock for 06.10.2009 = 100 + 0 - 100 = 0
Stock for 05.10.2009 = 100 + 0 - 100 = 0
Stock for 04.10.2009 = 100 + 0 -  ((20 - 40) + 100) = 20
And all the other stocks are also correct as per the calculation logic and the records in the LISTCUBE. But the stocks are incorrect when compared to the BX and BF datasources. I cant find where I have gone wrong. Can you pls help me to solve this issue....
Regards,
BIJESH

Similar Messages

  • Stock calculation report in mm module

    Hi all,
    I have developed report for stock calculation in mm module. my opening stock and closing stock is not matching with that of MB5B.can anyone provide the guidance into this as I have worked on mm reports.
    Regards,
    Harshada

    declarations:
    * Structure type Declarations
    TYPES : BEGIN OF STYPE_MSEG_LEAN,
               MBLNR             LIKE      MKPF-MBLNR,
               MJAHR             LIKE      MKPF-MJAHR,
               VGART             LIKE      MKPF-VGART,
               BLART             LIKE      MKPF-BLART,
               BUDAT             LIKE      MKPF-BUDAT,
               CPUDT             LIKE      MKPF-CPUDT,
               CPUTM             LIKE      MKPF-CPUTM,
               USNAM             LIKE      MKPF-USNAM,
               XABLN             LIKE      MKPF-XABLN,        
               LBBSA             LIKE      T156M-LBBSA,
               BWAGR             LIKE      T156S-BWAGR,
               BUKRS             LIKE      T001-BUKRS,
               BELNR             LIKE      BKPF-BELNR,
               GJAHR             LIKE      BKPF-GJAHR,
               WAERS             LIKE      MSEG-WAERS,
               ZEILE             LIKE      MSEG-ZEILE,
               BWART             LIKE      MSEG-BWART,
               MATNR             LIKE      MSEG-MATNR,
               WERKS             LIKE      MSEG-WERKS,
               LGORT             LIKE      MSEG-LGORT,
               CHARG             LIKE      MSEG-CHARG,
               BWTAR             LIKE      MSEG-BWTAR,
               KZVBR             LIKE      MSEG-KZVBR,
               KZBEW             LIKE      MSEG-KZBEW,
               SOBKZ             LIKE      MSEG-SOBKZ,
               KZZUG             LIKE      MSEG-KZZUG,
               BUSTM             LIKE      MSEG-BUSTM,
               BUSTW             LIKE      MSEG-BUSTW,
               MENGU             LIKE      MSEG-MENGU,
               WERTU             LIKE      MSEG-WERTU,
               SHKZG             LIKE      MSEG-SHKZG,
               MENGE             LIKE      MSEG-MENGE,
               MEINS             LIKE      MSEG-MEINS,
               DMBTR             LIKE      MSEG-DMBTR,
               DMBUM             LIKE      MSEG-DMBUM,
               XAUTO             LIKE      MSEG-XAUTO,
               KZBWS             LIKE      MSEG-KZBWS,
               retail(01)        type c,                       
               oiglcalc(01)      type  c,                     
               oiglsku(07)       type  p  decimals 3,     
               insmk             like      mseg-insmk,      
    * the following fields are used for the selection of
    * the reversal movements
              SMBLN    LIKE      MSEG-SMBLN,    " No. doc
              SJAHR    LIKE      MSEG-SJAHR,    " Year        
              SMBLP    LIKE      MSEG-SMBLP.    " Item in doc
    TYPES : END OF STYPE_MSEG_LEAN.
    TYPES: STAB_MSEG_LEAN        TYPE STANDARD TABLE OF STYPE_MSEG_LEAN
                                 WITH KEY MBLNR MJAHR.
    * Data Declarations
    DATA : G_S_MSEG_LEAN         TYPE STYPE_MSEG_LEAN,
           G_S_MSEG_UPDATE       TYPE STYPE_MSEG_LEAN,         
           G_T_MSEG_LEAN         TYPE STAB_MSEG_LEAN,
           AKTDAT                LIKE SY-DATLO,
           INDEX_2               LIKE SY-TABIX.
    DATA: BEGIN OF IMSWEG OCCURS 1000,
            MBLNR LIKE MSEG-MBLNR,
            MJAHR LIKE MSEG-MJAHR,
            ZEILE LIKE MSEG-ZEILE,
            MATNR LIKE MSEG-MATNR,
            CHARG LIKE MSEG-CHARG,
            BWTAR LIKE MSEG-BWTAR,
            WERKS LIKE MSEG-WERKS,
            LGORT LIKE MSEG-LGORT,
            SOBKZ LIKE MSEG-SOBKZ,
            BWART LIKE MSEG-BWART,
            SHKZG LIKE MSEG-SHKZG,
            XAUTO LIKE MSEG-XAUTO,
            MENGE LIKE MSEG-MENGE,
            MEINS LIKE MSEG-MEINS,
            DMBTR LIKE MSEG-DMBTR,
            DMBUM LIKE MSEG-DMBUM,
            BUSTM LIKE MSEG-BUSTM,
            BUSTW LIKE MSEG-BUSTW,                              
            oiglcalc(01)         type  c,                      
            oiglsku(07)          type  p  decimals 3,      
            insmk                like      mseg-insmk,       
          END OF IMSWEG.
    DATA: BEGIN OF SUM_MAT OCCURS 100,
            WERKS LIKE MSEG-WERKS,
            MATNR LIKE MSEG-MATNR,
            SHKZG LIKE MSEG-SHKZG,
            MENGE(09) TYPE P DECIMALS 3,                             
          END OF SUM_MAT.
    Edited by: Kartik Tarla on Aug 5, 2010 7:06 PM

  • Safty stock calculation

    Dear all,
    I have a querry regrding the Safty stock calculation.
    I want system to consider the customer to whom I am issueing the material while calculating the safty stock.
    to be precise I dont want to consider the consuption made towards whole sale dealers and want to consider only service customer consumption.
    But as long as forecasting is concern I need to consider all the consuptions.
    this is required to keep my safety stock qty as low as possible.
    Regards
    Edited by: Donsandy on Jan 12, 2009 4:16 PM

    Hi,
    This is not possible using auto-safety stock calculation, as the calculation is based on all consumptions not just customer specific data.
    Safety stock is based on 4 factors that could affect the idealistic procurement pattern: 
    1. Ordering Lead-time. 
    2. Manufacuring Lead-time 
    3. Transporting Lead-time 
    4. Stock conversion Lead-time (or Quality Inspection lead time) 
    A delay in any or all of the above can have effect on the entire replenishment process and the stock. A buffer stock must be designed to take into account the above coverage. Again the determination of your safety stock depends on the accuracy of your forecast. Higher your accuracy, lower your safety stock.
    This relationship between forecast accuracy and service level is denoted by factor R. This also takes into account that the customer demand cannot be always satisfied 100% of the time. 
    Hence what we have is: 
    R = Relationship between forecast accuracy and service level (Service Factor) 
    W = Delivery time (in days) / Forecast Period (in days) 
    MAD = Mean absolute deviation (parameter for forecast accuracy) 
    Now If replenishment lead time is greater than the forecast period by factor W then: 
    Safety Stock = R x Sq.rt. W x MAD 
    Else 
    Safety Stock = R x W x MAD 
    So in other words, to control your safety stock effectively you need to maintain the service level. Lower the service level, lower your safety stock.
    Thanks.

  • Dynamic Safety stock calculation based on Future Requirements

    Dear All PP experts
    Our company wants to calculate the Dynamic Safety stock based on requirements in future period. Based on Standard SAP, it calculates dynamic stock based on current period only. So is there any way to do that. We are using MRP type PD.

    Use MRP type VM(Automatic reorder point plng) for Dynamic safety stock calculation.
    Also you can use coverage profile calculating dynamic safety stock.
    Use Tcode OMIA to define the coverage profile.
    For example if you  have defined a minimum range of coverage of 3 days, a maximum range of coverage
    of 7 days and a target range of coverage of 5 days.
    The system calculates the following:
    Minimum stock level = 3 x 15 pieces = 45 pieces
    Maximum stock level = 7 x 15 pieces = 105 pieces
    Target stock level = 5 x 15 pieces = 75 pieces
    The available quantity is 40 pieces and is therefore less than the minimum stock level. Therefore, the system creates a procurement proposal for 35 pieces (= target stock level 75 pieces u2013 actual quantity of 40 pieces) during the planning run.
    Regards
    S.Senthil

  • Safety Stock Calculation Setups

    Hi,
    Question 1:_
    I created a buy item with the safety stock details as below
    Method : MRP Planned %
    Bucket days : 2
    Percent : 100
    Also i enabled the MSO: Default Timestamp Safety Stocks to End of Day (23:59).After running the collection plan (Targeted Refresh) my msc_system_items table looks as below
    SAFETY_STOCK_CODE : 1
    SAFETY_STOCK_BUCKET_DAYS : Nill
    SAFETY_STOCK_PERCENT : Nill
    and then msc_safety_stocks is also empty.
    Please help me to solve the issue.
    Question 2:*
    what setups should i do to create the safety stock in my plan other than checking the calculate safety stock in plan option.Aslo what plan should i run (constrained or unconstrained)???
    Note : we done have inventory optimization installed.
    With Regards,
    M.Raamjee

    Hi Sandeep,
    I tried the generating safety stock.I succeeded too..Thanks for the help.But i need your help again for the analysis.
    I created a Buy item and i havent mentioned a LT for it.
    For safety stock calculation,i mentioned
    safety stock Buket days : 2
    safety stock percentage : 100
    Forecast was 100qty every day from 4/May to 9/May ..
    Output was as below
    29/Apr/2012 Forecast = 0 Saf.Stock = 76
    30/Apr/2012 Forecast =300 Saf.Stock = 100
    5/May/2012 Forecast =300 Saf.Stock = 73
    14/May/2012 Forecast = 0 Saf.Stock = 24
    As per the calculation
    ( 200/2) * 100% = 100 qty which is matching the qty in 30/Apr bucket.
    I need to know how was the other buckets got calculated.
    With Regards,
    M.Raamjee
    Edited by: Ramji on Apr 29, 2012 10:04 AM

  • Opening Stock and Closing Stock Calculation

    Hi,
         My report requirement is to display the material, opening stock for the lower date, closing stock for the higher date and the in between all stock operations..how to fetch the opening stock and closing stock for a particular  material ???.. what are the tables and fields for calculating them??..
    Thanks,
    Sri
    Edited by: Sri on Feb 13, 2009 8:33 AM

    Hi
    We have done a similar reports. One showing opening stock/Closing stock and another one showing all the transactions for a particular day. What we did was we developed a program to fetch data from MARD table for unrestricted, blocked & Qulaity stock(Our requirement talks only about these 3 stocks). And we scheduled the program exactly at system time 00.00 hrs with A class job.(today's closing day stock is nothing but tomorrow's opening stock)
      And for the second report which needs to pick all the transaction for a particular day, we picked it from MB51 entries. It is nothing but query between MKPF and MSEG.
    I hope this helps.

  • Income Tax Calculation problem: Urgent Help Needed

    Dear Gurus,
    I am facing a unique problem. Our client has two incentives –
    1) Product Incentive
    2) Sales Incentive
    Every month incentive figures get changed. These two are Monthly Regular Income (Cumulations Class 24) i.e. included in annual tax calculation.
    Now for tax calculation, my client wants "Actual Earning" and "Estimated Earning for the rest of the year" to be different. But Income tax calculation in SAP (for the month of April 2007) takes Actual Earning and multiplied it by 12( i.e. 11+1) to calculate Estimated Earning. But my client wants this Estimated Earning to be different. 
    Now please let me know is this possible in SAP system and how to calculate this?
    Your help will be highly appreciated
    Waiting for an early reply.
    Thanking You,
    With Best Regards,
    Pratik

    Hi,
    I am not understand your problem give your mb then i talk to you
    mhpo

  • Opening and Closing Stock Calculation In SAP BPC 10.0 NW

    Hello Experts,
    Need your guidance on this calculation.
    BI Cube: Receipts and Issues only Available on day basis
    BPC Report / Cube Context
    Product = Product1, Product2,
    Account = receipts, Issues, Opening Stock, Closing stock,
    Flow = Other
    Audittrail = Input
    UOM = QTY
    rptcurrency = LC
    Category = Actual
    TIme = All Periods (Monthly)
    Plant = Plant1, Plant2, Plant3, Plant4
                                       In the Cube I don't Have Opening Stock, without Which I cannot calculate Closing stock.
    Scenario: If I Enter Manually Opening stock for all products at some starting point, say In Year 2008 Jan.  How To take this closing stock of this month automatically to next month opening stock and So on and so forth to following Periods? Is it possible through "Carry Forward Business rule" in this case, as Closing stock is a calculated value using Member dimension Formula. I am having receipts and issues in Account dimension.
    Dimension Formula used:    Closing Stock = Opening Stock+Receipts- Issues.
    Please find attachment of the report screen shot.
    Thanking you
    Praveen

    Hello Vadim,
    1. The Cube storage Type is "Periodic".
    2. Acctype of the account dimension is "AST"
    3. Time Dimension Is based on Month.
    ID
    Description
    RELEVANT
    Base Period
    CLOSED
    Level
    Month Number
    Period
    TIMEID
    Year
    Calendar
    2006.01
    2006 Apr
    1
    MONTH
    1
    APR
    20060100
    2006
    2006.Q1
    2006.02
    2006 May
    2
    MONTH
    2
    MAY
    20060200
    2006
    2006.Q1
    2006.03
    2006 June
    3
    MONTH
    3
    JUN
    20060300
    2006
    2006.Q1
    2006.04
    2006 July
    4
    MONTH
    4
    JUL
    20060400
    2006
    2006.Q2
    2006.05
    2006 August
    5
    MONTH
    5
    AUG
    20060500
    2006
    2006.Q2
    2006.06
    2006 September
    6
    MONTH
    6
    SEP
    20060600
    2006
    2006.Q2
    2006.07
    2006 October
    7
    MONTH
    7
    OCT
    20060700
    2006
    2006.Q3
    2006.08
    2006 November
    8
    MONTH
    8
    NOV
    20060800
    2006
    2006.Q3
    2006.09
    2006 December
    9
    MONTH
    9
    DEC
    20060900
    2006
    2006.Q3
    2006.10
    2007 Jan
    10
    MONTH
    10
    JAN
    20061000
    2006
    2006.Q4
    2006.11
    2007 Feb
    11
    MONTH
    11
    FEB
    20061100
    2006
    2006.Q4
    2006.12
    2007 Mar
    12
    MONTH
    12
    MAR
    20061200
    2006
    2006.Q4
    2006.Q1
    2006 Q1
    3
    QUARTER
    3
    Q1
    2006
    2006.TOTAL
    2006.Q2
    2006 Q2
    6
    QUARTER
    6
    Q2
    2006
    2006.TOTAL
    2006.Q3
    2006 Q3
    9
    QUARTER
    9
    Q3
    2006
    2006.TOTAL
    2006.Q4
    2006 Q4
    12
    QUARTER
    12
    Q4
    2006
    2006.TOTAL
    2006.TOTAL
    2006
    12
    YEAR
    12
    TOTAL
    2006
    Thank You
    Praveen

  • QM/MM - STOCK TYPE PROBLEM - Pharmaceutical Industry

    In January 2005 we changed the material master 220072 to deactivate inspection set up for inspection type 01-05-08 and to change the QM control Key from Z0002 to 0001.
    The characteristic BC_USAGE_USAGE_DECISION of the relevant material batch class (ZBC_220072) has been updated accordingly to RELEASED.
    This workaround allows inbounding the material directly into unrestricted.
    Since the Scheduling Agreement/purchase master data wasn't updated, the stock of the first inbound after this change just received was posted in S (blocked stock).
    WM operator did the reverse of good issue.
    Purchasing data maintainer updated the  QM Control KEY to 0001. (Purchase Document IP00000012).
    WM operator inbound the batch again but the batch has been posted in S too.
    Scheduling Agreement was created on 30-Jul-2003; with relevant line item added on 25-Aug-2003 - it looks as though it is not reading the updated material master data.
    Is there a solution?  Which data must be changed to resolve the problem?

    Question not answered; workaround accepted by business.

  • Sale Analysis Profit Calculation problem

    Hello
    I create sale Invoice having Qty 2 unit price 150 & tax code is VAT@4% then Base amount is 300 & Total Bill
    amt is 312.
    My purchase price for the same item is INR 100 so my Gross profit show on Bill is INR 100 & profit percent
    is 33.33%
    Customer will debit with INR 312
    But when Create Rate difference bill ie credit memo of INR 20 per uint ie Qty 2 Tax VAT@4%  (maintain
    drop ship warehouse in row level to can't reduce the qty)
    Customer will debit -41.60
    So Customer Debit balance is 270.40
    But when I run Sale analysis report the result shows that Gross profit INR 260 & Gross Profit % is 100%
    But actually i calculated manually the real Profit is INR 60 & Profit % should be 23.08 should be show in sale
    analysis
    So what i do to see the same result

    Hi
    There is some problem in sales analysis report in some of the sap versions. Refer the following documents.
    [https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3030303130313637303426]
    [https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3135383735363826]
    [https://websmp130.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/sno/ui_entry/entry.htm?param=69765F6D6F64653D3030312669765F7361706E6F7465735F6E756D6265723D3136363835363426]
    Regards,
    Sudhir B.

  • [8i] Date/Time calculation problem...

    So, I am currently facing a situation where I need to calculate the total hours a workstation is in use for each day in a particular time period. I have a table with the log of each time each workstation is used. The problem is, a workstation can be used for any amount of time, starting on any day and ending on any day. This means that a particular entry in the log can span multiple days. I'm not sure how to split the difference between the end date/time of an entry and the start date/time of the entry over multiple days.
    Here's a sample table and some sample data for what I'm trying to do:
    -- Note: in reality, this table contains more columns
    CREATE TABLE     my_hrs
    (     record_id     NUMBER     NOT NULL
    ,     sdatetime     DATE     
    ,     edatetime     DATE     
    ,     workstation     VARCHAR2(4)
         CONSTRAINT my_hrs_pk PRIMARY KEY (record_id)
    -- Note: sdatetime, edatetime, and workstation CAN all be NULL, though I won't provide
    -- any sample data for these situations since I want to ignore them in my results
    -- Additionally, there are hundreds of workstations, but I'm only using 2 to simplify the sample data
    INSERT INTO     my_hrs
    VALUES (12345,TO_DATE('03/01/2010 08:00','mm/dd/yyyy HH24:MI'),TO_DATE('03/01/2010 13:35','mm/dd/yyyy HH24:MI'),'123A');
    INSERT INTO     my_hrs
    VALUES (13427,TO_DATE('03/01/2010 08:10','mm/dd/yyyy HH24:MI'),TO_DATE('03/01/2010 10:02','mm/dd/yyyy HH24:MI'),'321B');
    INSERT INTO     my_hrs
    VALUES (21543,TO_DATE('03/01/2010 14:07','mm/dd/yyyy HH24:MI'),TO_DATE('03/01/2010 16:30','mm/dd/yyyy HH24:MI'),'123A');
    INSERT INTO     my_hrs
    VALUES (22412,TO_DATE('03/01/2010 10:15','mm/dd/yyyy HH24:MI'),TO_DATE('03/01/2010 15:30','mm/dd/yyyy HH24:MI'),'321B');
    INSERT INTO     my_hrs
    VALUES (11976,TO_DATE('03/01/2010 17:00','mm/dd/yyyy HH24:MI'),TO_DATE('03/02/2010 02:30','mm/dd/yyyy HH24:MI'),'123A');
    INSERT INTO     my_hrs
    VALUES (34215,TO_DATE('03/01/2010 22:10','mm/dd/yyyy HH24:MI'),TO_DATE('03/02/2010 04:30','mm/dd/yyyy HH24:MI'),'321B');
    INSERT INTO     my_hrs
    VALUES (24789,TO_DATE('03/02/2010 13:00','mm/dd/yyyy HH24:MI'),TO_DATE('03/05/2010 02:30','mm/dd/yyyy HH24:MI'),'123A');
    INSERT INTO     my_hrs
    VALUES (31542,TO_DATE('03/02/2010 21:30','mm/dd/yyyy HH24:MI'),TO_DATE('03/04/2010 10:30','mm/dd/yyyy HH24:MI'),'321B');Based on my sample data above, these are the results I want to see:
    WORKSTATION     DATE          HRS_IN_USE
    123A          3/1/2010     14.96667
    321B          3/1/2010     8.95000
    123A          3/2/2010     13.50000
    321B          3/2/2010     7.00000
    123A          3/3/2010     24.00000
    321B          3/3/2010     24.00000
    123A          3/4/2010     24.00000
    321B          3/4/2010     10.50000
    123A          3/5/2010     2.50000
    321B          3/5/2010     0.00000Is this possible? (Please note, if the workstation was not used on a particular day, I want it to show 0 hours for that workstation for that day). Another thing to note is that I'm working with Oracle 8i.
    Thanks in advance for the help!

    Thanks, Frank, your explanation helped. My main problem was just that I couldn't picture what that line of the query was doing, even working from the inside out. I learn better through visual and hands-on methods, so to really understand, I had to look at the cross-join of a and h and go line by line. (In case there's anybody who looks at this post in the future and learns like I do, I've posted that data below).
    This definitely solves my problem!
    >
    By the way, this query is full of things that could be done better in later versions of Oracle. Generating table a is just one of them. Starting in Oracle 9, you can do a CONNECT BY query on dual to generate exacly how many rows you need. You never have to worry about an upper bound, and it's much faster than using ROWNUM. From time to time you might gently remind the people who decide these things that you're using a very old, unsupported version of Oracle, and that everyone could be more productive if you upgraded.
    >
    I could go on and on on this topic.... we have tried and continue to try to convince the powers that be to pay for the upgrades... if it were just Oracle that needed to be upgraded, we might actually have a chance at succeeding. As it is, ...ha.
    TABLE A (FROM SUB-QUERY)
    a_date          next_date
    3/1/2010     3/2/2010
    3/2/2010     3/3/2010
    3/3/2010     3/4/2010
    3/4/2010     3/5/2010
    3/5/2010     3/6/2010
    TABLE H (MY_HRS)          
    record_id     sdatetime     edatetime     workstation
    10000          2/28/2010 18:00     3/1/2010 5:30     123A
    12345          3/1/2010 8:00     3/1/2010 13:35     123A
    13427          3/1/2010 8:10     3/1/2010 10:02     321B
    21543          3/1/2010 14:07     3/1/2010 16:30     123A
    22412          3/1/2010 10:15     3/1/2010 15:30     321B
    11976          3/1/2010 17:00     3/2/2010 2:30     123A
    34215          3/1/2010 22:10     3/2/2010 4:30     321B
    24789          3/2/2010 13:00     3/5/2010 2:30     123A
    31542          3/2/2010 21:30     3/4/2010 10:30     321B
    CROSS-JOIN TABLE A WITH TABLE H                                             (and calculations done by the query below)     
    record_id     sdatetime     edatetime     workstation     a_date          next_date     LEAST (h.edatetime, a.next_date)     GREATEST (h.sdatetime, a.a_date)     GREATEST(TO_NUMBER(L-G),0)
    10000          2/28/2010 18:00     3/1/2010 5:30     123A          3/1/2010     3/2/2010     3/1/2010 5:30                    3/1/2010 0:00                    0.229166667
    10000          2/28/2010 18:00     3/1/2010 5:30     123A          3/2/2010     3/3/2010     3/1/2010 5:30                    3/2/2010 0:00                    0.00000
    10000          2/28/2010 18:00     3/1/2010 5:30     123A          3/3/2010     3/4/2010     3/1/2010 5:30                    3/3/2010 0:00                    0.00000
    10000          2/28/2010 18:00     3/1/2010 5:30     123A          3/4/2010     3/5/2010     3/1/2010 5:30                    3/4/2010 0:00                    0.00000
    10000          2/28/2010 18:00     3/1/2010 5:30     123A          3/5/2010     3/6/2010     3/1/2010 5:30                    3/5/2010 0:00                    0.00000
    12345          3/1/2010 8:00     3/1/2010 13:35     123A          3/1/2010     3/2/2010     3/1/2010 13:35                    3/1/2010 8:00                    0.23264
    12345          3/1/2010 8:00     3/1/2010 13:35     123A          3/2/2010     3/3/2010     3/1/2010 13:35                    3/2/2010 0:00                    0.00000
    12345          3/1/2010 8:00     3/1/2010 13:35     123A          3/3/2010     3/4/2010     3/1/2010 13:35                    3/3/2010 0:00                    0.00000
    12345          3/1/2010 8:00     3/1/2010 13:35     123A          3/4/2010     3/5/2010     3/1/2010 13:35                    3/4/2010 0:00                    0.00000
    12345          3/1/2010 8:00     3/1/2010 13:35     123A          3/5/2010     3/6/2010     3/1/2010 13:35                    3/5/2010 0:00                    0.00000
    13427          3/1/2010 8:10     3/1/2010 10:02     321B          3/1/2010     3/2/2010     3/1/2010 10:02                    3/1/2010 8:10                    0.07778
    13427          3/1/2010 8:10     3/1/2010 10:02     321B          3/2/2010     3/3/2010     3/1/2010 10:02                    3/2/2010 0:00                    0.00000
    13427          3/1/2010 8:10     3/1/2010 10:02     321B          3/3/2010     3/4/2010     3/1/2010 10:02                    3/3/2010 0:00                    0.00000
    13427          3/1/2010 8:10     3/1/2010 10:02     321B          3/4/2010     3/5/2010     3/1/2010 10:02                    3/4/2010 0:00                    0.00000
    13427          3/1/2010 8:10     3/1/2010 10:02     321B          3/5/2010     3/6/2010     3/1/2010 10:02                    3/5/2010 0:00                    0.00000
    21543          3/1/2010 14:07     3/1/2010 16:30     123A          3/1/2010     3/2/2010     3/1/2010 16:30                    3/1/2010 14:07                    0.09931
    21543          3/1/2010 14:07     3/1/2010 16:30     123A          3/2/2010     3/3/2010     3/1/2010 16:30                    3/2/2010 0:00                    0.00000
    21543          3/1/2010 14:07     3/1/2010 16:30     123A          3/3/2010     3/4/2010     3/1/2010 16:30                    3/3/2010 0:00                    0.00000
    21543          3/1/2010 14:07     3/1/2010 16:30     123A          3/4/2010     3/5/2010     3/1/2010 16:30                    3/4/2010 0:00                    0.00000
    21543          3/1/2010 14:07     3/1/2010 16:30     123A          3/5/2010     3/6/2010     3/1/2010 16:30                    3/5/2010 0:00                    0.00000
    22412          3/1/2010 10:15     3/1/2010 15:30     321B          3/1/2010     3/2/2010     3/1/2010 15:30                    3/1/2010 10:15                    0.21875
    22412          3/1/2010 10:15     3/1/2010 15:30     321B          3/2/2010     3/3/2010     3/1/2010 15:30                    3/2/2010 0:00                    0.00000
    22412          3/1/2010 10:15     3/1/2010 15:30     321B          3/3/2010     3/4/2010     3/1/2010 15:30                    3/3/2010 0:00                    0.00000
    22412          3/1/2010 10:15     3/1/2010 15:30     321B          3/4/2010     3/5/2010     3/1/2010 15:30                    3/4/2010 0:00                    0.00000
    22412          3/1/2010 10:15     3/1/2010 15:30     321B          3/5/2010     3/6/2010     3/1/2010 15:30                    3/5/2010 0:00                    0.00000
    11976          3/1/2010 17:00     3/2/2010 2:30     123A          3/1/2010     3/2/2010     3/2/2010 0:00                    3/1/2010 17:00                    0.29167
    11976          3/1/2010 17:00     3/2/2010 2:30     123A          3/2/2010     3/3/2010     3/2/2010 2:30                    3/2/2010 0:00                    0.10417
    11976          3/1/2010 17:00     3/2/2010 2:30     123A          3/3/2010     3/4/2010     3/2/2010 2:30                    3/3/2010 0:00                    0.00000
    11976          3/1/2010 17:00     3/2/2010 2:30     123A          3/4/2010     3/5/2010     3/2/2010 2:30                    3/4/2010 0:00                    0.00000
    11976          3/1/2010 17:00     3/2/2010 2:30     123A          3/5/2010     3/6/2010     3/2/2010 2:30                    3/5/2010 0:00                    0.00000
    34215          3/1/2010 22:10     3/2/2010 4:30     321B          3/1/2010     3/2/2010     3/2/2010 0:00                    3/1/2010 22:10                    0.07639
    34215          3/1/2010 22:10     3/2/2010 4:30     321B          3/2/2010     3/3/2010     3/2/2010 4:30                    3/2/2010 0:00                    0.18750
    34215          3/1/2010 22:10     3/2/2010 4:30     321B          3/3/2010     3/4/2010     3/2/2010 4:30                    3/3/2010 0:00                    0.00000
    34215          3/1/2010 22:10     3/2/2010 4:30     321B          3/4/2010     3/5/2010     3/2/2010 4:30                    3/4/2010 0:00                    0.00000
    34215          3/1/2010 22:10     3/2/2010 4:30     321B          3/5/2010     3/6/2010     3/2/2010 4:30                    3/5/2010 0:00                    0.00000
    24789          3/2/2010 13:00     3/5/2010 2:30     123A          3/1/2010     3/2/2010     3/2/2010 0:00                    3/2/2010 13:00                    0.00000
    24789          3/2/2010 13:00     3/5/2010 2:30     123A          3/2/2010     3/3/2010     3/3/2010 0:00                    3/2/2010 13:00                    0.45833
    24789          3/2/2010 13:00     3/5/2010 2:30     123A          3/3/2010     3/4/2010     3/4/2010 0:00                    3/3/2010 0:00                    1.00000
    24789          3/2/2010 13:00     3/5/2010 2:30     123A          3/4/2010     3/5/2010     3/5/2010 0:00                    3/4/2010 0:00                    1.00000
    24789          3/2/2010 13:00     3/5/2010 2:30     123A          3/5/2010     3/6/2010     3/5/2010 2:30                    3/5/2010 0:00                    0.10417
    31542          3/2/2010 21:30     3/4/2010 10:30     321B          3/1/2010     3/2/2010     3/2/2010 0:00                    3/2/2010 21:30                    0.00000
    31542          3/2/2010 21:30     3/4/2010 10:30     321B          3/2/2010     3/3/2010     3/3/2010 0:00                    3/2/2010 21:30                    0.10417
    31542          3/2/2010 21:30     3/4/2010 10:30     321B          3/3/2010     3/4/2010     3/4/2010 0:00                    3/3/2010 0:00                    1.00000
    31542          3/2/2010 21:30     3/4/2010 10:30     321B          3/4/2010     3/5/2010     3/4/2010 10:30                    3/4/2010 0:00                    0.43750
    31542          3/2/2010 21:30     3/4/2010 10:30     321B          3/5/2010     3/6/2010     3/4/2010 10:30                    3/5/2010 0:00                    0.00000
    (Then, the query sums up the last column in the "table" above, grouped by a_date and workstation).

  • Alternative sales commission calculation problem

    hi sir,
    I am a junior consultant trying to solve a problem for my Senior, the question goes as follows:
    We are trying to impute sales commissions to sales rep as a discount for every sale, in which for every sale a determined amount is imputed to the sales rep as a commission.
    the problem arises when the product is returned and customer asks for a refund. Then the commission should be refunded aswell. Could you please throw some light to wether we should clear that invoice the same month or the next one as a negative pendent discount, if so, how is the negative imputation applied?
    thanks a lot in advance,
    HF

    Bobsterslc wrote:
    Here is a screenshot of a piece of what I'm working on.
    Hi Bob,
    Here's what your screenshot looks like when embedded in a post, using the HTML code that Photobucket provides (third item in the list of codes provided).
    In your original post you said:
    I have a table that calculates sales commissions for a number of people and includes an overriding commission for the sales managers. I need to cap the sales commission at a fixed percentage, say 25%, for the sales people.
    I'm not sure what you mean by "I need to cap the sales commission at a fixed percentage."
    The first question that comes to mind is "25% of what?"
    Do you mean that the commission is not to exceed 25% of Total earnings?
    If so, your formula for B5 (the first cell where commission is calculated) would be:
    =MIN(formula1,B2/3)
    Where formula1 is whatever formula is used to calculate the commission when it is less than the cap, and B2 contains the salary/wages which must constitute at least 75% of the total compensation under this interpretation.
    Do you mean the commission rate is on a sliding scale that rises with increased sales, but does not exceed 25%?
    If so, you need to specify the rules that control the rate. Does it rise in steps? Does the 'new' rate at each step apply to total sales, or only to sales above that step? Are the steps the same size for everyone, directly related to the individual goals, or set by some other criteria?
    There's not enough information available fom your table to determine a pattern. For the first three columns, person B's commission is 12% of sales, person C's is under 4% and person D's is 30% of sales.
    For a more detailed response, we'll ned a more detailed specification of the question.
    Regards,
    Barry

  • Date Difference Calculation problem

    I am creating a form which should calculate the number of days between two calender dat
    es using the Date2Sum expression but my result cell gives me
    zeo despite setting the locale and the calculation correcttly. Where could
    my problem be?
    Darlington Sakwa

    Validate the date patterns on the date fields match the date patterns used in Date2Num. For example, the attached has a start date with the display date pattern date{YYYY-MM-DD} and that matches the date pattern in my Date2Num function call.
    // form1.page1.startDateNum::calculate - (FormCalc, client)
    if (form1.page1.startDate.isNull) then
      $.rawValue = ""
    else
      $.rawValue = Date2Num(form1.page1.startDate.rawValue,"YYYY-MM-DD")
    endif
    Steve

  • Y-intercept calculation problem: "A2:A7" isn't a valid reference

    This is actually a problem I have with many calculations in Numbers but I will use the following as an example:
    I am trying to calculate the y-intercept and slope for a set of data. Table 1 contains the raw data with each data point in triplicate. In Table 2, column 1 is the ordinate value and column 2 is the abscissa value, which is the average of the triplicates. I would like to place the calculation for the y-intercept in column 3 and the slope in column 4, but always get the error, "A2:A7" isn't a valid reference" for a result. Instead, I have to have a third table for just the y-int and slope. Why isn't A2:A7 a valid reference?

    No, I didn't; I only had a 5 rows but I made it 7 rows - so it was a 4 column x 7 row table - and then the formulas worked. The odd thing is that there was still only data in the first 5 rows and, after I set up the formulas, I reduced the table back to 4x7 and the formulas remained unchanged. Thanks for the help.

  • Calculation Problem help solution needed quickly

    I have created an adobe acrobat registration form in Adobe LiveCycle.  I've worked on this all day and needed to distribute today.  I can not find out what the problem with my code is.  I need a discerning eye right away if possible.  The calculated fields are on page two.  The right column TotTour, TotMDin, TotWDin & then TotDue
    Nikki

    Paul the problem was solved by someone else.  When I posted another post.  This is the answer I got, which worked.
    Nothing wrong with your code.
    Simply go to the Row1[0] and uncheck the "Repeat Row for Each Data Item" option
    Nikki

Maybe you are looking for

  • Error while importing on local files/queries from Sap Portal EP6

    Hi, When i try to import a file from sap portal to the local PC, I get a screen with the header "Enter Some File attributes". Text displayed in the screen is "Please wait. You will be forwarded automatically. This page had to be included for technica

  • Custom File Info panels from PS into LR

    I have a large number of Custom File Info panels created for use within Photoshop that are imperative to our workflow of different departments. These Metadata strings are later read by Extensis Portfolio as our DAM tool of choice. I don't see to be a

  • Purchasing Groups deleted: Errors when processing related documents

    Hi Gurus, We are on SRM 7 and we are currently facing an issue when processing documents which Purchasing Groups have been deleted after thee procurement documents were created In our case, when a PGroups is deleted and unassigned, an interfase from

  • HTC One M8 - screen won't turn on, still vibrates

    I've had my HTC One M8 for less than two weeks now. The last action I performed on it was to take a picture and upload it to Facebook. Shortly after, I went to turn my phone on and nothing happened. No screen appeared. The green indicator light is st

  • Bridge runs low on memory CS5

    Now I have a problem while working in photoshop and I open bridge if I open adjust and close a few raw images I get a message that says Bridge is running low on memory you should restart bridge.  I looked for a memory adjustment and can't find it.  A