on 11-16-2006 6:29 AM
Hi,
I have three characteristic fields in my query. I want to create a formula that will display the value in either field1 or field2 based on a value in field3. Example:
if field 3 = Yes then
display value in field1
else
display value in field2
end if
How do I do that?
Thanks,
MIG
Hi,
Right click on the Structure and select "Create New Formula". In the next page different functions will be listed. Select your conditional field (In your case Field 3) and use the logical expressions listed (Like Greater than or equal to >=, lesser than or equal to <= etc.,) Use your logic in creating the formula and thats it, you are done...
Regards,
Kishore
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can use the below formula.
( V == 1 ) * ( M ) + ( V ==2 ) * ( Y )
Here * means "THEN" '+' Means Else
Regards,
Malli
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi MIG,
In bex there is no direct if then else functionality but you can use boolean function to full fill your requirement.
in your example
use formula like this
(field 3 = yes )* field1 + ( field 3 <> yes) * field 2.
Here booloen opereator return value 1 if condition met otherwise it returns 0.
Hope you understood.
Regards,
Vijay.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
MIG,
Could you please give more details along with sample data. Your requirement is not clear.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.