Calculation problem
how can i make a function that takes a String parameter (math expression) and return the calculated result.
function calc(str_exp in varchar2) return number is
Result number;
begin
*// logic here*
return(Result);
end
if i call it as r = calc(' 2+3*2') then it should return 8
Edited by: Aasem on Feb 25, 2009 10:12 AM
Hi ,
I implemented like this ,
I created a function,
create or replace function cal (strin in varchar2) return number is
resul number;
begin
resul := to_number(strin);
return (resul);
end;
then I called the executed the following line Sql developer,
declare
resul number;
begin
resul:= cal(to_char(2+(3+2)+(8-2)+(3*2)));
dbms_output.put_line('Result'||'----'||resul);
end;
and it gave me 19 as a result.
Thanks,
Pavan.
Similar Messages
-
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,
PratikHi,
I am not understand your problem give your mb then i talk to you
mhpo -
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 resultHi
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,
HFBobsterslc 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 SakwaValidate 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
NikkiPaul 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 -
Hi friends,
I am facing problem in Plan costing part. When I run KOC4, & see Material Overheads, activity cost, it shows 0 agst Paln, but calculated agst Actual Cost.
Is there any option to run for all plan order recalculation of costs in one go. If yes, what & how????
regards
VikasHi Amit,
Thanks for your reply. I confirmed with my basis team that this note is already implemented in system but still we are facing this error.
If any one help in this regard that will be really appreciable.
Regards,
AVI -
Percentage Variance calculation problem
Hi experts,
I have report with following scenarios:
<h3>Account Name---ActualBudget---Variance --Variance Percentage </h3>
Account Level 1______3400_______5200____-1800______________X
-Account Level 2______2200_______4200_____-2000______________XX
--Account Level 3______1000_______2000_____-1000_______________-50
--Account Level 3______1200_______2200_____-1000_______________-45.45454545
-Account Level 2______1200_______1000_____200________________XX
This is how the report is now displayed. I have done a Hierarchical Grouping of database field (Field Account). Here the Actual and Budget columsn are the summary fields with "sum" and the Summarize across hierarchy checked.. The formula for Variance Percentage is
if Budget =0 then 0
else ((Variance/Budget)*100)
Now, all the output is displayed in Group Header. The problem here is the calculation of Variance Percentage of Levels above Level3 i.e. Level 2 and Level 1. Level 2 percentage should be the calculation of (Variance / Budget ) *100 of that Level only i.e. Level2 and same should be the case for Level 1. When I apply the summary field on this column, the percentage calculation is all wrong as the Level 2 will be sum of Level 2 variance percentages which is not correct output.
I need a solution to this quickly.. if some more clarification is required please reply to this post..
ThanksDon't use a summarized field. Instead create a formula field
Right Click on the formula field which will be there in your Field Explorer --> Select New --> Provide the name for your formula field in the text box shown
and put the condition there like
if {test.Budget} =0 then 0
else (({test.Variance}/{test.Budget})*100)
Once formula field is created place in the desired location where you need to show the Variance Percentage.
Hope this helps! -
RFEBBECODA00: rounding calculation problem
Hi there,
I'm running program RFEBBECODA00 vi transaction FEBC but for one account in OMR (defined with 3 decimals in TCURX), SAP seems to calculate the ending balance based on amounts with 2 decimals whereas the bank statement has actually amounts with 3 decimals. Because "Calculated ending bal. <> statement" is with 0.01 difference during RFEBBECODA00 execution and, then the conversion is not done.
Do we have to force this amount via user exit FEB00002 or is there any else solution ?
Thanks for your help,
Rgds,
PhilHi john,
first of all I would like to say thanks for responce,when I am exporting all data from this Database in middle it is going to freaz every time from past 2 months before that there is no problem like this so i that it has some in DB .I have expoted level0data then deleted all data from DB then loaded level0data after this ran CALCall
Please give any suggestion
regards,
Prabhakar -
Major Calculation Problem?
Hi,
I've got a table with multiple columns. Each column have is average calculated at the bottom. If I put 0 (zeros) in each cell of the table, some averages are correct but some give me different results! I tried several things like changing the cells format etc.
If I make a sum instead, the problem still there. BUT, If a make the formula manually ( =sum(A1+A2+A3... etc) OR =average(A1+A2+A3... etc) ) it works! So I think that the problem comes from a bug in the span of the data (":" from, to).
I am on this problem for more than an hour now and I can't figure it out... (Google didn't help me neither)
(grrrrrrrrrrrrrrrrrr)Hi ironnickmac,
AVERAGEIF may do what you want.
A table with a Header Row and a Footer Row
Item
Item
Item
1
1
1
2
2
2
3
3
3
0
0
2
1.5
2
Formula in Footer Row A6
=AVERAGE(A)
Correct answer! (Blank cells are ignored).
Formula in B6
=AVERAGE(B)
Correct, if you want to include zeroes, not correct if you want to exclude zeroes.
Formula in C6
=AVERAGEIF(C,">0",C)
Correct answer, by including only those values >0
Regards,
Ian. -
Hi all, I'm having a problem with a form that I've created in Adobe LiveCycle designer. I've uploaded the form to the Acrobat.com site (https://acrobat.com/#d=OTqg07-glxa3jkGWUGssVA)
My problem is that the "Sub-Total Salary & Wages) table won't calculate when an add.Instance button is selected. Could some you wonderful experts out there take a look at the form and tell me what I've done wrong?
Thanks so much for your assistance.
ConnieI don't think it's rounding. Otherwise, none of my time calculations would match. Most of them do, but unfortunately, not all of them do.
Also, when I look at the seconds on the lines that don't match, they don't round up (Example: 466.9722222 is rounded to 466.97).
I even changed my calculation to see if that was it. I get the same results.
The new calc I tried:
IIf((Sum(AWDB_Q_Agent_Skill_Group_Half_Hour!CallsHandledToHalf))>0,
(Format(Int(((Sum(AWDB_Q_Agent_Skill_Group_Half_Hour!HandledCallsTimeToHalf))/(Sum(AWDB_Q_Agent_Skill_Group_Half_Hour!CallsHandledToHalf)))/3600),"00") & ":" & Format(Int((((Sum(AWDB_Q_Agent_Skill_Group_Half_Hour!HandledCallsTimeToHalf))/(Sum(AWDB_Q_Agent_Skill_Group_Half_Hour!CallsHandledToHalf)))-(Int(((Sum(AWDB_Q_Agent_Skill_Group_Half_Hour!HandledCallsTimeToHalf))/(Sum(AWDB_Q_Agent_Skill_Group_Half_Hour!CallsHandledToHalf)))/3600)*3600))/60),"00") & ":" & Format(((((Sum(AWDB_Q_Agent_Skill_Group_Half_Hour!HandledCallsTimeToHalf))/(Sum(AWDB_Q_Agent_Skill_Group_Half_Hour!CallsHandledToHalf))) Mod 60)),"00")),"00:00:00") -
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,
BIJESHHi 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 -
My Timeline of the Universe needs fixing. I have hobbled together something that works so-so, but the attached swf shows the flaws.
Assistance much appreciated.If you explain the issue in more detail and provide the calculations that are not working you might get better results. Most people are not going to spend time searching thru a file to try to see what is wrong. I looked thru it briefly and the problem isn't obvious to me.
-
Hi all..I use Analyzer 6.5 and I have create a report with an Essbase database connexion.I have a list of costumer with their account A and B. I want a report having Top 10 costumers, The Total Costumers and the other Costumers (difference between Total and Top10).To do that, in the report, I have generate the Top 10 costumer (with Analayzer Cube Designer options) regarding the Account A. The total A and B of the costumer is known (dynamic calc in the outline). So I have calculated a member "Other Costumer" = "Total Costumers" - "Top 10" in the Analyzer calculation Tool. My problem is that I want to have a ratio C = %(A/B), for each member of my report (Top 10 costumer, "Oher Costumer" and "Total Costumers"). The problem is that C member is correct for the top 10 and for the total costumer. But, for the "Other costumer", the result is C(Other costumer) = C (total costumer) - C(top 10) instead of C (Other costumer) = A (Other costumer)/ B (Other Costumer). Somdebody has a solution to avoid this error ? thanks ...
You can go to Analisys Tools Manager and place the "C" formula below "Other" formula. Analyzer will calculate "Other" first and than "C".Hope it helps
Maybe you are looking for
-
Movement of material from Unrestricted to Quality at sub contractor
Hi Expert, I am looking for a way to move stock from Unrestricted to Quality for stock that is stored at a vendor (sub contractor)? Have you got any advice?
-
Oracle Jinitiator 1.3.1.22 for Windows 7 or IE 8,
Hello, We are using Oracle Jinitiator 1.3.1.22 for our home grown applications. It is working perfectly in IE 7 on windows XP. Now some users are getting new laptop's with WINDOWS 7. They are not able to login to application with Oracle Jinitiator 1.
-
Older laptop connecting to Panasonic Viera using VGA to HDMI
I have an older Pavilion Tx1000 that I would like to hook up to my new Panasonic Viera TV. I don't have an hdmi port on my laptop, but I do have a vga to hdmi cable. When I hook it up, the tv says no signal. The video card in my computer is an NVIDI
-
How to Write a FOX Formula in Intergrated Planning Functions?
HI BI-IP Experts, I have just written a FOX formula to call an ABAP Function Module which will execute a Process CHain to run. Here is what I wrong in the FOX formula in the Planning Function ZPF_FOX_CALL_PC. Call Function Z_CALL_PROC_CHAIN = * 1. I
-
Corrupt Time Portion of a DATE column - how can this happen?
DUMP(START_TIME) gives 'Typ=12 Len=7: 100,99,255,255,0,0,0' How can this happen? Is there any way to prevent the database from allowing invalid dates to be inserted. Thanks in advance, Cade