Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditional values

Status
Not open for further replies.

ShortyA

MIS
Feb 20, 2002
363
0
0
CH
Hi,
I am new to using the BO Designer as used to working with Crystal Reports. Using Designer on BOE XI Release 2 and have a question that I am hoping you can help with.

I would like to create an object which has a value of "1" if various conditions are met. For example "if (field1=A and field2 =Z) then 1 else if (field3=Y and field4=F) then 1 else 0;

Is this possible in BO Designer and if yes how can it be done as I would prefer to have this logic in the universe than the report?
Many thanks for your help.
ShortyA
 
What type of database are you connecting to? I would do create a dimension or measure (depending on how you're going to use it) that looks something like this:
Code:
Case
  when (field1 = 'A' and field2 = 'Z') then 1
  when (field3 = 'Y' and field 4 = 'F') then 1
  else 0
end

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Hi - thanks for your prompt reply. I am connecting to an Oracle database but have used case statements before in PL/SQL. I am going to summarise the field value within various groupings in the end report. Would a measure be best for that ?
Thanks for your help.
ShortyA
 
Yes, you'll need a measure for that.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
This is the first time I have created a measure which is not a direct field value. Is this syntax entered in the "Select" section of the measure ? Thanks.
 
Yes, it's in the Select section. You can use just about any valid SQL expression there to get the data you need, including calls to user-defined functions - it all gets passed to the database when the dimension or measure is included in a query.

-Dell

A computer only does what you actually told it to do - not what you thought you told it to do.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top