Quantcast
Channel: SCN : Discussion List - SAP Business Explorer (SAP BEx)
Viewing all articles
Browse latest Browse all 4032

BEx Formula Use of 'Logical And' and Calculation for Gross Margin

$
0
0

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

gm-case.png

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

gm2.png

 

GM%

gm1.png


Viewing all articles
Browse latest Browse all 4032

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>