BusinessObjects Web Intelligence XI 3.0/3.

1: Advanced Report Design

Learner’s Guide BOW320 Material Number: BOW32091P

Copyright
©

2009 SAP® BusinessObjects™. All rights reserved. SAP BusinessObjects owns the following United States patents, which may cover products that are offered and licensed by SAP BusinessObjects and/or affliated companies: 5,295,243; 5,339,390; 5,555,403; 5,590,250; 5,619,632; 5,632,009; 5,857,205; 5,880,742; 5,883,635; 6,085,202; 6,108,698; 6,247,008; 6,289,352; 6,300,957; 6,377,259; 6,490,593; 6,578,027; 6,581,068; 6,628,312; 6,654,761; 6,768,986; 6,772,409; 6,831,668; 6,882,998; 6,892,189; 6,901,555; 7,089,238; 7,107,266; 7,139,766; 7,178,099; 7,181,435; 7,181,440; 7,194,465; 7,222,130; 7,299,419; 7,320,122 and 7,356,779. SAP BusinessObjects and its logos, BusinessObjects, Crystal Reports®, Rapid Mart™, Data Insight™, Desktop Intelligence™, Rapid Marts®, Watchlist Security™, Web Intelligence®, and Xcelsius® are trademarks or registered trademarks of Business Objects, an SAP company and/or affiliated companies in the United States and/or other countries. SAP® is a registered trademark of SAP AG in Germany and/or other countries. All other names mentioned herein may be trademarks of their respective owners.

C O N T E N T S
About this Course
Course Introduction.....................................................................................................xi Course Description......................................................................................................xii Course Audience.........................................................................................................xii Prerequisites.................................................................................................................xii Additional Education..................................................................................................xii Level, delivery and duration.....................................................................................xii Applicable certifications and designations..............................................................xii Course success factors.................................................................................................xii Course setup...............................................................................................................xiii Course materials.........................................................................................................xiii Learning process ........................................................................................................xiii

Lesson 1

Reviewing Web Intelligence Core Report Design
Lesson introduction.......................................................................................................1 Reviewing core report design concepts......................................................................2 Review: Web Intelligence core report design.....................................................2 Lesson summary............................................................................................................3

Lesson 2

Working with Advanced Query Techniques
Lesson introduction.......................................................................................................5 Using combined queries...............................................................................................6 About combined query functions........................................................................6 Understanding when to use a combined query.................................................8 Advantages of using combined queries..............................................................9 Comparing query filters and combined queries................................................9 Using the combined query technique...............................................................10 Important facts about combined queries..........................................................11 Activity: Combined queries................................................................................12 Activity: Combined queries - Optional.............................................................13 Using subqueries..........................................................................................................16 Understanding subqueries..................................................................................16 Creating a subquery.............................................................................................16 Activity: Using subqueries..................................................................................18

Table of Contents—Learner’s Guide

iii

.......................................................................................................31 Understanding calculation contexts ............29 Lesson 3 Working with Calculation Contexts Lesson introduction..........................................................60 How to use the Pos() function....................................................................................................43 Using the In context operator with Where..................................................60 Concatenating different character strings....................................................................................................................................................36 About the extended syntax operators and keywords ..........46 Activity: Calculation contexts ...........................................................................................28 Lesson summary................................................53 How to extract characters using the Right() function....................................................................................................................................................................................................................................58 How to extract characters using the SubStr() function......................................32 Dynamic calculations....................................................................................25 Quiz: Advanced Query Techniques..................52 Using functions in formulas and variables..............................51 Using character strings...............................................................................................................56 Using the SubStr() function ..............................35 Forcing the input calculation context..........................................................Creating a query based on another query ............................................................... output calculation contexts..........................................52 About character-string functions.......................20 Changing data sources.......................50 Lesson 4 Creating Formulas with Character and Date String Functions Lesson introduction..............46 Activity: Calculation contexts......................................22 Activity: Changing the data source.........................................35 Input and output contexts............................................................................................................................................................................................................................................................................43 Input vs.........................................................................49 Lesson summary.............................47 Quiz: Calculation Contexts............................40 More about the extended syntax keywords............................................................................................................................................56 Replacing a string............44 Important facts about calculation contexts............................................................53 Using the Replace() function.........20 Duplicating queries............................................................................................62 iv Web Intelligence Advanced Report Design—Learner’s Guide ...........................39 Forcing the output calculation context............................58 Using the Pos() function.............................................................Optional....................................................................................................................................................................................................................................................................................................................52 Using the Right() function .....................................................................32 Redefining calculation contexts....................................22 About changing data sources..............

..90 Using formula language to track data changes..........Optional 2.......................................................................................................................................2...............................................................................................98 Understanding additional functions.....................................................................62 Formatting a date that is concatenated with a string...............................................................68 Converting a string to a date value ................................................................90 Understanding data tracking.............................................................................................96 Displaying drill filters in the report......................................................................................................94 Overriding a report filter or ranking................................87 Lesson 6 Working with Additional Reporting Techniques Lesson introduction................................73 Using If() to group data.........................................................69 Quiz: Character and Date String Functions ..................................................................................................................62 Using date functions .................................84 Activity: Modifying the calculation behavior.........................................72 Lesson 5 Using If Logic Lesson introduction................................................................................................74 Grouping values with the If() function to show higher levels of detail........................................................82 Modifying the way calculations behave.94 Displaying a running sum............94 Determining matches in strings....................91 Using additional report functions............................................................91 Activity: Calculating on changed data.......................................74 Grouping values with the If() function to show categories............................................................................104 Table of Contents—Learner’s Guide v .....99 Activity: Displaying data restricted by a filter or ranking................................................................................86 Lesson summary..................................................................................................Optional...........................65 Using date calculations......................................................................................................................................................................................................75 Activity: Grouping data.............................................................................................................................................................80 Using the If() function to modify calculation behavior...................................................................................................................................66 Activity: Character and date string functions ..........................82 Syntax of the If() function ..................................................................................................................................................................................89 Using data tracking..........65 Converting a string to a date value .....77 Activity: Grouping data .........................................................................................100 Quiz: Additional Reporting Techniques...........................................................................................................................71 Lesson summary..84 Quiz: Using If Logic..........................67 Activity: Character and date string functions ...................................................How to concatenate a string with a date............90 Security for data tracking.................................................................................................................78 Activity: Grouping data .......................................

...............................108 About hyperlinks in Web Intelligence........................118 Lesson summary.131 Quiz: Advanced Query Techniques.....................................109 About hyperlinks in the Interactive panel...............................121 Appendix B Creating Hyperlinks with the OpenDocument Command Using OpenDocument to create a hyperlink to documents ..............................................................................................................................................................................................................116 Quiz: Creating Hyperlinks.........................................................................................................................................................................................................................................119 Appendix A Optional End of Course Challenge Activity: Using advanced querying and reporting techniques.....................................................................................114 About hyperlinks to a URL .............................................................107 Working with hyperlinks in Web Intelligence documents............................................................126 Appendix C Dimensions and Details Understanding dimensions and details .....................108 Creating hyperlinks in the Web Intelligence Interactive panel..............................114 Activity: Creating hyperlinks in the Interactive panel................................................................135 Quiz: Character and Date String Functions ....................................134 Quiz: Calculation Contexts......Lesson summary............................................128 Answer Key Review: Web Intelligence core report design...............................................................................................109 Creating hyperlinks in Web Intelligence Rich Client and the Java Report Panel.....................................................................................................................................................136 vi Web Intelligence Advanced Report Design—Learner’s Guide ...............................123 OpenDocument URL command syntax ............................................................................123 More about using the OpenDocument URL ....................................................................128 Review: Dimensions and details ..............................................127 Understanding the impact of changing the object qualification....................................125 Finding more information ...................................105 Lesson 7 Creating Hyperlinks Lesson introduction.....

............................................................................137 Quiz: Additional Reporting Techniques.................................................138 Quiz: Creating Hyperlinks.......139 Review: Dimensions and details ...............................................................................................................................140 Table of Contents—Learner’s Guide vii ......................Quiz: Using If Logic...............................................

viii Web Intelligence Advanced Report Design—Learner’s Guide .

A

G

E

N

D

A

Web Intelligence Advanced Report Design
Introductions, Course Overview...........................................30 minutes
Lesson 1

Reviewing Web Intelligence Core Report Design...........30 minutes
❒ Reviewing core report design concepts Lesson 2

Working with Advanced Query Techniques...............................1 hour
❒ ❒ ❒ ❒ Using combined queries Using subqueries Creating a query based on another query Changing data sources

Lesson 3

Working with Calculation Contexts........................................1.5 hours
❒ Understanding calculation contexts ❒ Redefining calculation contexts Lesson 4

Creating Formulas with Character and Date String Functions.........................................................................................1.5 hours
❒ ❒ ❒ ❒ ❒ ❒ ❒ Using character strings Using the Right() function Using the Replace() function Using the SubStr() function Using the Pos() function Concatenating different character strings Using date functions

Lesson 5

Using If Logic.......................................................................................1 hour
❒ Using If() to group data ❒ Using the If() function to modify calculation behavior

Agenda—Learner’s Guide

ix

Lesson 6

Working with Additional Reporting Techniques.......................1 hour
❒ Using data tracking ❒ Using additional report functions Lesson 7

Creating Hyperlinks..................................................................45 minutes
❒ Working with hyperlinks in Web Intelligence documents ❒ Creating hyperlinks in the Web Intelligence Interactive panel ❒ Creating hyperlinks in Web Intelligence Rich Client and the Java Report Panel

x

Web Intelligence Advanced Report Design—Learner’s Guide

About this Course
Course Introduction
This section explains the conventions used in the course and in this training guide.

About this Course—Learner’s Guide

xi

and redefine calculation contexts.BusinessObjects Web Intelligence XI 3. Applicable certifications and designations This is an intermediate course for the Business Objects Certified Professional . Prerequisites Learners should have attended the following courses: • BusinessObjects Web Intelligence XI 3.Course Description BusinessObjects Web Intelligence™ is a query. Course success factors Your learning experience will be enhanced by: xii Web Intelligence Advanced Report Design—Learner’s Guide . After completing this course. This one-day instructor-led classroom course is designed to give you the comprehensive skills needed to apply alternative query and reporting techniques when creating complex Web Intelligence documents.1: Report Design To be successful. learners who attend this course should have the following experience: • Experience designing Web Intelligence reports Additional Education Not applicable for this offering. The course also provides an optional appendix describing how to link Web Intelligence documents using the OpenDocument URL command. Course Audience The target audience for this course is report designers who are experienced Web Intelligence users and who need to create complex Web Intelligence documents. Level.0/3. create variables using "If" logic. reporting and analysis tool that allows you to access the data in your corporate databases directly from within BusinessObjects Enterprise™ InfoView and to present and analyze this information in a Web Intelligence document. you will be able to create combined queries and use sub-queries.1 certification path.0/3. delivery and duration This advanced-level instructor-led offering is a one-day course. You will also be able to use character and date string functions.

learner materials. and course-specific requirements. Your comments will assist us to improve future courses. The Learner’s Guide is designed to assist students who attend the classroom-based course and outlines what learners can expect to achieve by participating in this course. • Online Help Retrieve information and find answers to questions using the online Help and/or user’s guide that are included with the product. you will receive an electronic feedback form as part of our evaluation process. instructor. Learning process Learning is an interactive process between the learners and the instructor. Course materials The materials included with the course materials are: • Name card • Learner’s Guide The Learner’s Guide contains an agenda. the instructor guides the learners through the learning framework. Additional resources include: • Sample files The sample files can include required files for the course activities and/or supplemental content to the training guide. About this Course—Learner’s Guide xiii .• • • • Activities that build on the life experiences of the learner Discussion that connects the training to real working environments Learners and instructor working as a team Active participation by all learners Course setup Refer to the setup guide for details on hardware. and facility. • Evaluation form At the conclusion of this course. By facilitating a cooperative environment. and practice activities. Provide feedback on the course content. Introduction Why am I here? What’s in it for me? The learners will be clear about what they are getting out of each lesson. software.

xiv Web Intelligence Advanced Report Design—Learner’s Guide . Review How did I do? The learners will have an opportunity to review what they have learned during the lesson. This step sets the groundwork for practice. Practice How do I do it? The learners will demonstrate their knowledge as well as their hands-on skills through the activities.Objectives How do I achieve the outcome? The learners will assimilate new concepts and how to apply the ideas presented in the lesson. Review reinforces why it is important to learn particular concepts or skills. Summary Where have I been and where am I going? The summary acts as a recap of the learning objectives and as a transition to the next section.

.

you will be able to: • Build on your knowledge of the Web Intelligence core reporting concepts reviewed Reviewing Web Intelligence Core Report Design—Learner’s Guide 1 . After completing this lesson.Lesson 1 Reviewing Web Intelligence Core Report Design Lesson introduction In this lesson you will review and consolidate your knowledge of key Web Intelligence concepts required for advanced report design.

You synchronize the two data sources by merging the Region and Region_Area objects. How many rows appear after the synchronization? 12.Reviewing core report design concepts After completing this unit. A query filter contains three components.You have two queries on two different data sources. What is the difference between an ascending or descending sort and a custom sort? 9. you will be able to: • Build on your knowledge of Web Intelligence core concepts to become an advanced report designer.What is the difference between a dimension and a detail? 11. and Sales total in Query 2. what must you use to separate the values? 5. and a block filter? 7. What are the two benefits provided when you apply a break to a table? 6. What object type does not have a list of values? 4.When you synchronize two queries from different data sources. and Sales revenue in Query 1.You have a report with the objects Region. Year. Query 1 returns 10 rows for Region. what rules must you respect? 14. Why purge the data in your document? 10. What are the differences among a query filter.Can you synchronize the data between a Web Intelligence document and an Excel spreadsheet? 2 Web Intelligence Advanced Report Design—Learner’s Guide . When you list values in a formula. Review: Web Intelligence core report design 1. and you have another report on a different data source with Region. What is the difference between a section and a break? 8. Which objects do you choose to merge to synchronize the information in one table? 13. Area. a report filter. What are they? 2. Query 2 returns 12 rows for Region_Area . A Web Intelligence document consists of three components. What are they? 3.

Lesson summary After completing this lesson. you are now able to: • Build on your knowledge of the Web Intelligence core reporting concepts reviewed Reviewing Web Intelligence Core Report Design—Learner’s Guide 3 .

4 Web Intelligence Advanced Report Design—Learner’s Guide .

.

Lesson 2 Working with Advanced Query Techniques Lesson introduction After completing this lesson. you will be able to: • • • • Use combined queries Use subqueries Create a query based on another query Change data sources Working with Advanced Query Techniques—Learner’s Guide 5 .

As a Web Intelligence user. This can be done by using the Union. • Combined queries The combined queries technique enables you to create two queries and merge the results of both into a single data provider on a selective basis. there are several techniques available that enable you to do this. This standard technique allows you to combine multiple filters in a single query. Note: In this unit. There may be situations when you want to combine the results of two queries into a single block. you will see that combining queries in a single data provider is different from synchronizing multiple data providers using merged dimensions.Using combined queries When you design Web Intelligence documents. you will be able to: • Describe the Union. Note: The subquery technique is presented later in this lesson. Intersection. Intersection. They are: • Data synchronization using merged dimensions Data synchronization refers to the process of merging data from multiple sources into a single block in a document. there are certain instances where you may need to build two or more queries to retrieve the results you require in your report.0/3. and these combinations can be designed to make queries very specific and limiting. this technique only works with a single query. This unit describes how to use combined queries.1: Report Design course. • Subqueries The subquery technique enables you to specify the output of a query as the operand value(s) for a query filter of another query. and Minus functions used to combine queries • Discuss reasons and advantages to using combined queries instead of applying complex filters • Create a combined query • Remove a combined query • List important facts to remember when using combined queries About combined query functions Adding single and complex query filters to a query allows you to restrict the amount of information returned by the query. Note: This technique is presented in the BusinessObjects Web Intelligence XI 3. or Minus functions. 6 Web Intelligence Advanced Report Design—Learner’s Guide . However. After completing this unit.

Like a union query. Note: Union is the default operator for combined queries. Web Intelligence considers each select statement separately and combines their results in the end. and can only be built using a single universe.To accomplish this. For example. A union query forces Web Intelligence to return the data from both objects together in one column. you must build a combined query. You use an intersection query to obtain data common to two sets of results. Union queries are especially useful for working with incompatible objects. Each query needs to have the same number of objects as well as the same data types. Web Intelligence would run separate SQL statements for each object and then return the data in different blocks (tables). when used to combine the results of two queries using the same objects. Unions. Working with Advanced Query Techniques—Learner’s Guide 7 . if you built a query with two incompatible objects. leaving a single instance of the duplicate in the report. All combined queries are built in the Query panel. You use a union query to combine the data from two objects in a single column in a table. will remove duplicate values. • Intersection: combines results which appear in Query 1 AND Query 2. There are three methods of combining queries: • Union: combines results which appear in Query 1 OR Query 2.

Since the objects are incompatible. since the results of Query 2 will always be subtracted from the results of Query 1. the intent of the dates is incompatible and therefore. the Minus function is similar in effect to NOT. Combining queries is similar but not equivalent to Boolean logical operators that you may have used when combining conditions in a single query. However. you must pay attention to the order of the queries. if you include them in a standard query. Web Intelligence returns two blocks of data and does not synchronize the values in a single block. You could not obtain this data with standard query filters since the result sets need to be obtained separately before being combined. You use a minus query to exclude the results of one query from the main query result (Query 1). the query returns a column entitled Invoice Date. Like a union query. the Union function is similar in effect to OR. When you build minus queries. with Invoice Date in the first query and Reservation Date in the other. In this sense. a minus query could be used to find out which customers bought product A but not product B. the data appears in a single column in the block. the intersection query only returns those values that are in both queries.Unlike a union query. The query requires two incompatible objects: Invoice Date and Reservation Date. While the data that the objects represent is identical (that is. a date is a date). using the example above. However. • Minus: combine results which include everything in Query 1 except for what is also true in Query 2. the objects are incompatible. the minus query considers each query separately and combines their results in the end. Understanding when to use a combined query The following is a typical scenario where you might choose to use a combined query: You need to find the dates on which your customers either made reservations or paid their invoices. For example. but the column actually contains both invoice dates 8 Web Intelligence Advanced Report Design—Learner’s Guide . it works much the same as using the AND operator when creating a regular query with multiple query filters. by building a combined query using the Union function. the column of data retrieved by the combined query displays a header that reflects the date object from the first query only. In other words. The Intersection function is similar in effect to AND.

Note: The table in this image has been truncated.and reservation dates. Note: A decision on whether to use query filters or a combined query to retrieve the data you need often depends on how the data is structured in your database. as it may require you to reformat the column header. Advantages of using combined queries There are a number of reasons why you may want to use combined queries instead of applying multiple query filters against a single query: • To make the construction of the query easier • When it is not possible to set the required query filters using Boolean logic The downside of using the combined query technique is that because you are actually creating multiple queries. The resulting report should list 203 products that have not had a special promotion. you need to resolve issues concerning data integrity. To produce this report. Comparing query filters and combined queries Suppose that you have been asked by the Marketing Manager of the eFashion group to produce a report listing all products that have not had a special promotion across all stores. Working with Advanced Query Techniques—Learner’s Guide 9 . processing against the database may take longer. This is important to understand.

This is because the eFashion database only has information on product promotions where a promotion has actually occurred. and the second query produces a list of only those products for which there has been a promotion. the other to show the list of SKU numbers. of the 211 records available. 10 Web Intelligence Advanced Report Design—Learner’s Guide . and then apply a count on the SKU number column for each query. or data provider. there are only 8 records where an entry identifies that a promotion has taken place. You get the same message if you apply a query filter to display only those products where the Promotion y/n value is null. you will see that while the first query produces a list of 211 records. To build a combined query 1. you can generate the table you need by creating a combined query using the SKU Number and SKU desc objects in Combined Query 1. and products that have had a promotion (Promotion y/n). Minus. only products that have a Promotion y/n value will show up in the report. and adding the following query filter to Combined Query 2. Using the combined query technique The combined query technique combines the results of one query with the results of another query into a single query. you could not generate a table listing only the products for which there were no promotions. Due to a relational database limitation. The manner in which the data is combined depends on the function you choose: Union. when products are listed with a Promotion column. SKU descriptions. one to show the total list of product SKU numbers and SKU descriptions.If you create two queries. you can generate a table that subtracts the 8 records generated by Combined Query 2 from the 211 generated by Combined Query 1. Create an initial query in the Query panel. If you apply a query filter to display only those products where the Promotion y/n value is not equal to Yes. the second produces a list of only 8. This is a common data integrity issue. you get a message stating that there is no data to return. The first query produces a list of all products. However. or Intersection . because the Promotion y/n object only contains data about the products for which there were promotions. In the previous scenario. You need to use a combined query to generate the results you require. In this case. resulting in a table listing the 203 products for which there has been no promotion. By using the Minus function to combine the two queries.

using the Union operator. • It is combined with the original query in a Union relationship. Working with Advanced Query Techniques—Learner’s Guide 11 . 6. The individual queries in the combined queries are named Combined Query n. Important facts about combined queries Below are some important facts to keep in mind when you use combined queries: • Queries that you combine must be built using the same universe. then select Remove on the menu. • It does not contain the filters defined on the original query. double-click the operator. To change the combination type. Minus. click Combined Query n. Click Combined Query on the toolbar. right-click the Combined Query n you want to delete. 7. • Queries that you combine must contain the same number of objects to run successfully. To delete a query. The operator moves through the sequence Union. The second query has the following characteristics: • It contains the same objects as the original query. Build each query within the combined query as you build any normal Web Intelligence query. Click Run Query. 3. Web Intelligence adds a copy of the initial query to the data provider. Intersection. 5. date or number). you must use objects of the same type (character.2. 4. To switch to a query. for example. • When you build a combined query to return data from more than one object in a column.

You need to define a custom formula or variable for Web Intelligence to perform a UnionAll.• Only the objects placed in the first query are displayed in the block after the query is run. create a document by combining queries. even if they are repeated. 2. the same data may be repeated over many rows. This default behavior may cause an inaccurate count when combining queries. Intersection or Minus functions. clear the Retrieve duplicate rows option. but instead. create the following table: • Which operator will you use to combine the queries? 12 Web Intelligence Advanced Report Design—Learner’s Guide . Any object used in a combined query does not display in its own column. The list must show: • Product lines that are colored Anise AND • Product lines that are both Coffee colored. particularly when you use the Minus operator. • Web Intelligence's default behavior when combining queries is to perform a Union (not a UnionAll) and to return all values less the duplicates. Activity: Combined queries Objective • Using Web Intelligence Rich Client. using the Union. Web Intelligence automatically returns all rows. In the Query panel. you need a user name and password for the BusinessObjects Enterprise server. You can change Web Intelligence’s default behavior so that only unique rows are returned by the combined query. Instructions Note: To log onto Web Intelligence Rich Client. the values are returned in the same column as the object from the first query. In the Data zone. You want to create a query that shows a list of product lines. and also have sold a greater quantity than 450 units Using the combined query technique. To retrieve only unique rows 1. By default. Refer to your class instructor for this information. display the Query Properties tab. Retrieving duplicate or unique rows In a database.

000 in sales revenue and those stores whose margin was at least $1. Assume that you already have two reports built using the following queries: • Report 1:1 • Report 2:1 Working with Advanced Query Techniques—Learner’s Guide 13 . using the Union.000.000. Intersection and Minus functions.Optional Objective • Create a Web Intelligence document by combining queries.300.Activity: Combined queries . Instructions You are interested in reporting on the relationship between the eFashion stores that earned at least $3.

check that the Count is still applied to the Store name column.300.300.000 or a Margin of at least $1. apply a Count to the Store name column.000.000 or higher. Using the combined query technique. create a table showing all Store names that have both Sales revenue of $3. Once you run the combined query. Once you run the combined query. Edit the query to display all Store names that have had either Sales revenue of at least $3. 14 Web Intelligence Advanced Report Design—Learner’s Guide . check that the Count is still applied to the Store name column.000 or higher and a Margin of $1.000 but not a margin of $1. • Which operator will you use to combine the queries? 4.000.000 or more. • Which operator will you use to combine the queries? 6.300. Once you run the combined query.1. • Which operator will you use to combine the queries? 2. The table appears like this: 5.000. Edit the query and update the data in the table so that it shows all Store names that have had Sales revenue of at least $3. The table should appear like this: 3.000.

Save the document as Act_Combinedqueries_Opt.The table should appear like this: 7. Which of the previous results could you also achieve using multiple query filters? 8. Working with Advanced Query Techniques—Learner’s Guide 15 .

Like combined queries. you will be able to: • Describe subqueries • Create a subquery Understanding subqueries Subqueries are used in cases where the results of the main query are dependent upon the results of the inner query.Using subqueries A subquery. as its name suggests. The operator you include in the query filter determines the relationship between the data sets returned by the inner and outer queries. Suppose that you have been asked by the Manager of the Chicago 33rd store of the eFashion Group to produce a report that lists stores and their revenue whenever those stores' revenue are higher than Chicago 33rd. 16 Web Intelligence Advanced Report Design—Learner’s Guide . • The query filter for the report involves a value that will change over time. This means that the inner query must be processed first so that the result set can be passed on the main query. which returns a set of data that is used as the basis for a second. subqueries are always built in the Query panel. Typically you use subqueries when: • The value of the operand is unknown. is a query within a query. Creating a subquery Now you will explore how and when to use subqueries. After completing this unit. outer (or main) query. You construct a subquery by placing a query filter on one of the objects in the main query and then using the operand for that query filter to launch the subquery. It contains an inner query.

Select the object that you want to filter with a subquery. and it will change over time. 3. Click Add a subquery. and then. you cannot enter a hard-coded figure for the sales revenue because the user would never be able to refresh the report and get accurate results. using the Add a subquery button. the report returns the results for the Chicago 33rd store. 2. By default the object you selected appears as the Filter object and Filter By object. drag an object to the To filter the query. To resolve this problem.. as well as results for all the other stores with equal or greater sales revenue. To build a subquery 1.To produce the requested report. Since the revenue of the Chicago 33rd store changes over time. To add a WHERE condition to the subquery. area. complete the subquery by dragging the Store name dimension just below the subquery filter definition. The subquery outline appears in the Query Filters pane. 4. By default.. change the operand in the subquery to Greater than or Equal to. you need to resolve an issue regarding the query filter. you can use a subquery. Working with Advanced Query Techniques—Learner’s Guide 17 . Begin by creating a query using the Store name and Sales revenue objects. the Sales revenue object appears in the subquery definition in the Query Filters pane. and use this syntax: Store name Equal to e-Fashion Chicago 33rd When you run the query. Then. The Add a subquery button appears in the toolbar for the Query Filters pane. Since you want your report to display the results for all stores with sales revenue greater than or equal to the Chicago 33rd location. Add the objects that you want to appear in the query to the Result Objects pane. The query filter for the report involves a value that is not known prior to the query being made. create a subquery.

Click Subquery to add an additional subquery to the query filter... 1. In addition to linking subqueries in AND or OR relationships. Save the document as Act_Subqueries. area. Select the operator and values used to filter the object in the WHERE condition. return those lines with a higher Margin than the Sweaters line. To copy rather than move the subquery to the WHERE condition. hold down the Control key while dragging and dropping. To copy rather than move the existing filter to the WHERE condition. In this case the inner subquery becomes part of the WHERE condition of the outer subquery.5. you can nest them (create subqueries within subqueries) by dragging an existing subquery to the To filter the query. 2. You also need to display a title. Using the eFashion universe. In this case the existing filter remains in its initial place and becomes part of the WHERE condition of the subquery. hold down the Ctrl key while dragging and dropping. drag and drop the existing filter or subquery to the To filter the query. To do so. You can use a standard query filter as a WHERE condition in a subquery. 3. 18 Web Intelligence Advanced Report Design—Learner’s Guide . By default the two subqueries are linked in an AND relationship. Using the subquery technique. and becomes part of the WHERE clause of the first. Instructions You have been asked by the Manager of the Colorado Springs store of the eFashion Group to produce a report that lists product lines and their Margin. 6.. create a new document and build a query using Line and Margin. In this case the second subquery remains at the same level as the first. Activity: Using subqueries Objective • Create a subquery using the results of one query as the starting point for a second query. area. Click the AND operator to toggle between AND and OR. 4. when the lines' Margin is higher than that of the Sweaters line..

The report should look like this: Working with Advanced Query Techniques—Learner’s Guide 19 .

20 Web Intelligence Advanced Report Design—Learner’s Guide . Year. but that this time displays sales revenue broken down by store and year. Suppose that you are asked to create a report for eFashion that displays state. you place the State. Consequently. and replace it with the Store name object. duplicating your query can accelerate the process. using the required prompt. To create the query. you can duplicate the first query. you save time with complex reports and can ensure that different queries are defined in exactly the same way. it produces the results you require. year. especially when the queries have some of the objects in common. Next. After completing this unit. The report must use a prompted query filter to allow users to select the state for which to return the results. suppose that you are asked to generate another report that prompts for state. To save yourself the effort of creating an entirely new query to generate the second report. and sales revenue. you will be able to: • Duplicate a query in a document to build another query. and place the State object in the Query Filters pane. When you run the new query. delete the State object in the Result Objects pane. where in the first query you used the State object. you must use the Store name object in the Result Objects pane. and Sales revenue objects in the Result Objects pane of the Query panel. Duplicating queries When you build a report with many queries based on the same universe.Creating a query based on another query Web Intelligence allows you to create a query based on the structure of another query. rather than by state and year. The query you need to create this report is almost identical to that required for the previous report. The only difference is that in the second query.

Select Duplicate Query. and its tab is labeled <query name> (1). Select the query you want to duplicate by right-clicking the appropriate Query tab at the bottom of the Query panel. 2. A duplicate query appears in the Query panel. You can now modify the query. Working with Advanced Query Techniques—Learner’s Guide 21 .To duplicate a query 1.

The Marketing universe uses objects for companies. an organization has a Marketing universe and a Sales universe based on the Sales database. The Query panel displays. change the universe from Marketing to Sales. With appropriate access to the Sales universe. contacts. click the Edit Query button. • You change between different universes covering different functional areas but based on the same database. The Marketing managers want to know how many contacts established during a promotional campaign actually led to sales within the six months following the campaign. and promotional efforts. leads. the managers can take a query that retrieves the companies and contacts that participated in the campaign. The Sales universe uses objects for companies. you can change the test universe stores to the production universe eFashion. sales orders. From your document in the Web Intelligence Rich Client main window. After completing this unit. 22 Web Intelligence Advanced Report Design—Learner’s Guide . contacts. For example. you will be able to: • Change the data source for a document • Map the objects to the new data source About changing data sources With the Web Intelligence query interface. and sales revenue. you can change the data source for your query when required. This is particularly useful when: • You move a test universe into production and want to use the same documents on the new universe.Changing data sources Web Intelligence allows you to change the data source used to create a document: • From one universe to another universe • From a local data source to a universe You cannot change data sources from a universe to a local data source. add the Sales Revenue object from the Sales universe to the query and filter to retrieve data for the six-month period following the campaign. To change the data source 1. For example.

next to the Source file field. For a document built on a universe. The Choose File dialog box displays for you to browse to a new local data source. browse to select the local data source and click the Open button. click the Properties tab. The Change Source dialog box displays to show you how the objects from the query on the original data source map to objects in the new data source. the data source appears in the Query Properties section of the left-hand panel. 2. The first column shows the object Working with Advanced Query Techniques—Learner’s Guide 23 . • In the Choose File dialog box. click the … (ellipsis) button. The Universe field appears on the Properties tab. click the … (ellipsis) button. The Universe dialog box displays with a list of the universes that you can use to replace the current one. next to the Universe field. • For a document built on a local data provider. click to select the universe and click the OK button. To change the data source: • For a document built on a universe. 3. To select the new data source: • In the Universe dialog box.For a document built on a local data source.

and the second column shows the object in the new data source. • The check mark to the left of the object names indicates that the object is mapped to another object in the new data source. or the target object. 24 Web Intelligence Advanced Report Design—Learner’s Guide . • The X to the left of the object name indicates that the object is removed from the query on the new data source.. Optionally. • The check mark to the left of the object names indicates that the object is mapped to another object in the new data source.from the original query. Web Intelligence proposes mapping to objects based on the object name and data type. to modify the proposed mapping or removal of an object. • The X to the left of the object name indicates that the object is removed from the query on the new data source. click the . 4. (ellipsis) button on the line corresponding to the object for which you want to modify the mapping.. or the source object.

The Result Objects pane shows the objects for the new data source. 9. 5. 6. Repeat steps 5 and 6 for each object with a proposed mapping or removal that you want to change. you change the data source from the development universe (stores) to the production universe (eFashion). 7. Save the document. Click Run Query. select the Remove object option . Activity: Changing the data source Objective • In this activity. In the Map Object dialog box: • To remove the object. the Universe field shows the new data source. • To map to a new object. The results of the query on the new data source display in the Web Intelligence Rich Client main window. in the Properties tab.The Map Object dialog box displays. Working with Advanced Query Techniques—Learner’s Guide 25 . 8. Click OK to close the Change Source dialog box. In the Query panel. select the Select a new object option and click the object from the new data source displayed in the Map Object dialog box. Click OK to close the Map Object dialog box.

26 Web Intelligence Advanced Report Design—Learner’s Guide . open the Sales per Region. To achieve the desired results. From the course resources. The report looks like this: 2.Instructions 1.wid document. Change the data source to the eFashion universe and map the objects as appropriate. remove one object from the query and map another object to a corresponding object in the new universe that has a different name. This document was created using the stores universe.

The report looks like this: Working with Advanced Query Techniques—Learner’s Guide 27 .

Which subquery operand type means that Web Intelligence will look for only one instance of a value from the subquery that meets the query filter? ○ a. what can you choose to do to the objects in the original query? 28 Web Intelligence Advanced Report Design—Learner’s Guide . If you were to use the MINUS operator to combine queries. what would be the result? 5. ANY 8. What are the three types of query techniques used in this lesson? 2. 6. what would be the result? 4. When you change a data source.Quiz: Advanced Query Techniques 1. Can you do a subquery and return exactly the same results as a combined query? 7. If you were to use the INTERSECTION operator to combine queries. ALL ○ b. List two reasons why you might want to use combined queries. Why would you choose to do a combined query rather than a subquery? 9. If you were to use the UNION operator to combine queries. what would be the result? 3.

you are now able to: • • • • Use combined queries Use subqueries Create a query based on another query Change data sources Working with Advanced Query Techniques—Learner’s Guide 29 .Lesson summary After completing this lesson.

30 Web Intelligence Advanced Report Design—Learner’s Guide .

.

Web Intelligence determines the result of a measure when it is projected in the report based on the dimension(s) in the part of the report where the measure is inserted (for example. you will be able to: • Understand calculation contexts • Redefine calculation contexts Working with Calculation Contexts—Learner’s Guide 31 . This lesson demonstrates how to use various operators and keywords to define and redefine contexts in your calculations. in columns of a table). When you understand the default behavior of contexts. After completing this lesson. you can also understand how to manipulate the contexts and force a report to display data in the manner you specify regardless of the other objects projected. These dimensions make up what is called the calculation context of the measure object or variable.Lesson 3 Working with Calculation Contexts Lesson introduction This lesson provides information on how Web Intelligence performs calculations in reports. By default.

Understanding calculation contexts This unit introduces key concepts of calculation contexts in Web Intelligence. as shown in the second table. measures are calculated dynamically based on the dimensions with which they appear. the measures will be aggregated to the Year level. For instance. If you added State to the beginning of the table then the Sales revenue would be aggregated by year for each state. For this reason. as shown in the first table. if you create a table showing Year and Sales revenue. 32 Web Intelligence Advanced Report Design—Learner’s Guide . by default. performs calculations at the row level and at the lowest level dimension available in your block. Calculation context is the way that Web Intelligence dynamically calculates values projected in a report by measure objects or variables. the projected values of the measures are aggregated to the level of the dimensions displayed in the block. In a Web Intelligence document. when objects are placed in a block. it is important to understand that Web Intelligence. as opposed to the level of the values as stored in the data provider. you will be able to: • Explain how Web Intelligence calculates data dynamically • Explain the impact of input and output contexts on how data is calculated • Explain how you can use extended syntax to change the default calculation context Dynamic calculations By default. After completing this unit.

so the cell displays the sales revenue grand total. Web Intelligence automatically recalculates the sales revenue data according to the new context (State. You can see in this example that sales revenue is calculated at the row level. In this example. In Web Intelligence. Beside the section heading is a cell displaying sales revenue at the state level. in this case). the calculation context is the whole report.When you remove a dimension from the table (Year. Notice that the sales revenue value at the state level matches the sum of sales revenue results for all of the stores in the state. this row level calculation is the default calculation context for any measure object or variable placed in a column. the report is sectioned by state. If you set a section on a report. Similarly. as in the third table in the diagram. Working with Calculation Contexts—Learner’s Guide 33 . in this case). any measures inserted at the section level are calculated by default using the section as the calculation context. if you insert a sales revenue cell beside the report title.

Such functionality is required if you are going to create percentage calculations across sectioned reports. • The position of the measure within the body of the report can also control the aggregation level.These examples demonstrate the first way of controlling a calculation. The second way of controlling a calculation is to force a level of aggregation other than the default. For example. where the level of aggregation is affected by the environment of the report: • The projected values of a measure are aggregated to the level of the dimensions displayed in the block. If a report is sectioned and you place a measure at the section level of the report. the projected value of the measure will be aggregated at the dimension level on which the section is based. The remainder of this lesson demonstrates how to force the level of aggregation for measure values when you project the values in a report. you can place a variable or a formula in a table. 34 Web Intelligence Advanced Report Design—Learner’s Guide . but force it to aggregate to the sum of all values for the table.

• Input context consists of any dimension objects that need to be included directly IN the calculation itself. the output context determines at what aggregation level the calculation is displayed (for example. It also provides examples of the logic to apply when you redefine the input or output contexts. This calculation does not specify an output context. Working with Calculation Contexts—Learner’s Guide 35 . a master variable in a section).Redefining calculation contexts This unit provides reasons why you might choose to redefine the input or output contexts of measures in your report. or in other words. so Web Intelligence assumes the default context and uses the dimensions with which the measure appears. • Output context consists of one or more dimension objects that determine where the calculation is placed in the report. the level where the calculation is to be turned OUT in the report. After completing this unit. so the input context is the sum of the values returned by the measure object Sales revenue. In fact. you will be able to: • • • • Explain the impact of input and output contexts on how measures are calculated Define the input context in order to change the level of aggregation Define the output context in order to change the level of aggregation Use the In context operator with Where to redefine a calculation context Input and output contexts Input and output contexts must be added to a calculation if you want the context of the calculation to be something other than the default context. Consider the simple calculation shown here: = Sum([Sales revenue]) There are no dimension objects in the calculation itself. These examples show how to use both extended syntax context operators and keywords.

This is referred to as the input calculation context. Since you don't want your final report to contain a Year column. You cannot show data at the city level if the query does not include this object in the data provider. so the top entry in the Sales revenue column is what you would like to create a variable to identify. Suppose that you want to create an eFashion report that displays each state. Note: It's important to understand that you can only set the context to a level that exists within the data provider of the document. For example. you can now insert a new table that contains only the State and Sales revenue objects. it assumes the context of State. and the best revenue ever achieved in any one year. the City object must exist in the data provider. but are contained within the data provider. To understand how to create a variable that returns the best revenue achieved in any one year by state. grouped by state. Forcing the input calculation context You have seen how to use the default calculation context.As no output context is specified for the Sum calculation. you would want to use this when the calculation needs to take into account specified dimensions that may not appear in the report. 36 Web Intelligence Advanced Report Design—Learner’s Guide . The Sales revenue column is sorted in descending order. its total revenue. You can determine what dimensions will be taken into account when calculating the aggregate for the formula. it helps to begin by looking at a report that shows sales revenue by year. Typically. if you wanted to change the default context to calculate sales revenue at the city level.

you might create a variable called State's best year amount. and the result is the exact same calculation that the Sales revenue object projects. you get this result: If you compare the state's best year revenue shown in the first block with the data calculated by the variable you have just created. at the row level. using this syntax: =max([Sales revenue]) If you add the new variable to the table. is obviously not the correct context. the available operators are: • ForEach • In Working with Calculation Contexts—Learner’s Guide 37 . As your first attempt.it uses State as the context to calculate the values. you can see that the default behavior of the calculation. By default.Now you just need to create a variable that returns the state's best year amount and insert it in the new table. Web Intelligence does not know that the Year object needs to be included in the context of the calculation . The syntax for specifying input and output context is: Aggregate function([Measure] input_context) output_context To extend the syntax. extend the syntax to specify the correct input and output context so that Web Intelligence knows how to calculate the data correctly. Now.

[State])) The report looks like this: 38 Web Intelligence Advanced Report Design—Learner’s Guide . it does not include State. the In operator only takes into account dimensions in the formula's dimension list. Now you can modify the variable to use this formula: =max([Sales revenue] In([Year] . In an input calculation context. Even though the table includes a State column.The key syntactic difference between an input and an output context is where the operator is placed. and you would normally expect the data to aggregate to the state level. the operator is placed within the brackets of the aggregate: Syntax: Aggregate(measure FOREACH (dimension list)) For example: =Max([Sales revenue] ForEach ([Year])) Or Syntax: Aggregate(measure IN (dimensionlist)) For example: =Max([Sales revenue] In ([Year])) Suppose that you modify the State's best year amount variable to use this formula: =Max([Sales revenue] In ([Year])) The report now looks like this: This formula does not work because although it includes Year in the calculation context.

By default. the ForEach operator takes into account all the dimensions in the table. Specifies limiting conditions on the data. so you can achieve the same result using this formula: =max([Sales revenue] ForEach ([Year])) About the extended syntax operators and keywords The extended syntax available to redefine the calculation context of measures includes: • Extended projection context operators. and Body. and ForAll. Unlike the In operator. Removes dimensions from the context. It is often easier to "add" or "subtract" from the context using ForAll and ForEach than it is to specify the list explicitly using In. ForEach. Break.This formula achieves the desired result. Block. including In. You can create an alternate formula for the variable by using the ForEach operator instead of In. Where ForEach ForAll The ForAll and ForEach operators are useful when you have a default context with many dimensions. Working with Calculation Contexts—Learner’s Guide 39 . These keywords are used in formulas in conjunction with the In context operator. Web Intelligence takes [state] as the output context. including Report. The context operators that are available to redefine the calculation context of measures include: Operator Definition In Used to specify dimensions explicitly. • Extended environment keywords. Also used with extended syntax keywords. Adds dimensions to the context. Section.

Report. Block. If you create an Average variable using the same syntax Web Intelligence used to calculate the average for all stores. and Body are useful in defining calculation context. It returns a correct average of revenue earned by stores because no other specific context was defined. You begin with this report: Now you want to create a formula that returns the average sales revenue. Section. you considered how you wanted the measure to aggregate based on the dimensions available in the table and the data provider. the default context in the table footer calculates only the values retained by the filter. allow you to change the default context from the row level to another level in the document. These keywords. Note: If a report filter is applied to the table. and add a new Average column to the table. You can also determine the level of aggregation at which the value for the variable is displayed in the report. The calculation used the default context of the table footer.Forcing the output calculation context In the previous examples. which contains calculations based only on data that resides in the block (the table. in this case). Suppose that you want to create a report that contains an alerter which highlights any store whose revenue for the year 2006 is lower than the average revenue of all stores in 2006. The extended syntax keywords. you considered the input calculation contexts. If you click on the Average value in the footer at the bottom of the table and look in the Formula toolbar. you see that the footer uses this calculation: =Average([Sales revenue]) This calculation is generic. That is. Break. so you can use the variable in your alerter. you get this result: 40 Web Intelligence Advanced Report Design—Learner’s Guide . it has no input or output context specified. used in conjunction with the In operator.

while the In operator aggregates at the report environment level. the formula calculation is aggregated at the specified level regardless of which dimensions or variables are used in the report. the report looks like this: Working with Calculation Contexts—Learner’s Guide 41 .The Average variable appears in the table. When the formula =Average([Sales revenue]) is placed in: • The footer: the context is to calculate for the entire table. the alerter will not work since the Sales revenue values are currently equal to the Average values. To solve this. at the body. you can use either the ForAll or the In Block operators. using the following syntax: Aggregate(measure) ForAll(dimensionlist)) For example: =Average([Sales revenue]) ForAll ([Store name].[Year]) Or Syntax: Aggregate(measure) In Block For example: =Average([Sales revenue]) In Block The difference between the two is that the ForAll operator only aggregates the measure for the dimensions in the dimension list. If you update the Average formula to use the =Average([Sales revenue]) In Block formula. that is. If you try to build an alerter to highlight values in the Sales revenue column that are below the average. block or report level. The key difference is that when you use the In operator. but the values are now calculated at the row level rather than at the whole table level. Why is this happening? The default calculation context has changed. • The table: the context is to calculate for each individual row.

By leaving the input context to assume the default. even though the calculation was placed at the row level. Now that the Average variable uses the correct formula. Why is there no input context? No input context is needed since the calculation needs to find the average based on the entire table. you are specifying that the calculation should be displayed at the block (whole table) level. If you apply this alerter to the Store name column in the report. you can create the alerter to highlight below average results per store.Why use this syntax? By adding In Block as the output context. you get the results you require: 42 Web Intelligence Advanced Report Design—Learner’s Guide . and remove the Average column. you ensure that no additional objects are considered when the average is calculated.

The projected value of the measure is aggregated for all dimensions at the level in the report that it is placed. Section. and Body. output calculation contexts In summary. an output calculation will suffice. Block. Break. Environment Level Effect Report The projected value of the measure is aggregated for all dimensions contained within the page of the report. The projected value of the measure is aggregated for all dimensions contained within the break of the table. The projected value of the measure is aggregated across all values for dimensions contained within the block. Working with Calculation Contexts—Learner’s Guide 43 . The projected value of the measure is aggregated for all dimensions contained within the section of the report. unless you need the aggregate of a measure to take into account a dimension that is in the data provider but not in the table.More about the extended syntax keywords The following keywords can be used with the In operator to control how measures are calculated at different levels within the document: Report. Section Break Block Body Input vs.

When specifying an output calculation context, it is normally best to use the In operator as this is more flexible and will not need to be changed if the dimensions of the environment are altered. Conversely, when specifying an input calculation context, it is normally better to use the ForEach operator as it will automatically take into account the dimensions in the block.

Using the In context operator with Where
Two of the most widely-used operators used to specify both input and output contexts are In and Where. Although each operator denotes a different type of calculation environment, the two may be used together in a single variable. The In operator specifies all parameters (dimension objects) that are to be included in the context. When using multiple dimension objects, the dimensions should be listed in order of granularity and must be separated with ";". The Where operator instructs the variable to calculate only where certain values are true. Suppose that you need to produce a report that calculates both the highest sales revenue for all states as well as specific information for California. You start out creating a query including the Year, State, and Sales revenue objects, and remove the State column from the table so that your report looks like this:

44

Web Intelligence Advanced Report Design—Learner’s Guide

Now you can create a Sales revenue By Year for California variable using this syntax:
=[Sales revenue] Where ([State]="California")

This context uses the Where operator to isolate the California state in the calculation. If you replace the Sales revenue column with this new variable, and apply some formatting to the table, it looks like this:

Now you want to create a variable to find the highest revenue for any one state. You can use this syntax:
=Max([Sales revenue] In([State]))

This context uses the In operator to specify input context. This assures that the calculation only addresses the State values when locating a maximum amount. There is no output context defined, so the calculation uses the default output context of the entire report, because it was placed at the report level rather than in a table. Next you can create a Highest annual revenue for California variable using the following syntax:
=Max([Sales revenue] In([State];[Year]) Where([State] ="California"))

This variable definition uses both the In and Where operators to achieve the correct calculation. Both operators were used in defining the input context. • The In operator forces the =Max operator to look in the State values first and then the Year values within each State in order to locate the maximum value. • The Where operator assures that the =Max calculation is only valid where the state is California. Finally, you can create a Sales revenue for California for the 2006 variable using this syntax:
=[Sales revenue] Where([State]="California" And [Year] ="2006")

Like the Sales revenue By Year for California variable, this calculation uses the Where operator in the input context to ensure that the calculation is valid for only those values denoted by the Where operators. It is not necessary to list the components of the calculation in order of granularity when using the Where operator. You must list the components when using the In operator. The following table shows syntax and examples for the Where operator.

Working with Calculation Contexts—Learner’s Guide

45

Operator: Description: Where

Syntax and Examples:

Restricts the data [measure_expression] Where [boolean_expression] used to calculate The formula Average ([Sales Revenue]) Where ([Country] the measure = "US") calculates the average sales where the country is "US". expression. The formula Average ([Sales Revenue]) Where ([Country] = "US" Or [Country] = "France") calculates the average sales where the country is "US" or "France". The formula [Revenue] Where (Not ([Country] Inlist ("US";"France"))) calculates the revenue for the countries other than US and France. The variable [High Revenue] has the formula [Revenue] Where [Revenue> 500000]. When placed in a block, [High Revenue] displays either the revenue when its value is greater than 500000, or nothing. When placed in a footer at the bottom of the [High Revenue] column, the formula Average ([High Revenue]) returns the average of all the revenues greater than 500000.
Note: You can use the boolean operators with the Where operator.

Important facts about calculation contexts
• If you do not define an input or output context, Web Intelligence assumes the default context of where the calculation has been placed. • When using variables as the basis of an alerter (as in the Average example just seen), it is necessary to ensure that the calculation has been created as a variable (that is, a formula with a name), and not as a simple formula. Note: If the calculation is a formula, show the Formula toolbar, then click the Create Variable button in order to save it as a variable. • When using the Where operator, it is necessary to place parentheses around the values listed after the Where , as in the following example:
=[Sales revenue] Where ([Year] = "2004”)

Activity: Calculation contexts
Objective
• Use extended syntax to redefine the calculation context of measures in a Web Intelligence document.

46

Web Intelligence Advanced Report Design—Learner’s Guide

Instructions 1. 2. Working with Calculation Contexts—Learner’s Guide 47 . Save the document as Act_Calculationcontext. Total sales revenue for all stores. 3. Highlight those stores whose revenue was above the average revenue for all stores. Your document should look like this example: Activity: Calculation contexts .Optional Objective • Use extended syntax to redefine a calculation context of measures in a Web Intelligence document. Change the name of the report to Revenue Information for All Stores. Average revenue for all stores. Create a document that shows in a single block: • Sales revenue per Year. Instructions 1. Create a document that shows in a single block: • • • • Sales revenue for each eFashion store. broken down by Store name.

2. Your document should look like this example: 48 Web Intelligence Advanced Report Design—Learner’s Guide .000. • Highlight the store name when this maximum revenue value is greater than $1.000. over the three year period. Save the document as Act_Calculationcontext_2.• The maximum revenue per store.

Which of the following is an extended syntax context operator? ○ NoFilter() ○ ForEach ○ Block 4. What is an input context? 2. What is an output context? 3.Quiz: Calculation Contexts 1. Which of the following is an extended syntax keyword? ○ NoFilter() ○ ForEach ○ Section Working with Calculation Contexts—Learner’s Guide 49 .

Lesson summary After completing this lesson. you are now able to: • Understand calculation contexts • Redefine calculation contexts 50 Web Intelligence Advanced Report Design—Learner’s Guide .

.

you will be able to: • • • • • • • Use character strings Use the Right() function Use the Replace() function Use the SubStr() function Use the Pos() function Concatenate different character strings Use date functions Creating Formulas with Character and Date String Functions—Learner’s Guide 51 . it is well worth the effort as variables can provide you with more flexibility in reporting.1: Report Design course. refer to the BusinessObjects Web Intelligence XI 3. Once you have created a variable.Lesson 4 Creating Formulas with Character and Date String Functions Lesson introduction The ability to create formulas and define them as variables in Web Intelligence offers the report designer a very powerful tool. After completing this lesson. Note: For more information about creating formulas and defining them as variables. you can use it throughout the document to display data that you cannot retrieve by using the existing objects in the universe.0/3. In this lesson. Variables act just like dimension or measure objects. you learn about some of the formula functions available for manipulating character and date variables. While the syntax may take some time to comprehend.

SubStr() is a more powerful function. modify. If in doubt.used to identify the position of a character in a string Replace() . A dimension object can be of character. Right(). but the reverse is not true. if you want to display the result as a column in a report block. or remove either all or part of a character string. date. then creating a formula is best. If you want to use the formula repeatedly in different blocks or different reports in the document. 52 Web Intelligence Advanced Report Design—Learner’s Guide . Using Web Intelligence character-string functions. Using functions in formulas and variables You use the functions presented in this lesson when you are creating a formula. as there are certain things that cannot be done with a formula that can be done with a variable. you can define the formula as a variable.used to extract a given number of characters from the right • Replace() . You will use the SubStr() function to extract strings where the length and position are not consistent.Using character strings A character string is a series of characters that form either a piece of text or the individual values of a character-type variable. then defining the formula as a variable is best. or if you want to identify the formula as though it were an object in the document. or numeric type. you will be able to: • Describe the character-string functions presented in this lesson About character-string functions The character-string functions presented in this lesson are: • Right() . you can replace. and Left() are only useful when you want to manipulate a constant string or a constant number of characters. If you only want to display the calculated value in a single cell. always create a variable rather than a formula. You can create a formula by typing it in the Formula bar or in the Formula Editor . You can also drag and drop objects in the Formula bar and then complete the formula by typing in the Formula bar.used to extract a given number of characters from the left • SubStr() .used to identify the length of a string • Pos() . They are always categorized as dimension objects. Either method calculates the data and displays the resulting values in the column that you have highlighted in the block.used to replace a specified string with another string • Left() . However. After completing this unit.used to extract a string from within a string using variable length and position • Length() .

2) where: Creating Formulas with Character and Date String Functions—Learner’s Guide 53 . To do this. After completing this unit. 04). 2004). The syntax for the Right() function is: string Right(string input_string. Create a new variable called Years. number_of_characters sets the number of characters to display from the right of the input string.Using the Right() function The Right() function displays a fixed number of characters starting from the right end of the character string and removes the others. you need to display the year in two-digit format (for example. you can use the Right() character string function to remove the first two digits and display the last two. using this syntax: =Right([Year] . integer number_of_characters) input_string refers to the string from which you want to select characters to display. However. you will be able to: • Use the Right() function to display selected characters from a character string How to extract characters using the Right() function Suppose that you are working with this report: The Year object in the eFashion universe is formatted to return the year as a four-digit number (for example.

2) where: Syntax NameOf([Year]( Description To display the name of the Year object.Syntax [Year] Description The name of the object that retrieves the data. To concatenate and display two characters starting from the right end of the character string. The number of characters to display from the right of the character string. you can modify the Years formula to use this syntax: =NameOf ([Year]) + " " + Right([Year] . +” “ + Right ([Year]) . When you drop the Years variable in the section header block. the report looks like this: To further clarify the section header. 2 ) The report looks like this: 54 Web Intelligence Advanced Report Design—Learner’s Guide . 2 Note: The Left character string function works in exactly the same way except that the function displays the specified number of characters starting from the left. To concatenate a space after the object name.

Creating Formulas with Character and Date String Functions—Learner’s Guide 55 .

You can create a variable using the Replace() function to modify the character string displayed in the report using this formula: =Replace([Quarter] . string_to_replace The string within input_string to be replaced. After completing this unit. “Quarter ”) where: Syntax Description [Quarter] The name of the object that retrieves the data.Using the Replace() function The Replace() function replaces a specified string with another string. “Q” . string replace_string) input_string The input string. The syntax for the replace function is: string Replace(string input_string. replace_string The string to replace string_to_replace with. string string_to_replace. you will be able to: • Use the Replace() function to replace “Q” with the word “Quarter” Replacing a string Suppose that you need to report on quarterly revenue using the word Quarter instead of Q in the report. 56 Web Intelligence Advanced Report Design—Learner’s Guide .

The character string that will replace “Q” in every instance. “Quarter ” If you replace the Quarter column with the new variable you created. you get this result: Creating Formulas with Character and Date String Functions—Learner’s Guide 57 . Note: Be sure to add a space after the word Quarter and before the end-quote. followed by 1 through 4 to indicate the first through fourth quarters of the year.Syntax Description “Q” The value stored in the database.

After completing this unit. with or without the "e-Fashion" portion. Create a variable called Store. 11 . start is the position of the first character in the input string to be extracted (for example. Neither the Right() or Left() functions will work here. you will be able to: • Use the SubStr() function to extract a character string from within a string How to extract characters using the SubStr() function The Store name object in the eFashion universe returns the name of each store in the company. The syntax for the SubStr() function is: string Substr(string input_string. This presents a challenge since the length of each store's name is different. integer start. length is the number of characters (from the initial position forward) to be extracted. Suppose that you want to remove the e-Fashion portion of the character string. The easiest way to achieve the removal is to use the SubStr() function. and use this syntax: =SubStr([Store name] .Using the SubStr() function The SubStr() function extracts a specified character string from within a string. This was established by counting the number of characters in "e-Fashion" (9) and then adding a 58 Web Intelligence Advanced Report Design—Learner’s Guide . Length([Store name])) Why? • "11" represents the starting point at which the formula is to start displaying characters. 1). but prefaces each one with "e-Fashion". integer length) input string is the string from which the substring is to be extracted.

Therefore you want the starting point to be character 11.character to account for the space between the word "e-Fashion" and each store name (10). If you replace the Store name column with the Store column. • The Length() function returns the length of the original store name. including the “e-Fashion” part of the name. Note: Don’t forget that the beginning number in the SubStr() function is the beginning character position that you want the substring to start displaying characters. not those you want to remove. Character positions identified in the SubStr() syntax are those you want to see displayed. the report looks like this: Creating Formulas with Character and Date String Functions—Learner’s Guide 59 .

Create a variable called Space. Notice that in each address there is a space after the building number. " ") 60 Web Intelligence Advanced Report Design—Learner’s Guide . string pattern) input_string defines the string to be searched for the occurrence of a character and it's position in the string. you must create a substring to return only the portion of the address that is needed. The Address object from the universe returns both the building number and the street name. pattern is the character string you wish to search for. and the number of spaces before the street name begins is inconsistent. After completing this unit. using this syntax: Syntax: =Pos([Address] . you will be able to: • Use the Pos() function to return the position of a specific character string How to use the Pos() function Suppose that you are working on a report containing these columns: In the address column. you want to display only the street names for each of the eFashion stores. If you can create a formula that recognizes at what position the space lies for each value. The syntax for this function is: integer Pos(string input_string. you can use that position as a starting point for the SubStr() function.Using the Pos() function The Pos() function identifies the first instance of a unique character and returns the number of characters from the start of a string to that instance of the character. Therefore.

Length([Address])) Why? • The Space variable sits at the 'beginning number' slot of the SubStr() function's syntax. If you delete the Space column from the report. [Space]+1 . • The Length() function instructs the system that the number of characters to be displayed from each Address string is equal to the length of each address after the character (a space in this case) in the beginning number position. Now you can create a new variable called Store Address. • The +1 tells the function to begin the substring at one position more than the location of the space so that the space is not returned. If you add a Space column to the report. Use this syntax: =SubStr([Address] . that removes the building number from the address string. and replace the Address column with the Store Address variable you just created. It contains the variable name and the text pattern you want to locate (a space in this case). you get the result you require: Creating Formulas with Character and Date String Functions—Learner’s Guide 61 . you get this result: The integer returned by the Space variable corresponds to the number of characters before the street address begins.This variable locates the first space within each address string.

Now you want to display the date using a character string as well. was last refreshed. If you insert the Last Refresh Date free-standing cell into a report and view the formula in the Formula Editor. The Last Refresh Date cell now looks like this: Formatting a date that is concatenated with a string You have seen how to concatenate a date with a string. is the plus symbol "+". You must enclose the name of the data provider in square brackets. or concatenate data. If your report has one data provider only. you can omit the [data_provider] parameter. you will be able to: • Combine two strings in a formula using the concatenate function • Format a date when it is concatenated with a string How to concatenate a string with a date To explore concatenating different data types.Concatenating different character strings The character used to link two strings together in a formula. The Last Refresh Date free-standing cell displays the date and time that the document was last executed: The syntax for the formula of the cell is: date LastExecutionDate(string data_provider) Note: This formula returns the date on which a data provider. you see this: =LastExecutionDate() To insert a descriptive string prior to the date. 62 Web Intelligence Advanced Report Design—Learner’s Guide . consider combining a string value with the Last Refresh Date free-standing cell formula. The syntax is: "String1” + "String2” Note: You can concatenate as many strings together as you like. After completing this unit. you can modify the formula like this: ="Last Execution Date: "+LastExecutionDate() This formula concatenates the "Last Execution Date" character string with the LastExecutionDate() function. or query.

yyyy") The date now displays like this: Creating Formulas with Character and Date String Functions—Learner’s Guide 63 . The syntax for this function is: string FormatDate(date date_to_format. if you modify the Last Refresh Date formula to use the FormatDate() function. you use the FormatDate() function. now that you have edited the formula to add a character string. "Mmmm dd. you could right-click the cell and select the Format Number item from the drop-down menu. you can no longer use the standard formatting method. using this syntax: ="Last Execution Date: " + FormatDate(LastExecutionDate() . string date_format) For example: FormatDate([Start Date] ."dd/MM/yyyy") For example.Normally. To format a date so that it is displayed as a string when it is concatenated with another string. Then you would select the date format of your choice from the Date/Time zone of the Number Format dialog box. if you had not included the character string Last Execution Date in the formula. However.

Note: To convert a number to a string you can use the Format number() function. string number_format) 64 Web Intelligence Advanced Report Design—Learner’s Guide . The syntax for this function is: string Format number(number number_to_format.

Note: The values returned by the Opening Date object are displayed in the format "MM/dd/yy hh:mm:ss AM.Using date functions The three most commonly used date functions are: • ToDate: changes the data type of a value to date • CurrentDate: gives the date today • DaysBetween: calculates the number of days between two dates In this unit. Creating Formulas with Character and Date String Functions—Learner’s Guide 65 . After completing this unit. If you right-click the Opening Date object in the Data tab. there is no object for number of years trading. you will be able to: • Use date functions to create a variable • Convert a character string to a date value Converting a string to a date value In the eFashion universe. you see that it is a string. based on the date the stores opened." Suppose that you want to create a variable that calculates the number of years that stores have been trading. you will consider the process of converting a string to a date as dates are often formatted as character type at either the database or universe level. You will use all of these date functions to create a variable named Trading Years. The universe only has the Opening Date dimension object.

The syntax of the DaysBetween() function is: integer DaysBetween(date first_date. last_date The most recent date. Then you will be able to perform a date calculation to determine the difference between today's date and the opening date. if the order of the dates in the string is Month/Day. Pos([Opening date] . 66 Web Intelligence Advanced Report Design—Learner’s Guide . 1 . date last_date) first_date The oldest date. then the date must be formatted the same way. Since the date is always followed by a space you can use the Pos() function to define the number of character elements of the Substr() syntax. You can use the Substr() function to strip out the time element of the string.Before you can calculate the trading years you need to strip out the time element of the string and then convert it to a date type. However." ")-1) Then you can create another variable called Open_Date to convert the Date_ Substring values to date type using this formula. For instance. "MM/dd/yy") Note: The date must be formatted in the same way as the string that is being converted. the column looks like this: Using date calculations Now that you have created a date type variable for the store opening date. you can calculate the number of days to the current date using the CurrentDate() and DaysBetween() functions. You can create a variable called Date_Substring based on this formula: =SubStr([Opening date] . some days and months are expressed as single digits while others are two digits). the date element is not in a constant format (for example. If you replace the Opening Date column in the report with the Open_Date variable. then the formula must use that format as well. =ToDate([Date_Substring] . If the order of the dates in the string is Day/Month however.

the date calculation is divided by 365. Hence. you must divide by the number of days in a year and in so doing take account of leap years. Instructions Create a report showing the year that each eFashion store opened. you achieve the required result: Activity: Character and date string functions Objective • Use the SubStr() functions in conjunction with the Length() function to do high-level string formatting.25 Note: To convert the days to years. CurrentDate())/365. Creating Formulas with Character and Date String Functions—Learner’s Guide 67 . Using the Opening Date object as the basis for the formulas. not the exact date and time. If you replace the Open_Date column with the Trading_Years variable you just created. 1.You can create a variable called Trading_Years using this formula: =DaysBetween([Open_Date] .25 days. create new variables so that the final report displays simply the year that each store opened. Create a report using the eFashion universe and select the following objects: Opening Date and Store name 2.

1. not a date. 3. Instructions Create a report showing the margin performance across all eFashion stores. There is a lot of repetition in the Store name column. 4. Sales Revenue. 3. Margin 2. Save the report as Act_YearOpened. Create a variable called Store to remove the eFashion from the Store name. Apply a sum to all measures.Your report appears like this: Note: The Year opened object is formatted as a number. Create a report using the eFashion universe and select the following objects: State. Store name. Save the report as Act_characterdatestring.2 Objective • Use the SubStr() function in conjunction with the Length() function to do high-level string formatting. Activity: Character and date string functions . 68 Web Intelligence Advanced Report Design—Learner’s Guide . so you must format the number to display without a comma to achieve the desired result. Quantity Sold.

based on the date the stores opened. The universe only has the Opening Date dimension object.Your report appears like this: Converting a string to a date value In the eFashion universe." Suppose that you want to create a variable that calculates the number of years that stores have been trading. If you right-click the Opening Date object in the Data tab. Note: The values returned by the Opening Date object are displayed in the format "MM/dd/yy hh:mm:ss AM. there is no object for number of years trading. Creating Formulas with Character and Date String Functions—Learner’s Guide 69 . you see that it is a string.

You can use the Substr() function to strip out the time element of the string. then the formula must use that format as well. Pos([Opening date] . "MM/dd/yy") Note: The date must be formatted in the same way as the string that is being converted. If you replace the Opening Date column in the report with the Open_Date variable. if the order of the dates in the string is Month/Day." ")-1) Then you can create another variable called Open_Date to convert the Date_ Substring values to date type using this formula. the column looks like this: 70 Web Intelligence Advanced Report Design—Learner’s Guide . the date element is not in a constant format (for example. Then you will be able to perform a date calculation to determine the difference between today's date and the opening date. then the date must be formatted the same way. If the order of the dates in the string is Day/Month however. 1 . =ToDate([Date_Substring] . some days and months are expressed as single digits while others are two digits). Since the date is always followed by a space you can use the Pos() function to define the number of character elements of the Substr() syntax. For instance. However.Before you can calculate the trading years you need to strip out the time element of the string and then convert it to a date type. You can create a variable called Date_Substring based on this formula: =SubStr([Opening date] .

6.Quiz: Character and Date String Functions 1. When would you choose to use the Length() function? 5. To find the occurrence of a comma in an object’s value. 2. Name at least three character string functions used in this lesson. If you want to create a formula to return the number of years between two dates. which function would you use? 3. what would the syntax be? 7. Give an example of string concatenation. What is the syntax for the Replace() function? 4. Can you do calculations on a date? Creating Formulas with Character and Date String Functions—Learner’s Guide 71 .

Lesson summary After completing this lesson. you are now able to: • • • • • • • Use character strings Use the Right() function Use the Replace() function Use the SubStr() function Use the Pos() function Concatenate different character strings Use date functions 72 Web Intelligence Advanced Report Design—Learner’s Guide .

.

and to modify the way calculations behave when certain values are returned by an object... After completing this lesson. Else" logic.Lesson 5 Using If Logic Lesson introduction The If() function is a powerful tool available to Web Intelligence report designers. This lesson shows you how to use the If() function logic in two ways: to group values in a variable. Then. you will be able to: • Use If() to group data • Use If() to modify calculation behavior Using If Logic—Learner’s Guide 73 . this function can be used in many different ways to apply custom formulas in a report... Often referred to as "If.

if your reporting requirement is to display the quantity sold measure aggregated at the half year level of detail. 74 Web Intelligence Advanced Report Design—Learner’s Guide . These categories can then be used as the basis for aggregating measures at higher levels of detail. Using the If() in this manner. If() can be used to group some of the values returned by an object and then to define that grouping as a new variable in the document. Case. and If functions available to universe designers at the database level. you will use the If() function to group values returned from the database into categories.Using If() to group data In this unit. you can aggregate quantity sold totals for each half of the year. which allow you to analyze the quantity sold totals for each quarter. then the universe does not provide the objects you need to meet this requirement. By creating a Half Year variable based on the Quarter object. After completing this unit. the eFashion universe contains Quarter and Quantity sold objects. report designers are empowered to perform the report equivalent of the Decode. This data can then be presented in the same report with quantity sold totals for each quarter. you will be able to: • Group values using the If() function • Define the grouping as a new variable in the document Grouping values with the If() function to show higher levels of detail You can use the If() function in Web Intelligence to group values returned by an object into categories. However. For example.

“Q2”) Grouping values with the If() function to show categories Suppose that you need to display revenue totals in both a table and a 3D pie chart aggregated for each of the eFashion Market Types. you could use this syntax: =If([Quarter] InList("Q1". value_if_false is the value returned if the expression returns FALSE. you replace the semicolons in the formula with the words they represent. and Low Performers."Q2").500.x.000 Using If Logic—Learner’s Guide 75 . All the values must appear between the parenthesis that follow the operator. value_if_true is the value returned if the expression returns TRUE. you can also use this syntax with the If() function: If boolean_expr then value_if_true else value_if_false Using this syntax.000. "Year's Second Half") Or this syntax: =If[Quarter] InList("Q1". Each store needs to be assigned to the appropriate category based on the following business rules: Market Type Sales Revenue Top Performers Average Performers Low Performers Greater than 7.000 Between 2.000.500."Q2") Then "Year's First Half" Else "Year's Second Half" Note: You can use the Inlist operator to provide multiple values. The three Market Types are Top Performers. value_if_false) boolean_expr refers to an expression that returns TRUE or FALSE. "Year's First Half". Each value must be in quotes and separated from other values by semicolon. Note: In Web Intelligence XI 3. The syntax used with the If() function is: If (boolean_expr. Either syntax produces the same results. Average Performers. value_if_true.000 Less than 2. the Half Year variable looks at each value for the Quarter object.000 and 7. If the quarter’s returned value is either Q1 or Q2 then the variable displays the words “Year’s First Half” and if the quarter’s value is anything other than Q1 or Q2 then it displays the words “Year’s Second Half”. If you wanted to create the Half Year variable in this example. Example : InList(“Q1” .In this example.

Next. If([Sales revenue]Between(2000000. You can begin by creating a table using the State and Sales revenue objects.7500000) Then "Average Performers" ElseIf[Sales revenue]<2000000 Then "Low Performers" If you add a Market Type e column to the report."Average Performers". apply a break on Market Type."Top Performers" . If([Sales revenue]<2000000. and insert a Sum on the Sales revenue column. you need to create a Market Type dimension variable. you get this result: To insert the chart. using this formula: =If([Sales revenue]>7500000.7500000).You need to display revenue figures including market-type subtotals in the table and market-type revenue breakdowns in the chart."Low Performers"))) Or =If[Sales revenue]>7500000 Then "Top Performers" ElseIf[Sales revenue]Between(2000000. drag the 3D Pie Doughnut template onto the report and insert the Sales revenue measure on the Y-axis and Market Type dimension on the X-axis like this: 76 Web Intelligence Advanced Report Design—Learner’s Guide .

based on the following categories: Using If Logic—Learner’s Guide 77 .The finished report looks like this: Activity: Grouping data Objective • Use the If() function syntax to group data values. Create a new document using the eFashion universe and select the following objects: State and Sales revenue 2. Instructions You want to group states into regions so that you can compare revenue per region. 1. Create a variable called Region and group the states by regions.

Region

State

West

California Colorado Illinois Texas Massachusetts

Central

East

New York DC Florida

3. Insert the Region variable into the table so that its values are projected in a new column in the table. Your report should look like this example:

4. Save the document as Act_Groupdata_1.

Activity: Grouping data - Optional
Objective
• Use the If() function syntax to group data values.

Instructions
You want to group store managers by their degree of experience managing their store. Then, you are going to create a report that shows the sales revenue earned by each manager in each tenure-type category.

78

Web Intelligence Advanced Report Design—Learner’s Guide

It is necessary to create a variable to group the managers into categories, because experience, or tenure type, is not an object that is available in the eFashion universe. 1. Create a new Web Intelligence document using the eFashion universe. 2. Include the Name of manager, State, and Sales revenue objects in the query. 3. Create a variable called Tenure type. 4. Validate the syntax and verify that Web Intelligence has applied the Dimension qualification to the variable. 5. Define the formula to group each store manager into a category, based on the following tenure-type categories:
Tenure type Name of manager

Trainee

Bennett Leonard

Junior

Tuttle Queen Anderson Barrett Larry

Senior

Mark Michelle Quinn Richards Steve

6. Insert the Tenure type variable into the table so that its values are projected in the first column in the table. 7. Format the report so that it is organized in blocks that show the sales revenue earned by the managers in each tenure-type category.

Using If Logic—Learner’s Guide

79

Your report should look like this:

8. Save the document as Act_Groupdata_2.

Activity: Grouping data - Optional 2
Objective
• Use the If() function syntax to group data values.

Instructions
You want to divide products into groups based on Unit Price MSRP ranges to see if there is a relationship between price range and Quantity Sold. 1. Create a new Web Intelligence document using the eFashion universe. 2. Include the SKU Desc, Unit Price MSRP, and Quantity Sold objects in the query. 3. Create a variable called Price Range, using these categories:
Group Price range

High Price

Over $300

80

Web Intelligence Advanced Report Design—Learner’s Guide

Apply a break on Price Range. Apply an Average calculation on the Quantity Sold column.Group Price range Mid Price Low Price Between $150 and $300 Below $150 4. and sort the Price Range column to display the report blocks in this order: High Price. The first block in your report should look similar to this: Using If Logic—Learner’s Guide 81 . Low Price 6. Mid Price. Insert a Price Range column in the table. 5.

Therefore. 82 Web Intelligence Advanced Report Design—Learner’s Guide . Each store has a different target for the percentage of growth to achieve based on the state in which the store is located. the value should be calculated in a different manner. otherwise. you will be able to: • Use the If() function to modify how data is calculated depending on the values returned by an object used in the report Modifying the way calculations behave You can also use the If() function to extend the functionality of calculations so that they behave more dynamically. The syntax for using the If() function to modify the behavior of calculations is: =If([object name]= “true value”. a single calculation will not work. You begin by creating a query including the State. More specifically. report designers can change how a measure behaves based on each value returned for an object. and Sales revenue objects. then the calculation should behave in a certain manner. resulting in this table. Now you need to insert a column that shows the appropriate target revenue for each store. [measure] behavior A . Store name.Using the If() function to modify calculation behavior The If() function is useful for extending the functionality and flexibility of calculations in reports. After completing this unit. Suppose that you want to build a report that calculates the target revenue for each store. [measure] behavior B) Or =If[object name]= “true value” Then [measure] behavior A Else [measure] behavior B In other words: if the value returned by an object is equal to what is specified in quotes. by using the If() function.

05 ElseIf [State]="Colorado" Then [Sales revenue]*1. if you prefer to create the formula using text rather than semicolons: =If[State]="California" Then [Sales revenue]*1.1 ElseIf [State] InList ("DC" . [Sales revenue]*1. If([State]="Colorado" ."Texas ") .18)))) Or. If([State]="Massachusetts" ."New York". [Sales revenue]*1. "Illinois" . and apply the appropriate formatting to the column. "Florida" .05 .15 . "Texas ") Then [Sales revenue]*1. you get this result: Using If Logic—Learner’s Guide 83 . "New York" .The stores in the following states are to grow their revenue based on these percentages: State % Growth Required California Colorado DC Florida Illinois Massachusetts New York Texas 5% 10% 15% 15% 15% 18% 15% 15% You can create a Target Revenue Based on Required % Growth variable using this syntax: =If([State]="California" . [Sales revenue]*1. If([State]InList ("DC"."Illinois"."Florida".1 . [Sales revenue]*1.18 If you add this variable to the report.15 ElseIf [State]="Massachusetts" Then [Sales revenue]*1.

84 Web Intelligence Advanced Report Design—Learner’s Guide . 1. you use the InList operator. you place the "=" sign before the State value. and if it falls above certain criteria. 2.Syntax of the If() function This syntax is based on the If…Then…Else logic and the percentage rates that each state is supposed to grow by. but when two (or more) states are listed. all the values must appear in parentheses and each individual value must be in quotes as well as separated from the other values by a semicolon. you want to display the projected revenue for each store based on the revenue generated to date. You need to create a variable to calculate this projection based on the sales revenue. Store name and Sales revenue objects in the query. Instructions Using the eFashion universe. This variable needs to look at the sales revenue. Some considerations regarding this syntax are: • When you list a single state. Include the State. • The syntax requires that when multiple values (States) are listed. then a different calculation needs to be performed. Activity: Modifying the calculation behavior Objective • Use the If() function to create a variable that calculates the projected revenue based on revenue by store. Create a new Web Intelligence document using the eFashion universe.

6. 4. Define the formula to calculate each store’s projected revenue based on the following: Revenue Amount >=2000000 >=1500000 All others 1.25 1. Your report appears like this example: Using If Logic—Learner’s Guide 85 . Create a variable called Projected Revenue.05 5.15 1. Validate the syntax and verify that Web Intelligence has applied the Measure qualification to the variable.3. Drag the Projected Variable variable to the right of the last column in the table.

You can use the If() function to define a variable so that a different calculation is used depending on the value retrieved by the object specified in the variable’s formula. 86 Web Intelligence Advanced Report Design—Learner’s Guide .Quiz: Using If Logic 1. Which of the following are examples of why you might use the If() function to group values in a variable: • To display categories of values • To show values aggregated at higher levels of detail 3. True/False. What is another term for the logic used by the If() function? 2.

Lesson summary
After completing this lesson, you are now able to: • Use If() to group data • Use If() to modify calculation behavior

Using If Logic—Learner’s Guide

87

88

Web Intelligence Advanced Report Design—Learner’s Guide

including using data tracking to quickly identify changes in report data. overrding report filters or ranking to calculate total values. displaying a running sum. determining whether a character string matches a particular pattern. and displaying drill filters.Lesson 6 Working with Additional Reporting Techniques Lesson introduction In this lesson you will explore several reporting techniques. After completing this lesson. you will be able to: • Use data tracking • Use additional report functions Working with Additional Reporting Techniques—Learner’s Guide 89 .

Modifying the SQL generated by a data provider. After completing this unit. you can quickly identify the data changes and focus on the most relevant data when you analyze the changes.Using data tracking With Web Intelligence data tracking. A document with data tracking activated retrieves two microcubes -. A document with data tracking activated contains two times more data than a document for which data tracking is not active so the data tracking document can take up to three times longer to refresh. the data tracking function cannot compare the data sets and highlight the changes. For example. Similarly. Purging the document. Using formula language to track data changes You can use the formula language to include calculations based on data changes. the current version of the document is not compatible with the reference version so the changed data does not display. and open it again. Using the query drill. when a document contains calculations on the data set. Deleting a query. You can also use formula language to build custom alerters for formatting data changes. when the data provider changes. Similarly. The actions that clear the document of the data or change the data provider include: • • • • • Drilling out of scope. Note: When you unintentionally purge a document. Close the document. Certain actions clear the document of the data stored in the microcubes or modify the data provider. you can include a calculation to show the difference between the previous value and the current value of a measure. do not save it.one for the reference data set and one for the current data set. The document compares the data in the two microcubes and highlights the changes according to the formatting that you defined for the changes. 90 Web Intelligence Advanced Report Design—Learner’s Guide . it compares the calculations on each data set to display the changes. you can recuperate the data from the microcube before you save the purged document. you will be able to: • Understand additional aspects of data tracking • Use formula language to display and perform calculations on the reference data set Understanding data tracking With data tracking you can highlight the values that have changed since a previous refresh for any level of aggregation. When the document no longer contains the data. This includes modifying security rights.

Security for data tracking Two security options exist for the data tracking feature. When there is no reference data. Your system administrator determines the rights assigned to each user. You may want to create a backup of both files before beginning the activity. you can use the RefValue function to create a formula or variable. you may want to know the different profiles that exist: • The right to see. The RefValueDate function returns the date of the reference data used for data tracking. Activity: Calculating on changed data Objectives • In this activity. • The right to see data tracking. Then.To display the reference data set in your report. the formula RefValue([Revenue]) returns 900. you use the refValue and refValue date functions to display the reference data in your report. This function gives the value of the reference data for the measure. to simulate a change in the data.xls file in the course resources. when the Revenue measure currently has the value 1000. but not modify the data tracking. Note: You can find the Data Tracking1. Working with Additional Reporting Techniques—Learner’s Guide 91 . Instructions 1. For example. However.xls and activate data tracking.xls. • Note: For this activity. you run the report against Data Tracking2. You can find these Microsoft Excel spreadsheet files in the course resources. Create a new document from the local data source Data Tracking1. the function returns null.xls which has updated data. you create a report on the local data source Data Tracking1. when you work with different report users. and to use the interface elements for data. and the reference value is 900.

Make the following changes: • Create a column to the right of the Sales revenue column for the sales revenue in the reference data set and display the values. Format the report to look like the one below: 3. 5. • In the cell next to the total Sales revenue sum. • Display the reference data set date at the top of the report.2. 92 Web Intelligence Advanced Report Design—Learner’s Guide . Activate data tracking to use the current data set as the reference data set for all refreshes. 4. Define the formatting for data changes. • Display a sum for the Sales revenue column. place a variable to calculate the difference between the current sales revenue and the revenue from the reference data set.

8. Using Windows Explorer.xls and Data Tracking2. Rename Data Tracking 2. browse to the location of the Data Tracking 1. The report appears like this: Working with Additional Reporting Techniques—Learner’s Guide 93 . refresh the data in the report. In Web Intelligence.The report appears like this: 6.xls.xls Microsoft Excel files in your course resources folder.xls to Data Tracking 1. 7.

pattern is the character string you wish to search for. "Sundance" . "Un. The wildcards that you can use with this function include: • * (asterisk) for any number of characters. The Match() function is a boolean function and returns 1 if there is a match or 0 if there is no match. You can create a Store Type variable using this syntax: =If(Match([Store name] . "*Sundance") . "*Magnolia") Then "Magnolia" Else "Un. but not currently shown in the table. • Understand additional functions that enhance the formula language in the Web Intelligence XI 3. "*Sundance") Then "Sundance" ElseIf Match([Store name] .Branded")) Or =If Match([Store name] .0/3.Branded" Overriding a report filter or ranking At times you may need to display a calculation that includes both the data that is shown in the table and data that is present in the data provider. • ? (question mark) for any one character.1 release. you will be able to: • • • • Use the Match() function to determine whether a character string matches a particular pattern Use the NoFilter() function to override a report filter or ranking Use the RunningSum() function to return the running sum of a set of numbers Use the DrillFilter() function to return the drill filters applied to a document or used in drill mode or use the Drill Filters cell from the Templates tab.Using additional report functions This unit describes several functions that you can use to display specific data in your documents. The only way to achieve this is to force Web Intelligence to ignore a report filter or ranking that has been applied to an object or variable in the data provider. Determining matches in strings The Match() function allows you to determine whether a character string matches a particular pattern. "*Magnolia") . After completing this unit. If(Match([Store name] . 94 Web Intelligence Advanced Report Design—Learner’s Guide . Suppose that you want to create a report that identifies eFashion locations with the branding "Sundance" or "Magnolia" in their store name. Syntax: boolean Match(string input_string. string pattern) input_string defines the string to be searched for. "Magnolia" .

This part of the formula returns the sum of the stores in the current block (with the rank). -Sum([Sales revenue]) To add another line to the report. Syntax: expression_output_type NoFilter(expression) Suppose that you have a report that uses ranking to display the top three stores per year. If you would like to add a row to the report that displays the total Sales revenue for all the rest of the eFashion stores. even if the data is not displayed in the table or block. you can apply another sum to the Sales revenue column. you can apply another Sum to the Sales revenue column. displaying the total revenue for all locations. Formula component: Syntax and description: NoFilter(Aggregate([Measure])) =NoFilter(Sum([Sales revenue])) This returns the sum of all the stores and ignores rank. NoFilter() includes all of the values for a variable in the data provider in the calculation.Use the NoFilter() function to override a report filter or ranking. and modify the insertion formula like this: Working with Additional Reporting Techniques—Learner’s Guide 95 . It does not include the stores that have been excluded. you can see how the formula returns the desired result. the sum for the Sales revenue column only includes the results from the three top-performing stores. and edit the insertion formula like this: =NoFilter(Sum([Sales revenue]))-Sum([Sales revenue]) By dissecting this formula. Because this report uses ranking.

such as at a break. Row|Col refers to the calculation direction (optional parameter). You can also use running aggregate functions. Others include RunningAverage(). the report looks like this: Displaying a running sum The RunningSum() function is one of a number of running aggregate functions available for calculating data in Web Intelligence. Syntax: number RunningSum([measure]. This allows you to start the cumulative total over at a given value.=NoFilter(Sum([Sales revenue])) If you add some text labels to describe the new rows of the table. Use the RunningSum() function to return the running sum of a set of numbers. RunningCount(). reset_dimensions refers to the list of dimensions used to reset the running sum (optional).[(reset_dimensions)]) [any measure] refers to any measure object in the data provider. and RunningMax(). One benefit of the running aggregate functions is that a reset can be applied to them within the report. 96 Web Intelligence Advanced Report Design—Learner’s Guide . A running sum is a total that is accumulated from value to value across a series of values.[Row|Col]. RunningMin().

and Sales revenue. you can modify the formula to reset the total each time the table breaks: =RunningSum([Sales revenue] . ([State])) Now the report looks like this: Working with Additional Reporting Techniques—Learner’s Guide 97 . it looks like this: If you would like the running total to reset for each state. You would like to add another column to the report to display a running sum. You can create a Running Total variable using this formula: =RunningSum([Sales revenue]) If you add a Running Total column to the report.Suppose that you are creating a report to show Year. Store name. grouped by State.

Syntax: string DrillFilters([object]. based on the DrillFilters() function to return the drill filters applied to a document or to an object using drill mode.Displaying drill filters in the report As you drill down and up hierarchies in a document in drill mode. Note: The Drill Filters cell and the DrillFilters() function only return data when you view the document with drill mode active. This is useful if you want to print a drilled document and show the drill filters along with the report itself. [string separator]) [object] refers to any object in the data provider. Examples: For a document in drill mode: 98 Web Intelligence Advanced Report Design—Learner’s Guide . and other users can see the drill filters you were using as you drilled. string separator refers to the drill filter separator (optional parameter). you may want to display the drill filters that you are using at any given moment. Use the Drill Filters cell. You can then save the document as a PDF or print it.

Colorado Springs" if the document has been drilled into the state of Colorado and into the city of Colorado Springs When you create a report to display State and Sales revenue. Alternatively. Function: Product() Returns: Syntax and Examples: The product of a set of number Product([measure]) numerical values. 3. Working with Additional Reporting Techniques—Learner’s Guide 99 . 5 . =Product([Measure]): Returns 30 if [Measure] has the values 2. you can create a Drill Filter variable using this formula to display the drill filters in a column: =DrillFilters() The Drill Filters cell or the Drill Filter column display data only when you activate drill mode and begin to drill in the report. For example: Syntax: Returns Colorado / Colorado Springs =DrillFilters("/") Understanding additional functions You can use additional functions not presented in detail in this lesson. you can use the Drill Filters cell to display the drill filters in a single cell.Syntax: Returns: =DrillFilters() "Colorado . If you drill down the State dimension to the Store name level. a report with the Drill Filters cell looks like this: Note: You can change the character used to separate the filter levels by modifying the variable formula. Some examples appear below. and want to display the drill filters that are applied when the report is viewed in Drill mode.

Note: Mode returns null if the set of values does not contain one value that occurs more frequently than all the others. 200. 100 Web Intelligence Advanced Report Design—Learner’s Guide . To achieve this. Mode([Country]): Returns the most frequently-occurring value of [Country]. Use the eFashion universe to build a query with the appropriate objects. 1. string DataProviderType (object data_provider) DataProviderType([Sales]): Returns "Universe" if the Sales data provider is based on a universe. ranking and formatting to the table. Returns 200 if [Revenue] has the values 100. 300. Instructions . 200. You will also apply breaks. Activity: Displaying data restricted by a filter or ranking Objective • Build a formula to override a ranking and calculate total values. you also want to display the total state revenue. Note: Enclose the name of the data provider in square brackets. you need to create a new variable using the NoFilter() function.Example 1 Create a document that displays the best sales revenue achieved for any year by state. DataProviderType() The type of data provider. For purposes of comparison.Function: Mode() Returns: Syntax and Examples: The most expression_output_type Mode(expression) frequently-occurring Mode([Revenue]): value in a set of values.

Verify the calculation displayed below the Total revenue column. display only the highest earning year for each state. Display a table header. you change the way Web Intelligence calculates data by default. 6. Add the new variable to the table and display the sum in the footer of both the Sales revenue and the new Total revenue columns. This is known as changing the calculation context. 3. Create a new variable called Total revenue using the following syntax: =NoFilter([Sales revenue] In([State])) Note: By putting In([State]) at the end of the formula. 5. 7. Using the Formula toolbar. Modify the document to display the data as shown in the following screen capture: Note: To display the data as shown. apply a break to the table and format the break so the break header and footer do not display.2. The final report appears like this: Working with Additional Reporting Techniques—Learner’s Guide 101 . 4. Has the sum calculated the data correctly? 8. On the Year column. modify the formula used in the Total Revenue footer cell to calculate the sum total accurately.

In the table footer. and quantity sold with a query filter that prompts the report users to specify the state(s) that they want to see. 2.9. Enter text to identify the values displayed in the break footers. Save the document as Act_NoFilter. Insert a new footer row and build a formula to show the sum of the quantities sold in the other two years. 6. build a formula to show the total sum of the quantities sold by all stores. Run the new query and choose California and Colorado when prompted. 3. Enter text to identify the value displayed in the table footer. Instructions . 9. year. 4. Display the Quantity Sold totals per state in the break footers. Apply a break to organize the data by state. The report appears like this: 102 Web Intelligence Advanced Report Design—Learner’s Guide . Show only the year that sold the highest quantities. build a new query to show the state. store name.Example 2 1. In the same document. 5. 7. 8.

Save the document.10. Working with Additional Reporting Techniques—Learner’s Guide 103 .

Which function can you use to determine whether a character string matches a particular pattern? 4. How do you format a break? 3. How can you display a report filter? 104 Web Intelligence Advanced Report Design—Learner’s Guide . What is the syntax for creating a running sum on Margin with a reset on Year? 5. where is the calculation inserted? • In a data cell • In the break footer • In the section • In the break header 2. Which function would you use if you want to show the SQL for a particular query? 6. When you apply a standard calculation such as a Sum or an Average on a column in a table with a break. Which function can you use to override a report filter or a ranking? 7.Quiz: Additional Reporting Techniques 1.

you are now able to: • Use data tracking • Use additional report functions Working with Additional Reporting Techniques—Learner’s Guide 105 .Lesson summary After completing this lesson.

106 Web Intelligence Advanced Report Design—Learner’s Guide .

.

you will be able to: • Work with hyperlinks in Web Intelligence documents • Create hyperlinks in the Interactive panel • Create hyperlinks in Web Intelligence Rich Client and the Java Report Panel Creating Hyperlinks—Learner’s Guide 107 . After completing this lesson.Lesson 7 Creating Hyperlinks Lesson introduction You can create hyperlinks from your documents to URLs and to other documents in Web Intelligence XI 3.0/3.1.

you can create hyperlinks to: • Other documents such as Web Intelligence documents or Crystal Reports For example. you can create all hyperlinks via a dialog box. number of employees and opening hours. • Other documents via the OpenDocument command.1. The appendix to this course. covers creating hyperlinks with the OpenDocument command. a document that shows sales results per store can display the store name as a hyperlink to another document with store details. The website also gives access information and opening hours for the store. 108 Web Intelligence Advanced Report Design—Learner’s Guide . In the Web Intelligence Interactive panel. • URLs or websites For example. After completing this unit. Creating Hyperlinks with the OpenDocument Command. you can create hyperlinks to documents and to URLs. location. you can create hyperlinks to: • URLs or websites via a dialog box.0/3. the document that shows store details can display a hyperlink to a website that shows the promotional offers and merchandise available at the store for the current period. The details can include the store floor area.Working with hyperlinks in Web Intelligence documents In Web Intelligence XI 3. you will be able to: • Understand the different options for creating hyperlinks in Web Intelligence • Know the options available to you in the panel that you use About hyperlinks in Web Intelligence In your Web Intelligence documents. In the Web Intelligence Rich Client main window and the Java Report Panel.

you can create a hyperlink with the Create Hyperlink dialog box. When you click the Link to document option. Creating Hyperlinks—Learner’s Guide 109 . the dialog box displays a field for the path to the document and a Browse button to help you browse to the document.Creating hyperlinks in the Web Intelligence Interactive panel You can create all hyperlinks via a single dialog box in the Web Intelligence Interactive panel. you will be able to: • Create hyperlinks to URLs and websites in the Interactive panel • Create hyperlinks to other documents About hyperlinks in the Interactive panel When you use Interactive viewing mode to view a Web Intelligence document in InfoView. The dialog box changes dynamically to display the options that you can associate with your hyperlink. After completing this unit.

the Choose a document dialog box displays. When you select the document.When you click the Browse button. the fields for defining the options associated with the hyperlink display. You can browse to your document or perform a search for it from the dialog box. 110 Web Intelligence Advanced Report Design—Learner’s Guide .

• Link to a specific document instance. Creating Hyperlinks—Learner’s Guide 111 . • Customize the look and behavior of the hyperlink. When you click the Link to webpage option. For example. • Link to a specific area in the document. the dialog box displays a field for the URL. you can have the hyperlink display the document in a new window or display a tooltip that describes the document when you move the mouse over the hyperlink. • Pass a prompt value to the document.You can choose to: • Refresh the document when you click the hyperlink.

4. Depending on whether you want to link to a URL or a document. Note: Log onto InfoView using the user name and password provided to you by the class instructor. Log onto InfoView and display the InfoView Preferences page. verify that the Default view format option is set to Interactive. click the: • Link to web page button to link to a web page or URL and in the Enter the URL below. In the Web Intelligence Preferences zone. click Hyperlink > New.When you enter the URL and click the Parse button the fields for defining the options associated with the hyperlink display. then.. type the URL. 2. The Create Hyperlink dialog box displays. 112 Web Intelligence Advanced Report Design—Learner’s Guide . 3. Proceed to step 6. To create a hyperlink in the Interactive panel 1. • Link to document button and click the Browse button to browse to and select your document. field.. Proceed to step 5. Open or create a new Web Intelligence document in InfoView. right-click the cell or cells containing the text that you want to make a hyperlink and in the context menu.

5. 6. Click the Parse button. The value(s) that you selected in your document now appear as (an) active hyperlink(s). Creating Hyperlinks—Learner’s Guide 113 . Define the options associated with your hyperlink and click OK.

The Hyperlinks dialog box is similar to the Create Hyperlink dialog box in the Interactive panel. After completing this unit. You can choose to customize the look and behavior of the hyperlink to display the web page in a new window or to display a tooltip that describes the web page or URL when you move the mouse over the hyperlink. Web Intelligence displays the fields for the URL and for defining the options associated with the hyperlink display. you will be able to: • Create a hyperlink to a URL with the Hyperlinks dialog box About hyperlinks to a URL The Hyperlinks dialog box provides the same functionality for creating hyperlinks to a URL in the Web Intelligence Rich Client main window and the Java Report Panel as the Create Hyperlink dialog box provides in the Interactive panel. you use the Hyperlinks dialog box to create a hyperlink to a URL. but it only applies to links to URLs or web pages and not to links to documents.Creating hyperlinks in Web Intelligence Rich Client and the Java Report Panel In the Web Intelligence Rich Client main window and the Java Report Panel. When you enter a URL and click Parse. 114 Web Intelligence Advanced Report Design—Learner’s Guide .

5. 3. 2. right-click the cell or cells containing the text that you want to make a hyperlink and. type. Click OK. By default. or copy and paste. in the context menu. Optionally. The fields for the options to customize the hyperlink display in the Customize the visual and interaction properties of the hyperlink area of the dialog box.To create a hyperlink to a URL 1. In your Web Intelligence document. 6. define a tooltip for the hyperlink. define the target window for the URL. Optionally. 4. the system selects the current window. 7. the URL to which you want the hyperlink to lead. Creating Hyperlinks—Learner’s Guide 115 . In the field that displays in the Hyperlinks dialog box. click Hyperlinks > New Hyperlink. Click Parse. The URL displays in the URL field. Open or create a new Web Intelligence document using either the Web Intelligence Rich Client or the Java Report Panel. The Hyperlinks dialog box displays.

Log onto InfoView and verify that the Web Intelligence default view and the default creating/editing preferences are set to Interactive. create two documents -. 2.In your document. create a hyperlink on each store name to open the store details document and display only the data for the store name displayed in the hyperlink. 3. you want the details for a specific store name value to display so create a prompt on the document. Also. • In the sales margin document create a hyperlink to a URL.one to show sales margin for all stores for all years and another to show store details. the value(s) that you selected for the hyperlink now appear(s) as (an) active hyperlink(s). 1. Using the eFashion universe. Using the eFashion universe. When the hyperlink opens this document. Without the prompt. create the hyperlink target document that displays store details and save the document in the Favorites folder. Activity: Creating hyperlinks in the Interactive panel Objectives • In the Web Intelligence Interactive panel in InfoView. your report looks like this: Save the document as Store Details. Save the document. 8.wid. create a second document that displays the sales margin per store per year and save the document in the Favorites folder. 116 Web Intelligence Advanced Report Design—Learner’s Guide .

6. From the Sales Margin per Store document. make the report title a hyperlink to a web page. 5. From the Sales Margin per Store document. use the BusinessObjects Enterprise server URL. Pass the value of the store name in the hyperlink to the Store Details.The report looks like this: Save the second document as Sales Margin per Store. Creating Hyperlinks—Learner’s Guide 117 .wid document so that it displays the details for a specific store name. For the purposes of the activity. Test that the hyperlinks work in the Interactive panel. Save the documents and log off from InfoView. 4.wid. create a hyperlink on the Store name value to link the two documents.

what options can you associate with the hyperlink? 3.Quiz: Creating Hyperlinks 1. How do you create a hyperlink in the Web Intelligence Rich Client main window or the Java Report Panel? 118 Web Intelligence Advanced Report Design—Learner’s Guide . When you use the Create Hyperlink dialog box to create a hyperlink to another document. How do you create a hyperlink in the Web Intelligence Interactive panel? 2.

you are now able to: • Work with hyperlinks in Web Intelligence documents • Create hyperlinks in the Interactive HTML panel • Create hyperlinks in the Web Intelligence Rich Client and Java Report Panel Creating Hyperlinks—Learner’s Guide 119 .Lesson summary After completing this lesson.

120 Web Intelligence Advanced Report Design—Learner’s Guide .

.

Include the following objects in the query: Country. and Mexico. 2. 1. Create a new document using the Xtreme universe to return data for Canada. Unit Price. USA.Appendix A Optional End of Course Challenge Activity: Using advanced querying and reporting techniques Objective • Create a document using the techniques presented in this course. The finished document should look like this: Optional End of Course Challenge—Learner’s Guide 121 . Instructions The management team of the Xtreme Sporting Group requires a report of North American sales by product type. Quantity Note: Do not display the Product Name object in the table. Product Name.

122 Web Intelligence Advanced Report Design—Learner’s Guide .

Note: The port is 8080 for Tomcat web servers. is specific to the BusinessObjects Enterprise server. Note: Each of the syntax arguments are joined with a plus sign (+) in the formula bar.jsp? be executed on it. You can find this name displayed in the address bar of your browser's address toolbar. For example. The second report can contain a hyperlink on state that opens the detailed revenue report for the state. used in this example."". you create a link to a document with a formula that uses the OpenDocument command. The name of the document. OpenDocument URL command syntax An example of the syntax to use when you want to create a hyperlink on a state object to open a document with sales details for the state appears below: ="<a href="+"http://<server_name>:8080/OpenDocument/opendoc/openDocument. based on the prompted query filter built in the query of the linked document. The command can pass detailed data to the second document. "&sType=wid" The type of document to be opened. in this case. and provides an explanation for each argument. a Web Intelligence document. http://<server_name>:8080/OpenDocument/ The server name and the command which will opendoc/openDocument."%20") + "> "+[State]+"</a>" The table below divides the example of syntax into understandable arguments. Syntax argument "<a href=" Explanation The opening HTML syntax for a hyperlink. you can create a report with detailed revenue information for a particular state and create another report with a state-level summary on sales revenue.jsp? "+"&sType=wid"+"&sDocName=Detailed+Sales+Report"+"&lsSEnter+State:="+Replace([State] . "&sDocName=Detailed+Sales+ Report" Creating Hyperlinks with the OpenDocument Command—Learner’s Guide 123 . <server_name>:8080.Appendix B Creating Hyperlinks with the OpenDocument Command Using OpenDocument to create a hyperlink to documents In Web Intelligence Rich Client and the Java Report Panel.

In this case. Notice that this argument has to match exactly with the prompt created in the first document. Multiple prompts can be listed in the code. In your Web Intelligence document. "</a>" The closing HTML code for a hyperlink. %20 is the HTML encoding symbol for a space. [State] indicates the data from the main report to be passed to the linked report. "&lsSEnter_State:="+Replace( [State]. %20 can be used in place of the +. t">"+ [State] Required HTML encoding and the object name that indicates to the document which data to show in the table. Click the Show/Hide Formula button on the Reporting toolbar. Once you have formatted the column in the Web Intelligence table. To use the OpenDocument command for hyperlinks 1. 2.Syntax argument Explanation Note that spaces in the name of the document are replaced with a + sign. 124 Web Intelligence Advanced Report Design—Learner’s Guide . select the values that you want to display as hyperlinks. the State values in this case appear as hyperlinks. This parameter can be substituted with the sDocID. a single parameter is being passed (lsS)." The prompt parameter which will be passed to ". The Replace command is used with the value to replace spaces in the value with the HTML symbol for a space. Additional parameters are available: • • lsM for multiple values lsR for a range of values The object name in brackets. You just continue to string them together with the + character to concatenate the pieces."%20") the document being opened.

To display the hyperlinks 1. 4. 5. 4. Type the hyperlink syntax in the Formula zone of the Formula Editor and click OK. 2. More about using the OpenDocument URL Keep in mind the following important points when using the OpenDocument URL command. or the hyperlink will not work. select the values that you want to display as hyperlinks. Click + to expand the Display section. Now you are ready to define the formula to apply a hyperlink to the selected values. Select Hyperlink from the list of options. Click the Properties tab. The value selected displays as a hyperlink. Note: Verify that there are no blank spaces in the hyperlink formula. URL syntax The typical URL syntax is as follows: • For JAVA installations: http://<hostname>:<port>/OpenDocument/opendoc/openDocument.jsp? • For COM installations: http://<hostname>:<port>/OpenDocument/opendoc/openDocument.jsp? Creating Hyperlinks with the OpenDocument Command—Learner’s Guide 125 . 3. Click the Formula Editor button on the Formula toolbar. Click the Text field next to the Read cell content as option and then click the drop-down arrow.3. In your Web Intelligence document.

refer to the document delivered on the CD with Web Intelligence XI 3.0/3. as shown in the previous example. Performing on-report analysis with Web Intelligence Chapter 13.By default.jsp? • IIS: http://paris/OpenDocument/opendoc/openDocument. such as data returned by a universe object. has embedded spaces in the data. then the link will be truncated after the space and the remainder of the link will not be executed. Constructing the link with & as delimiter The arguments are delimited by the & character. BusinessObjects Enterprise XI 3. There are three different methods for handling spaces: • Use the "+" character. The port is 8080 for Tomcat web servers and 80 for IIS web servers (which is the default HTTP port and can be omitted).0/3. "Linking to other documents" for more information on using the OpenDocument URL command with Web Intelligence documents. If you include spaces in the link. Finding more information For more information using the OpenDocument URL command with Web Intelligence documents. • Use "%20" in the hard-coded arguments. 126 Web Intelligence Advanced Report Design—Learner’s Guide . The following are example URLs where the server name is "paris": • TOMCAT: http://paris:8080/OpenDocument/opendoc/openDocument. • Use URLEncode() when an argument. except when a universe object name is included within [ ] brackets.jsp? No blank spaces allowed in the hyperlink There can be NO SPACES in the link.1 uses the <hostname> as the server name.1.

The key differences are that dimensions can: • Be part of the scope of analysis. or dates. Can contain calculations such as: Return Date. Can contain calculations such as: Return Age. Details cannot serve the two purposes above. for example. The table below describes dimensions and details and their differences. data. as well as how the universe designer decides to define an object as a dimension or a detail. Dimensions and Details—Learner’s Guide 127 . Can merge with an object from another data source to synchronize different data sources. date.Appendix C Dimensions and Details Understanding dimensions and details As an advanced report designer. but typically retrieve character-type number. and what objects you want to use for synchronizing different data sources. or number. Age. Can have all data types. to enable drilling on the dimension. Cannot merge with an object from a data source to synchronize different data sources. So when you communicate your reporting needs to a universe designer. customer names. you are in a better position to communicate your organization's reporting needs to the universe designer. Can be part of the scope of analysis so report users can drill down on the dimensions. character. Cannot be part of the scope of analysis for drilling. Provide descriptive data about a dimension. Date. you want to consider what objects you want to use when defining scope of analysis for drilling. You can be more effective in that role when you understand the differences between dimension objects and detail objects. store names. date. Details are always associated with the dimension for which they provide additional information. Days to Ship. or Can have all data types. Days to Ship. Dimensions Details Retrieve the data that provides the basis for analysis in a report. • Merge with an object from another data source to synchronize their respective data sources. character.

which objects the universe designer defines as details. 128 Web Intelligence Advanced Report Design—Learner’s Guide . What object type did the universe designer assign to the objects and why? 2. She wants to bring the information from these different sources into one table and to merge for data synchronization on the Store name and Product line objects. He does not want to drill to SKU number or Color. The Color object appears in only one report. and why. the change can impact your reports. and Color. • Objects are no longer at the top level in the class. The Purchasing director wants to analyze the Product Line information and to drill down to Category. • More objects are available for synchronization between data sources. 1. Reports which use the dimension object to merge data from multiple data sources no longer function properly because you cannot merge detail objects. A group of reports include Store name. When a universe designer changes an object from a dimension to a detail. Read the user needs below and decide which objects the universe designer defines as dimensions.Understanding the impact of changing the object qualification When your reporting needs changing and you discover the need to change a dimension to a detail. sometimes: • Additional objects are available in the hierarchies when you drill in the report. A Merchandising manager has access to more than one data source – an Excel Spreadsheet and a number of universes. Review: Dimensions and details The eFashion Purchasing department requires new reports. they appear as an associated object. Quantity sold. discuss and plan for the possible consequences described in this section. When a universe designer changes an object from a detail to a dimension. sometimes: • Objects disappear from the hierarchies and existing drill documents have objects missing from the scope of analysis. The first four objects retrieve important data for the reports. When your universe designer considers making such a change. The risk is that they may be associated with the wrong object. 3. SKU description. and Promotion. Product line. or to change a detail to a dimension. SKU Description. Instead. • Objects appear available for data synchronization when they may not be compatible with objects from other data sources.

Answer Key—Learner’s Guide 129 .Answer Key This section contains the answers to the reviews and/or activities for the applicable lessons.

130 Web Intelligence Advanced Report Design—Learner’s Guide .

What are the differences among a query filter. A report filter allows selected data to display in a page and hides the other data. When you list values in a formula. What object type does not have a list of values? Answer: A measure 4. A query filter contains three components. a report filter. What are the two benefits provided when you apply a break to a table? Answer: You can use the break to: ○ Group data ○ Display sums 6. What are they? Answer: A Web Intelligence document contains: ○ A data provider or query ○ A report ○ Blocks of data 2.Review: Web Intelligence core report design Page 2 1. what must you use to separate the values? Answer: A semi-colon 5. The report filter applies to all data blocks on the page. A Web Intelligence document consists of three components. 7. What are they? Answer: A query filter contains: ○ An object ○ An operator ○ An operand 3. What is the difference between a section and a break? Answer Key—Learner’s Guide 131 . and a block filter? Answer: A query filter limits the data returned from the database. A block filter allows selected data to display in a single block and hides the other data.

A detail cannot serve in a scope of analysis or merge with an object from another data source to synchronize two different data sources. complementary information to the information contained in a dimension and must be associated with a dimension.Answer: A section impacts the whole report page. A section allows you to display multiple blocks of data on the same page. the custom sort impacts all the blocks that use the object. When you apply a custom sort to an object. Query 1 returns 10 rows for Region. 9. 8.What is the difference between a dimension and a detail? Answer: A dimension displays values that report users want to see in their documents. for reasons of security. the document arrives more quickly. Consequently. Query 2 returns 12 rows for Region_Area . after synchronization: 132 Web Intelligence Advanced Report Design—Learner’s Guide . A break does not allow you to display multiple blocks of data on the same page. You can make the document lighter when you purge the data. a break impacts the table or crosstab to which you apply the break. What is the difference between an ascending or descending sort and a custom sort? Answer: Ascending and descending sorts impact the column of the block to which you apply the sort. for example. 10. A detail provides additional. You can merge a dimension with a dimension from another data source to synchronize two different data sources. 11. ○ When you want to send a data-heavy document to a report user. Custom sorts impact the data in an object. Why purge the data in your document? Answer: You can use the purge function: ○ When you want a document to refresh when the report user opens it.You have two queries on two different data sources. but you do not want the report user to see the existing data. You synchronize the two data sources by merging the Region and Region_Area objects. How many rows appear after the synchronization? Answer: When the Region and Region_Area objects contain data in the same format and case. You can use a dimension for a scope of analysis.

Web Intelligence handles similar values with different format or case as different values. When the Region and Region_Area objects contain data in different format or case. Which objects do you choose to merge to synchronize the information in one table? Answer: You choose the Region objects because they are the only common dimensions. Answer Key—Learner’s Guide 133 . yes.When you synchronize two queries from different data sources. You can only display measures with synchronized dimensions. ○ 22 rows appear when 10 values for Region do not match the 12 values for Region_Area.x. When you use them for another purpose. Data must have the same case because the data provider is case-sensitive. and Sales revenue in Query 1. 13. Area. you can. what rules must you respect? Answer: Respect the following rules: ○ ○ ○ ○ ○ Object names can differ.○ 12 rows appear when the 10 values for Region match some of the 12 values for Region_Area . Year. duplicate values appear. when a dimension appropriate for merging exists in the two documents. 14. You can only synchronize on dimensions.You have a report with the objects Region. You cannot merge a measure so you cannot use the Sales revenue and Sales total objects.Can you synchronize the data between a Web Intelligence document and an Excel spreadsheet? Answer: In Web Intelligence XI 3. The data type for the merged objects must be the same. and Sales total in Query 2. after synchronization 22 rows appear. 12. and you have another report on a different data source with Region.

Answer: ○ To make the construction of the query easier. 6. what would be the result? Answer: Only records that matched ALL criteria would be returned. ALL ○ b. what can you choose to do to the objects in the original query? Answer: You can map them to objects in the new data source or delete them from the query. what would be the result? Answer: All records that match the first query condition and not the second condition. Subquery. 9. yes. what would be the result? Answer: The result returns all records that satisfy one of the two conditions. 3. If you were to use the MINUS operator to combine queries. Where you place the queries determines which is the first condition and which is the second condition. This is equivalent to using an OR between query filters. ○ When it is not possible to apply the required query filters using Boolean logic. 134 Web Intelligence Advanced Report Design—Learner’s Guide . List two reasons why you might want to use combined queries. If you were to use the UNION operator to combine queries. Why would you choose to do a combined query rather than a subquery? Answer: Combined queries tend to be faster at returning the data. This is the equivalent of doing an AND between query filters. 8. If it finds one. 5. 7.Quiz: Advanced Query Techniques Page 28 1. and Duplicating a query to build another. 4. ANY Answer: ANY. When you change a data source. Can you do a subquery and return exactly the same results as a combined query? Answer: Depending on the query. The Any option means that Web Intelligence only looks for one instance of a value from the subquery that meets the query filter. 2. Which subquery operand type means that Web Intelligence will look for only one instance of a value from the subquery that meets the query filter? ○ a. What are the three types of query techniques used in this lesson? Answer: Combining. If you were to use the INTERSECTION operator to combine queries. it then ceases the comparison with the remainder of the subquery output.

3. Block is an extended syntax keyword. For example. 2. the output context can be the dimension displayed at the row level. What is an output context? Answer: The output context is the dimension level in which the calculation is to be displayed in the report. What is an input context? Answer: The input context is the list of dimensions that are included in the calculation itself.Quiz: Calculation Contexts Page 49 1. Which of the following is an extended syntax keyword? ○ NoFilter() ○ ForEach ○ Section Answer: Section Answer Key—Learner’s Guide 135 . Which of the following is an extended syntax context operator? ○ NoFilter() ○ ForEach ○ Block Answer: ForEach NoFilter() is a function. the dimension displayed at the break level. and so on. 4.

what would the syntax be? Answer: =DaysBetween(first date.second date)/365. To find the occurrence of a comma in an object’s value. 5. Pos(). “new string”) 4. “ + Firstname 6. Replace(). Give an example of string concatenation. What is the syntax for the Replace() function? Answer: Replace([string] . Length() 2. “old string” . Answer: Choice of Right(). If you want to create a formula to return the number of years between two dates.25 7.Quiz: Character and Date String Functions Page 71 1. Substr(). which function would you use? Answer: Pos() 3. Answer: Lastname+ “. Name at least three character string functions used in this lesson. When would you choose to use the Length() function? Answer: To identify the length of a field. Can you do calculations on a date? Answer: Yes 136 Web Intelligence Advanced Report Design—Learner’s Guide .

..Else logic 2.. True/False.. Answer: True Answer Key—Learner’s Guide 137 . You can use the If() function to define a variable so that a different calculation is used depending on the value retrieved by the object specified in the variable’s formula. What is another term for the logic used by the If() function? Answer: If.Then.Quiz: Using If Logic Page 86 1. Which of the following are examples of why you might use the If() function to group values in a variable: • To display categories of values • To show values aggregated at higher levels of detail Answer: 1 and 3 3.

[Year])) 5. How can you display a report filter? Answer: With the Drill Filters cell or the DrillFilter() function. Which function can you use to override a report filter or a ranking? Answer: NoFilter() 7. Which function would you use if you want to show the SQL for a particular query? Answer: Dataprovider(SQL) 6. Which function can you use to determine whether a character string matches a particular pattern? Answer: Match() 4. How do you format a break? Answer: Select the column with the break and go to the Breaks folder in the Properties tab.Quiz: Additional Reporting Techniques Page 104 1. where is the calculation inserted? • In a data cell • In the break footer • In the section • In the break header Answer: In the break footer. 138 Web Intelligence Advanced Report Design—Learner’s Guide . 3. What is the syntax for creating a running sum on Margin with a reset on Year? Answer: =RunningSum([Margin] . When you apply a standard calculation such as a Sum or an Average on a column in a table with a break. 2.

you use the Hyperlinks dialog box. Linking to a specific area in the document. for example. • Another document. How do you create a hyperlink in the Web Intelligence Interactive panel? Answer: With the Create Hyperlink dialog box. Passing a prompt value to the document. Customizing the look and behavior of the hyperlink. you use the OpenDocument command. When you use the Create Hyperlink dialog box to create a hyperlink to another document. Answer Key—Learner’s Guide 139 . 3. what options can you associate with the hyperlink? Answer: The options include: ○ ○ ○ ○ ○ Refreshing the target document when it opens.Quiz: Creating Hyperlinks Page 118 1. 2. How do you create a hyperlink in the Web Intelligence Rich Client main window or the Java Report Panel? Answer: To create a hyperlink to: • A URL or website. to have the hyperlink display the document in a new window or to display a tooltip that describes the document when you move the mouse over the hyperlink. Linking to a specific document instance.

Quantity sold. and Color. The first four objects retrieve important data for the reports. Product line. The Purchasing director wants to analyze the Product Line information and to drill down to Category. 140 Web Intelligence Advanced Report Design—Learner’s Guide . SKU Description. 3. Answer: The universe designer defines the Store name and Product line objects as dimensions so the merchandising manager can merge them. A group of reports include Store name. What object type did the universe designer assign to the objects and why? Answer: The universe designer defines the Store name. The Color object appears in only one report. 2.Review: Dimensions and details Page 128 1. Answer: The universe designer defines SKU number and Color as details to keep the default hierarchy easy to read and defines the other objects as dimensions. and Promotion. Product line. SKU description and Quantity sold as dimensions and defines the Color as a detail. SKU description. A Merchandising manager has access to more than one data source – an Excel Spreadsheet and a number of universes. He does not want to drill to SKU number or Color. She wants to bring the information from these different sources into one table and to merge for data synchronization on the Store name and Product line objects.

Notes .

Notes .

Notes .

Notes .