Data Management Group  
 
TRAINER'S TALK

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

The information in the article applies to
BusinessObjects 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.



Have a question for our trainers?
Click here to send your questions!


Overview
Crystal Reports Tips & Tricks
Xcelsius Tips & Tricks
Web Intelligence Tips & Tricks
Trainer's Talk

Main | Company | Consulting | Training | Resources | Contact
Copyright © Data Management Group
All Rights Reserved.
DMG
11870 Fountain Way, Suite 502
Newport News, VA 23606
v. 888.394.1664
f. 757.578.4532
GSA Contract Number: GS-35F-0783N