bow320 en col91 fv part ltr

158
BusinessObjects Web Intelligence XI 3.0/3.1: Advanced Report Design Learner’s Guide BOW320

Upload: amondaca

Post on 27-Oct-2014

176 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Bow320 en Col91 Fv Part Ltr

BusinessObjects Web Intelligence XI3.0/3.1: Advanced Report Design

Learner’s GuideBOW320

Page 2: Bow320 en Col91 Fv Part Ltr

Copyright© 2009 SAP® BusinessObjects™. All rights reserved. SAPBusinessObjects owns the followingUnited States patents,whichmay cover products that are offered and licensed by SAPBusinessObjects 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. SAPBusinessObjects and its logos, BusinessObjects, Crystal Reports®,Rapid Mart™, Data Insight™, Desktop Intelligence™, RapidMarts®, Watchlist Security™, Web Intelligence®, and Xcelsius®are trademarks or registered trademarks of Business Objects,an SAP company and/or affiliated companies in the UnitedStates and/or other countries. SAP® is a registered trademarkof SAPAG inGermany and/or other countries. All other namesmentioned hereinmay be trademarks of their respective owners.

Page 3: Bow320 en Col91 Fv Part Ltr

C O N T E N T S

About this CourseCourse Introduction.....................................................................................................xiCourse Description......................................................................................................xiiCourse Audience.........................................................................................................xiiPrerequisites.................................................................................................................xiiAdditional Education..................................................................................................xiiLevel, delivery and duration.....................................................................................xiiApplicable certifications and designations..............................................................xiiCourse success factors.................................................................................................xiiCourse setup...............................................................................................................xiiiCourse materials.........................................................................................................xiiiLearning process ........................................................................................................xiii

Lesson 1ReviewingWeb IntelligenceCoreReport DesignLesson introduction.......................................................................................................1Reviewing core report design concepts......................................................................2

Review: Web Intelligence core report design.....................................................2Lesson summary............................................................................................................3

Lesson 2Working with Advanced Query TechniquesLesson introduction.......................................................................................................5Using combined queries...............................................................................................6

About combined query functions........................................................................6Understanding when to use a combined query.................................................8Advantages of using combined queries..............................................................9Comparing query filters and combined queries................................................9Using the combined query technique...............................................................10Important facts about combined queries..........................................................11Activity: Combined queries................................................................................12Activity: Combined queries - Optional.............................................................13

Using subqueries..........................................................................................................16Understanding subqueries..................................................................................16Creating a subquery.............................................................................................16Activity: Using subqueries..................................................................................18

iiiTable of Contents—Learner’s Guide

Page 4: Bow320 en Col91 Fv Part Ltr

Creating a query based on another query ...............................................................20Duplicating queries..............................................................................................20

Changing data sources................................................................................................22About changing data sources.............................................................................22Activity: Changing the data source...................................................................25

Quiz: Advanced Query Techniques..........................................................................28Lesson summary..........................................................................................................29

Lesson 3Working with Calculation ContextsLesson introduction.....................................................................................................31Understanding calculation contexts .........................................................................32

Dynamic calculations...........................................................................................32Redefining calculation contexts.................................................................................35

Input and output contexts...................................................................................35Forcing the input calculation context................................................................36About the extended syntax operators and keywords ....................................39Forcing the output calculation context..............................................................40More about the extended syntax keywords.....................................................43Input vs. output calculation contexts................................................................43Using the In context operator with Where.......................................................44Important facts about calculation contexts.......................................................46Activity: Calculation contexts.............................................................................46Activity: Calculation contexts - Optional..........................................................47

Quiz: Calculation Contexts.........................................................................................49Lesson summary..........................................................................................................50

Lesson 4Creating Formulas with Character and DateString FunctionsLesson introduction.....................................................................................................51Using character strings................................................................................................52

About character-string functions.......................................................................52Using functions in formulas and variables.......................................................52

Using the Right() function .........................................................................................53How to extract characters using the Right() function.....................................53

Using the Replace() function......................................................................................56Replacing a string.................................................................................................56

Using the SubStr() function .......................................................................................58How to extract characters using the SubStr() function...................................58

Using the Pos() function.............................................................................................60How to use the Pos() function............................................................................60

Concatenating different character strings................................................................62

Web Intelligence Advanced Report Design—Learner’s Guideiv

Page 5: Bow320 en Col91 Fv Part Ltr

How to concatenate a string with a date...........................................................62Formatting a date that is concatenated with a string......................................62

Using date functions ...................................................................................................65Converting a string to a date value ..................................................................65Using date calculations........................................................................................66Activity: Character and date string functions .................................................67Activity: Character and date string functions - 2.............................................68Converting a string to a date value ..................................................................69

Quiz: Character and Date String Functions ............................................................71Lesson summary..........................................................................................................72

Lesson 5Using If LogicLesson introduction.....................................................................................................73Using If() to group data..............................................................................................74

Grouping values with the If() function to show higher levels ofdetail.......................................................................................................................74Grouping values with the If() function to show categories...........................75Activity: Grouping data......................................................................................77Activity: Grouping data - Optional...................................................................78Activity: Grouping data - Optional 2................................................................80

Using the If() function to modify calculation behavior..........................................82Modifying the way calculations behave...........................................................82Syntax of the If() function ...................................................................................84Activity: Modifying the calculation behavior..................................................84

Quiz: Using If Logic.....................................................................................................86Lesson summary..........................................................................................................87

Lesson 6Working with Additional Reporting TechniquesLesson introduction.....................................................................................................89Using data tracking.....................................................................................................90

Understanding data tracking..............................................................................90Using formula language to track data changes...............................................90Security for data tracking....................................................................................91Activity: Calculating on changed data..............................................................91

Using additional report functions.............................................................................94Determining matches in strings.........................................................................94Overriding a report filter or ranking.................................................................94Displaying a running sum..................................................................................96Displaying drill filters in the report...................................................................98Understanding additional functions.................................................................99Activity: Displaying data restricted by a filter or ranking...........................100

Quiz: Additional Reporting Techniques................................................................104

vTable of Contents—Learner’s Guide

Page 6: Bow320 en Col91 Fv Part Ltr

Lesson summary........................................................................................................105

Lesson 7Creating HyperlinksLesson introduction...................................................................................................107Working with hyperlinks in Web Intelligence documents..................................108

About hyperlinks in Web Intelligence............................................................108Creating hyperlinks in the Web Intelligence Interactive panel...........................109

About hyperlinks in the Interactive panel......................................................109Creating hyperlinks in Web Intelligence Rich Client and the Java ReportPanel............................................................................................................................114

About hyperlinks to a URL ..............................................................................114Activity: Creating hyperlinks in the Interactive panel.................................116

Quiz: Creating Hyperlinks.......................................................................................118Lesson summary........................................................................................................119

Appendix AOptional End of Course ChallengeActivity: Using advanced querying and reporting techniques...........................121

Appendix BCreating Hyperlinks with the OpenDocumentCommandUsing OpenDocument to create a hyperlink to documents ...............................123OpenDocument URL command syntax ................................................................123More about using the OpenDocument URL .........................................................125Finding more information .......................................................................................126

Appendix CDimensions and DetailsUnderstanding dimensions and details .................................................................127Understanding the impact of changing the object qualification.........................128Review: Dimensions and details .............................................................................128

Answer KeyReview: Web Intelligence core report design........................................................131Quiz: Advanced Query Techniques........................................................................134Quiz: Calculation Contexts.......................................................................................135Quiz: Character and Date String Functions ..........................................................136

Web Intelligence Advanced Report Design—Learner’s Guidevi

Page 7: Bow320 en Col91 Fv Part Ltr

Quiz: Using If Logic...................................................................................................137Quiz: Additional Reporting Techniques................................................................138Quiz: Creating Hyperlinks.......................................................................................139Review: Dimensions and details .............................................................................140

viiTable of Contents—Learner’s Guide

Page 8: Bow320 en Col91 Fv Part Ltr

Web Intelligence Advanced Report Design—Learner’s Guideviii

Page 9: Bow320 en Col91 Fv Part Ltr

A G E N D AWeb Intelligence Advanced Report Design

Introductions, Course Overview...........................................30 minutes

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

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

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

Lesson 4Creating Formulas with Character and Date StringFunctions.........................................................................................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 5Using If Logic.......................................................................................1 hour❒ Using If() to group data❒ Using the If() function to modify calculation behavior

ixAgenda—Learner’s Guide

Page 10: Bow320 en Col91 Fv Part Ltr

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

Lesson 7Creating 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 ReportPanel

Web Intelligence Advanced Report Design—Learner’s Guidex

Page 11: Bow320 en Col91 Fv Part Ltr

About this Course

Course IntroductionThis section explains the conventions used in the course and in this training guide.

xiAbout this Course—Learner’s Guide

Page 12: Bow320 en Col91 Fv Part Ltr

Course DescriptionBusinessObjects Web Intelligence™ is a query, reporting and analysis tool that allows you toaccess the data in your corporate databases directly from within BusinessObjects Enterprise™

InfoView and to present and analyze this information in a Web Intelligence document.

This one-day instructor-led classroom course is designed to give you the comprehensive skillsneeded to apply alternative query and reporting techniques when creating complex WebIntelligence documents. After completing this course, you will be able to create combinedqueries and use sub-queries. You will also be able to use character and date string functions,create variables using "If" logic, and redefine calculation contexts.

The course also provides an optional appendix describing how to link Web Intelligencedocuments using the OpenDocument URL command.

Course Audience

The target audience for this course is report designers who are experienced Web Intelligenceusers and who need to create complex Web Intelligence documents.

Prerequisites

Learners should have attended the following courses:• BusinessObjects Web Intelligence XI 3.0/3.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.

Level, delivery and duration

This advanced-level instructor-led offering is a one-day course.

Applicable certifications and designations

This is an intermediate course for the Business Objects Certified Professional - BusinessObjectsWeb Intelligence XI 3.0/3.1 certification path.

Course success factors

Your learning experience will be enhanced by:

Web Intelligence Advanced Report Design—Learner’s Guidexii

Page 13: Bow320 en Col91 Fv Part Ltr

• 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, software, and course-specific requirements.

Course materials

The materials included with the course materials are:• Name card• Learner’s Guide

The Learner’s Guide contains an agenda, learner materials, and practice activities.

The Learner’s Guide is designed to assist students who attend the classroom-based courseand outlines what learners can expect to achieve by participating in this course.

• Evaluation form

At the conclusion of this course, you will receive an electronic feedback form as part of ourevaluation process. Provide feedback on the course content, instructor, and facility. Yourcomments will assist us to improve future courses.

Additional resources include:• Sample files

The sample files can include required files for the course activities and/or supplementalcontent to the training guide.

• OnlineHelp

Retrieve information and find answers to questions using the onlineHelp and/or user’sguide that are included with the product.

Learning process

Learning is an interactive process between the learners and the instructor. By facilitating acooperative environment, the instructor guides the learners through the learning framework.

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.

xiiiAbout this Course—Learner’s Guide

Page 14: Bow320 en Col91 Fv Part Ltr

Objectives

How do I achieve the outcome?

The learners will assimilate new concepts and how to apply the ideas presented in 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 theactivities.

Review

How did I do?

The learners will have an opportunity to review what they have learned during 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.

Web Intelligence Advanced Report Design—Learner’s Guidexiv

Page 15: Bow320 en Col91 Fv Part Ltr

Lesson 1Reviewing Web Intelligence Core Report Design

Lesson introductionIn this lesson youwill review and consolidate your knowledge of keyWeb Intelligence conceptsrequired for advanced report design.

After completing this lesson, you will be able to:

• Build on your knowledge of the Web Intelligence core reporting concepts reviewed

1Reviewing Web Intelligence Core Report Design—Learner’s Guide

Page 16: Bow320 en Col91 Fv Part Ltr

Reviewing core report design conceptsAfter completing this unit, you will be able to:

• Build on your knowledge of Web Intelligence core concepts to become an advanced reportdesigner.

Review: Web Intelligence core report design

1. A Web Intelligence document consists of three components. What are they?

2. A query filter contains three components. What are they?

3. What object type does not have a list of values?

4. When you list values in a formula, what must you use to separate the values?

5. What are the two benefits provided when you apply a break to a table?

6. What are the differences among a query filter, a report filter, and a block filter?

7. What is the difference between a section and a break?

8. What is the difference between an ascending or descending sort and a custom sort?

9. Why purge the data in your document?

10.What is the difference between a dimension and a detail?

11.You have two queries on two different data sources. Query 1 returns 10 rows for Region.Query 2 returns 12 rows forRegion_Area . You synchronize the twodata sources bymergingthe Region and Region_Area objects.

How many rows appear after the synchronization?

12.You have a report with the objects Region, Year, and Sales revenue in Query 1, and youhave another report on a different data source with Region,Area, and Sales total in Query2. Which objects do you choose to merge to synchronize the information in one table?

13.When you synchronize two queries fromdifferent data sources,what rulesmust you respect?

14.Can you synchronize the data between a Web Intelligence document and an Excelspreadsheet?

Web Intelligence Advanced Report Design—Learner’s Guide2

Page 17: Bow320 en Col91 Fv Part Ltr

Lesson summaryAfter completing this lesson, you are now able to:

• Build on your knowledge of the Web Intelligence core reporting concepts reviewed

3Reviewing Web Intelligence Core Report Design—Learner’s Guide

Page 18: Bow320 en Col91 Fv Part Ltr

Web Intelligence Advanced Report Design—Learner’s Guide4

Page 19: Bow320 en Col91 Fv Part Ltr

Lesson 2Working with Advanced Query Techniques

Lesson introductionAfter completing this lesson, you will be able to:

• Use combined queries• Use subqueries• Create a query based on another query• Change data sources

5Working with Advanced Query Techniques—Learner’s Guide

Page 20: Bow320 en Col91 Fv Part Ltr

Using combined queriesWhen youdesignWeb Intelligence documents, there are certain instanceswhere youmayneedto build two or more queries to retrieve the results you require in your report.

As a Web Intelligence user, there are several techniques available that enable you to do this.They are:• Data synchronization using merged dimensions

Data synchronization refers to the process of merging data from multiple sources into asingle block in a document.

Note: This technique is presented in the BusinessObjects Web Intelligence XI 3.0/3.1: ReportDesign 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.

Note: The subquery technique is presented later in this lesson.

• Combined queries

The combined queries technique enables you to create two queries and merge the resultsof both into a single data provider on a selective basis. This can be done by using the Union,Intersection, or Minus functions.

Note: In this unit, you will see that combining queries in a single data provider is differentfrom synchronizing multiple data providers using merged dimensions.

This unit describes how to use combined queries.

After completing this unit, you will be able to:

• Describe the Union, Intersection, 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 ofinformation returned by the query. This standard technique allows you to combine multiplefilters in a single query, and these combinations can be designed to make queries very specificand limiting.

However, this technique only works with a single query. There may be situations when youwant to combine the results of two queries into a single block.

Web Intelligence Advanced Report Design—Learner’s Guide6

Page 21: Bow320 en Col91 Fv Part Ltr

To accomplish this, you must build a combined query. All combined queries are built in theQuery panel, and can only be built using a single universe. Each query needs to have the samenumber of objects as well as the same data types.

There are three methods of combining queries:• Union: combines results which appear in Query 1 OR Query 2.

You use a union query to combine the data from two objects in a single column in a table.Union queries are especially useful for working with incompatible objects.

For example, if you built a query with two incompatible objects, Web Intelligence wouldrun separate SQL statements for each object and then return the data in different blocks(tables). A union query forcesWeb Intelligence to return the data from both objects togetherin one column.

Unions, when used to combine the results of two queries using the same objects, will removeduplicate values, leaving a single instance of the duplicate in the report.

Note: Union is the default operator for combined queries.

• Intersection: combines results which appear in Query 1 AND Query 2.

You use an intersection query to obtain data common to two sets of results. Like a unionquery,Web Intelligence considers each select statement separately and combines their resultsin the end.

7Working with Advanced Query Techniques—Learner’s Guide

Page 22: Bow320 en Col91 Fv Part Ltr

Unlike a union query, the intersection query only returns those values that are in bothqueries. In this sense, it works much the same as using the AND operator when creating aregular query with multiple query filters.

• Minus: combine results which include everything in Query 1 except for what is also true inQuery 2.

You use aminus query to exclude the results of one query from themain query result (Query1). For example, a minus query could be used to find out which customers bought productA but not product B.

You could not obtain this data with standard query filters since the result sets need to beobtained separately before being combined. Like a union query, the minus query considerseach query separately and combines their results in the end.

When you build minus queries, you must pay attention to the order of the queries, sincethe results of Query 2 will always be subtracted from the results of Query 1.

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 theirinvoices. 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), the intent of thedates is incompatible and therefore, the objects are incompatible.

Since the objects are incompatible, if you include them in a standard query, Web Intelligencereturns two blocks of data and does not synchronize the values in a single block.

However, by building a combined query using the Union function, with Invoice Date in thefirst query andReservation Date in the other, the data appears in a single column in the block.

Combining queries is similar but not equivalent to Boolean logical operators that youmay haveusedwhen combining conditions in a single query. The Intersection function is similar in effectto AND; the Union function is similar in effect to OR; the Minus function is similar in effect toNOT.

However, the column of data retrieved by the combined query displays a header that reflectsthe date object from the first query only. In other words, using the example above, the queryreturns a column entitled Invoice Date, but the column actually contains both invoice dates

Web Intelligence Advanced Report Design—Learner’s Guide8

Page 23: Bow320 en Col91 Fv Part Ltr

and reservation dates. This is important to understand, as it may require you to reformat thecolumn header.

Advantages of using combined queries

There are a number of reasonswhy youmaywant to use combined queries instead of applyingmultiple 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 creatingmultiple queries, processing against the database may take longer.

Note: A decision on whether to use query filters or a combined query to retrieve the data you needoften depends on how the data is structured in your database.

Comparing query filters and combined queries

Suppose that you have been asked by theMarketingManager of the eFashion group to producea report listing all products that have not had a special promotion across all stores.

The resulting report should list 203 products that have not had a special promotion.

Note: The table in this image has been truncated.

To produce this report, you need to resolve issues concerning data integrity.

9Working with Advanced Query Techniques—Learner’s Guide

Page 24: Bow320 en Col91 Fv Part Ltr

If you create two queries, one to show the total list of product SKU numbers and SKUdescriptions, the other to show the list of SKU numbers, SKU descriptions, and products thathave had a promotion (Promotion y/n), and then apply a count on the SKU number columnfor each query, you will see that while the first query produces a list of 211 records, the secondproduces a list of only 8.

This is because the eFashion database only has information on product promotions where apromotion has actually occurred.

In this case, of the 211 records available, there are only 8 records where an entry identifies thata promotion has taken place. If you apply a query filter to display only those products wherethe Promotion y/n value is not equal to Yes, you get a message stating that there is no data toreturn. You get the same message if you apply a query filter to display only those productswhere the Promotion y/n value is null.

Due to a relational database limitation, when products are listed with a Promotion column,only products that have a Promotion y/n value will show up in the report. This is a commondata integrity issue. You need to use a combined query to generate the results you require.

Using the combined query technique

The combined query technique combines the results of one query with the results of anotherquery into a single query, or data provider. Themanner inwhich the data is combined dependson the function you choose: Union, Minus, or Intersection .

In the previous scenario, you could not generate a table listing only the products for whichthere were no promotions, because the Promotion y/n object only contains data about theproducts for which there were promotions. However, you can generate the table you need bycreating a combined query using the SKUNumber and SKU desc objects in Combined Query1, and adding the following query filter to Combined Query 2.

The first query produces a list of all products, and the second query produces a list of onlythose products for which there has been a promotion. By using the Minus function to combinethe two queries, you can generate a table that subtracts the 8 records generated by CombinedQuery 2 from the 211 generated by Combined Query 1, resulting in a table listing the 203products for which there has been no promotion.

To build a combined query

1. Create an initial query in theQuery panel.

Web Intelligence Advanced Report Design—Learner’s Guide10

Page 25: Bow320 en Col91 Fv Part Ltr

2. Click Combined Query on the toolbar.

Web Intelligence adds a copy of the initial query to the data provider. The second queryhas the following characteristics:

• It contains the same objects as the original query.• It does not contain the filters defined on the original query.• It is combined with the original query in a Union relationship.

3. To switch to a query, click Combined Query n.

The individual queries in the combined queries are named Combined Query n.

4. To delete a query, right-click theCombinedQuery n youwant to delete, then selectRemoveon the menu.

5. To change the combination type, double-click the operator. The operator moves throughthe sequence Union, Intersection,Minus.

6. Build each query within the combined query as you build any normal Web Intelligencequery.

7. Click Run Query.

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.• Queries that you combine must contain the same number of objects to run successfully.• When you build a combined query to return data from more than one object in a column,

for example, using the Union operator, you must use objects of the same type (character,date or number).

11Working with Advanced Query Techniques—Learner’s Guide

Page 26: Bow320 en Col91 Fv Part Ltr

• Only the objects placed in the first query are displayed in the block after the query is run.Any object used in a combined query does not display in its own column, but instead, thevalues are returned in the same column as the object from the first query.

• Web Intelligence's default behavior when combining queries is to perform a Union (not aUnionAll) and to return all values less the duplicates. You need to define a custom formulaor variable for Web Intelligence to perform a UnionAll.

Retrieving duplicate or unique rows

In a database, the same data may be repeated over many rows. By default, Web Intelligenceautomatically returns all rows, even if they are repeated. This default behavior may cause aninaccurate count when combining queries, particularly when you use the Minus operator.

You can change Web Intelligence’s default behavior so that only unique rows are returned bythe combined query.

To retrieve only unique rows

1. In theQuery panel, display theQuery Properties tab.

2. In theData zone, clear the Retrieve duplicate rows option.

Activity: Combined queries

Objective

• Using Web Intelligence Rich Client, create a document by combining queries, using theUnion, Intersection or Minus functions.

Instructions

Note: To log onto Web Intelligence Rich Client, you need a user name and password for theBusinessObjects Enterprise server. Refer to your class instructor for this information.

You want to create a query that shows a list of product lines. The list must show:• Product lines that are colored Anise

AND

• Product lines that are both Coffee colored, and also have sold a greater quantity than 450units

Using the combined query technique, create the following table:

• Which operator will you use to combine the queries?

Web Intelligence Advanced Report Design—Learner’s Guide12

Page 27: Bow320 en Col91 Fv Part Ltr

Activity: Combined queries - Optional

Objective

• Create a Web Intelligence document by combining queries, using the Union, Intersectionand Minus functions.

Instructions

You are interested in reporting on the relationship between the eFashion stores that earned atleast $3,000,000 in sales revenue and those stores whose margin was at least $1,300,000.

Assume that you already have two reports built using the following queries:• Report 1:1

• Report 2:1

13Working with Advanced Query Techniques—Learner’s Guide

Page 28: Bow320 en Col91 Fv Part Ltr

1. Using the combined query technique, create a table showing all Store names that have bothSales revenue of $3,000,000 or higher and aMargin of $1,300,000 or higher.• Which operator will you use to combine the queries?

2. Once you run the combined query, apply a Count to the Store name column.The table should appear like this:

3. Edit the query and update the data in the table so that it shows all Store names that havehad Sales revenue of at least $3,000,000 but not a margin of $1,300,000 or more.• Which operator will you use to combine the queries?

4. Once you run the combined query, check that the Count is still applied to the Store namecolumn.The table appears like this:

5. Edit the query to display all Store names that have had either Sales revenue of at least$3,000,000 or aMargin of at least $1,300,000.• Which operator will you use to combine the queries?

6. Once you run the combined query, check that the Count is still applied to the Store namecolumn.

Web Intelligence Advanced Report Design—Learner’s Guide14

Page 29: Bow320 en Col91 Fv Part Ltr

The table should appear like this:

7. Which of the previous results could you also achieve using multiple query filters?

8. Save the document as Act_Combinedqueries_Opt.

15Working with Advanced Query Techniques—Learner’s Guide

Page 30: Bow320 en Col91 Fv Part Ltr

Using subqueriesA subquery, as its name suggests, is a query within a query. It contains an inner query, whichreturns a set of data that is used as the basis for a second, outer (or main) query.

After completing this unit, you will be able to:

• Describe subqueries• Create a subquery

Understanding subqueries

Subqueries are used in caseswhere the results of themain query are dependent upon the resultsof the inner query. This means that the inner query must be processed first so that the resultset can be passed on the main query.

Like combined queries, subqueries are always built in theQuery panel.

You construct a subquery by placing a query filter on one of the objects in the main query andthen using the operand for that query filter to launch the subquery. The operator you includein the query filter determines the relationship between the data sets returned by the inner andouter queries.

Typically you use subqueries when:• The value of the operand is unknown.

• The query filter for the report involves a value that will change over time.

Creating a subquery

Now you will explore how and when to use subqueries.

Suppose that you have been asked by the Manager of the Chicago 33rd store of the eFashionGroup to produce a report that lists stores and their revenue whenever those stores' revenueare higher than Chicago 33rd.

Web Intelligence Advanced Report Design—Learner’s Guide16

Page 31: Bow320 en Col91 Fv Part Ltr

To produce the requested report, you need to resolve an issue regarding the query filter. Thequery filter for the report involves a value that is not known prior to the query being made,and it will change over time. Since the revenue of the Chicago 33rd store changes over time,you cannot enter a hard-coded figure for the sales revenue because the user would never beable to refresh the report and get accurate results.

To resolve this problem, you can use a subquery. Begin by creating a query using the Storename andSales revenue objects, and then, using theAdd a subquery button, create a subquery.

By default, the Sales revenue object appears in the subquery definition in theQuery Filterspane. Since youwant your report to display the results for all stores with sales revenue greaterthan or equal to the Chicago 33rd location, change the operand in the subquery to Greater thanor Equal to. Then, complete the subquery by dragging the Store name dimension just belowthe subquery filter definition, and use this syntax:Store name Equal to e-Fashion Chicago 33rd

When you run the query, the report returns the results for the Chicago 33rd store, as well asresults for all the other stores with equal or greater sales revenue.

To build a subquery

1. Add the objects that you want to appear in the query to the Result Objects pane.

2. Select the object that you want to filter with a subquery.

3. Click Add a subquery.The Add a subquery button appears in the toolbar for theQuery Filters pane.

The subquery outline appears in theQuery Filters pane. By default the object you selectedappears as the Filter object and Filter By object.

4. To add aWHERE condition to the subquery, drag an object to theTo filter the query... area.

17Working with Advanced Query Techniques—Learner’s Guide

Page 32: Bow320 en Col91 Fv Part Ltr

5. Select the operator and values used to filter the object in the WHERE condition.

You can use a standard query filter as a WHERE condition in a subquery. To do so, dragand drop the existing filter or subquery to the To filter the query... area. To copy ratherthan move the existing filter to the WHERE condition, hold down the Control key whiledragging and dropping. In this case the existing filter remains in its initial place and becomespart of the WHERE condition of the subquery.

6. Click Subquery to add an additional subquery to the query filter.

In addition to linking subqueries in AND or OR relationships, you can nest them (createsubquerieswithin subqueries) by dragging an existing subquery to theTo filter the query...area. In this case the inner subquery becomes part of the WHERE condition of the outersubquery. To copy rather thanmove the subquery to theWHERE condition, hold down theCtrl key while dragging and dropping. In this case the second subquery remains at thesame level as the first, and becomes part of the WHERE clause of the first.

By default the two subqueries are linked in an AND relationship. Click the AND operatorto toggle between AND and OR.

Activity: Using subqueries

Objective

• Create a subquery using the results of one query as the starting point for a second query.

Instructions

You have been asked by the Manager of the Colorado Springs store of the eFashion Group toproduce a report that lists product lines and theirMargin, when the lines'Margin is higherthan that of the Sweaters line.1. Using the eFashion universe, create a new document and build a query using Line and

Margin.

2. Using the subquery technique, return those lines with a higherMargin than the Sweatersline.

3. You also need to display a title.

4. Save the document as Act_Subqueries.

Web Intelligence Advanced Report Design—Learner’s Guide18

Page 33: Bow320 en Col91 Fv Part Ltr

The report should look like this:

19Working with Advanced Query Techniques—Learner’s Guide

Page 34: Bow320 en Col91 Fv Part Ltr

Creating a query based on another queryWeb Intelligence allows you to create a query based on the structure of another query.Consequently, you save time with complex reports and can ensure that different queries aredefined in exactly the same way.

After completing this unit, you will be able to:

• Duplicate a query in a document to build another query.

Duplicating queries

When you build a report with many queries based on the same universe, duplicating yourquery can accelerate the process, especially when the queries have some of the objects incommon.

Suppose that you are asked to create a report for eFashion that displays state, year, and salesrevenue. The reportmust use a prompted query filter to allowusers to select the state forwhichto return the results.

To create the query, you place the State, Year, and Sales revenue objects in theResult Objectspane of theQuery panel, and place the State object in theQuery Filters pane, using the requiredprompt.

Next, suppose that you are asked to generate another report that prompts for state, but thatthis time displays sales revenue broken down by store and year, rather than by state and year.The query you need to create this report is almost identical to that required for the previousreport. The only difference is that in the second query, you must use the Store name object inthe Result Objects pane, where in the first query you used the State object.

To save yourself the effort of creating an entirely new query to generate the second report, youcan duplicate the first query, delete the State object in the Result Objects pane, and replace itwith the Store name object. When you run the new query, it produces the results you require.

Web Intelligence Advanced Report Design—Learner’s Guide20

Page 35: Bow320 en Col91 Fv Part Ltr

To duplicate a query

1. Select the query you want to duplicate by right-clicking the appropriateQuery tab at thebottom of theQuery panel.

2. SelectDuplicate Query.

A duplicate query appears in theQuery panel, and its tab is labeled <query name> (1).

You can now modify the query.

21Working with Advanced Query Techniques—Learner’s Guide

Page 36: Bow320 en Col91 Fv Part Ltr

Changing data sourcesWeb 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.

After completing this unit, 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 theWeb Intelligence query interface, you can change the data source for your querywhenrequired.

This is particularly useful when:• You move a test universe into production and want to use the same documents on the new

universe. For example, you can change the test universe stores to the production universeeFashion.

• You change between different universes covering different functional areas but based onthe same database.

For example, an organization has a Marketing universe and a Sales universe based on theSales database. The Marketing universe uses objects for companies, contacts, leads, andpromotional efforts. The Sales universe uses objects for companies, contacts, sales orders,and sales revenue.

TheMarketingmanagerswant to knowhowmany contacts establishedduring a promotionalcampaign actually led to sales within the six months following the campaign.

With appropriate access to the Sales universe, the managers can take a query that retrievesthe companies and contacts that participated in the campaign, change the universe fromMarketing to Sales, add the Sales Revenue object from the Sales universe to the query andfilter to retrieve data for the six-month period following the campaign.

To change the data source

1. From your document in theWeb Intelligence Rich Clientmain window, click the EditQuery button.TheQuery panel displays.

Web Intelligence Advanced Report Design—Learner’s Guide22

Page 37: Bow320 en Col91 Fv Part Ltr

For a document built on a local data source, the data source appears in theQuery Propertiessection of the left-hand panel.

For a document built on a universe, click the Properties tab. TheUniverse field appears onthe Properties tab.

2. To change the data source:

• For a document built on a universe, next to the Universe field, click the… (ellipsis)button.

TheUniverse dialog box displays with a list of the universes that you can use to replacethe current one.

• For a document built on a local data provider, next to the Source file field, click the…(ellipsis) button.

The Choose File dialog box displays for you to browse to a new local data source.

3. To select the new data source:

• In the Universe dialog box, click to select the universe and click theOK button.• In the Choose File dialog box, browse to select the local data source and click theOpen

button.

TheChange Source dialog box displays to show you how the objects from the query on theoriginal data sourcemap to objects in the newdata source. The first column shows the object

23Working with Advanced Query Techniques—Learner’s Guide

Page 38: Bow320 en Col91 Fv Part Ltr

from the original query, or the source object, and the second column shows the object in thenew data source, or the target object.

Web Intelligence proposes mapping to objects based on the object name and data type.• The check mark to the left of the object names indicates that the object is mapped to

another object in the new data source.• The X to the left of the object name indicates that the object is removed from the query

on 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.• The X to the left of the object name indicates that the object is removed from the query

on the new data source.

4. Optionally, to modify the proposed mapping or removal of an object, click the ... (ellipsis)button on the line corresponding to the object for which you want to modify the mapping.

Web Intelligence Advanced Report Design—Learner’s Guide24

Page 39: Bow320 en Col91 Fv Part Ltr

TheMap Object dialog box displays.

In theMap Object dialog box:

• To remove the object, select the Remove object option .• To map to a new object, select the Select a new object option and click the object from

the new data source displayed in theMap Object dialog box.

5. ClickOK to close theMap Object dialog box.

6. Repeat steps 5 and 6 for each object with a proposed mapping or removal that you want tochange.

7. ClickOK to close the Change Source dialog box.In theQuery panel, in the Properties tab, the Universe field shows the new data source.The Result Objects pane shows the objects for the new data source.

8. Click Run Query.The results of the query on the newdata source display in theWeb Intelligence Rich Clientmain window.

9. Save the document.

Activity: Changing the data source

Objective

• In this activity, you change the data source from the development universe (stores) to theproduction universe (eFashion).

25Working with Advanced Query Techniques—Learner’s Guide

Page 40: Bow320 en Col91 Fv Part Ltr

Instructions

1. From the course resources, open the Sales per Region.wid document. This document wascreated using the stores universe.The report looks like this:

2. Change the data source to the eFashion universe and map the objects as appropriate.To achieve the desired results, remove one object from the query and map another objectto a corresponding object in the new universe that has a different name.

Web Intelligence Advanced Report Design—Learner’s Guide26

Page 41: Bow320 en Col91 Fv Part Ltr

The report looks like this:

27Working with Advanced Query Techniques—Learner’s Guide

Page 42: Bow320 en Col91 Fv Part Ltr

Quiz: Advanced Query Techniques1. What are the three types of query techniques used in this lesson?

2. If you were to use the UNION operator to combine queries, what would be the result?

3. If you were to use the INTERSECTION operator to combine queries, what would be theresult?

4. If you were to use the MINUS operator to combine queries, what would be the result?

5. List two reasons why you might want to use combined queries.

6. Can you do a subquery and return exactly the same results as a combined query?

7. Which subquery operand type means that Web Intelligence will look for only one instanceof a value from the subquery that meets the query filter?○ a. ALL○ b. ANY

8. Why would you choose to do a combined query rather than a subquery?

9. When you change a data source, what can you choose to do to the objects in the originalquery?

Web Intelligence Advanced Report Design—Learner’s Guide28

Page 43: Bow320 en Col91 Fv Part Ltr

Lesson summaryAfter completing this lesson, you are now able to:

• Use combined queries• Use subqueries• Create a query based on another query• Change data sources

29Working with Advanced Query Techniques—Learner’s Guide

Page 44: Bow320 en Col91 Fv Part Ltr

Web Intelligence Advanced Report Design—Learner’s Guide30

Page 45: Bow320 en Col91 Fv Part Ltr

Lesson 3Working with Calculation Contexts

Lesson introductionThis lesson provides information on howWeb Intelligence performs calculations in reports.By default, Web Intelligence determines the result of a measure when it is projected in thereport based on the dimension(s) in the part of the report where the measure is inserted (forexample, in columns of a table). These dimensions make up what is called the calculationcontext of the measure object or variable.

When you understand the default behavior of contexts, you can also understand how tomanipulate the contexts and force a report to display data in themanner you specify regardlessof the other objects projected.

This lesson demonstrates how to use various operators and keywords to define and redefinecontexts in your calculations.After completing this lesson, you will be able to:

• Understand calculation contexts• Redefine calculation contexts

31Working with Calculation Contexts—Learner’s Guide

Page 46: Bow320 en Col91 Fv Part Ltr

Understanding calculation contextsThis unit introduces key concepts of calculation contexts in Web Intelligence. Calculationcontext is the way that Web Intelligence dynamically calculates values projected in a report bymeasure objects or variables.

In aWeb Intelligence document,measures are calculated dynamically based on the dimensionswith which they appear. For this reason, it is important to understand that Web Intelligence,by default, performs calculations at the row level and at the lowest level dimension availablein your block.

After completing this unit, you will be able to:

• Explain howWeb 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, when objects are placed in a block, the projected values of the measures areaggregated to the level of the dimensions displayed in the block, as opposed to the level of thevalues as stored in the data provider.

For instance, if you create a table showing Year and Sales revenue, the measures will beaggregated to the Year level, as shown in the first table.

If you added State to the beginning of the table then the Sales revenue would be aggregatedby year for each state, as shown in the second table.

Web Intelligence Advanced Report Design—Learner’s Guide32

Page 47: Bow320 en Col91 Fv Part Ltr

When you remove a dimension from the table (Year, in this case), as in the third table in thediagram, Web Intelligence automatically recalculates the sales revenue data according to thenew context (State, in this case).

You can see in this example that sales revenue is calculated at the row level. InWeb Intelligence,this row level calculation is the default calculation context for any measure object or variableplaced in a column.

If you set a section on a report, any measures inserted at the section level are calculated bydefault using the section as the calculation context.

In this example, the report is sectioned by state. Beside the section heading is a cell displayingsales revenue at the state level. Notice that the sales revenue value at the state level matchesthe sum of sales revenue results for all of the stores in the state.

Similarly, if you insert a sales revenue cell beside the report title, the calculation context is thewhole report, so the cell displays the sales revenue grand total.

33Working with Calculation Contexts—Learner’s Guide

Page 48: Bow320 en Col91 Fv Part Ltr

These examples demonstrate the first way of controlling a calculation, where the level ofaggregation 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.• The position of the measure within the body of the report can also control the aggregation

level. If a report is sectioned and you place a measure at the section level of the report, theprojected value of the measure will be aggregated at the dimension level on which thesection is based.

The second way of controlling a calculation is to force a level of aggregation other than thedefault. For example, you can place a variable or a formula in a table, but force it to aggregateto the sum of all values for the table. Such functionality is required if you are going to createpercentage calculations across sectioned reports.

The remainder of this lesson demonstrates how to force the level of aggregation for measurevalues when you project the values in a report.

Web Intelligence Advanced Report Design—Learner’s Guide34

Page 49: Bow320 en Col91 Fv Part Ltr

Redefining calculation contextsThis unit provides reasons why you might choose to redefine the input or output contexts ofmeasures in your report. It also provides examples of the logic to apply when you redefine theinput or output contexts.

These examples show how to use both extended syntax context operators and keywords.

After completing this unit, 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 thecalculation to be something other than the default context.• Input context consists of any dimension objects that need to be included directly IN the

calculation itself.• Output context consists of one or more dimension objects that determine where the

calculation is placed in the report, or in other words, the level where the calculation is to beturned OUT in the report.

In fact, the output context determines at what aggregation level the calculation is displayed(for example, a master variable in a section).

Consider the simple calculation shown here:= Sum([Sales revenue])

There are no dimension objects in the calculation itself, so the input context is the sum of thevalues returned by the measure object Sales revenue. This calculation does not specify anoutput context, so Web Intelligence assumes the default context and uses the dimensions withwhich the measure appears.

35Working with Calculation Contexts—Learner’s Guide

Page 50: Bow320 en Col91 Fv Part Ltr

As no output context is specified for the Sum calculation, it assumes the context of State.

Note: It's important to understand that you can only set the context to a level that exists within thedata provider of the document. For example, if youwanted to change the default context to calculatesales revenue at the city level, the City object must exist in the data provider.

You cannot show data at the city level if the query does not include this object in the dataprovider.

Forcing the input calculation context

You have seen how to use the default calculation context. You can determine what dimensionswill be taken into account when calculating the aggregate for the formula. This is referred toas the input calculation context. Typically, you would want to use this when the calculationneeds to take into account specified dimensions that may not appear in the report, but arecontained within the data provider.

Suppose that you want to create an eFashion report that displays each state, its total revenue,and the best revenue ever achieved in any one year. To understand how to create a variablethat returns the best revenue achieved in any one year by state, it helps to begin by looking ata report that shows sales revenue by year, grouped by state.

The Sales revenue column is sorted in descending order, so the top entry in the Sales revenuecolumn is what you would like to create a variable to identify. Since you don't want your finalreport to contain a Year column, you can now insert a new table that contains only the Stateand Sales revenue objects.

Web Intelligence Advanced Report Design—Learner’s Guide36

Page 51: Bow320 en Col91 Fv Part Ltr

Now you just need to create a variable that returns the state's best year amount and insert it inthe new table. As your first attempt, youmight create a variable calledState's best year amount,using this syntax:=max([Sales revenue])

If you add the new variable to the table, you get this result:

If you compare the state's best year revenue shown in the first block with the data calculatedby the variable you have just created, you can see that the default behavior of the calculation,at the row level, is obviously not the correct context.

By default, Web Intelligence does not know that the Year object needs to be included in thecontext of the calculation - it uses State as the context to calculate the values, and the result isthe exact same calculation that the Sales revenue object projects.

Now, extend the syntax to specify the correct input and output context so thatWeb Intelligenceknows how to calculate the data correctly. The syntax for specifying input and output contextis:

Aggregate function([Measure] input_context) output_context

To extend the syntax, the available operators are:• ForEach• In

37Working with Calculation Contexts—Learner’s Guide

Page 52: Bow320 en Col91 Fv Part Ltr

The key syntactic difference between an input and an output context is where the operator isplaced. In an input calculation context, the operator is placed within the brackets of theaggregate:

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 notwork because although it includesYear in the calculation context, it doesnot include State. Even though the table includes a State column, and you would normallyexpect the data to aggregate to the state level, the In operator only takes into account dimensionsin the formula's dimension list. Now you can modify the variable to use this formula:

=max([Sales revenue] In([Year] ; [State]))

The report looks like this:

Web Intelligence Advanced Report Design—Learner’s Guide38

Page 53: Bow320 en Col91 Fv Part Ltr

This formula achieves the desired result. By default,Web Intelligence takes [state] as the outputcontext.

You can create an alternate formula for the variable by using the ForEach operator instead ofIn. Unlike the In operator, the ForEach operator takes into account all the dimensions in thetable, 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, including In, ForEach, and ForAll.• Extended environment keywords, including Report, Section, Break, Block, and Body. These

keywords are used in formulas in conjunction with the In context operator.

The context operators that are available to redefine the calculation context ofmeasures include:

DefinitionOperator

Used to specify dimensions explicitly. Also used with extendedsyntax keywords.In

Specifies limiting conditions on the data.Where

Adds dimensions to the context.ForEach

Removes dimensions from the context.ForAll

The ForAll and ForEach operators are useful when you have a default context with manydimensions. It is often easier to "add" or "subtract" from the context using ForAll and ForEachthan it is to specify the list explicitly using In.

39Working with Calculation Contexts—Learner’s Guide

Page 54: Bow320 en Col91 Fv Part Ltr

Forcing the output calculation context

In the previous examples, you considered the input calculation contexts. That is, you consideredhow you wanted the measure to aggregate based on the dimensions available in the table andthe data provider.

You can also determine the level of aggregation at which the value for the variable is displayedin the report.

The extended syntax keywords, Report, Section, Break, Block, and Body are useful in definingcalculation context. These keywords, used in conjunction with the In operator, allow you tochange the default context from the row level to another level in the document.

Suppose that you want to create a report that contains an alerter which highlights any storewhose revenue for the year 2006 is lower than the average revenue of all stores in 2006. Youbegin with this report:

Now you want to create a formula that returns the average sales revenue, so you can use thevariable in your alerter. If you click on the Average value in the footer at the bottom of the tableand look in the Formula toolbar, you see that the footer uses this calculation:

=Average([Sales revenue])

This calculation is generic; it has no input or output context specified. It returns a correct averageof revenue earned by stores because no other specific contextwas defined. The calculation usedthe default context of the table footer, which contains calculations based only on data thatresides in the block (the table, in this case).

Note: If a report filter is applied to the table, the default context in the table footer calculatesonly the values retained by the filter.

If you create anAverage variable using the same syntaxWeb Intelligence used to calculate theaverage for all stores, and add a new Average column to the table, you get this result:

Web Intelligence Advanced Report Design—Learner’s Guide40

Page 55: Bow320 en Col91 Fv Part Ltr

The Average variable appears in the table, but the values are now calculated at the row levelrather than at the whole table level.

Why is this happening? The default calculation context has changed.

When the formula =Average([Sales revenue]) is placed in:• The footer: the context is to calculate for the entire table.• The table: the context is to calculate for each individual row.

If you try to build an alerter to highlight values in the Sales revenue column that are belowthe average, the alerter will not work since the Sales revenue values are currently equal to theAverage values.

To solve this, 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 thedimensions in the dimension list, while the In operator aggregates at the report environmentlevel, that is, at the body, block or report level.

The key difference is that when you use the In operator, the formula calculation is aggregatedat the specified level regardless of which dimensions or variables are used in the report.

If you update theAverage formula to use the =Average([Sales revenue]) In Block formula,the report looks like this:

41Working with Calculation Contexts—Learner’s Guide

Page 56: Bow320 en Col91 Fv Part Ltr

Why use this syntax?

By adding In Block as the output context, you are specifying that the calculation should bedisplayed at the block (whole table) level, even though the calculation was placed at the rowlevel.

Why is there no input context?

No input context is needed since the calculation needs to find the average based on the entiretable. By leaving the input context to assume the default, you ensure that no additional objectsare considered when the average is calculated.

Now that theAverage variable uses the correct formula, you can create the alerter to highlightbelow average results per store.

If you apply this alerter to the Store name column in the report, and remove the Averagecolumn, you get the results you require:

Web Intelligence Advanced Report Design—Learner’s Guide42

Page 57: Bow320 en Col91 Fv Part Ltr

More about the extended syntax keywords

The following keywords can be usedwith the In operator to control howmeasures are calculatedat different levels within the document: Report, Section, Break, Block, and Body.

EffectEnvironment Level

The projected value of themeasure is aggregated for all dimensionscontained within the page of the report.Report

The projected value of themeasure is aggregated for all dimensionscontained within the section of the report.Section

The projected value of themeasure is aggregated for all dimensionscontained within the break of the table.Break

The projected value of the measure is aggregated across all valuesfor dimensions contained within the block.Block

The projected value of themeasure is aggregated for all dimensionsat the level in the report that it is placed.Body

Input vs. output calculation contexts

In summary, unless you need the aggregate of a measure to take into account a dimension thatis in the data provider but not in the table, an output calculation will suffice.

43Working with Calculation Contexts—Learner’s Guide

Page 58: Bow320 en Col91 Fv Part Ltr

When specifying an output calculation context, it is normally best to use the In operator as thisis more flexible and will not need to be changed if the dimensions of the environment arealtered.

Conversely,when specifying an input calculation context, it is normally better to use the ForEachoperator 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 Inand Where. Although each operator denotes a different type of calculation environment, thetwo may be used together in a single variable.

The In operator specifies all parameters (dimension objects) that are to be included in thecontext. When using multiple dimension objects, the dimensions should be listed in order ofgranularity 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 forall states as well as specific information for California. You start out creating a query includingthe Year, State, and Sales revenue objects, and remove the State column from the table so thatyour report looks like this:

Web Intelligence Advanced Report Design—Learner’s Guide44

Page 59: Bow320 en Col91 Fv Part Ltr

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 youreplace the Sales revenue column with this new variable, and apply some formatting to thetable, it looks like this:

Now you want to create a variable to find the highest revenue for any one state. You can usethis syntax:

=Max([Sales revenue] In([State]))

This context uses the In operator to specify input context. This assures that the calculation onlyaddresses the State values when locating a maximum amount.

There is no output context defined, so the calculation uses the default output context of theentire 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 followingsyntax:

=Max([Sales revenue] In([State];[Year]) Where([State] ="California"))

This variable definition uses both the In andWhere 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 ByYear for California variable, this calculation uses theWhere operatorin the input context to ensure that the calculation is valid for only those values denoted by theWhere operators.

It is not necessary to list the components of the calculation in order of granularity when usingthe Where operator. You must list the components when using the In operator.

The following table shows syntax and examples for the Where operator.

45Working with Calculation Contexts—Learner’s Guide

Page 60: Bow320 en Col91 Fv Part Ltr

Syntax and Examples:Description:Operator:

[measure_expression] Where [boolean_expression]Restricts the dataused to calculate

Where

The formula Average ([Sales Revenue]) Where ([Country]= "US") calculates the average sales where the country is "US".the measure

expression.The formula Average ([Sales Revenue]) Where ([Country]= "US" Or [Country] = "France") calculates the average saleswhere the country is "US" or "France".

The formula [Revenue] Where (Not ([Country] Inlist("US";"France"))) calculates the revenue for the countriesother than US and France.

The variable [High Revenue] has the formula [Revenue] Where[Revenue> 500000].

When placed in a block, [High Revenue] displays either therevenue 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 theaverage of all the revenues greater than 500000.

Note: You can use the boolean operators with theWhere operator.

Important facts about calculation contexts

• If you do not define an input or output context,Web Intelligence assumes the default contextof where the calculation has been placed.

• When using variables as the basis of an alerter (as in the Average example just seen), it isnecessary to ensure that the calculation has been created as a variable (that is, a formulawith a name), and not as a simple formula.

Note: If the calculation is a formula, show the Formula toolbar, then click theCreateVariablebutton in order to save it as a variable.

• When using theWhere operator, it is necessary to place parentheses around the values listedafter 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 Intelligencedocument.

Web Intelligence Advanced Report Design—Learner’s Guide46

Page 61: Bow320 en Col91 Fv Part Ltr

Instructions

1. Create a document that shows in a single block:• Sales revenue for each eFashion store.• Total sales revenue for all stores.• Average revenue for all stores.• Highlight those stores whose revenue was above the average revenue for all stores.

2. Change the name of the report to Revenue Information for All Stores.

3. Save the document as Act_Calculationcontext.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 Intelligencedocument.

Instructions

1. Create a document that shows in a single block:• Sales revenue per Year, broken down by Store name.

47Working with Calculation Contexts—Learner’s Guide

Page 62: Bow320 en Col91 Fv Part Ltr

• The maximum revenue per store, over the three year period.• Highlight the store name when this maximum revenue value is greater than $1,000,000.

2. Save the document as Act_Calculationcontext_2.Your document should look like this example:

Web Intelligence Advanced Report Design—Learner’s Guide48

Page 63: Bow320 en Col91 Fv Part Ltr

Quiz: Calculation Contexts1. What is an input context?

2. What is an output context?

3. Which of the following is an extended syntax context operator?○ NoFilter()○ ForEach○ Block

4. Which of the following is an extended syntax keyword?○ NoFilter()○ ForEach○ Section

49Working with Calculation Contexts—Learner’s Guide

Page 64: Bow320 en Col91 Fv Part Ltr

Lesson summaryAfter completing this lesson, you are now able to:

• Understand calculation contexts• Redefine calculation contexts

Web Intelligence Advanced Report Design—Learner’s Guide50

Page 65: Bow320 en Col91 Fv Part Ltr

Lesson 4Creating Formulas with Character and Date StringFunctions

Lesson introductionThe ability to create formulas and define them as variables inWeb Intelligence offers the reportdesigner a very powerful tool. Variables act just like dimension or measure objects. Once youhave created a variable, you can use it throughout the document to display data that you cannotretrieve by using the existing objects in the universe.

In this lesson, you learn about some of the formula functions available formanipulating characterand date variables. While the syntax may take some time to comprehend, it is well worth theeffort as variables can provide you with more flexibility in reporting.

Note: For more information about creating formulas and defining them as variables, refer tothe BusinessObjects Web Intelligence XI 3.0/3.1: Report Design course.

After completing this lesson, 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

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

Page 66: Bow320 en Col91 Fv Part Ltr

Using character stringsA character string is a series of characters that form either a piece of text or the individual valuesof a character-type variable. They are always categorized as dimension objects, but the reverseis not true. A dimension object can be of character, date, or numeric type.

Using Web Intelligence character-string functions, you can replace, modify, or remove eitherall or part of a character string.

After completing this unit, 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() - used to extract a given number of characters from the right

• Replace() - used to replace a specified string with another string

• Left() - used to extract a given number of characters from the left

• SubStr() - used to extract a string from within a string using variable length and position

• Length() - used to identify the length of a string

• Pos() - used to identify the position of a character in a string

Replace() , Right(), and Left() are only useful when you want to manipulate a constant stringor a constant number of characters. SubStr() is a more powerful function. You will use theSubStr() function to extract strings where the length and position are not consistent.

Using functions in formulas and variables

You use the functions presented in this lessonwhen you are creating a formula. You can createa formula by typing it in the Formula bar or in the Formula Editor . Either method calculatesthe data and displays the resulting values in the column that you have highlighted in the block.

You can also drag and drop objects in the Formula bar and then complete the formula by typingin the Formula bar.

If youwant to use the formula repeatedly in different blocks or different reports in the document,or if you want to identify the formula as though it were an object in the document, you candefine the formula as a variable.

If you only want to display the calculated value in a single cell, then creating a formula is best.However, if you want to display the result as a column in a report block, then defining theformula as a variable is best.

If in doubt, always create a variable rather than a formula, as there are certain things that cannotbe done with a formula that can be done with a variable.

Web Intelligence Advanced Report Design—Learner’s Guide52

Page 67: Bow320 en Col91 Fv Part Ltr

Using the Right() functionThe Right() function displays a fixed number of characters starting from the right end of thecharacter string and removes the others.

The syntax for the Right() function is:

string Right(string input_string; integer number_of_characters)

input_string refers to the string from which you want to select characters to display.

number_of_characters sets the number of characters to display from the right of the inputstring.After completing this unit, 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, 2004). However, you need to display the year in two-digit format (for example,04). To do this, you can use the Right() character string function to remove the first two digitsand display the last two.

Create a new variable called Years, using this syntax:=Right([Year] ; 2)

where:

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

Page 68: Bow320 en Col91 Fv Part Ltr

DescriptionSyntax

The name of the object that retrieves the data.[Year]

The number of characters to display from theright of the character string.

2

Note: The Left character string function works in exactly the same way except that the functiondisplays the specified number of characters starting from the left.

When you drop the Years variable in the section header block, the report looks like this:

To further clarify the section header, you can modify the Years formula to use this syntax:=NameOf ([Year]) + " " + Right([Year] ; 2)

where:

DescriptionSyntax

To display the name of the Year object.NameOf([Year](

To concatenate a space after the object name.+” “

To concatenate and display two characters starting from the rightend of the character string.

+ Right ([Year]) ;2 )

The report looks like this:

Web Intelligence Advanced Report Design—Learner’s Guide54

Page 69: Bow320 en Col91 Fv Part Ltr

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

Page 70: Bow320 en Col91 Fv Part Ltr

Using the Replace() functionThe Replace() function replaces a specified string with another string.

The syntax for the replace function is:

string Replace(string input_string; string string_to_replace; string

replace_string)

input_string The input string.

string_to_replace The string within input_string to be replaced.

replace_string The string to replace string_to_replace with.

After completing this unit, 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 inthe report.

You can create a variable using the Replace() function to modify the character string displayedin the report using this formula:=Replace([Quarter] ; “Q” ; “Quarter ”)

where:

DescriptionSyntax

The name of the object that retrieves the data.[Quarter]

Web Intelligence Advanced Report Design—Learner’s Guide56

Page 71: Bow320 en Col91 Fv Part Ltr

DescriptionSyntax

The value stored in the database, followedby 1 through 4 to indicate the first throughfourth quarters of the year.

“Q”

The character string that will replace “Q” inevery instance.

“Quarter ”Note: Be sure to add a space after the word Quarterand before the end-quote.

If you replace the Quarter column with the new variable you created, you get this result:

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

Page 72: Bow320 en Col91 Fv Part Ltr

Using the SubStr() functionThe SubStr() function extracts a specified character string from within a string.

The syntax for the SubStr() function is:

string Substr(string input_string; integer start; integer length)

input string is the string from which the substring is to be extracted.

start is the position of the first character in the input string to be extracted (for example, 1).

length is the number of characters (from the initial position forward) to be extracted.

After completing this unit, 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,but prefaces each one with "e-Fashion".

Suppose that you want to remove the e-Fashion portion of the character string. This presentsa challenge since the length of each store's name is different, with or without the "e-Fashion"portion. Neither the Right() or Left() functions will work here.

The easiest way to achieve the removal is to use the SubStr() function. Create a variable calledStore, and use this syntax:=SubStr([Store name] ; 11 ; Length([Store name]))

Why?• "11" represents the starting point at which the formula is to start displaying characters. This

was established by counting the number of characters in "e-Fashion" (9) and then adding a

Web Intelligence Advanced Report Design—Learner’s Guide58

Page 73: Bow320 en Col91 Fv Part Ltr

character to account for the space between the word "e-Fashion" and each store name (10).Therefore you want the starting point to be character 11.

• 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 characterposition that you want the substring to start displaying characters. Character positions identifiedin the SubStr() syntax are those you want to see displayed, not those you want to remove.

If you replace the Store name column with the Store column, the report looks like this:

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

Page 74: Bow320 en Col91 Fv Part Ltr

Using the Pos() functionThe Pos() function identifies the first instance of a unique character and returns the number ofcharacters from the start of a string to that instance of the character.

The syntax for this function is:

integer Pos(string input_string; string pattern)

input_string defines the string to be searched for the occurrence of a character and it's positionin the string.

pattern is the character string you wish to search for.

After completing this unit, 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 eFashionstores. The Address object from the universe returns both the building number and the streetname, and the number of spaces before the street name begins is inconsistent. Therefore, youmust create a substring to return only the portion of the address that is needed.

Notice that in each address there is a space after the building number. If you can create a formulathat recognizes at what position the space lies for each value, you can use that position as astarting point for the SubStr() function.

Create a variable called Space, using this syntax:Syntax: =Pos([Address] ; " ")

Web Intelligence Advanced Report Design—Learner’s Guide60

Page 75: Bow320 en Col91 Fv Part Ltr

This variable locates the first space within each address string. If you add a Space column tothe report, you get this result:

The integer returned by the Space variable corresponds to the number of characters before thestreet address begins. Now you can create a new variable called Store Address, that removesthe building number from the address string. Use this syntax:=SubStr([Address] ; [Space]+1 ; Length([Address]))

Why?• The Space variable sits at the 'beginning number' slot of the SubStr() function's syntax. It

contains the variable name and the text pattern you want to locate (a space in this case).• 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.• 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 spacein this case) in the beginning number position.

If you delete the Space column from the report, and replace theAddress columnwith the StoreAddress variable you just created, you get the result you require:

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

Page 76: Bow320 en Col91 Fv Part Ltr

Concatenating different character stringsThe character used to link two strings together in a formula, or concatenate data, is the plussymbol "+". The syntax is:

"String1” + "String2”

Note: You can concatenate as many strings together as you like.

After completing this unit, 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, consider combining a string value with the LastRefresh Date free-standing cell formula.

The Last Refresh Date free-standing cell displays the date and time that the document waslast 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, or query, was last refreshed. If yourreport has one data provider only, you can omit the [data_provider] parameter. You must enclosethe name of the data provider in square brackets.

If you insert the Last Refresh Date free-standing cell into a report and view the formula in theFormula Editor, you see this:=LastExecutionDate()

To insert a descriptive string prior to the date, you can modify the formula like this:="Last Execution Date: "+LastExecutionDate()

This formula concatenates the "Last Execution Date" character string with theLastExecutionDate() function. 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 datewith a string. Nowyouwant to display the date usinga character string as well.

Web Intelligence Advanced Report Design—Learner’s Guide62

Page 77: Bow320 en Col91 Fv Part Ltr

Normally, if you had not included the character string Last Execution Date in the formula, youcould right-click the cell and select the Format Number item from the drop-down menu.

Then youwould select the date format of your choice from theDate/Time zone of theNumberFormat dialog box. However, now that you have edited the formula to add a character string,you can no longer use the standard formatting method. To format a date so that it is displayedas a string when it is concatenatedwith another string, you use the FormatDate() function. Thesyntax for this function is:string FormatDate(date date_to_format; string date_format)

For example:FormatDate([Start Date] ;"dd/MM/yyyy")

For example, if you modify the Last Refresh Date formula to use the FormatDate() function,using this syntax:="Last Execution Date: " + FormatDate(LastExecutionDate() ; "Mmmm dd, yyyy")

The date now displays like this:

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

Page 78: Bow320 en Col91 Fv Part Ltr

Note: To convert a number to a string you can use the Format number() function. The syntax forthis function is:string Format number(number number_to_format; string number_format)

Web Intelligence Advanced Report Design—Learner’s Guide64

Page 79: Bow320 en Col91 Fv Part Ltr

Using date functionsThe 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, you will consider the process of converting a string to a date as dates are oftenformatted 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.

After completing this unit, 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, there is no object for number of years trading. The universe only hastheOpening Date dimension object.

Note: The values returned by theOpening Date object are displayed in the format "MM/dd/yyhh:mm:ss AM."

Suppose that you want to create a variable that calculates the number of years that stores havebeen trading, based on the date the stores opened.

If you right-click theOpening Date object in theData tab, you see that it is a string.

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

Page 80: Bow320 en Col91 Fv Part Ltr

Before you can calculate the trading years you need to strip out the time element of the stringand then convert it to a date type. Then you will be able to perform a date calculation todetermine the difference between today's date and the opening date.

You can use the Substr() function to strip out the time element of the string. However, the dateelement is not in a constant format (for example, some days andmonths are expressed as singledigits while others are two digits).

Since the date is always followed by a space you can use the Pos() function to define the numberof character elements of the Substr() syntax. You can create a variable calledDate_Substringbased on this formula:=SubStr([Opening date] ; 1 ; Pos([Opening date] ;" ")-1)

Then you can create another variable called Open_Date to convert the Date_ Substring valuesto date type using this formula.=ToDate([Date_Substring] ; "MM/dd/yy")

Note: The datemust be formatted in the sameway as the string that is being converted. For instance,if the order of the dates in the string is Month/Day, then the date must be formatted the same way.If the order of the dates in the string is Day/Month however, then the formulamust use that formatas well. If you replace theOpening Date column in the report with theOpen_Date variable, thecolumn looks like this:

Using date calculations

Now that you have created a date type variable for the store opening date, you can calculatethe number of days to the current date using the CurrentDate() and DaysBetween() functions.The syntax of the DaysBetween() function is:integer DaysBetween(date first_date; date last_date)

first_date The oldest date.

last_date The most recent date.

Web Intelligence Advanced Report Design—Learner’s Guide66

Page 81: Bow320 en Col91 Fv Part Ltr

You can create a variable called Trading_Years using this formula:=DaysBetween([Open_Date] ; CurrentDate())/365.25

Note: To convert the days to years, you must divide by the number of days in a year and in sodoing take account of leap years. Hence, the date calculation is divided by 365.25 days.

If you replace theOpen_Date column with the Trading_Years variable you just created, youachieve the required result:

Activity: Character and date string functions

Objective

• Use the SubStr() functions in conjunction with the Length() function to do high-level stringformatting.

Instructions

Create a report showing the year that each eFashion store opened.1. Create a report using the eFashion universe and select the following objects:

Opening Date and Store name

2. Using theOpening Date object as the basis for the formulas, create new variables so thatthe final report displays simply the year that each store opened, not the exact date and time.

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

Page 82: Bow320 en Col91 Fv Part Ltr

Your report appears like this:

Note: The Year opened object is formatted as a number, not a date, so you must format thenumber to display without a comma to achieve the desired result.

3. Save the report as Act_YearOpened.

Activity: Character and date string functions - 2

Objective

• Use the SubStr() function in conjunction with the Length() function to do high-level stringformatting.

Instructions

Create a report showing the margin performance across all eFashion stores.1. Create a report using the eFashion universe and select the following objects:

State, Store name, Quantity Sold, Sales Revenue,Margin

2. Apply a sum to all measures.

3. There is a lot of repetition in the Store name column. Create a variable calledStore to removethe eFashion from the Store name.

4. Save the report as Act_characterdatestring.

Web Intelligence Advanced Report Design—Learner’s Guide68

Page 83: Bow320 en Col91 Fv Part Ltr

Your report appears like this:

Converting a string to a date value

In the eFashion universe, there is no object for number of years trading. The universe only hastheOpening Date dimension object.

Note: The values returned by theOpening Date object are displayed in the format "MM/dd/yyhh:mm:ss AM."

Suppose that you want to create a variable that calculates the number of years that stores havebeen trading, based on the date the stores opened.

If you right-click theOpening Date object in theData tab, you see that it is a string.

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

Page 84: Bow320 en Col91 Fv Part Ltr

Before you can calculate the trading years you need to strip out the time element of the stringand then convert it to a date type. Then you will be able to perform a date calculation todetermine the difference between today's date and the opening date.

You can use the Substr() function to strip out the time element of the string. However, the dateelement is not in a constant format (for example, some days andmonths are expressed as singledigits while others are two digits).

Since the date is always followed by a space you can use the Pos() function to define the numberof character elements of the Substr() syntax. You can create a variable calledDate_Substringbased on this formula:=SubStr([Opening date] ; 1 ; Pos([Opening date] ;" ")-1)

Then you can create another variable called Open_Date to convert the Date_ Substring valuesto date type using this formula.=ToDate([Date_Substring] ; "MM/dd/yy")

Note: The datemust be formatted in the sameway as the string that is being converted. For instance,if the order of the dates in the string is Month/Day, then the date must be formatted the same way.If the order of the dates in the string is Day/Month however, then the formulamust use that formatas well. If you replace theOpening Date column in the report with theOpen_Date variable, thecolumn looks like this:

Web Intelligence Advanced Report Design—Learner’s Guide70

Page 85: Bow320 en Col91 Fv Part Ltr

Quiz: Character and Date String Functions1. Name at least three character string functions used in this lesson.

2. To find the occurrence of a comma in an object’s value, which function would you use?

3. What is the syntax for the Replace() function?

4. When would you choose to use the Length() function?

5. Give an example of string concatenation.

6. If you want to create a formula to return the number of years between two dates, whatwould the syntax be?

7. Can you do calculations on a date?

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

Page 86: Bow320 en Col91 Fv Part Ltr

Lesson summaryAfter 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

Web Intelligence Advanced Report Design—Learner’s Guide72

Page 87: Bow320 en Col91 Fv Part Ltr

Lesson 5Using If Logic

Lesson introductionThe If() function is a powerful tool available toWeb Intelligence report designers. Often referredto as "If... Then... Else" logic, this function can be used in many different ways to apply customformulas in a report.

This lesson shows you how to use the If() function logic in two ways: to group values in avariable, and to modify the way calculations behave when certain values are returned by anobject.After completing this lesson, you will be able to:

• Use If() to group data• Use If() to modify calculation behavior

73Using If Logic—Learner’s Guide

Page 88: Bow320 en Col91 Fv Part Ltr

Using If() to group dataIn this unit, you will use the If() function to group values returned from the database intocategories. Using the If() in thismanner, report designers are empowered to perform the reportequivalent of the Decode, Case, and If functions available to universe designers at the databaselevel.

If() can be used to group some of the values returned by an object and then to define thatgrouping as a new variable in the document.

After completing this unit, 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 ofdetail

You can use the If() function in Web Intelligence to group values returned by an object intocategories. These categories can then be used as the basis for aggregating measures at higherlevels of detail.

For example, the eFashion universe containsQuarter andQuantity sold objects, which allowyou to analyze the quantity sold totals for each quarter. However, if your reporting requirementis to display the quantity sold measure aggregated at the half year level of detail, then theuniverse does not provide the objects you need to meet this requirement.

By creating aHalf Year variable based on theQuarter object, you can aggregate quantity soldtotals for each half of the year. This data can then be presented in the same report with quantitysold totals for each quarter.

Web Intelligence Advanced Report Design—Learner’s Guide74

Page 89: Bow320 en Col91 Fv Part Ltr

In this example, theHalf Year variable looks at each value for theQuarter object. If the quarter’sreturned value is either Q1 or Q2 then the variable displays the words “Year’s First Half” andif the quarter’s value is anything other thanQ1 or Q2 then it displays thewords “Year’s SecondHalf”.

The syntax used with the If() function is:If (boolean_expr; value_if_true; value_if_false)

boolean_expr refers to an expression that returns TRUE or FALSE.

value_if_true is the value returned if the expression returns TRUE.

value_if_false is the value returned if the expression returns FALSE.

Note: In Web Intelligence XI 3.x, you can also use this syntax with the If() function:If boolean_expr then value_if_true else value_if_false

Using this syntax, you replace the semicolons in the formula with the words they represent. Eithersyntax produces the same results.

If you wanted to create the Half Year variable in this example, you could use this syntax:=If([Quarter] InList("Q1";"Q2"); "Year's First Half"; "Year's Second Half")

Or this syntax:=If[Quarter] InList("Q1";"Q2") Then "Year's First Half" Else "Year's Second Half"

Note: You can use the Inlist operator to providemultiple values. All the valuesmust appear betweenthe parenthesis that follow the operator. Each value must be in quotes and separated from othervalues by semicolon.

Example :InList(“Q1” ; “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 aggregatedfor each of the eFashion Market Types. The three Market Types are Top Performers, AveragePerformers, and Low Performers. Each store needs to be assigned to the appropriate categorybased on the following business rules:

Sales RevenueMarket Type

Greater than 7,500,000Top Performers

Between 2,000,000 and 7,500,000Average Performers

Less than 2,000,000Low Performers

75Using If Logic—Learner’s Guide

Page 90: Bow320 en Col91 Fv Part Ltr

You need to display revenue figures including market-type subtotals in the table andmarket-type revenue breakdowns in the chart.

You can begin by creating a table using the State and Sales revenue objects.

Next, you need to create aMarket Type dimension variable, using this formula:=If([Sales revenue]>7500000;"Top Performers" ; If([Sales revenue]Between(2000000;7500000);"Average Performers"; If([Sales revenue]<2000000;"Low Performers")))

Or=If[Sales revenue]>7500000 Then "Top Performers" ElseIf[Sales revenue]Between(2000000;7500000) Then "Average Performers" ElseIf[Sales revenue]<2000000 Then "Low Performers"

If you add aMarket Type e column to the report, apply a break onMarket Type, and insert aSum on the Sales revenue column, you get this result:

To insert the chart, drag the 3D Pie Doughnut template onto the report and insert the Salesrevenuemeasure on the Y-axis andMarket Type dimension on the X-axis like this:

Web Intelligence Advanced Report Design—Learner’s Guide76

Page 91: Bow320 en Col91 Fv Part Ltr

The finished report looks like this:

Activity: Grouping data

Objective

• Use the If() function syntax to group data values.

Instructions

You want to group states into regions so that you can compare revenue per region.1. Create a new document using the eFashion universe and select the following objects:

State and Sales revenue

2. Create a variable called Region and group the states by regions, based on the followingcategories:

77Using If Logic—Learner’s Guide

Page 92: Bow320 en Col91 Fv Part Ltr

StateRegion

CaliforniaWest

Colorado

IllinoisCentral

Texas

Massachusetts

EastNew York

DC

Florida

3. Insert the Region variable into the table so that its values are projected in a new column inthe 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 eachtenure-type category.

Web Intelligence Advanced Report Design—Learner’s Guide78

Page 93: Bow320 en Col91 Fv Part Ltr

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 newWeb Intelligence document using the eFashion universe.

2. Include theName of manager, State, and Sales revenue objects in the query.

3. Create a variable called Tenure type.

4. Validate the syntax and verify thatWeb Intelligence has applied theDimension qualificationto the variable.

5. Define the formula to group each store manager into a category, based on the followingtenure-type categories:

Name of managerTenure type

BennettTrainee

Leonard

Junior Tuttle

Queen

Anderson

Senior

Barrett

Larry

Mark

Michelle

Quinn

Richards

Steve

6. Insert the Tenure type variable into the table so that its values are projected in the firstcolumn in the table.

7. Format the report so that it is organized in blocks that show the sales revenue earned bythe managers in each tenure-type category.

79Using If Logic—Learner’s Guide

Page 94: Bow320 en Col91 Fv Part Ltr

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 arelationship between price range andQuantity Sold.1. Create a newWeb Intelligence document using the eFashion universe.

2. Include the SKU Desc, Unit Price MSRP, andQuantity Sold objects in the query.

3. Create a variable called Price Range, using these categories:

Price rangeGroup

Over $300High Price

Web Intelligence Advanced Report Design—Learner’s Guide80

Page 95: Bow320 en Col91 Fv Part Ltr

Price rangeGroup

Between $150 and $300Mid Price

Below $150Low Price

4. Insert a Price Range column in the table.

5. Apply a break on Price Range, and sort the Price Range column to display the report blocksin this order:High Price, Mid Price, Low Price

6. Apply an Average calculation on theQuantity Sold column.The first block in your report should look similar to this:

81Using If Logic—Learner’s Guide

Page 96: Bow320 en Col91 Fv Part Ltr

Using the If() function to modify calculation behaviorThe If() function is useful for extending the functionality and flexibility of calculations in reports.More specifically, by using the If() function, report designers can change howameasure behavesbased on each value returned for an object.

After completing this unit, you will be able to:

• Use the If() function to modify how data is calculated depending on the values returned byan 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 behavemore dynamically.

The syntax for using the If() function to modify the behavior of calculations is:=If([object name]= “true value”; [measure] behavior A ; [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, thenthe calculation should behave in a certain manner; otherwise, the value should be calculatedin a different manner.

Suppose that you want to build a report that calculates the target revenue for each store. Youbegin by creating a query including the State, Store name, and Sales revenue objects, resultingin this table.

Now you need to insert a column that shows the appropriate target revenue for each store.Each store has a different target for the percentage of growth to achieve based on the state inwhich the store is located. Therefore, a single calculation will not work.

Web Intelligence Advanced Report Design—Learner’s Guide82

Page 97: Bow320 en Col91 Fv Part Ltr

The stores in the following states are to grow their revenue based on these percentages:

% Growth RequiredState

5%California

10%Colorado

15%DC

15%Florida

15%Illinois

18%Massachusetts

15%New York

15%Texas

You can create a Target Revenue Based on Required % Growth variable using this syntax:=If([State]="California" ; [Sales revenue]*1.05 ; If([State]="Colorado" ; [Sales revenue]*1.1 ; If([State]InList ("DC";"Florida";"Illinois";"New York";"Texas ") ; [Sales revenue]*1.15 ; If([State]="Massachusetts" ; [Sales revenue]*1.18))))

Or, if you prefer to create the formula using text rather than semicolons:=If[State]="California" Then [Sales revenue]*1.05 ElseIf [State]="Colorado" Then [Sales revenue]*1.1 ElseIf [State] InList ("DC" ; "Florida" ; "Illinois" ; "New York" ; "Texas ") Then [Sales revenue]*1.15 ElseIf [State]="Massachusetts" Then [Sales revenue]*1.18

If you add this variable to the report, and apply the appropriate formatting to the column, youget this result:

83Using If Logic—Learner’s Guide

Page 98: Bow320 en Col91 Fv Part Ltr

Syntax of the If() function

This syntax is based on the If…Then…Else logic and the percentage rates that each state issupposed to grow by.

Some considerations regarding this syntax are:• When you list a single state, you place the "=" sign before the State value, but when two (or

more) states are listed, you use the InList operator.

• The syntax requires that whenmultiple values (States) are listed, all the valuesmust appearin parentheses and each individual value must be in quotes as well as separated from theother values by a semicolon.

Activity: Modifying the calculation behavior

Objective

• Use the If() function to create a variable that calculates the projected revenue based onrevenue by store.

Instructions

Using the eFashion universe, you want to display the projected revenue for each store basedon the revenue generated to date. You need to create a variable to calculate this projectionbased on the sales revenue.

This variable needs to look at the sales revenue, and if it falls above certain criteria, then adifferent calculation needs to be performed.1. Create a newWeb Intelligence document using the eFashion universe.

2. Include the State, Store name and Sales revenue objects in the query.

Web Intelligence Advanced Report Design—Learner’s Guide84

Page 99: Bow320 en Col91 Fv Part Ltr

3. Create a variable called Projected Revenue.

4. Define the formula to calculate each store’s projected revenue based on the following:

AmountRevenue

1.25>=2000000

1.15>=1500000

1.05All others

5. Validate the syntax and verify that Web Intelligence has applied theMeasure qualificationto the variable.

6. Drag the Projected Variable variable to the right of the last column in the table.Your report appears like this example:

85Using If Logic—Learner’s Guide

Page 100: Bow320 en Col91 Fv Part Ltr

Quiz: Using If Logic1. What is another term for the logic used by the If() function?

2. Which of the following are examples of why youmight use the If() function to group valuesin a variable:

• To display categories of values• To show values aggregated at higher levels of detail

3. True/False. You can use the If() function to define a variable so that a different calculationis used depending on the value retrieved by the object specified in the variable’s formula.

Web Intelligence Advanced Report Design—Learner’s Guide86

Page 101: Bow320 en Col91 Fv Part Ltr

Lesson summaryAfter completing this lesson, you are now able to:

• Use If() to group data• Use If() to modify calculation behavior

87Using If Logic—Learner’s Guide

Page 102: Bow320 en Col91 Fv Part Ltr

Web Intelligence Advanced Report Design—Learner’s Guide88

Page 103: Bow320 en Col91 Fv Part Ltr

Lesson 6Working with Additional Reporting Techniques

Lesson introductionIn this lesson you will explore several reporting techniques, including using data tracking toquickly identify changes in report data, determining whether a character string matches aparticular pattern, overrding report filters or ranking to calculate total values, displaying arunning sum, and displaying drill filters.After completing this lesson, you will be able to:

• Use data tracking• Use additional report functions

89Working with Additional Reporting Techniques—Learner’s Guide

Page 104: Bow320 en Col91 Fv Part Ltr

Using data trackingWith Web Intelligence data tracking, you can quickly identify the data changes and focus onthe most relevant data when you analyze the changes.

After completing this unit, 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 forany level of aggregation.

A documentwith data tracking activated retrieves twomicrocubes -- one for the reference dataset and one for the current data set. The document compares the data in the two microcubesand highlights the changes according to the formatting that you defined for the changes.Similarly, when a document contains calculations on the data set, it compares the calculationson each data set to display the changes.

A document with data tracking activated contains two times more data than a document forwhich data tracking is not active so the data tracking document can take up to three timeslonger to refresh.

Certain actions clear the document of the data stored in the microcubes or modify the dataprovider. When the document no longer contains the data, the data tracking function cannotcompare the data sets and highlight the changes. Similarly, when the data provider changes,the current version of the document is not compatiblewith the reference version so the changeddata does not display.

The actions that clear the document of the data or change the data provider include:• Drilling out of scope.• Using the query drill.• Deleting a query.• Modifying the SQL generated by a data provider. This includes modifying security rights.• Purging the document.

Note: When you unintentionally purge a document, you can recuperate the data from themicrocube before you save the purged document. Close the document, do not save it, andopen it again.

Using formula language to track data changes

You can use the formula language to include calculations based on data changes. For example,you can include a calculation to show the difference between the previous value and the currentvalue of a measure. You can also use formula language to build custom alerters for formattingdata changes.

Web Intelligence Advanced Report Design—Learner’s Guide90

Page 105: Bow320 en Col91 Fv Part Ltr

To display the reference data set in your report, you can use the RefValue function to create aformula or variable. This function gives the value of the reference data for the measure. Whenthere is no reference data, the function returns null.

For example, when theRevenuemeasure currently has the value 1000, and the reference valueis 900, the formula RefValue([Revenue]) returns 900.

The RefValueDate function returns the date of the reference data used for data tracking.

Security for data tracking

Two security options exist for the data tracking feature. Your system administrator determinesthe rights assigned to each user. However, when you work with different report users, youmay want to know the different profiles that exist:• The right to see, but not modify the data tracking.• The right to see data tracking, and to use the interface elements for data.

Activity: Calculating on changed data

Objectives

• In this activity, you use the refValue and refValue date functions to display the referencedata in your report.

• Note: For this activity, you create a report on the local data source Data Tracking1.xlsand activate data tracking. Then, to simulate a change in the data, you run the report againstData Tracking2.xlswhich has updateddata. You can find theseMicrosoft Excel spreadsheetfiles in the course resources. Youmaywant to create a backup of both files before beginningthe activity.

Instructions

1. Create a new document from the local data source Data Tracking1.xls.

Note: You can find the Data Tracking1.xls file in the course resources.

91Working with Additional Reporting Techniques—Learner’s Guide

Page 106: Bow320 en Col91 Fv Part Ltr

2. Format the report to look like the one below:

3. Activate data tracking to use the current data set as the reference data set for all refreshes.

4. Define the formatting for data changes.

5. 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.• Display the reference data set date at the top of the report.• Display a sum for the Sales revenue column.• In the cell next to the total Sales revenue sum, place a variable to calculate the difference

between the current sales revenue and the revenue from the reference data set.

Web Intelligence Advanced Report Design—Learner’s Guide92

Page 107: Bow320 en Col91 Fv Part Ltr

The report appears like this:

6. Using Windows Explorer, browse to the location of the Data Tracking 1.xls and Data

Tracking2.xlsMicrosoft Excel files in your course resources folder.

7. Rename Data Tracking 2.xls to Data Tracking 1.xls.

8. In Web Intelligence, refresh the data in the report.The report appears like this:

93Working with Additional Reporting Techniques—Learner’s Guide

Page 108: Bow320 en Col91 Fv Part Ltr

Using additional report functionsThis unit describes several functions that you can use to display specific data in your documents.

After completing this unit, you will be able to:

• Use theMatch() function to determinewhether a character stringmatches 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 theDrill Filters cell from the Templates tab.• Understand additional functions that enhance the formula language in theWeb Intelligence

XI 3.0/3.1 release.

Determining matches in strings

The Match() function allows you to determine whether a character string matches a particularpattern.

The Match() function is a boolean function and returns 1 if there is a match or 0 if there is nomatch.

Syntax:

boolean Match(string input_string; string pattern)

input_string defines the string to be searched for.

pattern is the character string you wish to search for.

The wildcards that you can use with this function include:• * (asterisk) for any number of characters.• ? (question mark) for any one character.

Suppose that you want to create a report that identifies eFashion locations with the branding"Sundance" or "Magnolia" in their store name. You can create a Store Type variable using thissyntax:=If(Match([Store name] ; "*Sundance") ; "Sundance" ; If(Match([Store name] ; "*Magnolia") ; "Magnolia" ; "Un- Branded"))

Or=If Match([Store name] ; "*Sundance") Then "Sundance" ElseIf Match([Store name] ; "*Magnolia") Then "Magnolia" Else "Un- Branded"

Overriding a report filter or ranking

At times youmay need to display a calculation that includes both the data that is shown in thetable and data that is present in the data provider, but not currently shown in the table. Theonly way to achieve this is to forceWeb Intelligence to ignore a report filter or ranking that hasbeen applied to an object or variable in the data provider.

Web Intelligence Advanced Report Design—Learner’s Guide94

Page 109: Bow320 en Col91 Fv Part Ltr

Use the NoFilter() function to override a report filter or ranking. NoFilter() includes all of thevalues for a variable in the data provider in the calculation, even if the data is not displayed inthe table or block.

Syntax:

expression_output_type NoFilter(expression)

Suppose that you have a report that uses ranking to display the top three stores per year.

Because this report uses ranking, the sum for the Sales revenue column only includes the resultsfrom the three top-performing stores. If youwould like to add a row to the report that displaysthe total Sales revenue for all the rest of the eFashion stores, you can apply another Sum to theSales revenue column, and edit the insertion formula like this:

=NoFilter(Sum([Sales revenue]))-Sum([Sales revenue])

By dissecting this formula, you can see how the formula returns the desired result.

Syntax and description:Formula component:

NoFilter(Aggregate([Measure]))

This returns the sum of all the stores andignores rank.

=NoFilter(Sum([Sales revenue]))

This part of the formula returns the sum ofthe stores in the current block (with the rank).

-Sum([Sales revenue])It does not include the stores that have beenexcluded.

To add another line to the report, displaying the total revenue for all locations, you can applyanother sum to the Sales revenue column, and modify the insertion formula like this:

95Working with Additional Reporting Techniques—Learner’s Guide

Page 110: Bow320 en Col91 Fv Part Ltr

=NoFilter(Sum([Sales revenue]))

If you add some text labels to describe the new rows of the table, the report looks like this:

Displaying a running sum

The RunningSum() function is one of a number of running aggregate functions available forcalculating data in Web Intelligence. Others include RunningAverage(), RunningCount(),RunningMin(), and RunningMax().

A running sum is a total that is accumulated from value to value across a series of values.

You can also use running aggregate functions.

Use the RunningSum() function to return the running sum of a set of numbers. One benefit ofthe running aggregate functions is that a reset can be applied to them within the report. Thisallows you to start the cumulative total over at a given value, such as at a break.

Syntax:

number

RunningSum([measure];[Row|Col];[(reset_dimensions)])

[any measure] refers to any measure object in the data provider.

Row|Col refers to the calculation direction (optional parameter).

reset_dimensions refers to the list of dimensions used to reset the running sum (optional).

Web Intelligence Advanced Report Design—Learner’s Guide96

Page 111: Bow320 en Col91 Fv Part Ltr

Suppose that you are creating a report to show Year, Store name, and Sales revenue, groupedby State. You would like to add another column to the report to display a running sum. Youcan create a Running Total variable using this formula:

=RunningSum([Sales revenue])

If you add a Running Total column to the report, it looks like this:

If you would like the running total to reset for each state, you can modify the formula to resetthe total each time the table breaks:

=RunningSum([Sales revenue] ; ([State]))

Now the report looks like this:

97Working with Additional Reporting Techniques—Learner’s Guide

Page 112: Bow320 en Col91 Fv Part Ltr

Displaying drill filters in the report

As you drill down and up hierarchies in a document in drill mode, you may want to displaythe drill filters that you are using at any given moment. You can then save the document as aPDF or print it, and other users can see the drill filters you were using as you drilled.

Use theDrill Filters cell, based on the DrillFilters() function to return the drill filters appliedto a document or to an object using drill mode. This is useful if you want to print a drilleddocument and show the drill filters along with the report itself.

Note: TheDrill Filters cell and the DrillFilters() function only return data when you view thedocument with drill mode active.

Syntax:

string DrillFilters([object]; [string separator])

[object] refers to any object in the data provider.

string separator refers to the drill filter separator (optional parameter).

Examples:

For a document in drill mode:

Web Intelligence Advanced Report Design—Learner’s Guide98

Page 113: Bow320 en Col91 Fv Part Ltr

Returns:Syntax:

"Colorado - Colorado Springs" if the document has been drilledinto the state of Colorado and into the city of Colorado Springs

=DrillFilters()

When you create a report to display State and Sales revenue, andwant to display the drill filtersthat are applied when the report is viewed in Drill mode, you can use theDrill Filters cell todisplay the drill filters in a single cell. Alternatively, you can create a Drill Filter variable usingthis formula to display the drill filters in a column:

=DrillFilters()

TheDrill Filters cell or the Drill Filter column display data only when you activate drill modeand begin to drill in the report. If you drill down the State dimension to the Store name level,a report with theDrill Filters cell looks like this:

Note: You can change the character used to separate the filter levels by modifying the variableformula. For example:

ReturnsSyntax:

Colorado / Colorado Springs=DrillFilters("/")

Understanding additional functions

You can use additional functions not presented in detail in this lesson. Some examples appearbelow.

Syntax and Examples:Returns:Function:

number Product([measure])The product of a set ofnumerical values.

Product()

=Product([Measure]):

Returns 30 if [Measure] has the values 2, 3, 5 .

99Working with Additional Reporting Techniques—Learner’s Guide

Page 114: Bow320 en Col91 Fv Part Ltr

Syntax and Examples:Returns:Function:

expression_output_type Mode(expression)The mostfrequently-occurringvalue in a set of values.

Mode()

Mode([Revenue]):

Returns 200 if [Revenue] has the values 100, 200,300, 200.

Mode([Country]):

Returns the most frequently-occurring value of[Country].

Note: Mode returns null if the set of values does notcontain one value that occurs more frequently than allthe others.

string DataProviderType (object

data_provider)

The type of dataprovider.

DataProviderType()

DataProviderType([Sales]):

Returns "Universe" if the Sales data provider isbased on a universe.

Note: Enclose the name of the data provider in squarebrackets.

Activity: Displaying data restricted by a filter or ranking

Objective

• Build a formula to override a ranking and calculate total values.

Instructions - Example 1

Create a document that displays the best sales revenue achieved for any year by state. Forpurposes of comparison, you also want to display the total state revenue.

To achieve this, you need to create a new variable using theNoFilter() function. You will alsoapply breaks, ranking and formatting to the table.1. Use the eFashion universe to build a query with the appropriate objects.

Web Intelligence Advanced Report Design—Learner’s Guide100

Page 115: Bow320 en Col91 Fv Part Ltr

2. 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 thebreak header and footer do not display.

3. Display a table header.

4. On the Year column, display only the highest earning year for each state.

5. 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, you change the way WebIntelligence calculates data by default. This is known as changing the calculation context.

6. Add the new variable to the table and display the sum in the footer of both the Sales revenueand the new Total revenue columns.

7. Verify the calculation displayed below the Total revenue column. Has the sum calculatedthe data correctly?

8. Using the Formula toolbar, modify the formula used in the Total Revenue footer cell tocalculate the sum total accurately.

The final report appears like this:

101Working with Additional Reporting Techniques—Learner’s Guide

Page 116: Bow320 en Col91 Fv Part Ltr

9. Save the document as Act_NoFilter.

Instructions - Example 2

1. In the same document, build a new query to show the state, store name, year, and quantitysold with a query filter that prompts the report users to specify the state(s) that they wantto see.

2. Run the new query and choose California and Coloradowhen prompted.

3. Apply a break to organize the data by state.

4. Display theQuantity Sold totals per state in the break footers.

5. Show only the year that sold the highest quantities.

6. Insert a new footer row and build a formula to show the sum of the quantities sold in theother two years.

7. Enter text to identify the values displayed in the break footers.

8. In the table footer, build a formula to show the total sum of the quantities sold by all stores.

9. Enter text to identify the value displayed in the table footer.The report appears like this:

Web Intelligence Advanced Report Design—Learner’s Guide102

Page 117: Bow320 en Col91 Fv Part Ltr

10.Save the document.

103Working with Additional Reporting Techniques—Learner’s Guide

Page 118: Bow320 en Col91 Fv Part Ltr

Quiz: Additional Reporting Techniques1. When you apply a standard calculation such as a Sum or an Average on a column in a table

with a break, where is the calculation inserted?• In a data cell• In the break footer• In the section• In the break header

2. How do you format a break?

3. Which function can you use to determine whether a character string matches a particularpattern?

4. What is the syntax for creating a running sum on Margin with a reset on Year?

5. Which function would you use if you want to show the SQL for a particular query?

6. Which function can you use to override a report filter or a ranking?

7. How can you display a report filter?

Web Intelligence Advanced Report Design—Learner’s Guide104

Page 119: Bow320 en Col91 Fv Part Ltr

Lesson summaryAfter completing this lesson, you are now able to:

• Use data tracking• Use additional report functions

105Working with Additional Reporting Techniques—Learner’s Guide

Page 120: Bow320 en Col91 Fv Part Ltr

Web Intelligence Advanced Report Design—Learner’s Guide106

Page 121: Bow320 en Col91 Fv Part Ltr

Lesson 7Creating Hyperlinks

Lesson introductionYou can create hyperlinks from your documents to URLs and to other documents in WebIntelligence XI 3.0/3.1.

After completing this lesson, 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

107Creating Hyperlinks—Learner’s Guide

Page 122: Bow320 en Col91 Fv Part Ltr

Working with hyperlinks in Web Intelligence documentsIn Web Intelligence XI 3.0/3.1, you can create hyperlinks to documents and to URLs.

After completing this unit, 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, you can create hyperlinks to:• Other documents such as Web Intelligence documents or Crystal Reports

For example, a document that shows sales results per store can display the store name as ahyperlink to another document with store details. The details can include the store floorarea, location, number of employees and opening hours.

• URLs or websites

For example, the document that shows store details can display a hyperlink to a websitethat shows the promotional offers and merchandise available at the store for the currentperiod. The website also gives access information and opening hours for the store.

In the Web Intelligence Interactive panel, you can create all hyperlinks via a dialog box.

In theWeb Intelligence Rich Clientmain window and the Java Report Panel, you can createhyperlinks to:• URLs or websites via a dialog box.• Other documents via the OpenDocument command.

The appendix to this course, Creating Hyperlinks with the OpenDocument Command,covers creating hyperlinks with the OpenDocument command.

Web Intelligence Advanced Report Design—Learner’s Guide108

Page 123: Bow320 en Col91 Fv Part Ltr

Creating hyperlinks in the Web Intelligence InteractivepanelYou can create all hyperlinks via a single dialog box in theWeb Intelligence Interactive panel.

After completing this unit, 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,you can create a hyperlink with the Create Hyperlink dialog box. The dialog box changesdynamically to display the options that you can associate with your hyperlink.

When you click the Link to document option, the dialog box displays a field for the path tothe document and a Browse button to help you browse to the document.

109Creating Hyperlinks—Learner’s Guide

Page 124: Bow320 en Col91 Fv Part Ltr

When you click the Browse button, the Choose a document dialog box displays. You canbrowse to your document or perform a search for it from the dialog box.

When you select the document, the fields for defining the options associatedwith the hyperlinkdisplay.

Web Intelligence Advanced Report Design—Learner’s Guide110

Page 125: Bow320 en Col91 Fv Part Ltr

You can choose to:• Refresh the document when you click the hyperlink.• Link to a specific document instance.• Link to a specific area in the document.• Pass a prompt value to the document.• Customize the look and behavior of the hyperlink. For example, you can have the hyperlink

display the document in a new window or display a tooltip that describes the documentwhen you move the mouse over the hyperlink.

When you click the Link to webpage option, the dialog box displays a field for the URL.

111Creating Hyperlinks—Learner’s Guide

Page 126: Bow320 en Col91 Fv Part Ltr

When you enter theURL and click the Parse button the fields for defining the options associatedwith the hyperlink display.

To create a hyperlink in the Interactive panel

1. Log onto InfoView and display the InfoView Preferences page.

Note: Log onto InfoView using the user name and password provided to you by the classinstructor.

2. In theWeb Intelligence Preferences zone, verify that theDefault view format option is setto Interactive.

3. Open or create a newWeb Intelligence document in InfoView, then, right-click the cell orcells containing the text that you want to make a hyperlink and in the context menu, clickHyperlink > New.The Create Hyperlink dialog box displays.

4. Depending on whether you want to link to a URL or a document, click the:

• Link to web page button to link to a web page or URL and in the Enter the URL below...field, type the URL. Proceed to step 5.

• Link to document button and click the Browse button to browse to and select yourdocument. Proceed to step 6.

Web Intelligence Advanced Report Design—Learner’s Guide112

Page 127: Bow320 en Col91 Fv Part Ltr

5. Click the Parse button.

6. Define the options associated with your hyperlink and clickOK.The value(s) that you selected in your document now appear as (an) active hyperlink(s).

113Creating Hyperlinks—Learner’s Guide

Page 128: Bow320 en Col91 Fv Part Ltr

Creating hyperlinks in Web Intelligence Rich Client andthe Java Report PanelIn theWeb Intelligence Rich Clientmain window and the Java Report Panel, you use theHyperlinks dialog box to create a hyperlink to a URL.

After completing this unit, you will be able to:

• Create a hyperlink to a URL with theHyperlinks dialog box

About hyperlinks to a URL

TheHyperlinks dialog box provides the same functionality for creating hyperlinks to a URLin theWeb Intelligence Rich Client main window and the Java Report Panel as the CreateHyperlink dialog box provides in the Interactive panel.

TheHyperlinks dialog box is similar to the Create Hyperlink dialog box in the Interactivepanel, but it only applies to links to URLs or web pages and not to links to documents.

When you enter a URL and click Parse, Web Intelligence displays the fields for the URL andfor defining the options associated with the hyperlink display. You can choose to customizethe look and behavior of the hyperlink to display the web page in a newwindow or to displaya tooltip that describes the web page or URL when you move the mouse over the hyperlink.

Web Intelligence Advanced Report Design—Learner’s Guide114

Page 129: Bow320 en Col91 Fv Part Ltr

To create a hyperlink to a URL

1. Open or create a newWeb Intelligence document using either theWeb Intelligence RichClient or the Java Report Panel.

2. In your Web Intelligence document, right-click the cell or cells containing the text that youwant to make a hyperlink and, in the context menu, clickHyperlinks > New Hyperlink.TheHyperlinks dialog box displays.

3. In the field that displays in theHyperlinks dialog box, type, or copy and paste, the URL towhich you want the hyperlink to lead.

4. Click Parse.The URL displays in the URL field. The fields for the options to customize the hyperlinkdisplay in the Customize the visual and interaction properties of the hyperlink area ofthe dialog box.

5. Optionally, define a tooltip for the hyperlink.

6. Optionally, define the target window for the URL. By default, the system selects the currentwindow.

7. ClickOK.

115Creating Hyperlinks—Learner’s Guide

Page 130: Bow320 en Col91 Fv Part Ltr

In your document, the value(s) that you selected for the hyperlink now appear(s) as (an)active hyperlink(s).

8. Save the document.

Activity: Creating hyperlinks in the Interactive panel

Objectives

• In theWeb Intelligence Interactive panel in InfoView, create two documents -- one to showsales margin for all stores for all years and another to show store details.

• In the sales margin document create a hyperlink to a URL. Also, create a hyperlink on eachstore name to open the store details document and display only the data for the store namedisplayed in the hyperlink.

1. Log onto InfoView and verify that the Web Intelligence default view and the defaultcreating/editing preferences are set to Interactive.

2. Using the eFashionuniverse, create the hyperlink target document that displays store detailsand save the document in the Favorites folder.When the hyperlink opens this document, you want the details for a specific store namevalue to display so create a prompt on the document.Without the prompt, your report looks like this:

Save the document as Store Details.wid.

3. Using the eFashion universe, create a second document that displays the sales margin perstore per year and save the document in the Favorites folder.

Web Intelligence Advanced Report Design—Learner’s Guide116

Page 131: Bow320 en Col91 Fv Part Ltr

The report looks like this:

Save the second document as Sales Margin per Store.wid.

4. From the Sales Margin per Store document, make the report title a hyperlink to a webpage. For the purposes of the activity, use the BusinessObjects Enterprise server URL.

5. From the Sales Margin per Store document, create a hyperlink on the Store name valueto link the two documents. Pass the value of the store name in the hyperlink to the StoreDetails.wid document so that it displays the details for a specific store name.

6. Test that the hyperlinks work in the Interactive panel. Save the documents and log off fromInfoView.

117Creating Hyperlinks—Learner’s Guide

Page 132: Bow320 en Col91 Fv Part Ltr

Quiz: Creating Hyperlinks1. How do you create a hyperlink in the Web Intelligence Interactive panel?

2. When you use theCreate Hyperlink dialog box to create a hyperlink to another document,what options can you associate with the hyperlink?

3. How do you create a hyperlink in theWeb Intelligence Rich Clientmain window or theJava Report Panel?

Web Intelligence Advanced Report Design—Learner’s Guide118

Page 133: Bow320 en Col91 Fv Part Ltr

Lesson summaryAfter completing this lesson, 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

119Creating Hyperlinks—Learner’s Guide

Page 134: Bow320 en Col91 Fv Part Ltr

Web Intelligence Advanced Report Design—Learner’s Guide120

Page 135: Bow320 en Col91 Fv Part Ltr

Appendix AOptional End of Course Challenge

Activity: Using advanced querying and reportingtechniquesObjective

• Create a document using the techniques presented in this course.

Instructions

The management team of the Xtreme Sporting Group requires a report of North Americansales by product type.1. Create a new document using the Xtreme universe to return data for Canada, USA, and

Mexico.

2. Include the following objects in the query:Country, Product Name, Unit Price, Quantity

Note: Do not display the Product Name object in the table.

The finished document should look like this:

121Optional End of Course Challenge—Learner’s Guide

Page 136: Bow320 en Col91 Fv Part Ltr

Web Intelligence Advanced Report Design—Learner’s Guide122

Page 137: Bow320 en Col91 Fv Part Ltr

Appendix BCreating Hyperlinks with the OpenDocumentCommand

Using OpenDocument to create a hyperlink to documentsInWeb Intelligence Rich Client and the Java Report Panel, you create a link to a documentwith a formula that uses the OpenDocument command. The command can pass detailed datato the second document, based on the prompted query filter built in the query of the linkeddocument.

For example, you can create a report with detailed revenue information for a particular stateand create another report with a state-level summary on sales revenue. The second report cancontain a hyperlink on state that opens the detailed revenue report for the state.

OpenDocument URL command syntax

An example of the syntax to use when you want to create a hyperlink on a state object to opena document with sales details for the state appears below:="<a href="+"http://<server_name>:8080/OpenDocument/opendoc/openDocument.jsp?"+"&sType=wid"+"&sDocName=Detailed+Sales+Report"+"&lsSEnter+State:="+Replace([State];"";"%20") + "> "+[State]+"</a>"

The table below divides the example of syntax into understandable arguments, and providesan explanation for each argument.

Note: Each of the syntax arguments are joined with a plus sign (+) in the formula bar.

ExplanationSyntax argument

The opening HTML syntax for a hyperlink."<a href="

The server name and the command which willbe executed on it.

http://<server_name>:8080/OpenDocument/opendoc/openDocument.jsp?

<server_name>:8080, used in this example, isspecific to the BusinessObjects Enterprise server.You can find this namedisplayed in the addressbar of your browser's address toolbar.

Note: The port is 8080 for Tomcat web servers.

The type of document to be opened, in this case,a Web Intelligence document.

"&sType=wid"

The name of the document."&sDocName=Detailed+Sales+ Report"

123Creating Hyperlinks with the OpenDocument Command—Learner’s Guide

Page 138: Bow320 en Col91 Fv Part Ltr

ExplanationSyntax argument

Note that spaces in the name of the documentare replaced with a + sign. %20 can be used inplace of the +. %20 is the HTML encodingsymbol for a space.

This parameter can be substituted with thesDocID.

The prompt parameter which will be passed tothe document being opened.

"&lsSEnter_State:="+Replace( [State];"";"%20")

Notice that this argument has to match exactlywith the prompt created in the first document.In this case, a single parameter is being passed(lsS).

Additional parameters are available:• lsM for multiple values• lsR for a range of values

The object name in brackets, [State] indicatesthe data from the main report to be passed tothe linked report.

The Replace command is used with the valueto replace spaces in the value with the HTMLsymbol for a space.

Multiple prompts can be listed in the code. Youjust continue to string them together with the+ character to concatenate the pieces.

RequiredHTML encoding and the object namethat indicates to the document which data toshow in the table.

t">"+ [State]

Once you have formatted the column in theWeb Intelligence table, the State values in thiscase appear as hyperlinks.

The closing HTML code for a hyperlink."</a>"

To use the OpenDocument command for hyperlinks

1. In yourWeb Intelligence document, select the values that youwant to display as hyperlinks.

2. Click the Show/Hide Formula button on the Reporting toolbar.

Web Intelligence Advanced Report Design—Learner’s Guide124

Page 139: Bow320 en Col91 Fv Part Ltr

3. Click the Formula Editor button on the Formula toolbar.

Now you are ready to define the formula to apply a hyperlink to the selected values.

4. Type the hyperlink syntax in the Formula zone of the Formula Editor and clickOK.

Note: Verify that there are no blank spaces in the hyperlink formula, or the hyperlink willnot work.

To display the hyperlinks

1. In yourWeb Intelligence document, select the values that youwant to display as hyperlinks.

2. Click the Properties tab.

3. Click + to expand theDisplay section.

4. Click the Text field next to the Read cell content as option and then click the drop-downarrow.

5. SelectHyperlink from the list of options.

The value selected displays as a hyperlink.

More about using the OpenDocument URL

Keep in mind the following important points when using the OpenDocument URL command.

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?

125Creating Hyperlinks with the OpenDocument Command—Learner’s Guide

Page 140: Bow320 en Col91 Fv Part Ltr

By default, BusinessObjects Enterprise XI 3.0/3.1 uses the <hostname> as the server name. Theport is 8080 for Tomcat web servers and 80 for IIS web servers (which is the default HTTP portand can be omitted).

The following are example URLs where the server name is "paris":• TOMCAT:

http://paris:8080/OpenDocument/opendoc/openDocument.jsp?

• IIS:http://paris/OpenDocument/opendoc/openDocument.jsp?

No blank spaces allowed in the hyperlink

There can be NO SPACES in the link, except when a universe object name is included within[ ] brackets.

If you include spaces in the link, then the linkwill be truncated after the space and the remainderof the link will not be executed.

There are three different methods for handling spaces:• Use the "+" character, as shown in the previous example.• Use "%20" in the hard-coded arguments.• Use URLEncode() when an argument, such as data returned by a universe object, has

embedded spaces in the data.

Constructing the link with & as delimiter

The arguments are delimited by the & character.

Finding more information

For more information using the OpenDocument URL command with Web Intelligencedocuments, refer to the document delivered on the CD with Web Intelligence XI 3.0/3.1,Performing on-report analysis with Web Intelligence Chapter 13, "Linking to other documents" formore information on using the OpenDocument URL command with Web Intelligencedocuments.

Web Intelligence Advanced Report Design—Learner’s Guide126

Page 141: Bow320 en Col91 Fv Part Ltr

Appendix CDimensions and Details

Understanding dimensions and detailsAs an advanced report designer, you are in a better position to communicate your organization'sreporting needs to the universe designer. You can be more effective in that role when youunderstand the differences between dimension objects and detail objects, as well as how theuniverse designer decides to define an object as a dimension or a detail.

The table below describes dimensions and details and their differences. The key differencesare that dimensions can:• Be part of the scope of analysis, to enable drilling on the dimension.• Mergewith an object from another data source to synchronize their respective data sources.

Details cannot serve the two purposes above. So when you communicate your reporting needsto a universe designer, youwant to considerwhat objects youwant to usewhen defining scopeof analysis for drilling, and what objects you want to use for synchronizing different datasources.

DetailsDimensions

Provide descriptive data about a dimension.Details are always associated with the

Retrieve the data that provides the basis foranalysis in a report.

dimension forwhich they provide additionalinformation.

Can have all data types, character, date, ornumber.

Can have all data types, character, date, ornumber, but typically retrieve character-typedata, for example, customer names, store names,or dates.

Can contain calculations such as: ReturnDate, Age, Days to Ship.

Can contain calculations such as: Return Date,Age, Days to Ship.

Cannot be part of the scope of analysis fordrilling.

Can be part of the scope of analysis so reportusers can drill down on the dimensions.

Cannot merge with an object from a datasource to synchronize different data sources.

Can merge with an object from another datasource to synchronize different data sources.

127Dimensions and Details—Learner’s Guide

Page 142: Bow320 en Col91 Fv Part Ltr

Understanding the impact of changing the object qualification

When your reporting needs changing and you discover the need to change a dimension to adetail, or to change a detail to a dimension, the change can impact your reports. When youruniverse designer considers making such a change, discuss and plan for the possibleconsequences described in this section.

When a universe designer changes an object from a detail to a dimension, sometimes:• Additional objects are available in the hierarchies when you drill in the report.• More objects are available for synchronization between data sources.

When a universe designer changes an object from a dimension to a detail, sometimes:• Objects disappear from the hierarchies and existing drill documents have objects missing

from the scope of analysis.• Objects are no longer at the top level in the class. Instead, they appear as an associated object.

The risk is that they may be associated with the wrong object.• Objects appear available for data synchronization when they may not be compatible with

objects from other data sources.

Reports which use the dimension object to merge data from multiple data sources no longerfunction properly because you cannot merge detail objects.

Review: Dimensions and details

The eFashion Purchasing department requires new reports. Read the user needs below anddecide which objects the universe designer defines as dimensions, which objects the universedesigner defines as details, and why.

1. A group of reports include Store name, Product line, SKU description, Quantity sold, andColor. The first four objects retrieve important data for the reports. The Color object appearsin only one report. What object type did the universe designer assign to the objects andwhy?

2. The Purchasing director wants to analyze the Product Line information and to drill downto Category, SKU Description, and Promotion. He does not want to drill to SKU number orColor.

3. A Merchandising manager has access to more than one data source – an Excel Spreadsheetand a number of universes. She wants to bring the information from these different sourcesinto one table and to merge for data synchronization on the Store name and Product lineobjects.

Web Intelligence Advanced Report Design—Learner’s Guide128

Page 143: Bow320 en Col91 Fv Part Ltr

Answer Key

This section contains the answers to the reviews and/or activities for the applicable lessons.

129Answer Key—Learner’s Guide

Page 144: Bow320 en Col91 Fv Part Ltr

Web Intelligence Advanced Report Design—Learner’s Guide130

Page 145: Bow320 en Col91 Fv Part Ltr

Review: Web Intelligence core report designPage 2

1. A Web Intelligence document consists of three components. What are they?

Answer:

AWeb Intelligence document contains:○ A data provider or query○ A report○ Blocks of data

2. A query filter contains three components. What are they?

Answer:

A query filter contains:○ An object○ An operator○ An operand

3. What object type does not have a list of values?

Answer:

A measure

4. When you list values in a formula, what must you use to separate the values?

Answer:

A semi-colon

5. 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 the differences among a query filter, a report filter, 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 report filter allows selected data to display in a page and hides the other data. The reportfilter applies to all data blocks on the page.

7. What is the difference between a section and a break?

131Answer Key—Learner’s Guide

Page 146: Bow320 en Col91 Fv Part Ltr

Answer:

A section impacts the whole report page; a break impacts the table or crosstab to which youapply the break.

A section allows you to display multiple blocks of data on the same page. A break does notallow you to display multiple blocks of data on the same page.

8. 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 thesort.

Custom sorts impact the data in an object. When you apply a custom sort to an object, thecustom sort impacts all the blocks that use the object.

9. 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, but you do not

want the report user to see the existing data, for reasons of security, for example.○ When you want to send a data-heavy document to a report user. You can make the

document lighter when you purge the data. Consequently, the document arrives morequickly.

10.What is the difference between a dimension and a detail?

Answer:

A dimension displays values that report users want to see in their documents. You can usea dimension for a scope of analysis. You can merge a dimension with a dimension fromanother data source to synchronize two different data sources.

A detail provides additional, complementary information to the information contained ina dimension and must be associated with a dimension. A detail cannot serve in a scope ofanalysis ormergewith an object from another data source to synchronize two different datasources.

11.You have two queries on two different data sources. Query 1 returns 10 rows for Region.Query 2 returns 12 rows forRegion_Area . You synchronize the twodata sources bymergingthe 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, aftersynchronization:

Web Intelligence Advanced Report Design—Learner’s Guide132

Page 147: Bow320 en Col91 Fv Part Ltr

○ 12 rows appear when the 10 values for Regionmatch some of the 12 values forRegion_Area .

○ 22 rows appear when 10 values forRegion do not match the 12 values forRegion_Area.

When the Region and Region_Area objects contain data in different format or case, aftersynchronization 22 rows appear. Web Intelligence handles similar values with differentformat or case as different values.

12.You have a report with the objects Region, Year, and Sales revenue in Query 1, and youhave another report on a different data source with Region,Area, and Sales total in Query2. 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. You cannotmerge a measure so you cannot use the Sales revenue and Sales total objects.

13.When you synchronize two queries fromdifferent data sources,what rulesmust you respect?

Answer:

Respect the following rules:○ Object names can differ.○ The data type for the merged objects must be the same.○ Data must have the same case because the data provider is case-sensitive.○ You can only synchronize on dimensions.○ You can only display measures with synchronized dimensions. When you use them for

another purpose, duplicate values appear.

14.Can you synchronize the data between a Web Intelligence document and an Excelspreadsheet?

Answer:

In Web Intelligence XI 3.x, when a dimension appropriate for merging exists in the twodocuments, yes, you can.

133Answer Key—Learner’s Guide

Page 148: Bow320 en Col91 Fv Part Ltr

Quiz: Advanced Query TechniquesPage 28

1. What are the three types of query techniques used in this lesson?

Answer: Combining, Subquery, and Duplicating a query to build another.

2. If you were to use the UNION operator to combine queries, what would be the result?

Answer:The result returns all records that satisfy one of the two conditions. This is equivalentto using an OR between query filters.

3. If you were to use the INTERSECTION operator to combine queries, what would be theresult?

Answer:Only records that matched ALL criteria would be returned. This is the equivalentof doing an AND between query filters.

4. If you were to use the MINUS operator to combine queries, what would be the result?

Answer: All records that match the first query condition and not the second condition.Where you place the queries determineswhich is the first condition andwhich is the secondcondition.

5. List two reasons why you might want to use combined queries.

Answer:○ To make the construction of the query easier.○ When it is not possible to apply the required query filters using Boolean logic.

6. Can you do a subquery and return exactly the same results as a combined query?

Answer: Depending on the query, yes.

7. Which subquery operand type means that Web Intelligence will look for only one instanceof a value from the subquery that meets the query filter?○ a. ALL○ b. ANY

Answer: ANY. The Any option means that Web Intelligence only looks for one instance ofa value from the subquery that meets the query filter. If it finds one, it then ceases thecomparison with the remainder of the subquery output.

8. Why would you choose to do a combined query rather than a subquery?

Answer: Combined queries tend to be faster at returning the data.

9. When you change a data source, what can you choose to do to the objects in the originalquery?

Answer:You canmap them to objects in the new data source or delete them from the query.

Web Intelligence Advanced Report Design—Learner’s Guide134

Page 149: Bow320 en Col91 Fv Part Ltr

Quiz: Calculation ContextsPage 49

1. What is an input context?

Answer:

The input context is the list of dimensions that are included in the calculation itself.

2. What is an output context?

Answer:The output context is the dimension level inwhich the calculation is to be displayedin the report. For example, the output context can be the dimension displayed at the rowlevel; the dimension displayed at the break level, and so on.

3. Which of the following is an extended syntax context operator?○ NoFilter()○ ForEach○ Block

Answer: ForEach

NoFilter() is a function. Block is an extended syntax keyword.

4. Which of the following is an extended syntax keyword?○ NoFilter()○ ForEach○ Section

Answer: Section

135Answer Key—Learner’s Guide

Page 150: Bow320 en Col91 Fv Part Ltr

Quiz: Character and Date String FunctionsPage 71

1. Name at least three character string functions used in this lesson.

Answer: Choice of Right(), Substr(), Pos(), Replace(), Length()

2. To find the occurrence of a comma in an object’s value, which function would you use?

Answer: Pos()

3. What is the syntax for the Replace() function?

Answer: Replace([string] ; “old string” ; “new string”)

4. When would you choose to use the Length() function?

Answer: To identify the length of a field.

5. Give an example of string concatenation.

Answer: Lastname+ “, “ + Firstname

6. If you want to create a formula to return the number of years between two dates, whatwould the syntax be?

Answer: =DaysBetween(first date;second date)/365.25

7. Can you do calculations on a date?

Answer: Yes

Web Intelligence Advanced Report Design—Learner’s Guide136

Page 151: Bow320 en Col91 Fv Part Ltr

Quiz: Using If LogicPage 86

1. What is another term for the logic used by the If() function?

Answer: If...Then...Else logic

2. Which of the following are examples of why youmight use the If() function to group valuesin a variable:

• To display categories of values• To show values aggregated at higher levels of detail

Answer: 1 and 3

3. True/False. You can use the If() function to define a variable so that a different calculationis used depending on the value retrieved by the object specified in the variable’s formula.

Answer: True

137Answer Key—Learner’s Guide

Page 152: Bow320 en Col91 Fv Part Ltr

Quiz: Additional Reporting TechniquesPage 104

1. When you apply a standard calculation such as a Sum or an Average on a column in a tablewith a break, 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.

2. How do you format a break?

Answer:

Select the column with the break and go to the Breaks folder in the Properties tab.

3. Which function can you use to determine whether a character string matches a particularpattern?

Answer:Match()

4. What is the syntax for creating a running sum on Margin with a reset on Year?

Answer: =RunningSum([Margin] ; [Year]))

5. 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 override a report filter or a ranking?

Answer:NoFilter()

7. How can you display a report filter?

Answer:With theDrill Filters cell or the DrillFilter() function.

Web Intelligence Advanced Report Design—Learner’s Guide138

Page 153: Bow320 en Col91 Fv Part Ltr

Quiz: Creating HyperlinksPage 118

1. How do you create a hyperlink in the Web Intelligence Interactive panel?

Answer:With the Create Hyperlink dialog box.

2. When you use theCreate Hyperlink dialog box to create a hyperlink to another document,what options can you associate with the hyperlink?

Answer:

The options include:○ Refreshing the target document when it opens.○ Linking to a specific document instance.○ Linking to a specific area in the document.○ Passing a prompt value to the document.○ Customizing the look and behavior of the hyperlink, for example, to have the hyperlink

display the document in a newwindowor to display a tooltip that describes the documentwhen you move the mouse over the hyperlink.

3. How do you create a hyperlink in theWeb Intelligence Rich Clientmain window or theJava Report Panel?

Answer:

To create a hyperlink to:• A URL or website, you use theHyperlinks dialog box.• Another document, you use the OpenDocument command.

139Answer Key—Learner’s Guide

Page 154: Bow320 en Col91 Fv Part Ltr

Review: Dimensions and detailsPage 128

1. A group of reports include Store name, Product line, SKU description, Quantity sold, andColor. The first four objects retrieve important data for the reports. The Color object appearsin only one report. What object type did the universe designer assign to the objects andwhy?

Answer: The universe designer defines the Store name, Product line, SKU description andQuantity sold as dimensions and defines the Color as a detail.

2. The Purchasing director wants to analyze the Product Line information and to drill downto Category, SKU Description, and Promotion. He does not want to drill to SKU number orColor.

Answer: The universe designer defines SKUnumber andColor as details to keep the defaulthierarchy easy to read and defines the other objects as dimensions.

3. A Merchandising manager has access to more than one data source – an Excel Spreadsheetand a number of universes. She wants to bring the information from these different sourcesinto one table and to merge for data synchronization on the Store name and Product lineobjects.

Answer:Theuniverse designer defines the Store name andProduct line objects as dimensionsso the merchandising manager can merge them.

Web Intelligence Advanced Report Design—Learner’s Guide140

Page 155: Bow320 en Col91 Fv Part Ltr

Notes

Page 156: Bow320 en Col91 Fv Part Ltr

Notes

Page 157: Bow320 en Col91 Fv Part Ltr

Notes

Page 158: Bow320 en Col91 Fv Part Ltr

Notes