cancel
Showing results for 
Search instead for 
Did you mean: 

How to calculate IF - THEN - ELSE condition in BEx Reports ??

Former Member
0 Kudos

Hi all,

I have a column called Class and depending on it's values I want to assign a value into a NEW column 'Owner Class' (It is not from any InfoObject) like the following:

If Class = 111ABC OR 111DFE OR 111PQRS OR 1111XYZ

then Owner Class = ABCD.

If Class = 222ABC OR 234DFE OR 333PQRS OR 345XYZ

then Owner Class = PQRS.

...................................

I have looked at the following 'boolean operators in formula' and it will not work in this case:

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

How could I accomplish my task at <b>Workbook</b> level, PLEASE ???

Thanks,

Venkat.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

The following is the solution for it:

=IF( OR(A2 = {"364A-EL","365A-EL","368A-EL","368B-EL","369A-EL","371A-EL","371B-EL","373A-EL","397-EL"}),"POLES", IF( OR(A2 = {"366A-EL","367A-EL","367B-EL","368C-EL","369B-EL","371C-EL","373B-EL"}),"UGCBL", IF(A2 = "370A-EL","METER","")))

Thanks.

Former Member
0 Kudos

Hi,

Can u help me to sort out my problem same as u faced.

As per my client requirment

If (plant = DDD1 or DDD2 or MHD1 or DLD1 or KKD1 or HPD1 or UPD1) then write DC else Direct.

Can u pls tell me how to write in bex.

Thanks & Regards,

Kavita

former_member188325
Active Contributor
0 Kudos

It is possible to achieve with little workarond depending on your Query deisgn.

Former Member
0 Kudos

Hello Venkat,

Check this logic out:

( (class==111ABC)(class== 111DFE)(class= 111PQRS)+(class= 1111XYZ )ABCD) ((Class== 222ABC)(class== 234DFE)(class== 333PQRS)(class==345XYZ)PQRS)

at any give if one of the conditions satisfy then the formula will yield result or else it will give 0.

<Reminder for points removed>

Peter R

Message was edited by:

Moderator

Former Member
0 Kudos

Hi Peter,

I have entered the following in the function (fx) of Column J20 and the condition values are in Column I20:

=((I20="364A-EL")(I20="365A-EL")(I20="368A-EL")(I20="368B-EL")(I20="369A-EL")(I20="371A-EL")(I20="371B-EL")(I20="373A-EL")(I20="397-EL")*"POLES")+

((I20="366A-EL")(I20="367A-EL")(I20="367B-EL")(I20="368C-EL")(I20="369B-EL")(I20="371CA-EL")(I20="373B-EL")*"UGCBL").

Since it has 364-EL in Column I20 and J20 should have POLES, but it gives '#VALUE!' in that column, PLEASE?

The following is my original requirement:

If Asset Class (Column I) = 364A-EL, 365A-EL, 368A-EL, 368B-EL, 369A-EL, 371A-EL, 371B-EL, 373A-EL, 397C-EL, then Owner Class(Column J) = POLES

If Asset Class = then 366A-EL, 367A-EL, 367B-EL, 368C-EL, 369B-EL, 371C-EL, 373B-EL, then Owner Class = UGCBL

How can I fix this problem, please ?

Thanks,

Venkat.

former_member184494
Active Contributor
0 Kudos

Venkat,

An IF Then Else condition is defined in the key figures using the formula option - you cannot substitute a characteristic there - your only optiopn would be to use a virtual characteristic and do the same at the data load...

Arun

Former Member
0 Kudos

or use VBA

Former Member
0 Kudos

Hi William,

Could you please help me to write VBA macro for the below:

If Asset Class (Column I) = 364A-EL, 365A-EL, 368A-EL, 368B-EL, 369A-EL, 371A-EL, 371B-EL, 373A-EL, 397C-EL, then Owner Class(Column J) = POLES

If Asset Class = then 366A-EL, 367A-EL, 367B-EL, 368C-EL, 369B-EL, 371C-EL, 373B-EL, then Owner Class = UGCBL

Thanks,

Venkat.