Data Management Group Crystal Reports Training Boot Camp
Business Objects Authorized Education Partner
Home Corporate Information Training And Education Resources

Business Objects Top Authorized Education Partner for 2004 - View Our Courses

HOME
CORPORATE INFORMATION
TRAINING AND EDUCATION
RESOURCES>>>
RESOURCES > Trainer's Talk > Creating a variable similar to an IF-THEN-ELSE sta...

Creating a variable similar to an IF-THEN-ELSE statement in Web Intelligence

The information in the article refers to
BusinessObjects

Applies to
Web Intelligence

Synopsis
In Web Intelligence, you want to create a variable whose output is similar to an IF-THEN-ELSE statement. For example, if a field has a value of 'Canada', the variable should show 'North America'. If the field shows 'Brazil', the variable should show 'South America'.

How can you create a variable whose output is similar to an IF-THEN-ELSE statement?

Solution
To create a variable that behaves like an IF-THEN-ELSE statement, use the 'INLIST' operator. INLIST allows you to select the values that you specifically require.

To Demonstrate INLIST:

  1. In Web Intelligence, create a report based on the 'Xtreme' database. Place the 'Country' object in the report and then preview it.
  2. Click 'show/hide variable editor'. Assign a name to your variable.
  3. In the 'Formula Definition', type the following formula: "=If ([Country] InList ("USA";"Canada";"Mexico");"North America";If ([Country] InList ("China";"Japan";"Korea");"Asia";"Other"))"
  4. Save the formula and close the editor. Your variable now appears under the 'Variables' area on the left.
  5. Add the variable to the report by placing it next to the 'Country' field.
  6. Preview the report.

When previewing the report, the variable shows "North America", "Asia", or "Other", depending on the value of the 'Country' field.

 

Sign Up for the BI Advantage Newsletter