cancel
Showing results for 
Search instead for 
Did you mean: 

Boolean Conditions- If Else statements

Former Member
0 Kudos

Hi BW Guys,

I have an extractor brining in the following fields and need to do some condition checks:

ZZEINDT- Item delivery date

ZBLDAT- Document date in document

ZZOUT- Quantity recieved but some outstanding

I need to set up the following boolean in BEx but not sure how I can do this:

If ZZEINDT >= ZBLDAT and ZZOUT <= 0.

FieldA = 1.

Else.

FieldB = 0.

Endif.

How do I tell BEx that I need to assign a value of 1 or 0 depending if the condition is met or not.

Can anyone explain how this will be done in BEx.

Thanks

Depesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Varsani,

This link will give you complete details with examples

You can do this by creating a new formula and using the boolean functions. Here is the link that explains how these work:

http://help.sap.com/saphelp_nw04/helpdata/en/23/17f13a2f160f28e10000000a114084/content.htm

Thanks

Varun

Answers (2)

Answers (2)

former_member188325
Active Contributor
0 Kudos

Hi,

do u have FieldA and FieldB columns (as 2 seperate columns)in u r Query?

regards

Former Member
0 Kudos

Hi,

No I don't have 2 columns in the query but I just need to assign the condition a value of 1 or 0 depending on the boolean criteria. Then I would like to tally up the 1's and divide them with the total deliveries total (total 1's + 0's).

Do I need 2 column values, I don't need to display these values of 1 and 0's, I just need them to assign a 'hit and miss' marker Does this make sense?

How can this value of 1 or be assigned in the query.

Thanks

Depesh

Former Member
0 Kudos

Hi Guys,

Would the following work once I have set up structures elements/new selections based on existing chars pulled into BW?

( ( 'Item Del Date' >= 'Doc Date in Doc' ) AND ( 'Quantity of Goods Recieved' <= 0 ) ) * 1

Thanks

Depesh

former_member188325
Active Contributor
0 Kudos

yes depesh.

rght click on u r structure-->create new formula

description FieldA/FieldB

formula:( ( 'Item Del Date' >= 'Doc Date in Doc' ) AND ( 'Quantity of Goods Recieved' <= 0 ) )

it displays '1' if condition is satisfied otherwise '0'

hope this helps

regards

former_member188325
Active Contributor
0 Kudos

or do u want to display '1's and '0's in two seperate columns?

regards

former_member188325
Active Contributor
0 Kudos

i mean that do u want to diaply all 'ones' in FieldA column and all 'zeros' in FieldB column?

regards

Former Member
0 Kudos

Hi C C,

No I don't need to display the 1 and 0 in different columns. I just need to make sure a value of either is assigned if boolean conditions met ot fail.

For the record: How can I actually display the 1's and 0's in columns in the query if I wanted, to say view the data?

This would be helpful to know.

Thanks

Depesh

former_member188325
Active Contributor
0 Kudos

will give u indetail.

regards

former_member188325
Active Contributor
0 Kudos

Hi,

1.<i>No I don't need to display the 1 and 0 in different columns. I just need to make sure a value of either is assigned if boolean conditions met ot fail.</i>

for this u just create a new formula and provide 'FieldsA/FieldB'as description.

Formula:(ZZEINDT >= ZBLDAT AND ZZOUT <= 0)

so this 'FieldsA/FieldB' column displays '1' if condition is satisfied,otherwise '0'.

2.<i>For the record: How can I actually display the 1's and 0's in columns in the query if I wanted, to say view the data?</i>

create a formula say 'x'(description).

formula:(ZZEINDT >= ZBLDAT AND ZZOUT <= 0).

now 'x' displays '1' or '0'.

create one more forula 'FieldA'.

formula : (x = 1 )

it displays '1' when ever X=1 otherwise '0'

crete one more formula 'FieldB'.

formula : (X=0)

it displays '1' if x=0 otherwise 0.

u can hide 'x' if u don't need.

u can change displayig of '1' and '0' as per u r need.

pl don't forget to assign points if its useful

regards

Former Member
0 Kudos

Hi c c,

Thanks for your input, this helps alot! I have assigned points as your info will be very good help.

Thanks

Depesh

Former Member
0 Kudos

Hello Depesh,

Check the link

http://help.sap.com/saphelp_nw04/helpdata/en/23/17f13a2f160f28e10000000a114084/content.htm

Also go through this thread

Hope it helps.

Regards,

Praveen