Quantcast
Channel: SCN : Blog List - SAP BusinessObjects Web Intelligence
Viewing all 221 articles
Browse latest View live

How to add "Others" in a pie chart with ranking in Webi

$
0
0

How to Bring “Others” in a Pie chart when ranking is applied in the data.

 

Let’s say there is a set of Region and there Revenue like below:

Region

Revenue

East Japan

1,012,727

Bavaria

783,520

Mid-West

441,594

South

400,899

West

324,640

East Germany

259,752

West Japan

33,292

East Coast

19,124

Ruhr

10,976

 

My requirement is  to get the TOP 3 Region based on Revenue and to display its percentage share from overall revenue. From below table we want to create a pie chart using Region and Percentage column.

 

Region

Revenue

Percentage_Share_overall

East Japan

1,012,727

30.81%

Bavaria

783,520

23.84%

Mid-West

441,594

13.44%

Sum:

2,237,841

68.09%

 

Pie chart always display total out of 100, in the above block, the percentage total is 68.09% only.

This will not come in a pie chart properly.

 

Option will be to show Other’s contribution and show in the pie chart.

For eg.

 

Region

Revenue

Percentage

Bavaria

783,520

23.84%

East Japan

1,012,727

30.81%

Mid-West

441,594

13.44%

Others

1,048,683

31.91%

Sum:

3,286,524

100.00%

 

This table can now be properly displayed in Pie chart.

pie1.JPG

 

Now comes the interesting part, how to bring value “Others” in the data.

 

I followed below steps:

Step: 1 Added an object in universe with Select statement as ‘Others’ and pointed it to Region from List of tables. Like below:

 

Step: 2 In the Webi Report which already has Region and revenue data, created another query selecting the newly created object (Region-Others) and revenue.

 

Step 3: Merge the object Region and Region-Others.

 

Step 4: Created four variables:

a.       Revenue_variable=If([Region]="Others";[Query 1 (1)].[Revenue];[Query 1].[Revenue])

This variable is used to give data for others in the block along with other regions.

 

b.      Variable1 = [Query 1 (1)].[Revenue]-(Sum([Query 1].[Revenue]) In Block)

This is used to subtract the value of all regions-sum of regions in block, which will assign others data.

 

c.       Variable2=If([Region]="Others";[Variable1];[Revenue-Variable])

This issued to display the values for all regions including “Others”.

 

d.      Final Percentage=([Variable2]/Sum([Variable2]) In Block )

This is used for calculating percentage.

 

Region

Revenue-Variable

Variable1

Variable2

Percentage

Bavaria

783,520

-3,286,524

783,520

0.24

East Coast

19,124

-3,286,524

19,124

0.01

East Germany

259,752

-3,286,524

259,752

0.08

East Japan

1,012,727

-3,286,524

1,012,727

0.31

Mid West

441,594

-3,286,524

441,594

0.13

Others

3,286,524

0

0

0

Ruhr

10,976

-3,286,524

10,976

0

South

400,899

-3,286,524

400,899

0.12

West

324,640

-3,286,524

324,640

0.1

West Japan

33,292

-3,286,524

33,292

0.01

 

Step 5: Applied ranking based Revenue_variable. Although I need Top 3 , I selected Top 4(4th for the Others)

 

Region

Revenue-Variable

Variable1

Variable2

Percentage

Others

3,286,524

1,048,683

1,048,683

31.91%

East Japan

1,012,727

-2,237,841

1,012,727

30.81%

Bavaria

783,520

-2,237,841

783,520

23.84%

Mid West

441,594

-2,237,841

441,594

13.44%

 

Step 6: Using region and Percentage turned it to Pie chart.

 

pie1.JPG

So the pie chart is correct now.

 

Note: If you have query filters in Query 1, apply same filter in query 2 also.


Business objects performance..........

$
0
0

Ways by which you can improve the performance of Business Objects. These are:


  1. Improving performance of Universe
  2. Improving Performance of Reports
  3. Improving Performance of Business Objects servers
  4. Improving Performance of Database 

1. Improving performance of Universe   · Reduce the use of unnecessary joins- Unnecessary joins will degrade the performance as it increases the execution time of query. Explore the universe properly and take out unnecessary joins. 

  • Use @Aggregate_Aware- @Aggregate_Aware is a function used in BO universe, by which universe can use aggregate tables in a database. It drastically reduces the query execution time and in turn enhances the performance.
  • Use shortcut joins- Shortcut joins provides the shorter path between 2 tables and thus improves the query efficiency.
  • Set the proper value of array fetch size in universe connection- Array fetch size is the number of records fetched by a universe from database in each fetch. It should neither be too high and nor be too low. It depends on the network speed and database which you use. Sometimes its good to play with this number and verify the performance. 
  • All measure objects should use SQL aggregate function- Every Measure Objects should use SQL Aggregation function so that while querying there will be less number of dataset retuned in report. Without this user has to handle many rows in the report side.
  • Use Row and Time limit in Universe ParameterUse the universe parameter “Limit size of result set to” and “Limit execution time to” efficiently and according to your need, because this feature can increase or decrease the universe performance based on how you use it.
  • Use Universe Conditions instead of report filters- the reason is very obvious, as Universe conditions will restrict the data at database itself but if you use report filters data will fetched from database and then it will be restricted at report side which degrades the performance. 

   2. Report Level: 

  • Reduce the number of complex formulas/local report variables/complex filters
  • Try to use variables instead of formulas.
  • Breaks/Crosstab Reports/Charts will degrade the performance a bit in reports-Use it if it’s very much required but do not use it frequently.
  • Get benefits from prompts- specially the use date prompts if possible.
  • Use drills- It makes the report interactive for users and improve the performance as well.
  • Remove auto height/width if possible.
  • Use refresh on demand instead of refresh on open.
  • If you have a very large reports do not use refresh on demand in infoview-instead try to schedule the report, as refreshing will increase load on processing server while scheduling will be done on job server which is less busy than processing server in most of the cases. 

 

 

Regards,

Giri

Freeze & Query Stripping in WebI 4.1

$
0
0

BusinessObjects Web Intelligence is a query, reporting, and analysis tool used to build reports from relational and OLAP data sources and to analyze data using features such as filters, conditional formatting, and data tracking.

 

Below I have attempted to list of the features I feel are notable, though the list is big, I have listed only few as I feel this can be easily related to

 

Microsoft Excel  life freeze option

 

Now when you view a Web Intelligence report in Quick Display mode, you can freeze headers, rows, or

columns in tables like in Excel to keep them at a fixed place or displayed as you scroll up & down, Left & right through the report page analyzing data.

Depending on the table your are using to display your data you have option to freeze one of more of the zones.  Also, the shortcut to the feature can be easily found  on the main toolbar making it easier for navigation and access.

 

Web Intelligence usability

 

You can fold and unfold tables in Reading mode in the Web Intelligence HTML interface

 

Something I always wished for, an object value selector is now available in the Formula Editor. So whenever you are editing a formula with an object with LOV defined, you can display the available values by double-clicking values in the Available Objects pane. This makes the List of Values selector appear and you select the values you want to use in the Formula Editor.

 

In the toolbar above the Side panel, there is now an Edit data provider button that allows easier

access to the Query Panel.

 

In the Query Panel, you can now execute a newly-added query without having to refresh all existing

Queries

 

Query stripping

 

Query stripping is a reporting feature, used only in Web Intelligence,  that can be used to optimize performance. Query Stripping automatically rewrites the query to retrieve only the objects included in the report and exclude others which are not needed Earlier Query Stripping was available only for non-relational Universe, however now it is also made available for relational universes, to use the same the administrator needs to enable the option.

 

The Allow query stripping option is unselected by default and needs to be selected in the business layer properties in the information to activate the feature.

 

Also, the Enable query stripping option is selected in the document properties in Web Intelligence (selected by default) and is also provided for  data provider in the query properties in Web Intelligence (selected by default).

 

For Non-relational type of Universe, the query stripping option is enabled by default and does not require user intervention.

Webi tricks : Interactive selecting and viewing TOPn data

$
0
0

Hi everyone,

 

In this trick I will show you how to dynamically display data tables with differents ranks in Read mode without entering in Design mode.


Application : Web Intelligence 4.1 SP2

 

Use Case : I want to dynamically see on the same report, all my datas and add a ranking with different TOPn without editing the document in Read mode.

 

Create a report and add a table

 

Insert your first table with all data displayed.

01.png

 

Create your TOPn selection variable

 

In order to set up dynamic visibility, I'm going ti use an Input Control with a variable. This variable will allow user to choose the level of ranking of tables displayed on the report.

02.png

 

Create your TOPn Input Control

 

These steps show how to create your input control with custom values corresponding to the number of tables you want to display on your report. I've chosen a Radio button but you can choose other control. The important stemp is to configure custom values. There's no dependancy for this input control.

03.png04.png

05.png06.png

 

Create your TOPn tables and ranking

 

Now, you can duplicate your first table and change format to make difference between each rank value. To make it real, you can use relative position to ensure the relative position of tables whatever the data displayed.

 

07.png08.png

09.png10.png11.png

 

Hide/Show table dynamically

 

All is ready to hide tables according to the selection of your input control previously created. Right clic on a table, go to "Format" and enable "Hide when following formula is true" for each table sucha as below :

12.png

For example, my table named "Table_TOP5" will be displayed only when my variable "TOP" will obtain value "TOP5" with my input control. Other case will hide my block.

 

Repeat this step for each block and you're done !

 

Conclusion

 

When opening my document, I can choose which kind of ranking I want to read and export to answer quickly to a business issue. I don't to ask someone to modify the document in order to change ranking values.

13.png

 

More Webi tricks on Webi Tricks Summary : http://scn.sap.com/docs/DOC-50171

Business Objects 4.0 SP2 Webi Report Repointing Issue and Solution

$
0
0

Business Objects 4.0 SP2 Webi Report Repointing Issue and Solution

 

 

Issue :

 

When we try to repoint report which is having more than one data provider/query from existing universe to New Universe, after repointing the Report Cells/Variables will get distorted.

 

Reason :

 

When we repoint the report to the New Universe all the Merge Dimensions from different queries will Unmerge and then Repoint to the New universe and then these dimensions will Merge back. Because of this, after repointing, all the cells of the report which are using these merge dimensions will be showing "??" instead of actual Merge Dimension. Also all the Variables using these merge Dimensions will be showing "??" instead of actual Merge Dimension.

 

Solution :

 

Step 1: Before we repoint note all the variables and Cells using Merge Dimensions. Also note down the logic Used by these Variables and Cells.

 

Step 2: Repoint the Report to New Universe.

 

Step 3: Replace all the Variables which are using Merge Dimension with the Logic that you have noted before Repointing.

 

Step 4: Replace all the Cells in the report which are using Merge Dimension with the Logic that you have taken Before Repointing.

 

After this you will get the same Report, repointed to the New Universe without any errors or Issues.

Scope of Analysis

$
0
0

As the name suggests it defines the scope of analyzing the data when you are drilling  the report.

So let’s see what exactly it is.

Let’s say I have a hierarchy in universe Year-->Quarter-->Month-->Week.

 

sa1.JPG

 

So it means, in the report when I am drilling at these levels it will go through the above hierarchy.

 

What this feature “Scope of Analysis “actually does?

This is an option in web intelligence query panel.

sa2.JPG

 

 

It allows setting the scope at query time.

For eg. If I selected Year and Revenue in my query and the sql generated here is:

 

sa3.JPG

 

Which is correct.

I ran the report and the results are:

sa4.JPG

 

Now I will enable drill option and will try to drill through the hierarchy.

From Year-->Quarter

 

See the results below.

sa5.JPG

Webi brought quarter column in the query.

Same way as you drill down to month and week, it will bring in run time other columns as needed by the drill(it will hit the database to bring the columns data)

Now I will use Scope of analysis and see how it behaves.

Note: Scope of analysis by default is set to none.

I will enable scope of analysis and from drop down I will select “One level”.

sa6-1.JPG

You will notice that it brought Quarter object in scope of analysis and in query, quarter column which is one level after Year but there is no change in result objects pane, there it is still year and revenue.

I will run the report:

sa7.JPG

 

Note: Even though we have not selected Quarter in the select, it is there in query and in left pane (data pane).

This means by selecting scope of analysis , we have brought the quarter also, when we ran the query for  year and revenue.

Even if we drill to quarter from Year now, we don’t have to hit the database to bring quarter results.

But now if I try to drill further to Month from quarter, query will hit the database to bring month data.

Basically this helps in avoiding database hit each time you are drilling for analysis.

If you already set scope of analysis to Custom, it will bring all the objects in the query for that hierarchy and at time of drilling it won’t hit the database to fetch detail data, as it is already in webi microcube. But then you have to decide whether you want detail data to be fetched always when the query runs or bring the data at run time when a reporter is drilling into the levels.

 

Summary is:

Setting scope of analysis brings objects in the query for the levels you have specified and it wont hit the database while drilling for those levels.

So if you are aware of the users request of a drill you can set this option in the report you have created, so it should not have a time lag at time of drilling.

 

There is a Web Intelligence security rights for scope of analysis.

  1. This is in CMC-->Application-->WebIntelligence

“Extend Scope of Analysis”

sa8.JPG

 

What is this and how it works?

Lets see an example:

I am a report designer and create a report with Year and Revenue and I set the “Scope of Analysis” to 1 level.

As such when I run this report , I can drill from Year-->Quarter and can also drill to other levels(like month, week)  but than for other levels it will hit the database.

Let’s say I have a user ‘X’, I gave this report to him with “Scope of analysis” set to one level.

Assume he has the right to extend scope of analysis, he will be able to access the report same as I did, i.e. can drill to all levels.

But now, if I go to CMC and deny the right “extend scope of analysis”.

This will restrict the user to drill only till quarter only and no further levels , as you have set in your report.

So by this you are actually allowing user to access only the levels you want him to drill down.

Feature differences between the Web Intelligence clients (BI4.1 SP02)

$
0
0

_______________________________________________

Overview.

The aim of this document is to provide you with an overview of the main functionnal differences that exist between all the Web Intelligence clients, based on the latest release:  SAP BusinessObjects BI4.1 SP02.

The list is not complete: some others differences, minor, exists.

It concerns : 

- the Web Intelligence dHTML client (web);

- the Web Intelligence Rich Internet Application (web) (aka: the RIA / the Java Applet);

- the Web Intelligence Rich Client (desktop) (aka: the WRC);

 

_______________________________________________

 

Content.

1 - Setting up and using Web Intelligence.

2 - Creating and working with documents.

3 - Building queries.

4 - Creating reports.

5 - Publishng, formating and sharing reports.

6 - Analyzing data in Web Intelligence reports.

_______________________________________________

1 - Setting up and using Web Intelligence

Feature

HTML interface

Applet interface

Rich Client

Use Web Intelligence locally and offline

 

 

Yes (*)

Use RLT alignment based on the Preferred viewing locale setting

 

Yes

Yes

(*) You can install "Web Intelligence Rich Client" from a BusinessObjects BI Client 4.1 CD.

2 - Creating and working with documents

Feature

HTML interface

Applet interface

Rich Client

Select a folder in which local documents and universes are stored by default on your local machine

 

Yes

Yes

Create a query on a different data source in an existing document

Yes

Yes

Yes

Create and edit a document without a data source

Yes

Yes

Yes

Edit and refresh a document using a universe

Yes

Yes

Yes

Edit and refresh a document using a BEx query

Refesh only

Yes (*)

Yes (*)

Edit and refresh a document using an Advanced Analysis View

Refesh only

Yes

Yes

Edit and refresh a document using a text source

Refesh only (**)

Refesh only (**)

Yes

Edit and refresh a document using a web service data source

 

Refesh only

Yes

Send a Web Intelligence document to another user in the CMS

Yes

Yes

 

Send a Web Intelligence document by FTP

Yes

Yes

 

Export a document as a CSV file

Yes

Yes

Yes

Export a document as a CSV archive file

Yes

 

 

Save a document as a CSV archive file

 

Yes

Yes

Export a document as a PDF, text, Excel or Excel 2007 file

Yes

 

 

Save a document as a PDF, text, Excel or Excel 2007 file

 

Yes

Yes

Save a document to the corporate repository

Yes

Yes

Yes

Autosave documents to My Favorites folder

Yes

Yes

 

(*) You can use the "Web Intelligence Rich Client" and the "Web Intelligence Rich Internet Application" to build and edit queries based on BEx queries.

(**) If the Text file has previously been copied into the BusinessObjects Enterprise Platform

3 - Building queries

Feature

HTML interface

Applet interface

Rich Client

Work with hierarchies

Yes

Yes

Yes

Build queries on universes

Yes

Yes

Yes

Select all the members at a level in a hierarchy that is organized into levels

Yes, only OLAP unx

Yes

Yes

Copy query script to the clipboard in the “Query Script viewer” dialog box

Yes

Yes

Yes

Print query script the “Query Script viewer” dialog box

No

No

No

Build queries on Advanced Analysis Views

 

Yes

Yes

Build queries on Excel files saved locally

 

 

Yes

Build queries on Excel files saved to the CMS (*)

 

Yes

Yes (**)

Build queries on BEx queries

 

Yes (***)

Yes (***)

Build queries on text files

 

 

Yes

Access Data mode

 

Yes

Yes

Access the Change Source options in the Data Access table

 

Yes

Yes

Change the data source of queries based on text and Excel files.

 

 

Yes

For OLAP .unx universes, when filtering on measures, you can only type a constant.

 

Yes

Yes

(*) New in BI4.1 SP02 : "MS Excel" files have to be exported first into the "BI LaunchPad" for Life Cycle management.

(**) New in BI4.1 SP02 : the "WebI Rich Client" can perform a Change Data Source for the MS Excel files from "Stored Locally" to "Stored in CMS".

(***) You can use the "Web Intelligence Rich Client" and the "Web Intelligence Rich Internet Application" to build and edit queries based on BEx queries.

4 - Creating reports

Feature

HTML interface

Applet interface

Rich Client

Access a “Highlight All” button in the “Find” box to highlight all occurrences of a text string in a report page.

 

Yes

Yes

Access to custom order sort in a report.

Yes

Yes

Yes

Apply custom formats to numbers in tables

 

Yes

Yes

Edit or remove a document filter using the using applicable buttons in the “Document Structure and Filters” tab in the Side Panel

Yes

Yes

Yes

Merge objects in the “Available Objects” tab in the side panel.

Yes

Yes

Yes

Create and edit conditional formatting

(View them only)

Yes

Yes

5 - Publishing, formatting and sharing reports

Feature

HTML interface

Applet interface

Rich Client

Set a hyperlink to another document in the CMS

Yes, with a wizard

Yes, no wizard

Yes, no wizard

Publish content as a web service

 

Yes

Yes

6 - Analyzing data in Web Intelligence reports

Feature

HTML interface

Applet interface

Rich Client

Print documents directly from the interface

Export to PDF first

Yes

Yes

Fold and unfold tables and breaks in “Reading” mode

Yes

Yes

Yes

Fold and unfold sections in “Reading” mode

Yes

Yes

Yes

Adding Element Link on BW Bex Hierarchy Objects

$
0
0

It's a common requirement in Webi nowadays to have linking of tables in webi. So based on the selection of one dimension in one table the dimension of other table should get restricted to it. For example I am analyzing my Measures with respect to customer now based on the selection of the customer in the table my other table which is showing profit centers should get restricted to it.

 

Problem in webi right now is on Hierarchies we can't do the element linking.

 

So we need to apply some tricks to make it happen. And here is the trick.

 

Step 1. Create one dimension variable at the report level for hierarchy on which we want to do the element linking let's say this is customers.

Image 1.JPG

 

 

Step 2. Now based create two tables one for the customers and other for the profit centers.

 

 

Image2.png

As you can see element linking is disabled which is the reason I am writing this blog.

 

Image3.png

 

Step 3. Put the Dimension Variable Parallel to the table

Image4.png

 

 

Step 4. Sort the Dimension Variable based onto the hierarchy

Image5.png

 

Step 5. Hide the Hierarchy column and put table next to the customer table so that this should look like a column from the same table by using the relative alignment property

 

Image6.png

 

Which make it look like this

 

Image7.png

Step 6. Now we can do element linking on Customer column dimension

 

Image8.png


Getting the Timezone offset to be used in a printable manor

$
0
0

I had a requirement to produce a report that showed dates and times of certain events in a table. The main problme I had is that the timestamps were stored on teh server as UTC timestamps, which means when I displayed the timestamps the time was not displayed in the timezone the logged in user was in. In order to convert the timestamps to the timezone that the user was, I had to somehow get the timezone from the user's computer or webbrowser (since all time related dimensions were specific to the timezone of the WEBI server).

 

I was able to get the timezone from the browser using Javascript, but this was in HTML, which does not print.

 

It occurred to me that since we can run javascript in a WEBI report, that we could use an http redirect to launch a report and pass in any data accessible through javascript along with that redirect to a target report.

 

So I created a proof of concept!

 

Step 1: Create an empty report with no universe

Step 2: Create an empty cell in which all the Javascript will reside

Step 3: Set the cell to read as HTML

Step 4: Within the cell, add javascript to get the Timezone of the host browser

 

I created a variable that just gets the Current date, it is formated in the way that the Date() javascript function needs:

Date = FormatDate(CurrentDate();"Mmmm d, yyyy HH:mm:ss")

 

Step 5: Once we have the timesone offset, add an html redirect to launch a new report and pass the offset as a parameter to an invisible prompt

var offset = newDate.getTimezoneOffset()/60; //gets the offset in hours

window.parent.location.href = '/BOE/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID="+[DocID]+"&sType=wid&sRefresh=Y&sWindow=New&lsSOFFSET='+offset;

 

Full Javascript:

="<script type=\"text/javascript\">

    function convertUTCDateToLocal(date) {

        if(date != null && date != \"\") {

            var newDate = new Date(date);

            newDate.setUTCHours(newDate.getHours());

            var offset = newDate.getTimezoneOffset()/60;

          //launch the target report passing in the offset as a prompt parameter

            window.parent.location.href = '/BOE/OpenDocument/opendoc/openDocument.jsp?sIDType=CUID&iDocID="+[DocID]+"&sType=wid&sRefresh=Y&sWindow=New&lsSOFFSET='+offset;

        }  

    }

//get the date/timestamp       

var date = '"+[Date]+"';

convertUTCDateToLocal(date);

</script>"

</script>"

 

 

We use window.parent.location.href so that the current report is replaced by the launched report, and so that we don't load the bobj environment inside the existing bobj environment (can produce an infinite loop)

 

The resulting experience is as follows:

User launches a report

User sees a blank page inside the bobj window for ~1 second

The bobj window then instantly refreshes and the target report is displayed, with the timezone offset passed as a parameter, and fully usable to for variable usage and none of the html non-printable issues we see when showing web content in a report.

pie chart with two measure in BO XI 3.1

$
0
0

Description: We normally use web intelligence pie chart to show the data using one dimension and one measure.

But what about when we need to use two measure with pie chart. Looks bit difficult. Below is the workaround to fulfil the requirement.

Please note in this we don't have any dimension object.

 

 

Requirement:

Let us assume we need to show the below data in pie chart. In the above table we don’t have any dimension objects.

 

 

CommissionEarned

CommissionGiven

20000

15000

 

 

 

Solution:

  1. Create a new data provider. Use one dimension objects in the query panel. Now we will write the custom  SQL.

Select  ‘CommissionEarned

Union All

Select ‘CommissionGiven’

This is will create a one user defined dimension object.

  1. Now create a new formula with below condition.

If <New DataProvider>.ObjectName=”CommissionEarned” Then  Measure object  <CommissionEarned> Else  <Commissiongiven>. This will bring value of two columns in one column i.e a new variable which is created.

 

Object from 2nd DP

New Variable

CommissionEarned

20000

CommissionGiven

15000

 

 

This is it. Now we can use above table to show data in pie chart.

Webi Tricks: Displaying table data in Calendar format

$
0
0

Hello,

 

Recently, I came across interesting blog in crystal reports space from Jamie where he designed a report to display data in calendar format. So I took this same idea and wanted to reproduce this in Webi. So, lets start on how to do this in webi.

 

Step # 1: You need have date field from your DB and create a four variables Viz.. Day, Month, Week.Day in text

 

Day : FormatDate([date];"d") (Create as measure)

Month: Month([date])

Week: Week([date])

Day in text: FormatDate([date];"Dddd")

 

Step 2: Lets drop a cross tab and assign the above four variables.

 

Horizontal axis: Day in Text

Vertical axis: Month and Week

Body axis: Day

 

Step # 3: Just do some sorting on Month,week and day in text as needed and you will see now that crosstab looks like a calendar

calendar.png

When is a chart not a chart?

$
0
0

Chart.JPG

I'd like to share a mechanism I use to create the above table & graphic. For this example we are using a very simple E-Fashion query:

Query.JPG

The basis of this mechanism is using the FILL function to dynamically populate a cell with a symbol.

 

Firstly, once I know the size of the column I want to use, I use a FILL function to work out how many symbols it can hold:

=fill("¦";35)

The 35 is an arbitrary number. Experiment with it until you arrive at the number which your column can accommodate easily. I know my column holds 35 of these symbols.

 

Now, I need to work out which store has the greatest revenue amount:

=Max([Sales revenue]) ForAll ([Store name])

...which is e-Fashion Magnolia with $1,911,434.

 

If we divide this by our 35 number, we have an operator we can use on each stores Sales Revenue:

=Max([Sales revenue]) ForAll ([Store name])/35


If we now divide each stores Sales Revenue by this operator, we arrive at a Fraction of 35 - this is what we use in our FILL function. Add a ROUND function to make it neat:

=Fill("¦";Round([Sales revenue]/(Max([Sales revenue]) ForAll ([Store name])/35);0))


Finally, we apply an alerter to colour code the symbols based upon an arbitrary percentage of your choosing:

Alerter.JPG

...the [Max Revenue] variable is just:

=Max([Sales revenue]) ForAll ([Store name])

 

...and that's pretty much it. Obviously you can use any symbol you like, and you can make your column any width you like and experiment with the capacity of it to derive the number to use with the FILL function.

 

You can easily modify the mechanism to work with static ranges or to use percentages instead. I hope you find this useful!

Pie Chart with Ranking and Others in Web Intelligence

$
0
0

Pie Chart with Ranking and Others in Web Intelligence:

 

Pie chart always display total out of 100. And if you have ranking (that is restricting few rows) then it will not depict the actual or correct data unless you add the rest of ranking fact/numbers (Others) to the chart.

 

Let’s take sample data:

clip_image002.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Requirement is to show top 3 Ethnicity, Percentage in a 100% pie chart.

 

For calculating percentage I created a measure variable with the following definition

PercentageVar =[Total]/NoFilter(Sum([Total]))In Report

 

After applying top 3 ranking:

clip_image002.jpg

Note: Applied percentage formatting to Percentage column

 

As you see the total percentage is not 100%. That’s the reason business requested for adding others and make it 100%.

If i create the pie chart on this above it will not consider the "Others" contribution. In order make pie chart 100% it is necessary to bring "Others" into consideration like

 

clip_image002.jpg

Steps to follow:

 

Create measure variable

               RankVar =Rank([PercentageVar];[Ethnicity]) In ([Ethnicity])

 

Create detail variable by associating dimension [Ethnicity]

               TopVar =If([RankVar]<4;[Ethnicity];"Others") In ([Ethnicity])

 

Create pie chart with [TopVar] and [PercentageVar] variables.

Apply descending sorting on [PercentageVar]

 

clip_image002.jpg

 

Hope it helps!!

Scheduled Reports & User input in Prompts

$
0
0

Often when you schedule a report, you’ll use a “Current date” object to ensure the data returned is from the date the report was scheduled.

But sometimes you want your end users to be able to refresh this report and enter their own date parameters – but it is setup to use a current date object so that you don’t need to enter a date each time you schedule the report. How can we get the best of both worlds?

 

There are many solutions which usually involve some kind of universe work in the back end, but here’s a nice ease one which requires no universe work at all.

 

I'm using Island Resorts Marketing as an example, but you can use anything that includes a date object.

 

Create a query just returning the Reservation Date:

1.jpg

Then, in the query filters section, drag the same object in three times, and arrange it like so:

2.jpg

Make sure you setup the two prompts as Optional. This is very important or this process will not work – they have to be optional prompts! In the above example I’m using a hard coded date in the middle field, but this can just as easily be a Current Date object (there isn’t one in Island Resorts Marketing, and I’m too lazy to add one – sorry).

 

Now, test your report. Leave your prompt blank and you will return the hard coded date (or object if you have it setup):

3.jpg4.jpg

Now, do it again but this time enter a date into your optional prompt:

5.jpg6.jpg

There you have it – when you don’t enter a value it will use whatever you have in the middle date filter.

2.jpg

…and when you do, it will use whatever you enter into the prompt.

 

Therefore, when you schedule the report, you just leave the optional prompt blank to use the default from the middle filter. When users refresh the report, they can enter a date and it will return data for the date they enter.

 

Simple eh? You can apply this mechanism to anything, it doesn't have to be dates.

 

Hope you find useful

Setting up the correct client-side JRE for Webi Rich Internet Applet

$
0
0

A lot of the support calls I get on result in a short tutorial on how the web browser is utilizing the Java Runtime Engine (JRE) to run the Web Intelligence Rich Internet Applet (RIA) aka Java Report Panel or Java Viewer for those that have been with Webi for a while.  Below I will discuss some of the common scenarios I have seen on support calls lately.  I included a top level summary for those that want the quick and dirty and a longer more detailed version for those that want more info.

 

SUMMARY

  • BI 4.x supports 32-bit browsers only (in most cases, read the PAM for more info)
  • You need to make sure that you setup the 32-bit JRE settings instead of the 64-bit ones.
  • Control Panel "Java" icon launches the 64-bit Java Control Panel in most cases so best to launch javacpl.exe from the C:\Program Files (x86)\Java\... directory
  • Read my blog for more details on some recommended Java settings.

 

DETAILS

Oracle's latest JRE releases have included a number of security enhancements and changes to the default configuration options of the local JRE installs that can drastically reduce performance of the RIA and any Java applet that you may be running.  The release notes for JRE 1.7 Update 25, 45, and 51 are listed below for your reference on the changes I am about to talk about:

 

 

Most notably, the latest versions require applets to include some new manifest file attributes in their JAR files.  If these attributes are missing or set incorrectly, end users will start getting security pop-ups and warnings that are quite annoying and can cause our applet to misbehave if answered incorrectly.  SAP is working to update the JAR files in Patch and Support Package releases but I won't get into that in this post as I have another topic in mind.  It's just important to note this as its common with the latest JREs to see these warnings.

 

Another major change that I will mention is an option called "Online Certificate Status Protocol" that is now enabled by default.  What this option does is forces the JRE to go out to internet servers (verisign) to check the validity of a certificate.  Since our applet has over 60 signed JAR files, this check is done over 60 times and often adds anywhere from 30-90 seconds on to the load time of the applet.  If you are having Performance issues with the load time of the applet, this is the first thing to check!

 

For more details on evaluating Performance issues, visit my blog and wiki posts here:

Performance tuning tips for BI 4.0 Web Intelligence (Chapter 1 - Client Tier)

 

Ok, on to the subject that I wanted to blog about.  Ensuring that you are actually setting up the JRE that Webi RIA is using.

 

So, first things first.  The Webi RIA uses either a 32-bit or a 64-bit JRE, depending on your browser bits, so you need to know which one you are using first.

Another interesting fact is that BI 4.0 only supports a 32-bit browser in most cases.  So those of you that are using 64-bit browsers, you may not be running in a supported scenario.  Be sure to reference the Product Availabiltiy Matrix that matches your version to see what browsers are supported.

 

Once you know what bit browser you are using, I'll assume 32-bit in these steps since that is what we support, you can go ahead and open the correct Java Control Panel (CP)

 

The best way that I have found to open the Java CP is from Windows Explorer.  This way you can ensure that you are opening the correct bit CP.  For example, to open the 32-bit Java Control Panel, I follow these steps:

  1. Open Windows Explorer
  2. Navigate to:  C:\Program Files (x86)\Java\jre7\bin  (This is the 32-bit JRE directory because it's in the c:\Program Files (x86)\ directory)
  3. Open the javacpl.exe from that directory.
  4. Set my JRE options. 

 

My blog post and the wiki it refers to above will go over some of the options you need to check in the Java Control Panel. 

 

The "Java" icon in Windows Control Panel is almost always opening the 64-bit Java Control Panel when clicked.  I have had countless calls from customers saying that they have set the options I recommended but it still wasn't working and the root cause is almost always that they set the options for the *wrong bit* Java.

 

Hope you got some use out of this.  If it prevents even 1 support call then it has saved me some time!

Feel free to let me know of any other tips, tricks or gotchas that you have found with the RIA and Java Runtime Engine.

Jb


Date Variables in Web Intelligence

$
0
0

Dear All,

 

Here in SAP BusinessObjects Web Intelligence Space, it is noted that many of us are searching/asking questions on Date/Time Dimensions.

I am submitting all necessary formulas for the same. Hope it is useful to all.

 

We need daily,monthly,quarterly & yearly date variables.

 

Before making any date variable please make a variable which holds current date.

 

Reason to make another variable for Current Date is, for validation purpose you can change date manually and then check it whether all other date variables are working properly or not.

 

(1) Current Date = CurrentDate()

 

(2) Current Year =If(Month([Current Date]) InList("January")) Then(FormatNumber(Year([Current Date])-1;"###")) Else (FormatNumber(Year([Current Date]);"###"))

 

(3) Current Fiscal Year =FormatNumber([Year];"####")  Where ([Year]=Year([Current Date]) And [Month] InList (1;2;3) And MonthNumberOfYear([Current Date]) InList (1;2;3;4) Or  [Year]=Year([Current Date])-1 And [Month] InList (4;5;6;7;8;9;10;11;12) And MonthNumberOfYear([Current Date]) InList (1;2;3;4)

Or [Year]= Year([Current Date])And MonthNumberOfYear([Current Date]) InList (5;6;7;8;9;10;11;12))

where [Year]= Year of Your Transaction Date, and it is for Indian Fiscal Year

 

(4) Last Year =If(Month([Current Date]) InList("January")) Then(FormatNumber(Year([Current Date])-2;"###")) Else (FormatNumber(Year([Current Date])-1;"###"))

 

(5) Last Fiscal Year =FormatNumber([Year];"####")  Where ([Year]=Year([Current Date])-1 And [Month] InList (1;2;3) And MonthNumberOfYear([Current Date]) InList (1;2;3;4)  Or [Year]=Year([Current Date])-2 And [Month] InList (4;5;6;7;8;9;10;11;12) And MonthNumberOfYear([Current Date]) InList (1;2;3;4) Or [Year]= Year([Current Date])-1 And MonthNumberOfYear([Current Date]) InList (5;6;7;8;9;10;11;12))

where [Year]= Year of Your Transaction Date, and it is for Indian Fiscal Year

 

(6) CYCM=Concatenation(Left(Month(RelativeDate([Current Date];-DayNumberOfMonth([Current Date])));3);Concatenation("-";[Current Year]))

*Current Year Completed Month

 

(7) CYLM=Concatenation((Concatenation(Left(Month(RelativeDate(RelativeDate([Current Date];-DayNumberOfMonth([Current Date]));-DayNumberOfMonth(RelativeDate([Current Date];-DayNumberOfMonth([Current Date])))));3);"-"));If(MonthNumberOfYear([Current Date])=1 Or MonthNumberOfYear([Current Date])=2) Then (Right(FormatNumber(Year([Current Date])-1;"####");4)) Else (Right(FormatNumber(Year([Current Date]);"####");4)))

*Current Year Last Month

 

(8) LYCM=Concatenation(Left(Month(RelativeDate([Current Date];-DayNumberOfMonth([Current Date])));3);Concatenation("-";[Last Year]))

*Last Year Completed Month

 

(9) YTM=Concatenation(If(MonthNumberOfYear([Current Date]) Between (5;12)) Then (Concatenation((Concatenation("Apr";"-"));Right(FormatNumber((Year([Current Date]));"####");4))) Else(Concatenation(Concatenation("Apr";"-");Right(FormatNumber((Year([Current Date])-1);"####");4)));If(MonthNumberOfYear([Current Date])=5)Then("")Else(Concatenation(" to ";(Concatenation((Concatenation(Left(Month(RelativeDate([Current Date];-DayNumberOfMonth([Current Date])));3);"-"));(If(MonthNumberOfYear([Current Date])=1) Then(Right(FormatNumber(Year([Current Date])-1;"####");4))Else(Right(FormatNumber(Year([Current Date]);"####");4))))))))

*Year Till Month

 

(10) LYTM=Concatenation(If(MonthNumberOfYear([Current Date]) Between (5;12)) Then (Concatenation((Concatenation("Apr";"-"));Right(FormatNumber((Year([Current Date])-1);"####");4))) Else(Concatenation(Concatenation("Apr";"-");Right(FormatNumber((Year([Current Date])-2);"####");4)));If(MonthNumberOfYear([Current Date])=5)Then("")Else(Concatenation(" to ";(Concatenation((Concatenation(Left(Month(RelativeDate([Current Date];-DayNumberOfMonth([Current Date])));3);"-"));(If(MonthNumberOfYear([Current Date])=1) Then(Right(FormatNumber(Year([Current Date])-2;"####");4))Else(Right(FormatNumber(Year([Current Date])-1;"####");4))))))))

*Last Year Till Month

 

(11) MTD=Concatenation(Left(FormatDate([Current Date];"dd/MM/yyyy");2) ;Concatenation("-";Concatenation(Concatenation(Left(Month([Current Date]);3);"-");Right(FormatNumber(Year(CurrentDate());"####");4))))

*Month Till Date

 

(12) YTD=Concatenation(Concatenation("Apr-";[Current Year]);If(MonthNumberOfYear([Current Date])=4)Then("") Else(Concatenation(" to ";Concatenation(Concatenation(Left(Month([Current Date]);3);"-");Right(FormatNumber(Year([Current Date]);"####");4)))))

* Year Till Date

 

(13) Current Quarter

=If(Quarter(RelativeDate([Current Date];-DayNumberOfMonth([Current Date])))=1) Then(Concatenation(Concatenation("Q4:Jan-";[Current Year]);Concatenation(" to Mar-";[Current Year]))) ElseIf(Quarter(RelativeDate([Current Date];-DayNumberOfMonth([Current Date])))=2) Then(Concatenation(Concatenation("Q1:Apr-";[Current Year]);Concatenation("to Jun-";[Current Year]))) ElseIf(Quarter(RelativeDate([Current Date];-DayNumberOfMonth([Current Date])))=3) Then(Concatenation(Concatenation("Q2:Jul-";[Current Year]);Concatenation("to Sep-";[Current Year]))) ElseIf(Quarter(RelativeDate([Current Date];-DayNumberOfMonth([Current Date])))=4) Then(Concatenation(Concatenation("Q3:Oct-";[Current Year]);Concatenation("to Dec-";[Current Year])))

*based on Indian Fiscal Year

 

(14) Last Quarter

=If(Quarter(RelativeDate([Current Date];-DayNumberOfMonth([Current Date])))=1)

Then(Concatenation(Concatenation("Q3:Oct-";[Last Year]);Concatenation(" to Dec-";[Last Year])))

ElseIf(Quarter(RelativeDate([Current Date];-DayNumberOfMonth([Current Date])))=2)

Then(Concatenation(Concatenation("Q4:Jan-";[Current Year]);Concatenation(" to Mar-";[Current Year])))

ElseIf(Quarter(RelativeDate([Current Date];-DayNumberOfMonth([Current Date])))=3)

Then(Concatenation(Concatenation("Q1:Apr-";[Current Year]);Concatenation("to Sep-";[Current Year])))

*based on Indian Fiscal Year

 

(15) Last to Last Quarter

=If(Quarter(RelativeDate([Current Date];-DayNumberOfMonth([Current Date])))=1)

Then(Concatenation(Concatenation("Q2:Jul-";[Last Year]);Concatenation(" to Sep-";[Last Year])))

ElseIf(Quarter(RelativeDate([Current Date];-DayNumberOfMonth([Current Date])))=2)

Then(Concatenation(Concatenation("Q3:Oct-";[Last Year]);Concatenation(" to Dec-";[Last Year])))

ElseIf(Quarter(RelativeDate([Current Date];-DayNumberOfMonth([Current Date])))=3)

Then(Concatenation(Concatenation("Q4:Jan-";[Current Year]);Concatenation("to Mar-";[Current Year])))

ElseIf(Quarter(RelativeDate([Current Date];-DayNumberOfMonth([Current Date])))=4)

Then(Concatenation(Concatenation("Q1:Apr-";[Current Year]);Concatenation("to Jun-";[Current Year])))

 

(16) Last Year Current Quarter

=If(Quarter(RelativeDate([Current Date];-DayNumberOfMonth([Current Date])))=1) Then(Concatenation(Concatenation("Q4:Jan-";[Last Year]);Concatenation(" to Mar-";[Last Year])))

ElseIf(Quarter(RelativeDate([Current Date];-DayNumberOfMonth([Current Date])))=2)

Then(Concatenation(Concatenation("Q1:Apr-";[Last Year]);Concatenation("to Jun-";[Last Year])))

ElseIf(Quarter(RelativeDate([Current Date];-DayNumberOfMonth([Current Date])))=3)

Then(Concatenation(Concatenation("Q2:Jul-";[Last Year]);Concatenation("to Sep-";[Last Year])))

ElseIf(Quarter(RelativeDate([Current Date];-DayNumberOfMonth([Current Date])))=4)

Then(Concatenation(Concatenation("Q3:Oct-";[Last Year]);Concatenation("to Dec-";[Last Year])))

 

 

Best Regards,

-Harshil J Joshi

 


Selectively Opening Latest Instances by Default (3.x)

$
0
0

Sometimes you want your users to open the latest instance of a report and not the report itself.

 

Sadly, this option is set as a global default across Infoview - when you click on a report you can either open the report itself OR the latest instance.

 

CMS>MANAGE>APPLICATIONS>INFOVIEW>PREFERENCES

Default Viewing Action.JPG

Luckily there's an easy workaround.

 

Create an OpenDocument link for your report, and include the &sInstance=Last parameter.

 

Then, create a new hyperlink in Infoview:

 

NEW>HYPERLINK

 

Insert your OpenDocument link into the URL and title as per the report.

 

Finally, use this hyperlink in place of the report (e.g move the report somewhere else and use the link in its place).

 

Easy huh? Hope you find useful

 

(note: may also work for 4.x, don't have it to test, apologies.)

Dynamic default values with prompt in webi reports (based on bex queries) in BO

$
0
0

     There has always been requirement wherein webi reports in BO are scheduled to run periodically for dynamic prompt values.

For e.g. We have reports which are scheduled to run monthly with cal.year month input as last month.

(P.S.  This document considers only universe based on bex queries for using this method.)

 

This obviously is easily achieved by using customer exit variables in BI. However, the only issue in using such variables is that there is no prompt for such variables in BO reports. Due to which such reports can by default be executed only for the values that are passed in the variables from the exit.

 

      But, many a time we have requirements wherein we want a report to by default get executed for the dynamic value passed through the variable when it is scheduled on periodic basis and also have a prompt option so that user can execute it for any value he/she requires. Since, there is no such option in BO ( as of now atleast ) to have a prompt with default values, and after looking out for a work around everywhere and failing to find any thing which could suffice such a requirement, I have found a work around which has helped to overcome this difficulty.

    

       To explain the method used, I would take a simple scenario where every month a BO report which is based on a bex query is scheduled to execute for last month i.e. Cal.year month(0calmonth) is the input for the query and the report should get executed by default for last month.

The idea is, whenever  ‘# ‘(not assigned ) value is passed to the query, the query would by default pick last month as value for the 0calmonth characteristic. However, if there is any other value passed as input other than  ” #” then the input value is to be considered as value for 0calmonth. To achieve this we would require two variables :

1. Manual Input variable (Based on 0Calmonth). 2. Customer exit variable (Based on 0Calmonth).

 

CV_CMON.jpgCV_MONDEF.png

 

Here, the manual input variable (i.e. CV_CMON) would contain the value which would be provided as input in the query

and the customer exit variable (i.e. CV_MONDEF) would be filled in exit with the desired value at I_Step = “2” (Call after variable entry ).

Below is the screenshot of the logic used to fill the variable CV_MONDEF.

 

EXIT.png

 

Next, while creating the query on which the universe would be built, restrict the 0calmonth characteristic to both the variables.

As shown in below screenshot.

 

Bexquery.png

 

On execution of query as shown in below screenshots, if ” #”  value is entered in variable CV_CMON then CV_MONDEF is filled with last month value

whereas if any other value is provided as input then CV_MONDEF is filled with value which is provided as input.

 

Defl_Input.pngDefl_Op.png

 

 

Input.pngOutput.png

 

 

So as shown in the screenshots above, based on the input, the variable is restricted to the desired value and hence the desired output is achieved.

Now, using this a publication of the Webi report in BO can be created and scheduled with the Cal.year month as “#”.

 

Webi.png

 

So this way the report will be scheduled to run monthly based on the default value of last month and also at the same time

if user wants to change the cal.year month and execute the report the same can be done. Both the things can be achieved with the same webi report.

 

Hope this helps.

Establishing Matches Within Merged Dimensions

$
0
0

Here’s a little trick I use for establishing matches in merged dimensions. I’m using the Island Resorts Universe to demonstrate.

 

Let’s say I have the Sales Data for 2006 to establish which customers bought holidays in 2006, and I want to compare this to reservations in 2007 to see which of these customers made reservations for the following year as well.

 

We all know the easy way to do this is via a Combined (intersection) query:

Cquery1.JPGCquery2.JPG

..which gives us the following (correct) output:

CombinedOutput.JPG

..but if we want to show this in the context of our Sales 2006 data, what can we do?

 

I have my combined query already (as above), and I've added a query returning just the 2006 Sales customers (essentially this is the "2006 Sales" half of the combined query). For full disclosure, I’ve also added a query to return the 2007 reservations data (which is the other half of the combined query) so you can check the results – which for all three of these is:

Alloutput.JPG

…but really the 2007 data isn’t necessary – all we need is the combined query and the 2006 Sales Data. I'm merging the dimensions in the report.

 

So,I want to show all of my 2006 Customers and highlight those who have reserved in 2007.

 

The first thing you might think of doing is something like this:

=If [Sales].[Customer]=[Reservations].[Customer] Then 1 Else 0

 

..which doesn't quite hit the spot. Try it yourself.

 

Next, maybe:

=Match(ReportFilter([Sales].[Customer]);"*"+[Reservations].[Customer]+"*")

 

..which also doesn't quite cut the mustard.

 

So what can we do?

 

Here’s my solution, which like most things I try to do, is low maintenance and involves no universe work in the background.

 

Create another query containing just the Customer object, and in the query filter section, use the same object but set it to return values from another query. The query to return values from is our first query – the combined one – which is the intersection between 2006 Sales and 2007 Reservations:

query4.jpg

I’m calling this query [Filter Query]. Then back in the report, we need to create a couple of objects. Firstly, this one which I will call [SQL]:

 

=DataProviderSQL([Filter Query])

 

This object returns the SQL statement from the query, which is this:

SQL.JPG

As you can see, it contains a list of our Customers from the Combined Query. We can now use this as a basis to match against our results from the 2006 Sales Customers query. We do this using our second object:

 

=Match([SQL];"*"+[Sales].[Customer]+"*")

 

When we apply this object to our 2006 Sales Customers, we can see that those who have reserved in 2007 have a “1” next to them, indicating a true result for the match function:

Matched 1.JPG

It’s not hard to turn this into an alerter instead:

Matched 2.JPG

One caveat: This mechanism is limited by the number of results you can return using query on query, which I believe is set by default to 1000.

 

Like many things in Business Objects, there's often more than one way to accomplish something. This was my way of performing matches with merged dimensions, there may well be other easier ways....let me know if there are!

 

Either way, I hope you find this useful!

Linear & Polynomial Trend Lines in Webi

$
0
0

Currently, there is no option to draw a linear or polynomial trend line in a webi chart. However, we can use mathematical calculations to overcome the challenge.

In this post, I utilize eFashion Universe for demonstration purposes. I am assuming that you are somewhat familiar with regression analysis and Webi 4.0 – Rich Internet Application Viewing Mode.

 

Warm-up reminders:

A linear trend line is defined by this equation: Y= a0 + b*X1 , in which we are assuming that

  • variable X is a timing factor (day, month, year etc..) and can be used to explain the fluctuation of the output Y;
  • a0 & b are the best estimators of the model and can be calculated using the ordinary least squares (OLS) method.

 

We define: x1=X1-Average[X1] and y=Y-Average[Y] then

  • b = Sum[x1*y]/Sum[x1*x1]
  • a0 = Average[Y] - b*Average[X1]

 

Similarly, a polynomial trend line can be defined by this equation: Y=a + b1*X1 + b2*X2, in which:

  • variable X1, X2 are timing factor (day, month, year etc..) and can be used to explain the fluctuation of the output Y;
  • X2 = X1 * X1
  • a, b1 & b2 are the best estimators of the model and can be calculated using the ordinary least squares (OLS) method.


We also define x2=X2-Average[X2] then

  • b1 = {Sum[x2*x2] * Sum[x1*y] – Sum[x1*x2] * Sum[x2*y]}/ {Sum[x1*x1] * Sum[x2*x2] – Sum[x1*x2] * Sum[x1*x2]}
  • b2 = {Sum[x1*x1] * Sum[x2*y] – Sum[x1*x2] * Sum[x1*y]}/ {Sum[x1*x1] * Sum[x2*x2] – Sum[x1*x2] * Sum[x1*x2]}
  • a = Average[Y] – b1*Average[X1] – b2*Average[X2]

 

Create a linear trend line in Webi 4.0

Step 1: Build a Webi report using eFashion Universe.

step1.png

Step 2: Create new variables for those in the warm-up reminders Section. Note that we don’t have to create a new variable for each of them.

 

Create X1 (assuming we are showing trend lines by month)

step2.png

Similarly, create x1y

=([X1]-(Average([X1]) In Block))*([Sales revenue]-(Average([Sales revenue]) In Block))

 

Create x1x1

=([X1]-(Average([X1]) In Block))*([X1]-(Average([X1]) In Block))

 

Create b

=(Sum([x1y]) In Block)/(Sum([x1x1]) In Block)

 

Create a0

=Average([Sales revenue]) In Block - [b]*(Average([X1]) In Block)

 

Create Linear Trend

=[a0]+[b]*[X1]

 

Step 3: Insert a webi chart with the linear trend line we have created:

Go to Report Element \ Chart \ Line

step3-1.png


Assign data to the new chart

Step3-2.png


Enjoy the result. The image below shows linear trend line and Sales revenue in DC only

Step3-3.png

Below is the Sales revenue Report for California

Step3-4.png


Create a polynomial trend line in Webi 4.0

Assuming we continue to use some of the work we have done in the Linear Trend Line section.


Step 4: Create additional variables for the polynomial trend line

Create X2

=[X1]*[X1]

 

Create x2x2

=([X2]-(Average([X2]) In Block))*([X2]-(Average([X2]) In Block))

 

Create x2y

=([X2]-(Average([X2]) In Block))*([Sales revenue]-(Average([Sales revenue]) In Block))

 

Create x1x2

=([X1]-(Average([X1]) In Block))*([X2]-(Average([X2]) In Block))

 

Create b1

=((Sum([x2x2]) In Block)*(Sum([x1y]) In Block)-(Sum([x1x2]) In Block)*(Sum([x2y]) In Block))/((Sum([x2x2]) In Block)*(Sum([x1x1]) In Block)-(Sum([x1x2]) In Block)*(Sum([x1x2]) In Block))

 

Create b2

=((Sum([x1x1]) In Block)*(Sum([x2y]) In Block)-(Sum([x1x2]) In Block)*(Sum([x1y]) In Block))/((Sum([x2x2]) In Block)*(Sum([x1x1]) In Block)-(Sum([x1x2]) In Block)*(Sum([x1x2]) In Block))


Create a

=(Average([Sales revenue]) In Block)-[b1]*(Average([X1]) In Block)-[b2]*(Average([X2]) In Block)

 

Create Poly Trend

=[a]+[b1]*[X1]+[b2]*[X2]

 

Step 5: Add the polynomial trend line in the current chart

Right-click on the chart then choose Assign Data…

Step5.png

Click on the plus sign in the Value Axis 1 Section, then choose Poly Trend.

step5-2.png

Enjoy the result.

step5-3.png

 

If you have any questions, please leave a comment below and I will try to answer them as soon as I can.

 

Happy Valentine!

Huu Nguyen


Viewing all 221 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>