Bex - Formula Calculation
HI ,
I'm trying to display a column that show the 'SHARE' calculation in BEX query.
Share = (Value by Order / Total Value by Order Group )*100
<order group> <order> <value> <Share>
ABC 31000001 $200 28.57%
XYZ 31000005 $400 100%
ABC 31000007 $500 71.42%
Note : In the above, order group ABC , Order 31000001, Share = (200/700)*100
I'm unable to sum up by order group in query.
Is there any way we can utilize CKF (aggregation) or anything other method that can be used to populate this column.
Appreciate help from anyone who's familiar with this.
Thank you.
Regards,
Maili
Edited by: Maili06 on Mar 31, 2011 6:07 AM
HI Divyesh,
I'm using an alternative approach. This manage to solve my issue.
I'm using SUMCT function in BEX.
I create :
Formula 1 --> formula sumct(Value)
Formula 2 --> (Value / formula 1)*100
Formula 2 provides the share percentage for me.
I placed the Order group as the first column.
You may find abt sumct here :
http://help.sap.com/saphelp_nw04/helpdata/en/03/17f13a2f160f28e10000000a114084/content.htm
http://www.scribd.com/doc/46732230/SAP-BI-Reporting
hope it helps you to solve your prob.
Regards,
Maili
Edited by: Maili06 on Apr 1, 2011 11:52 AM
Similar Messages
-
BEx Formula Use of 'Logical And' and Calculation for Gross Margin
HI Bex gurus.
Having an odd time with what should be a simple formula to handle the display of gross margin (GM). The goal here is to display GM% properly and the requirement is as follows
If GM <= 0 then 0.0
Else
If GM > 0 and Sell > 0 then ( ( sell - cost /sell ) * 100 )
Else
If GM >0 and Sell = 0 then 100
I am familiar with bex formulas and have referenced the help docs on booleans here -
Boolean Operators - SAP Business Explorer - SAP Library
But what is odd is that if I use a calculation or a CFK in the IF, THEN with a LOGICAL AND, the formula does not report correctly
If I put in a static value, like 77, the expected logic is followed. I have tried making sure have extra parentheses and changing the order of the statement, to no avail! I could use some extra brains on this puzzling matter, so you help is greatly appreciated and will award points!
Thanks
lee lewis
Here are the formulas in text and below screen shots. Wish could copy and past formulas to and from editor!
GM%77
( ( ( 'Order GM' >0 ) AND ( Order Sell > 0 ) ) == 1) * 77 + ( ( ( 'Order GM'> 0 ) AND ( Order Sell == 0 ) ) == 1) * 100 + ('Order GM' <= 0) *0.0
GM%
( ( ( 'Order GM' >0 ) AND ( Order Sell > 0 ) ) == 1) * 'REF GM%' + ( ( ( 'Order GM' > 0 ) AND ( Order Sell == 0 ) ) == 1) * 100 + ('Order GM' <= 0) *0.0
'REF GM%
(order sell - order cost /order sell ) * 100 )
GM%77
GM%Shouldn't you change on of the brackets in your REF GM% ?
'REF GM%
(order sell - order cost /order sell ) * 100 )
I would put that as
'REF GM%
(order sell - order cost) /order sell * 100 )
Not sure what you mean with those red arrows... but in both cases you would be dividing by 0 (order sell = 0). -
Setting in BEx formula for calculation of YTD and MAT
Hi,
I have to implement 2 formulae in BEx.
As I am trying to avoide ABAP coding, can anyone please suggest SETTINGS in BEx FORMULA to achieve these below mentioned 2 formulae -
1 ) Calculate YTD - Average of the sum of the reported quarter values from the start of the year until and including the selected quarter. But, if we enter Quarter 3 and there is no data for quarter 2 then the average should be equal to sum of data for Q1 and Q2 divided by 2 instead of 3 even though user entered Q3.
2) Calculate MAT - Average of the sum of the reported quarter values for the last 4 quarters. We need to check last 4 quarters. If data is present only for 3 quarters in the last four quarters then the MAT will be data for 3 quarters divided by 3.
Please suggest BEx formulae settings, if any for the above calculations.
Thanks a lot.
Regards,
PrernaHi
I am not sure requirement related YTD is possible without customer exits variable
But regarding your 2nd requirement
Calculate MAT
Create four restricted key figures by using offset (0, -1, -2, -3) and restriction characteristic will be quarter.
Create a calculated key figure "Count of Quaerter". This will consist of "Number of rows" key figure with exception aggr on the Quarter characteristic and aggr will be "Count for all not eq to 0".
Create a calculated key figure which will be sum of four restricted key figures divided by Count of Quarter.
Kindly let me know incase further details required
Best Regards
Rohit -
How to use rounded values in BEx Formulas
Hello,
I have the following question. Is it possible to use rounded values up to a certain # of decimal points in BEx Formulas?
I have the following problem.
Consider this:
keyfigure val 1 = 0.416666667
keyfigure val 2 = 72
val 3 (BEx Formula) = val 2 / val 1 = 172.799999862
However, what I need to do is this.
val 1 & val 3 should rounded up to 2 decimal points. So, I really need the report to show this:
val1 = 0.42
val2 - 72
val 3 = val 2 /val 1 = 171.43
I changed the number of decimal places on val 1 and val3 to be 0.00. However, it appears that these rounded values are not taken into account in the Formulas, as if the OLAP still uses the original values from the backend with 9 decimal points. So, no matter how many decimal points I use on the Display tab for a key figure, my val3 or result of my formula is always taking into account the 9 digit decimal values, not rounded values that I want. So in the example above, my val 3 comes to 172.80, which it should be 171.43 instead of you use the rounded values in the calculation.
Please let me know if there is any workaround where I could force my BEx Formula to utilize the rounded values and not actual values from the backend DSO. Or any other solution.
Thank youIf you create a Formula in BEx Query Designer like the one below, it works:
val3 = val2 / ( TRUNC ( ( val1 * 100 + 0.5 ) ) / 100 )
The TRUNC function (among other things) actually ensures that your formula takes into account the rounded values that you want. -
MAX( , ) function in BEx formula
Hello Experts!
Does anyone know, how the mathematical function MAX( , ) in BEx-formulas work? Which are the two parameters if i want to have the maximum of the values in one colum? Or does this function work another way?
Best Regards,
PeterHello Oscar!
Thank you for answer! Thats what I want to know but it doesn't solve my problem. If I use calculate result as maximum and if I want to calculate with this value (maximum) than i got a result which is calculated with the sum, not with the maximum which I see as result.
I do open a new thread for new question...
Thanks,
Peter -
Formula calculation showing wrong data.
Hi All,
I have an issue in the formula calculation at BEx.
I have a formula2 whose values is formula1/RKF * Constant.
formula2=formula1/RKF * Constant.
Formula1 formual2 RKF constant
73.00 25.63 80.00 28
The error is the actual value of formula2 to be a
formula2 = 73.00/80.00 * 28
=25.33
But in report result it is displaying as 25.63.
for some different values it is showing very different result.
can any one tell me how to round of this value to avoid confusion
regards,
santosh.Santosh,
rounding off the result will not solve your problem. In your scenario, the actual result is 25.33 and rounding it off will be 25.
Now BI is showing you a value of 25.63 and rounding it off will give you 26. This will still give you the wrong answer.
You can go to the properties for the formula and in the display properties, you can change it 0 decimal places instead of 2. This is just a interim solution.
Regards,
Sameer -
Can i now exact bex formula to be inserted
Can i know the bex formula to be used by if else statement in bex query.
if f9 greater than e9 then result should be E9*B9 else F9*B9
IF(F9>E9,E9*B9,F9*B9)Hi Naiduz,
There I have missed one point, you have to create a formula variable for both these fields and with replacement processing type. Then only you can use the formula like this.
Hope this clarifies totally.
Kindly refer the doc for more understanding. It has been explained crystal clear here.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d08b56a8-daf5-2e10-2397-904d6aeb55c2?QuickLink=index&…
Thank you.
Chandan Praharaj -
Formula Calculation in Recipe Management
Hello All,
I am using a Z_PACK Packaging spec (of category Packaging) as a component inside a Formula. The spec is used in BOM in 'Grams' even though it is packaging and not in EA. I dont want to include this packaging spec in any of the following formula calculations related to Ingredients (ii) Quantity (iii) Composition but only want to make it relevant for (iv)Costing View.
How do I achieve this. What configuration I need to do to make it work.
Thanks,
SachinHello Sachin,
Please check the possibilities of the IMG activity 'Specifiy Events'.
Example: event EVT_EXPL06 (Explosion: List of Ingredients (Specifications)) for the Ingredients view and component Z_PACK for packaging. With the indicator Explosion and Calculations it is possible to control the usage.
Please have a look into the documation of the IMG activity.
Best regards,
Roland -
What is available in essbase to show analysts formula calculations for accounts/ratios?
Hello all,
What is available in Essbase to show analysts formula calculations for accounts/ratios?
Access to the EAS console is not an option, so we are looking for something else.
Also what is best practice for use of a “Data Dictionary” for Essbase reports/database.
Thanks,See this discussion.
https://forums.oracle.com/message/11201356#11201356 -
How to define Excel function using BEx formula
Hi experts,
May I know how to define the following Excel function using BEx formula?
IF(AND(Revenue<0,Cost<0),"N/A",(Profit/Lost/ABS(Revenue)))
Thanks!for me its easy to implament logic with * and + rather than AND and OR respectively
((Revenue<0)(Cost<0))Value +((Revenue>0)(Cost>0)) ( Profit&Lost / ABS(Revenue))
As i have mentoned already,for Else case i have considered (Revenue>0) and (Cost>0) only.
Value can be a KeyFigure/Formula/formula variable/CKF/RKF
its not possible to type characters in the formula window so 'N/A'
Regards.
Message was edited by:
Murali c -
Formula calculation not work, when one inspection characteristic was set by formula
In the inspection plan, set 0040 charac. "calc. charac." in control indicators, and the formula is "15.86/C0020*100".
when the inspection lot was created, the 0040 charac. could be edit, and the formula title "formula calculation not by SAP interpreter".
However by the same basic data in QAS system,the formula title is "formula calculation by SAP interpreter", and the charac. couldnot be edit, only be claculated by the system.
Anybody know why this error occurred?
this is the question in PRD system,
this is the right situation in QAS systemHi Pei,
Please can you check the characteristic value using C00020 (C0 then 2 zeros before 20. Total 3 zeros before 20) instead of C0020 and check if this is working.
You can take some clues form the below thread -
http://scn.sap.com/thread/1672782
Thanks to all previous contributors of the attached thread!!
Thanks,
Arijit -
FRM-40735: Formula-CALCULATION trigger
Hi,
I'm getting this error in my form....
FRM-40735: Formula-CALCULATION trigger raised unhandled exception
How can I find where the issue is? Can you please suggest some ideas?I have the following 6 formula columns in my form....
1. PCT_COND_COMP_FORMULA -->
(:CLT.DUCT_LENGTH_ACTUAL / :CLT.TRENCH_FT_EST) * 1002. ACTUAL_COST_FORMULA -->
nvl(:clt.unit_cost,0) + nvl(:clt.te_cost,0) + nvl(:clt.paving_cost,0)3. CSOA_AVG_COST_TRENCH_FT_AVG -->
:CR_ACCOUNTS.CONDUIT_COST_TO_DATE_SUM / :CR_ACCOUNTS.CONDUITS_COUNT4. COST_TO_ACCRUE_FORMULA -->
((:cr_accounts.completed * :cr_accounts.unit_price) * (nvl(:clt.residue,100)/100))5. CWE_FORMULA -->
:cr_accounts.accrual + ((:cr_accounts.est_quantity - :cr_accounts.completed) * (:cr_accounts.unit_price))6. COST -->
:CR_ACCOUNTS_DETAIL.UNIT_PRICE * :CR_ACCOUNTS_DETAIL.QUANTITY1. POST-TEXT-ITEM trigger on ESTIMATE_CUSTOM item has....
BEGIN
if get_block_property('cr_accounts', update_allowed) ='TRUE' then
IF NVL(:CR_ACCOUNTS.EST_QUANT_CUSTOM,0) <> 0 THEN
:CR_ACCOUNTS.UNIT_PRICE_CUSTOM := (:CR_ACCOUNTS.ESTIMATE_CUSTOM / :CR_ACCOUNTS.EST_QUANT_CUSTOM);
update_nonprano;
END IF;
end if;
END;2. Procedure update_nonprano ...........
PROCEDURE update_nonprano IS
BEGIN
:CR_ACCOUNTS.COMPLETED := (:CR_ACCOUNTS.PCT_COMPLETE_CUSTOM/100) * :CR_ACCOUNTS.EST_QUANTITY;
-- sets cost_to_date
:cr_accounts.cost_to_date := ((:cr_accounts.estimate_custom) * (:cr_accounts.pct_complete/100)) ;
-- sets cost_to_accrue
:cr_accounts.cost_to_accrue := (:cr_accounts.cost_to_date) * (nvl(:CLT.residue, 100)/100);
-- sets accrual
:cr_accounts.accrual := (:cr_accounts.cost_to_accrue) + NVL(:cr_accounts.adjustment, 0);
-- sets CWE per ACCOUNT
:CR_ACCOUNTS.CWE := :CR_ACCOUNTS.CWE_FORMULA;
-- sets CWE
:CLT.CWE := :CR_ACCOUNTS.CWE_SUM;
IF :CLT.PCT_COMP = 100 AND :CLT.CWE > :CLT.ESTIMATE THEN
WARNING_ALERT('The Layout Complete is set to 100% but the CWE is larger than the Estimate. This job is incomplete and over budget. Please modify % Layout Complete.');
END IF;
END;Now in my form when I enter EST_QUANT_CUSTOM= 12, ESTIMATE_CUSTOM=13, PCT_COMPLETE_CUSTOM=15... I get error.
But when I put EST_QUANT_CUSTOM= 12, ESTIMATE_CUSTOM=12, PCT_COMPLETE_CUSTOM=12... I don't get error. -
Formula calculation doubt ?!
Hello ,
Can we make a database item in a form store a formula calculation ..?
:ITEM_QTY * :ITEM_PRICEor we have 2 make it displayed...!
Regards,
Abdetu...An item in a Data Block does not have to be displayed/visible in your form in order to stored/hold a formula calculation value. Create a test form which displays the calculation field initially so you know it is working correctly. Then set the "Canvas" property to NULL for the item and add a button that displays the value of the non-displayed calculated item in a Message(). When you click the button, you will see the value displayed! ;-)
Hope this helps,
Craig B-)
If someone's response is helpful or correct, please mark it accordingly.
Edited by: CraigB on Oct 29, 2010 8:48 AM -
BEx Formula Problem (If-Else)
Hello everybody,
I am heaving a little problem with the BEx Formula Editor.
I would like to create a formula based on time dependent attributes; witch should provide me with an actual customer rebate.
The Query should look like (displayed in Excel/Analyzer):
Customer Rebate A Rebate B Rebate C Actual Rebate
1 5 % 10 % 0 (#) 10 %
2 2 % 0 (#) 0 (#) 2 %
3 5 % 0 (#) 0 % 0 %
Rebate A, B, C are attributes of different characteristics and for being able to use them in my formula (for Actual Rebate) I have created a formula variable (replacement path) for every rebate. I have already figured out, that there is no possibility to differentiate between real zero values and zeros being displayed because there is no value defined (#) (at least it seems so to me). So I added another attribute which is 1 if there is a value. For the following example lets call it Rebate X (exists)
The formula I would like to use should contain the following logic:
If (Rebate C (exists) == 1) {
Actual Rebate = Rebate C
} elseif (Rebate B (exists) == 1) {
Actual Rebate = Rebate B
} elseif (Rebate A (exists) == 1) {
Actual Rebate = Rebate A
} else {
Actual Rebate = 0
Any help would be appreciated.
Kind Regards
Simon UlrichHi,
I suppose Eugenes Formular will give you the total of all three rebates if they all exist. To get the elseif correctly, I propose a formular like
(Rebate C (exists) == 1)* Rebate C + NOT (Rebate C (exists) == 1)* (((Rebate B (exists) == 1)*Rebate B) + NOT (Rebate B (exists) == 1) * ((Rebate A (exists) == 1)*Rebate A))
Hope all brackets are set correctly, slightly confusing in this editor -
Bex formula shows empty cell (NULL)
Hi,
I have a bex formula that calculate a few fields.
sometime there is no value in it (NULL) and effects bedly on other formulas in the query. (NULL also)
i have tried several ways to solve it:
multiply with 1
IF condition
add and reduce 1
but still the column shows NULL (empty cell)
thanks a lot for helping me out
points will be granted
nirHi Nir:
Nulls used in formulas give Nulls as results. So you need to deal with the Nulls since the first occurrence, replace the Nulls and use another value instead.
To evaluate if a null is present use the function "IS_INITIAL" in your formulas, this is a boolean function and therefore has the return values TRUE and FALSE.
Unfortunately the function "IS_INITIAL" is not available for BEx queries, you can use it on transformations while loading DataTargets.
Regards,
Francisco Milán.
Edited by: Francisco Milan on May 31, 2010 1:55 PM
Maybe you are looking for
-
How can I get back iPhoto after upgrading to mountain lion
I've upgraded to mountain lion and lost iphoto. Do I need to re buy it?
-
Hello Everyone, We all know whenever we try to connect to a PC which is not on network, we get UnKnownHostException etc..... by which we can detect that the corresponding PC is not an network(intranet/internet) But when i send a msg from my PC to my
-
Silent Install of Oracle 8i on NT
I'm having trouble silently installing Oracle 8i on Windows NT. I have customized the svrcustom.rsp file (see below) but I'm getting an error that says "no forced value specified for the variable ToplevelComp". Anyone with more experience with this h
-
Cross-tab cell padding: how to change
Post Author: EnRoute CA Forum: General I am trying to minimize the height of the cells of a cross-tab object. I can re-size the text, but that doesn't change the padding between the text and the cell border lines. There is more padding than I want.
-
All, I need to do a mass partner function addition to all customer masters. Basically i need to add a particular partner function VN (Vendor) to all the customer masters within the sales org. How can i do this?