Bex Formula help required
Hi,
I have a requirement for a formula in bex,I have 2 key figures ie A (Actuals) & B (Targets).I need a new formula with the condition - if A>B then result should be 1 and if A< B then result should be 0 . I need the condition in the same formula.Kindly provide me a formula for these using boolean operators
Hi,
Your formula can be.
(A>B)Result + (A<B)Result =0
Regards,
ray
Similar Messages
-
BEx Formula assistance required
Good Morning
Please assist? In Excel the formula is:
""=IF('SUM Sales' > 'SUM Target',('SUM Target' *'% of Nat'),IF('SUM Sales' < 'SUM Target',('SUM Sales' *' % of Nat'))""
I have the key figures available in BEx, but I have difficulty creating the same in a formula in BEx.
Key figures in BEx:
(1) SUM Sales
(2) SUM Target
(3) % of National
How do I do it in Bex, not to get a Syntax error?
Assistance or guidance will be highly appreciated.
Thanks and have a nice weekend.
Cornelius FaurieHello,
Use the following formula in formula key figure:
('SUM Sales' > 'SUM Target')*('SUM Target' '% of Nat') + ('SUM Sales' < 'SUM Target')('SUM Sales' *'% of Nat')
regds,
Shashank -
Hi Experts,
I have repots which displays
........................... *Good stock.............Stock Age *
*Brand..................Qty.....Value *
Product A.........103.....77066.41................10
Product B...........79......50071.54................45
Product C.............4.....235.77 2..................25
Product D............38 ....31583.1..................20
I want to display the stock which is older than 30 days in a separate row like this
........................... Good stock.............._Good stock >30days_
Brand..................Qty.....Value......................Qty.....Value
Product A.........103.....77066.41
Product B...........79......50071.54................79............50071.54
Product C.............4.....235.77 2
Product D............38 ....31583.1
All should be displayed in a single report. and only the stock and the stock which is older than 30 days should be displayed in the next columns.
Can anyone tell me how do I achieve this plz.
ThanksHi,
U can drag the 'stock age' column under key figures and then in display property for 'stock age' -hide it..THen for the column 'Good stock >30days'-create a formula as follows:
( 'stock age' > 30 ) * 'goods stock value'
and similarly for qty as well:
( 'stock age' > 30 ) * 'Qty'
hope it helps.
Regards,
Rathy -
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 -
Bex Formula using customer Exit
Dear Friends,
I am trying to resolve the below problem. Require your help.
In one of the bex reports, the requirement is to provide a variable on Bill date. From the given bill date, the report should display data for 7 consecutive days.
But the condition is that the from date should always be a saturday?
What i have done is : In ROWS, i selected the required key figure columns
and then, created a structure in which i created Seven New Selections and used offsets.
so, if the user enters a specific date, the report displays seven days of the data from the given date. However, how do i restrict the user's choice to only saturdays.
I suppose the solution lies in using customer Exit.. but could some one help me with the ABAP coding.
I am also available on [email protected]
Thanks for the anticipated support.Hi,
You can get the Day from the current system date and put a case statement to substract 1 for sunday to get saturday
2 for monday
3 for tuesday
etc
Fuction Module : DATE_TO_DAY
Can check this link : FM: DATE_TO_DAY -
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 -
XSLT mapping Help Required.
XSLT mapping Help Required.
Hi Experts,
I am New to XSLT Mapping. I am practising the below Example:
InputXML File:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="Persons111.xsl"?>
<ns0:MT_XSLT_Source xmlns:ns0="http://XYZ.com/gen">
<Person>
<FirstName>Anshul</FirstName>
<LastName>Chowdhary</LastName>
<Gender>Male</Gender>
<Address>
<Street>2nd Main</Street>
<Houseno>83/b</Houseno>
<City>Mysore</City>
</Address> </Person>
</ns0:MT_XSLT_Source>
XSL StyleSheet File:
<?xml version='1.0' encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://XYZ.com/Gen"
Xmlns:ns1=”http://XYZ.com/Test”>
<xsl:template match="/">
<ns1:MT_XSLT_Target>
<Title> <xsl:value-of select="ns0:MT_XSLT_Source/Person/Gender"/> </Title>
<Name> <xsl:value-of select="concat(concat(ns0:MT_XSLT_Source/Person/FirstName,' '), ns0:MT_XSLT_Source/Person/LastName)"/>
</Name>
<Street> <xsl:value-of select="concat(concat(ns0:Mt_XSLT_Source/Person/Address/Houseno,' '),
ns0:Mt_XSLT_Source/Person/Address/Street)"/> </Street>
<City> <xsl:value-of select="ns0:Mt_XSLT_Source/Person/Address/City"/> </City>
</ns1:MT_XSLT_Target>
</xsl:template>
</xsl:stylesheet>
The Desired Output shuold be:
<?xml version="1.0" encoding="UTF-8"?>
<ns1:MT_XSLT_Target xmlns:ns1="http://XYZ.com/Test">
<Title>Male</Title>
<Name>Anshul Chowdhary</Name>
<Street>83/b 2nd Main</Street>
<City>Mysore</City>
</ns1:MT_XSLT_Target>
I have refered the xsl in xml and i am getting the below Oupt in a Single line like this:
Anshul Chowdhary Male 2nd Main 83/b Mysore
I am Unable to display in Target XML Fomrat as shown above. Please check and do the needful.
Regards,
GIRIDHARHi,
I have used below for testing.
Input xml:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="Persons111.xsl"?>
<ns0:MT_XSLT_Source xmlns:ns0="http://XYZ.com/gen">
<Person>
<FirstName>Anshul</FirstName>
<LastName>Chowdhary</LastName>
<Gender>Male</Gender>
<Address>
<Street>2nd Main</Street>
<Houseno>83/b</Houseno>
<City>Mysore</City>
</Address> </Person>
</ns0:MT_XSLT_Source>
xsl code:
<?xml version='1.0' encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://XYZ.com/gen"
xmlns:ns1="http://XYZ.com/Test">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<ns1:MT_XSLT_Target>
<Title> <xsl:value-of select="ns0:MT_XSLT_Source/Person/Gender"/> </Title>
<Name> <xsl:value-of select="concat(concat(ns0:MT_XSLT_Source/Person/FirstName,' '), ns0:MT_XSLT_Source/Person/LastName)"/>
</Name>
<Street> <xsl:value-of select="concat(concat(/ns0:MT_XSLT_Source/Person/Address/Houseno,' '),
/ns0:MT_XSLT_Source/Person/Address/Street)"/> </Street>
<City> <xsl:value-of select="/ns0:MT_XSLT_Source/Person/Address/City"/> </City>
</ns1:MT_XSLT_Target>
</xsl:template>
</xsl:stylesheet>
For testing in PI ,change the extension from .txt to .xsl and zip it and upload into PI as an imported archive .
Regards
Venkat -
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 -
Urgent help required: Query regarding LC Variables
Hi All
Sometime earlier I was working on a performance issue raised by a customer. It was shell script that was taking almost 8-9 hrs to complete. During my research I came across a fact that there were some variables which were not set, the LC variables were impacting the sort funnel operations because of which the script was taking a long time to execute.
I asked them to export the following commands, after which the program went on smoothly and finished in a couple of mins:
export LC_COLLATE=en_US.ISO8859-1
export LC_MESSAGES=C
export LC_MONETARY=en_US.ISO8859-1
export LC_MONETARY=en_US.ISO8859-1
export HZ=100
export LC_CTYPE=en_US.ISO8859-1
export LANG=en_US.UTF-8
Later I did recover that setting the LC_COLLATE to C, is not helping and the program was again taking a lot of time. Few questions that I want to ask are:
1. Can someone please tell me, what each of these variable mean and how these values make a difference.
2. When I exported LC_COLLATE=en_US.ISO8859-1, it worked fine, but when i tried with the defalut value LC_COLLATE=C, then why the program didnt work.
As this issue is still going on, hence I would request All to provide their valuable inputs and let me know as much as possible.
Appreciate your help in this regard.
Thanks
Amit
Hi All
A new development in this regard. The customer has send us a screen shot in which they were trying to export the locale variable using the commands which I have pasted above. I can see in the screen shot that while exporting LC_COLLATE and LC_TYPE, they get a message that ""ksh: export: couldn't set locale correctly"".
Request everyone to please give their inputs as it's a bit urgent.
Thanks for all the help in advance.
Thanks
Amit
Some help required please...
Edited by: amitsinhaengg on Jul 22, 2009 2:03 AM
Edited by: amitsinhaengg on Jul 22, 2009 2:06 AMLC_CTYPE
Controls the behavior of character handling functions.
LC_TIME
Specifies date and time formats, including month names, days of the week, and common full and abbreviated representations.
LC_MONETARY
Specifies monetary formats, including the currency symbol for the locale, thousands separator, sign position, the number of fractional digits, and so forth.
LC_NUMERIC
Specifies the decimal delimiter (or radix character), the thousands separator, and the grouping.
LC_COLLATE
Specifies a collation order and regular expression definition for the locale.
LC_MESSAGES
Specifies the language in which the localized messages are written, and affirmative and negative responses of the locale (yes and no strings and expressions).
You can use command
# locale -k LC_CTYPE
to see more detail about each type. -
Help required - Sales order item is partially delivered but the item grayed
I have a sales order 123 having say item10 with qty 1, item20 with qty 10 , item 30 qty 12
Item 1 confirmed qty 1 and delivered qty is 1
Item 2 confirmed qty 10 and delivered qty 10
Item 3 confirmed qty 1 and delivered qty is 1
Now the item3 still has open requirements of 11 to be delivered. But the item is GRAYED OUT already.
even if I do ATP the qty is not confirming for the remaining 11 pieces.
Why is that? How to make that item out from GRAY.
How to confirm the remaining 11 qty for that item.
Help required as early as possible.
Appreciate ur help guys
Radhahi Radha, how are you ?
---the partial deliveries in master data must have not been mentioned.
---the deliveries should be upto target quantity.
---check order type, item category and schedule line category.
---check unrestricted stock availability.
thank you
regards
Khera. -
Search Help with in a serach help required in SRM 4.0
Hi,
Requirement: Search help required for Product Category field in the Search help for Product(BBPH_PRODUCT) in SRM portal.
This search help is used in Create shopping Cart transaction. The hyper link on Internal Goods/Services leads to the search help BBPH_PRODUCT.
My analysis:
The field Product Category (CATEGORY_ID) has search help(COM_CAT_HIER) attached to its data element. When I single test the search help BBPH_PRODUCT in SAP GUI,I can see the search help for field product category in the selection dialogue box. However the same does not appear on the corresponding screen in HTML.
Please let me know whether I need to do some thing to make the search help appear on the HTML screen?
With Regards,
Prakash KamathHi Prakash,
I have the same problem but with another field. Unloading point. Could you please tell me how did you solve this problem with displaying F4 help on html/ SRM portal?
Thank you very much.
Best regards,
Danijela ZIvanovic -
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. -
Help required with Photoshop Elements 4.0 this has been installed on my new Toshiba laptop with windows 8.1 for some 18 months and operating well. Now it will not open, message pops up saying “attempt to access invalid address” then “application not responding” Suggestions how to access would be much appreciated. Tks. Stuart
What is the size of your hard disk? PSE 4 is a very old program and I suspect it is not able to access the entire hard disk on your machine. Just a thought here.
Maybe you are looking for
-
Photoshop Elements 10 Installed on a Mac - Error 213:5
I've installed Photoshop Elements 10 on my Mac and I'm getting error code 213:5. It won't open and/or run after that. Any suggestions?
-
I have reset my mac book but password and username isnt accepted
having serious problems doing anything with my mac as udername and password keeps being rejected
-
Hi! I cleared "Menu Module" property (DEFAULT&SMARTBAR) in my form module, but I still have "Window" menu. Is there way to disable menu at all? Thank you.
-
Can I use autozero function to block DC part of an AC signal?
Will it increase the signal resolution of the AC signal i am trying to measure?
-
Moving the tabs to right of the jsf page in the adf panel tabbed component
Hi, i want to move the tabs in the panel tabbed component to the right. In the property inspector of this component, it doesn't have an option called right. How can we do this? Thanks, sudan