Bex Formula Rounding Up Values!
Hi Guys,
I am doing a calculation in BEx where I divide items by days (items%Adays) but the result value is 4.77 on a calculator but Bex rounds up to 4.0! All my results differ by the fraction so I need to the 4.77 to come up else all columns will be 4.0!
In properties I increased the decimal places to 2 d.p for the results formula field but it didnt work!
Anyone have any ideas?
Thanks
DV
Depesh,
This is the same as posted by AVR but contains the procedure also...
Check the following ,
have you defined the decimal places in the KF properties . Right click on KF and select properties , the decimal places will be a dropdown.
Set the same to the first value in the dropdown and then execute your query , come back with the results.
Arun
Assign points is helpful...
Message was edited by: Arun Varadarajan
Similar Messages
-
Bex Formula for calcualting Value from Quantity & Price
Hello,
In my query I need to calculate the value by multiplying Quantity available in my cube and net price in my material master attribute.
How can I do this?
I tried creating a formula variable for net price and multipied it with Qty but it still says the formula is incorrect.
Any suggestions please??I created a formula variable using replacement path as processing type, selected the reference characteristics as 0Material.
Under replacement rule selected replace variable with "infoobject", replace with "Attribute Value" and selected my attribute infoobject "0Net_Price"
In my calculated key figure I try to use this formula variable and multiply it with Qty,but it still gives a warning element not defined properly.
Can you let me know if I have missed out any step in the formula variable creation??
How is the final unit of the Calculated key figure determined? Does it take the unit of net price ?? -
hello
i have one problem. i want to round off the key figures in the report in BEx. like rounding up values Ex. 10.2345 to 10, 11.7756 to 12.
pls help. its urgent.Make the Decimal setting in teh Key Fig properties as mentioned in the above post. If this does not work try the following.
Hide ur actual column of the key figure K.F
Create a Formula Key Figure.You need to use Mathematical and Boolean Operations .Create the following formula
( FRAC ( 'K.F' ) >= 0.5 ) * CEIL ( 'K.F' ) + ( FRAC ( 'K.F' ) < 0.5 ) * FLOOR ('K.F' ) -
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. -
Can BEX boolean formula give text value?
The logic is:
If quantity > 4, then "Successful", otherwise "failed".
In BEX formula boolean:
(quantity > 4) * "Successful" + (quantity < 4) * "failed".
But somehow we can't find a way of adding the text wording "Successful" or "failed" into the BEX formula window. Any workaround?
Thanks and we will give you reward points!Hi Kevin,
Instead of displaying text in the report column you can populate 1 or 0 using a formula or formula variable. Again if you are displaying the report on web you can use the concept of table interface which can replace 1 or 0 with the required text (n BW3.5).
http://help.sap.com/saphelp_nw04/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/e3/e60138fede083de10000009b38f8cf/frameset.htm -
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). -
Need rounding off value for partial Goods receipt
Hi,
My requirement is that the PO value,PO tax value ,GR value and Invoice value(IR) should get rounded off.
When I am using the PO value which is rounded off in PO, but at the time of posting partial goods receipt the value for the GR/IR clearing or the stock value is not getting rounded off for these G/ls.
What should I do for this to get the rounded off values in GR.
Regards,
GorakshHi Goraksh,
The problem is that the pricing (incl. the rule 17) is not normally called at the time of GR. As Jürgen wrote, the system just uses the "net value" field of the PO.
I have however a "wild" idea. If the price in the PO comes from the info record or from a contract (and not changed manually there), then you can set the "pricing date category" = 5 there, meaning "GR date". This causes the pricing to be called again at the time of GR and your formula 17 will fire.
The side effect of course is that the price that you had in the PO, printed and sent to the vendor will not be binding: if you change the PIR price before the GR, the GR will be posted to the new PIR price, despite the fact that the PO printout showed something else. So the question is if the price printed on the PO is indeed binding in your business case - in many business cases it is the current vendor price that matters for the billing by the vendor, not the one that you prined on the PO. For such business cases you should have had pricing date category 5 anyway...
BR
Raf -
Rounding up values in Print Layout Designer
The customer has a database field in print layout designer and this is bringing back a value such as 0.25. They would like to create another field which shows this value rounded up to the nearest whole number, ie in the case of 0.25 they would like to see 1.
They have created a formulae field and used the round function, however this rounds the value down to the nearest whole number as per the general rounding rule i.e. round it down if it is below .5 and up to the nearest whole number when it is above .5
Is there anyway to achieve this using Print Layout Designer in SAP Business One 2007 A?Hi Samantha,
Apologies for the delay.
Yes, its possible to do this. Firstly, you will need to use the fields from my earlier post. However you will also need to add some more formula fields
The first formula field will work out what the numbers are to the right of the decimal point:
DecimalRight(Field_101)
Field_101 in your case will be the field ID for the quantity field and the field ID for the above formula field will be Field_102.
The second formula field will work out if the quantity is a whole number, here the field id will be Field_103:
Field_102==' '
The third formula field will work out if the quantity is not a whole number, here the field id will be Field_104:
Field_102!=' '
You can now use the Link To functionality to link the original quantity rounded field to Field_103 and you can link the quantity plus 0.5 rounded field to Field_104.
Kind regards,
Adrian -
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 -
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 AMHI 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 -
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 -
Mdx rounding of values included in calculation
Hello Experts
We have a problem with decimals which result in very large figures for some calculations so therefor wan't to add a rounding like this but then we will only round the result, but we need to round the values included in the calculation:
// Calculated in PS
*function fn_INDIPS(%denominator%,%numerator%,%p3%)
iif( (%denominator%,[currencydim].[sek],strToMember(categorydim.properties("PS_INDEX_CAT"))) = 0,Null,round((%numerator%,[currencydim].[sek],strToMember(categorydim.properties("PS_INDEX_CAT"))) / (%denominator%,[currencydim].[sek],strToMember(categorydim.properties("PS_INDEX_CAT"))),4) * %p3%), solve_order = 9
*endfunction
So i think what would solve it would be to add a rounding to the "if devided by 0 then null" or a if OR(<0.0001;>0.0001) but from what i have tried that is not possible. Do you know if it's possible or du you have any other suggestion for how we should get aroudn the problem?
// Calculated in PS
*function fn_INDIPS(%denominator%,%numerator%,%p3%)
iif( (round(%denominator%,[currencydim].[sek],strToMember(categorydim.properties("PS_INDEX_CAT"))),4) = 0,Null,(%numerator%,[currencydim].[sek],strToMember(categorydim.properties("PS_INDEX_CAT"))) / (%denominator%,[currencydim].[sek],strToMember(categorydim.properties("PS_INDEX_CAT"))) * %p3%), solve_order = 9
*endfunction
Best regards
JonasHi Perven,
You can definitely do a round off using the native excel formulas. However, the problem lies with the EVDRE. Whenever an EVDRE template is expanded, all the custom formulas maintained in the expansion range gets overwritten. So, it will be little difficult. One option would be to turn off the expansion for either rows and columns and use the custom functions for you purpose.
Hope this helps. -
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 -
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 to install Mountain Lion on my macbook pro MB990LL/A 2009?
Hi, I have a big problem here.. I saw on internet that many people have installed on they're macbook pro MB990LL/A an OS like Snow Leopard, Lion, Mountain Lion. This weekend, I've tried to install Snow Leopard, and when I've inserted the disc in my m
-
I keep getting a pop up box on my iPhone asking me to enter my password - and the apple id does not match mine. I click 'Cancel' but it keeps reappearing and interfering with other apps. What did I do to get this and what do I do to get rid of it?
-
I'm getting error message "Podcasts cannot be updated because all of the podcasts selected for update no longer exist". I have -Reset iPod -deleted all Podcast from iTunes and added new one Still the same message, still unable to copy podcast to my i
-
Macro not working for Word.
My macro is not working for Microsoft word. Its showing some macro settings issue. Please help.
-
N86 Problem!!!!!!!!!!!
Hi, I Bought a Nokia n86 from K.S.A. I was using it smoothly but unfortunately i broke my phones charging port i a gave it to Nokia care in India & it had no international warranty but i had to get it fixed some how so i handed it over to them they