Conditional values

Hello,

I have an object that references a numerical column from a table. I wan it to rereturn the values in this way:

  • “Contains” if value=1
  • “No contains” if value=2
  • the original value if value distinct of 1 and 2.

Can I define it in the Designer? I have tried it defining the object format but the condoitional format only works with negative,positive or null value.

I’m working with Business Objects 4.1.1.

Thanks to all.


Listserv Archives (BOB member since 2002-06-25)

Are you using Oracle? If so, this is a simple DECODE:

DECODE( Value, 1, ‘Contains’, 2, ‘No Contains’, to_char(Value) )


Erich Hurst
Compaq Computer Corporation
(281) 514-9445
Erich.Hurst@Compaq.com

I have an object that references a numerical column from a table. I wan it to rereturn the values in this way:

  • “Contains” if value=1
  • “No contains” if value=2
  • the original value if value distinct of 1 and 2.

Can I define it in the Designer?


Listserv Archives (BOB member since 2002-06-25)

If-ElseIf-Else logic can be accomplished in the Formula Editor as follows (for your case):

=If <> 1 Then (If <> 2 Then FormatNumber(, “#”) Else “No contains”) Else “Contains”

This example assumes the column is of type character.

HTH,
Donald May


Listserv Archives (BOB member since 2002-06-25)

If I understand correctly, you could most easily do this with a decode in Oracle (assuming you are using oracle) in the object. Just:

decode(table.field,‘1’,‘Contains’,‘2’,‘No Contains’,table.field)

…you could also do this in a variable in BO:

if table.field = 1 then “Contains” else if table.field = '2 then “No Contains” else table.field

Good luck.

You wrote:

  • “Contains” if value=1
  • “No contains” if value=2
  • the original value if value distinct of 1 and 2.

Can I define it in the Designer? I have tried it defining the object format but the condoitional format only works with negative,positive or null value.

I’m working with Business Objects 4.1.1.


Listserv Archives (BOB member since 2002-06-25)