cancel
Showing results for 
Search instead for 
Did you mean: 

How to write a formula using Boolean Operators?

Former Member
0 Kudos

Dear BW mates,

I have two Key Figures <b>stock</b> and <b>Prevous 12 week Stock</b>.

I want to calculate <b>Excee stock</b> from these with the following condition.

If <b>Prevous 12 week Stock</b>is less than <b>stock</b>then substract <b>Prevous 12 week Stock</b>from the <b>stock</b>. Thease substracted value is the <b>Excee stock</b>.

Thanks,

SB

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

When you try to write formula, on the wizard itself click on the question mark(?) and you will get the help with example how to use the IF and ELSE. Also ELSE IF statements. If any statement is TRUE then it returns 1 otherwise it returns 0.

This help doc is really very good i would suggest to refer this.

Regards,

Tapan

Former Member
0 Kudos

Hi Reddy,

Where do you use the formula? is this in BeX, update rule or transfer rule?

Former Member
0 Kudos

Hi Emmanuel,

It is in BEX.

SB

udayabhanupattabhiram_cha
Active Contributor
0 Kudos

Hi:

Look at the previous Post.

Ram Chamarthy

former_member188325
Active Contributor
0 Kudos

Hi Reddy,

Your formula is not complete..what happens if Stock = Prv 12 week stock, or stock > 12 wwek stock?

thanks

Former Member
0 Kudos

Hi Murali,

My aim is to get the only highre value stocks by comparing with 12 weeks sale.

Otherwise it should be zero.

Thanks,

SB

Former Member
0 Kudos

Hi Reddy,

I presume if Prevous 12 week Stock > stock, Excee stock would have the value of stock, here the formula:

(Prevous 12 week Stock < stock)* Prevous 12 week Stock - stock * stock

Hope it helps.

Cheers,

CK

Former Member
0 Kudos

Hi CK,

Thanks for your reply.

In Excess stock I have to feed the substracted value that is my requirement. I have to do in go.

If(Pre.12 week Sales < Stock)then result should be (Stock-Prev.12 weeks sale).

In Exess stock I should see this substracted value.

I am sorry if I say Previous 12 weeks stock in my previous posting.

Thanks,

SB

former_member188325
Active Contributor
0 Kudos

hi,

try this:

first create a fromula leats say

a = stock - Prv 12 weeks sale.

now go for one more formula

Excess stock = (Pre.12 week Sales < Stock) * a.

(You just provide this formula as it is in formula window)

thats it..

but excess stock would be 0 for other two conditions.

please hide fromula 'a'.

thnaks

Message was edited by: Murali

Former Member
0 Kudos

Hi Murali,

Please see the requirements once again.

I have two Key figures.

1: Stock,

2: Previous 12 weeks sale.

I have to calculate <b>Excess S</b>tock as <b>Stock - Prev.12 weeks sale</b>if Stock is greater than Prev.12 weeks sale, otherwise zero.

former_member188325
Active Contributor
0 Kudos

Hi Reddy,

Create a formula 'a' as i said first or you can use

(Stock-Prev. 12 week sale ) directly in Excess Stock

formula.

<b>Excess stock = ( Stock >Pre.12 week Sales )*(Stock-Prev. 12 week sale )</b> .

Formula works like this:

if Stock>Prev 12 weeks sales,

Excess Stock = 1 * (stock - Prv 12 weeks sale) = stock - Prv 12 weeks sale

if Stock is not greater than prev 12 week sale,

Excess Stock = 0 * (Stock-Prev. 12 week sale ) = 0.

have you got it?

i assume Stock and Prev 12 week sale Keyfigures are of same units.

thanks

Message was edited by: Murali

Message was edited by: Murali

Former Member
0 Kudos

Hi Murali,

Will you let me know your contact no...

I will call you for clarification.

SB

former_member188325
Active Contributor
0 Kudos

u can mail me u r contact number at cc.sdn.sap@gmail.com

former_member188325
Active Contributor
0 Kudos

then it is straight forward know?you are missing out something i guess