Sunteți pe pagina 1din 66

Sage Intelligence Reporting

Version 7.3
Advanced Manual

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 1 of 66

Contents
Welcome ....................................................................................................................................................... 5
Course Pre-Requisites .................................................................................................................................. 5
Course Objective ........................................................................................................................................... 5
How to Use the Curriculum ............................................................................................................................ 5
Document Conventions ................................................................................................................................. 5
Course Outline .............................................................................................................................................. 6
Sample Company Information ....................................................................................................................... 6

Lesson 1: Overview Of Sage Intelligence Reporting ...................................................................................... 7


An Overview of Business Intelligence ............................................................................................................ 7
How Sage Intelligence Reporting Fulfils Business Intelligence Needs ........................................................... 8
The Sage Intelligence Reporting Modules ..................................................................................................... 9
Report Manager ......................................................................................................................................... 9
Report Viewer .......................................................................................................................................... 10
Report Designer ....................................................................................................................................... 10
Connector ................................................................................................................................................ 11
Security Manager ..................................................................................................................................... 12
License Manager ...................................................................................................................................... 13

Lesson 2: Navigating Within The Connector ................................................................................................ 14


Object Window ............................................................................................................................................ 15
Properties Window ...................................................................................................................................... 16
Accessing Commands ................................................................................................................................. 18

Lesson 3: Steps To Create Connectivity To A Data Source ......................................................................... 19

Lesson 4: Creating Data Connectivity To An Access Database ................................................................... 21


Adding a Connection ................................................................................................................................... 21
Adding a Container ...................................................................................................................................... 23
Testing the Container Works .................................................................................................................... 24
Sampling Data in the Container ................................................................................................................ 25
Adding an Expression.................................................................................................................................. 26
2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 2 of 66

Lesson 5: Using Excel As A Data Source For Reports ................................................................................ 28


Named Ranges ........................................................................................................................................... 28
Creating a new connection to the Excel Workbook ...................................................................................... 29

Lesson 6: Creating A Container For Multiple Tables .................................................................................... 31


Graphical Joins in More Detail ..................................................................................................................... 31
Understanding Inner, Outer or Full Outer Joins ........................................................................................... 33
Inner Join ................................................................................................................................................. 33
Full Outer Join .......................................................................................................................................... 34
Outer Join ................................................................................................................................................ 36
Primary and Secondary (Foreign) Keys ....................................................................................................... 38
Creating a Container Using the Graphical Join Tool .................................................................................... 40
Joining the Tables .................................................................................................................................... 42
Adding Expressions to a Graphical Join ...................................................................................................... 44

Lesson 7: Customizing Expressions ............................................................................................................ 45


Why Modify the Expression in the Connector and Not In Excel? ................................................................. 46
Creating a Custom SQL Expression from a Copied Expression .................................................................. 46
Customizing Expressions Using Excel Formulas ......................................................................................... 48
Adding a New Excel Formula Expression ................................................................................................ 48
Applying an Excel Formula to an Existing Expression .............................................................................. 48

Lesson 8: Using Variables As Expressions .................................................................................................. 49


Terminology ................................................................................................................................................ 49
What can Pass Through Variables be used for? .......................................................................................... 50
Adding a Pass Through Variable Expression ............................................................................................... 50
Using a Pass Through Variable Within Another Container Expression ........................................................ 51
Using a Pass Through Variable to Filter Data in a Report ............................................................................ 52
Using a Pass Through Variable to Filter Aggregated Data in a Report ........................................................ 52
Using a Pass Through Variable Within Multiple Union Sub Reports ............................................................ 52

Lesson 9: Managing Containers And Expressions ....................................................................................... 55


Moving a Container ..................................................................................................................................... 55
Checking Container Dependencies ............................................................................................................. 55
Renaming an Expression ............................................................................................................................ 56
2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 3 of 66

Deleting an Expression................................................................................................................................ 57
Modifying the Lookup Location of an Expression ......................................................................................... 58

Lesson 10: Connecting To Multiple Companies ........................................................................................... 60


PICKLIST .................................................................................................................................................... 60
Creating a Consolidation Connection .......................................................................................................... 62
Importing the Report onto the Consolidated Connection .......................................................................... 63

Lesson 11: Report Writing Methodology And Best Practices ....................................................................... 64


Report Writing Methodology ........................................................................................................................ 64
Pre-requisites ........................................................................................................................................... 64
Report Writing Best Practices ...................................................................................................................... 65
Connector ................................................................................................................................................ 65

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 4 of 66

Welcome
The Sage Intelligence Advanced course is designed to introduce you to the way Sage Intelligence Reporting
connects to data sources. Highlights include an overview of the modules, how to connect to data sources,
how to create and modify expressions as well as Best Practices to create the most efficient connectivity.
With your instructors assistance and your efforts, you will become familiar with this Sage Alchemex product
through hands on classroom training.
Course Pre-Requisites

A basic understanding of Microsoft Excel and Microsoft Windows is required.

A basic understanding of databases, particularly SQL is helpful.

Completion of the Sage Intelligence Reporting Beginners and Intermediate course or hands on
experience working with the Report Manager is required.

Course Objective
The objective of this course is to enable you to build more advanced custom reports using the connector.
The Connector incorporates a number of innovative features. It enables you to connect to any supported
ODBC compliant database and extract the data into an Excel workbook in the way you want it to be
presented.
Through the course instruction you will learn to:

Build more advanced database connections

Build reports to consolidate databases and companies

Identify the components of a connection, container and expression

How to Use the Curriculum


In addition to this course been completed, an online assessment will be required to be passed in order to
obtain your course certificate.

Document Conventions
Sage Alchemex uses the Microsoft Manual of Style (MMOS), Third Edition, as its corporate authority for
technical terminology and references to user interface elements as well as terms approved by the Sage
Softwares Training Council or the CSC for references to specific training types, individual roles, certification
terms, and specific elements of the curriculum.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 5 of 66

Course Outline
The Sage Intelligence Intermediate Report Writing course is divided into 10 lessons. Each lesson is
designed to provide you with practical knowledge and experience that can be applied to your specific needs.
This course includes the following lessons:
Lesson

Purpose

Lesson 1: Overview of Sage


Intelligence Reporting

This lesson introduces you to the Sage Intelligence Reporting


product and its functionality.

Lesson 2: Navigating within the


Connector

This lesson will provide you with an understanding of how to


navigate and work with the Connector Module.

Lesson 3: Steps to Create


Connectivity to a Data Source

This lesson will provide you with the steps to create connectivity to
a data source.

Lesson 4: Creating Data


Connectivity to an Access Database

This lesson will provide you with the understanding of how to


create connectivity using Access as a Data source.

Lesson 5: Using Excel as a Data


Source for Reports

This lesson will provide you with the understanding of how to use
Excel as a Data source.

Lesson 6: Creating a Container For


Multiple Tables

This lesson will provide you with an understanding of how to use


the Graphical Join Tool to create a Multiple Table container.

Lesson 7: Customizing Expressions

This lesson will demonstrate how to customize expressions using


SQL.

Lesson 8: Using Variables as


Expressions

This lesson will introduce Pass Through Variables and explain


different ways of using them.

Lesson 9: Managing Containers and


Expressions

This lesson will demonstrate how to use the connector to manage


containers and expressions.

Lesson 10: Connecting to Multiple


Companies

This lesson will provide you with an understanding of how to use


the connector to connect to multiple companies.

Lesson 11: Report Writing


Methodology and Best Practices

This lesson provides you with best practices to create the most
flexible efficient reports.

Sample Company Information


The exercises have been created based on the sample company RKL Trading provided with
Sage Intelligence Reporting software.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 6 of 66

Lesson 1: Overview of Sage Intelligence Reporting


Objective: This lesson will familiarize you with the following:

What is Business Intelligence?

How Sage Intelligence Reporting fulfils Business Intelligence needs.

The different modules Sage Intelligence Reporting offers and their functions.

An Overview of Business Intelligence


Business Intelligence (BI) refers to skills, technologies, applications and practices used to help a business
acquire a better understanding of its commercial context.
BI may also refer to the collected information itself and the knowledge developed from this information.
BI applications provide historic, current and predictive views of business operations. One of the key
objectives of BI is to provide the information businesses need in order to make better decisions.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 7 of 66

How Sage Intelligence Reporting Fulfils Business Intelligence Needs


Sage Intelligence Reporting is classified as a BI application because the data extraction and manipulation
tools, coupled with Excels ability to render the output into user-friendly reports, represents the level of
abstraction required to produce meaningful information supporting decision-making from endless sets of data
which are mostly meaningless to the business decision-maker.
Sage Intelligence Reporting is focused on businesses whose market dictates that BI solutions are rapidly
deployed in a cost effective manner so that companies realize their returns early. Sage Alchemex is well
placed to deliver on this initiative as its product suite, training and service offerings grow.
With Excel as the front-end for Sage Intelligence Reporting, its well-placed to take advantage of the enhanced
functionality available in Excel 2007 and beyond. Microsoft is serious about Business Intelligence and has
boosted this functionality supporting its vision of Excel as a platform for intelligence delivery in the future.
Companies typically begin to suffer from one or many of the following types of symptoms in their business
which leads them to the realization that they need a solution like Sage Intelligence Reporting to give them
proper insight into their business.

Need a business dashboard with sales and customer information to help them quickly understand the
health of their business

Require customized reports tailored to answering their business needs without manually formatting the
report each time they use it

Need access to additional information (such as inventory usage and collections issues) without learning
a new reporting tool.

Sage Intelligence Reporting not only creates real value beyond standard offerings, but also helps companies
make sense of what is going on in their businesses to make better decisions and become more profitable.
The end result is better information, better decision making and better companies.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 8 of 66

The Sage Intelligence Reporting Modules


There are six modules of Sage Intelligence Reporting: Report Manager, Report Viewer, Report Designer,
Connector, Security Manager and License Manager.
Report Manager
The Report Manager provides an interface to create and modify reports. Reports can be grouped into
folders, and properties of reports can be reviewed and edited as necessary. The Report Manager is the
primary focus of the Sage Intelligence Beginners and Intermediate course.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 9 of 66

Report Viewer
The Report Viewer provides an interface to run the reports directly.

Report Designer
The Report Designer is a component of Sage Intelligence Reporting that allows you to fast track the building
of powerful financial reports via the Layout Generator which provides an easy-to-use, drag-and-drop
interface to allow for flexible financial reporting with multi-level groupings according to your unique business
needs.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 10 of 66

The Report Designer Add-in is the newest addition to the Report Designer module which presents an
alternative to the current report layout generator to empower users to take control of all design aspects of
their reporting layouts within Excel.

The Report Designer is covered in detail in the Sage Intelligence course designed for your ERP.
Connector
The Connector maintains the connectivity between Sage Intelligence Reporting and the data sources. The
groups of connections are called containers, and the administration of these is the primary focus of the
Advanced course.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 11 of 66

Security Manager
The Security Manager controls the accessibility of Sage Intelligence Reporting reports by the various users.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 12 of 66

License Manager
The License Manager maintains the licenses installed for Sage Intelligence Reporting.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 13 of 66

Lesson 2: Navigating within the Connector


Objective: This lesson will familiarize you with the following:

Navigating within the Connector

Viewing the advanced options

Using the ribbon

Opening the help file

Expanding and collapsing objects

Accessing the shortcut menu

To effectively use the Connector, you need an understanding of the interface and how to perform actions.
The layout of the interface is divided into two main areas: the object window on the left, and the properties
window, on the right. Each is described in detail below.

Object
Window

2014 Sage Intelligence Reporting

Properties
Window

Sage Intelligence 7.3 Reporting Advanced Manual

Page 14 of 66

Object Window
You are able to select objects using your mouse from the object
window in order to either view the objects' properties or perform a
task with the object. For example, you are able to select an object
in the object window and rename the object just as youd rename
a file in Windows Explorer.
From the object window, you can also double-click on an object to
expand or collapse the objects.

Object Level Hierarchy


The following diagram explains the hierarchy of how the various object levels fit together. Each level below
is opened by either double-clicking on the level above it or, with the focus on the upper level; right-click and
select Open to open the level below it. To collapse a level, double-click on the level above it.

Referential Integrity
To protect structural relationships, the principle of Referential Integrity is applied to prevent the deletion of
the following:

Connection - if there are any containers linked to it that are used in reports as could be seen in the
Report Manager module.

Container - if there are any reports linked to it in the Report Manager module. Right-click on any
container and select Show Dependencies to see if there are any Report Manager Module reports
currently associated to this container.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 15 of 66

Expression - if there are any reports in the Report Manager that use it.

Properties Window
The properties window on the right displays the properties of whichever object is selected on the left in the
object window.
To maintain or view the fields, first select the relevant object (Enterprise. Connection, Container or
Expression) on the object window. All properties windows have editable and read-only fields to setup and
display various configurations, except the Enterprise object (has only read-only display fields and is not able
to be edited).
1.

From the object window, select the desired object.

2.

From the properties window, view the desired properties.

The various Properties windows are used to setup and display important object configurations. Certain
fields across all Properties windows are read-only and subsequently display with a blue background.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 16 of 66

All selected objects also has a Show Advanced option to display more options, with the exception of
Enterprise and the expressions.

3.

To save any changes made in the property window, click Apply.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 17 of 66

Accessing Commands
There are two ways to access menu commands within the Connector interface:
1.

Using the Ribbon


All of the ribbon icons have their own tool tips that are displayed upon hovering your mouse over the
icon.

There are additional tabs which will give you access to more options. For example, in the Tools tab,
options are available to view system variables and run SQL queries. From the Help tab, you can open
the help file, connect to the online academy or the knowledge base.
2.

Using the Shortcut menu.


Depending on your current selection in the object menu, the right-click options will differ.

To view an object's associated elements, double-click on the object. This action is called drilling down
or expanding. To drill down is to show additional information. To hide an object's associated
elements, double-click an open object. This action is called drilling up, or collapsing thereby hiding the
additional information.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 18 of 66

Lesson 3: Steps to Create Connectivity to a Data Source


Objective: This lesson will familiarize you with the following:

The process to create connectivity to source data

The types of connections

The types of containers

The types of expressions

The Connector maintains the connectivity between Sage Intelligence Reporting and the data source. The
data source is usually your ERP accounting system but can be other sources as well. The Report Manager
uses the connectivity to extract the data required for reports.
The steps to create connectivity to the source data is as follows:

1.

Add a Connection - A connection holds the relevant connection information to connect to a supported
ODBC or OLEDB compliant data source. By adding a connection to one of the defined connection
types, the Connector module can make data available from this data source. During this course, we
only use the RKL Trading Demo database which is an ODBC Driver for Access database. If you
open the connector and double-click on Enterprise, you will see the many other connection types that
are available.

2.

Add a Container - A Container is a set of metadata which is made available (published) by the
Connector module which will allow users access to the data using the Report Manager module. The
source of this data can be a database table, view, sql query, stored procedure or a custom join based
on two or more tables/views.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 19 of 66

3.

Add Expressions - An expression is a selection from the available fields of the selected container. In
addition to a data field from the container, an expression can be a:

Data Field - This is an expression that is directly linked to the database field.

SQL Expression - Returns data from a field or combination of fields based on a SQL expression;
the data reflected in this expression is based on the SQL syntax entered into the expression.

Microsoft Excel Formula - This is an Excel formula that will only resolve once it opens in Excel;
the data reflected in this expression is based on the Excel syntax entered into the expression.

Pass Through Variable - Pass Through Variables enable the queries (or SQL statements) that are
sent to the database systems during report execution to be affected at run time.

Each different type of expression is represented by a different icon.

Excel formula
SQL Expression
Data Field
Pass Through Variable

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 20 of 66

Lesson 4: Creating Data Connectivity to an Access Database


Objective: This lesson will familiarize you with the following:

Adding a connection to an access database

Adding a container

Adding an expression

Lets go through the procedure to create data connectivity to an access database by adding a connection,
container and expressions.
Adding a Connection
1.

From the object window, click on the ODBC Driver for Access.

2.

Select Add Connection.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 21 of 66

3.

Under Connection Name, enter in the desired name.

4.

Under Access Database (mdb), select the ellipses (...) to browse.

5.

Select the Access database file name.

6.

Select Add.
The new connection is now available under the chosen connection type.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 22 of 66

Adding a Container
1.

From the object window, right-click on the RKL Trading Demo Connection.

2.

Select Add Data Container.

3.

Select the desired container type. (Table, SQL Join, View, Graphical Join, Stored Procedure, SQL
Query)

4.

Select OK.

5.

Select the desired Table(s).

6.

Select OK. A container has now been created based on this single table.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 23 of 66

Testing the Container Works


TIP: Its important to always Check/Test your containers to make sure that they work before you start to
write reports.

To test if a container works, do the following:


1.

From the object window, click on the desired container.

2.

On the Home tab, select Check/Test.

3.

A confirmation that your container was checked successfully will appear.

4.

Select OK.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 24 of 66

Sampling Data in the Container


Once you have tested the container, we recommend you sample the data to check that the container is
requesting the correct data. Looking at the sample data in your container will give you an idea of what data
your final report could contain.
To sample data in a container, do the following:
1.

From the object window, select the desired container.

2.

On the Home tab, select Sample Data.

3.

The sample data will appear in the properties window.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 25 of 66

Adding an Expression
1.

From the object window, right-click on the desired container.

2.

Select Add Expressions.

3.

Select the expression type to add: Data Field(s).

4.

Select OK.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 26 of 66

5.

Select the table which contains the expressions youd like to add and click OK.

6.

Select the desired fields.

7.

Select OK. The fields will now be added under the container.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 27 of 66

Lesson 5: Using Excel as a Data Source for Reports


Objective: This lesson will familiarize you with the following:

Steps to prepare your Excel workbook to use it as a data source

Creating a named range in Excel

Creating a data connection to Excel

Creating a data container

Named Ranges
To use an existing Excel Workbook as a data source for a report, the data needs to be organized into
named ranges, and must not be formatted.
To create named ranges in Excel, do the following:
1.

Open the workbook in Excel.

2.

Make sure that the data is stored with accurate headings because the expressions will be created using
the heading names and we need to know what data we will be referring to later.

3.

Select the entire data range. There are some shortcuts you can use to select the entire data range but
lets stick to basics.

4.

In the Formulas tab, select Define Name.

5.

Give the data a name and click OK.

6.

With the range still selected, click Create from Selection.

7.

Select only the Top Row and click OK. This will create a named range for each column using the
column heading. Well use those for our expressions.

8.

Save the workbook and minimize it.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 28 of 66

Creating a new connection to the Excel Workbook


To add a new data connection to an Excel workbook, you will need to ensure that you have selected the
applicable data in Excel and have named the range prior to adding the connection within the Connector tool.
To create a new connection to the Excel workbook, do the following:
1.

Open the Connector.

2.

Select the ODBC Driver for Excel.

3.

On the Home tab, select Add Connection. The Connection Info window will appear.

4.

Give the connection a name.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 29 of 66

5.

In the Excel Workbook box, use the ellipses to browse to the location of the Excel workbook that you
will be accessing. If the workbook has been protected, you will need to add the relevant user id and
correct password.

6.

Click Add.

7.

Open the Excel workbook. You need to have it open to add a container to the workbook.

8.

In the Connector, click on the connection and select Add Data Containers.

9.

Select Table.

10. Select the table with the named range for the entire data.
11. Click OK.

Now add the expressions:


12. Select the container.
13. Click Add Expressions.
14. Select Data Field(s) and click OK.
15. Click Select All.
16. Click OK. You can now use this container to create reports in the Report Manager.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 30 of 66

Lesson 6: Creating a Container for Multiple Tables


Objective: This lesson will familiarize you with the following:

Graphical Joins

Types of Graphical Joins

Primary and Secondary (Foreign) Keys

Creating a Container Using the Graphical Join Tool

Adding Expressions to a Graphical Join

Up to now we have only linked to a single table. Many reports require you to join related database tables
together to retrieve the required data.
The JOIN keyword is used in SQL statements to query data from two or more tables, based on a
relationship between certain columns in these tables.
Its possible, in the Connector module, to create the join using SQL script, but if you are unfamiliar with SQL
script, you are able to create the join using the graphical join tool.
The graphical join tool enables you to create joins between tables using a graphical click and drag method.
This method enables you to create SQL joins that would normally require a technical understanding of SQL
scripting language.

Graphical Joins in More Detail


Using the Connector, data is made available through the addition of containers and relevant expressions.
The source of the underlying data can be a Table, a View, a Stored Procedure, SQL Query or a user
defined SQL Join or a Graphical Join.
To create a container based on a SQL Join, you should add a container, selecting the option SQL Join from
the Select Container Type window and providing a name for the container. Before adding expressions,
youd then type in the join syntax in the Source Container (Join) field.
The source should thus be the FROM clause (excluding the FROM keyword) of a SQL query that would
define the join.
The syntax of the Join can be verified by using the Check/Test facility for the container. When the SQL join
is verified to be correct, the Connector module can select to Add Expressions. The expression list will then
include all fields from all the tables in the Join.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 31 of 66

There are two main SQL Join styles that are used by database systems. For some systems either will work,
while for others only one of the methods will work. Its recommended where possible to use Syntax 2 (the
newer ANSI style Join).

Join Syntax 1
TABLE1, TABLE2, TABLE3
WHERE TABLE1.KEYFIELD = TABLE2.KEYFIELD
AND TABLE2.KEYFIELD_2 = TABLE3.KEYFIELD
Example
timesheet, employee, department
WHERE timesheet.employee_id = employee.id
AND employee.department_id = department.id

Join Syntax 2
TABLE1
[INNER | LEFT | RIGHT] JOIN TABLE2
ON TABLE1.KEYFIELD = TABLE2.KEYFIELD
[INNER | LEFT | RIGHT] JOIN TABLE3
AND TABLE2.KEYFIELD_2 = TABLE3.KEYFIELD
Example
timesheet
INNER JOIN employee
ON timesheet.employee_id = employee.id
INNER JOIN department
ON employee.department_id = department.id
INNER JOIN ON

TIP: Some systems allow tables to have names, which include space characters. Where this is the case,
its necessary to surround table names and field names with square brackets.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 32 of 66

Understanding Inner, Outer or Full Outer Joins


An Inner Join is created by default, which can be changed by right-clicking on the join box on either side of
the join and selecting Outer join. The reverse polarity option on the shortcut menu switches the join
between a Left and Right Outer Join.
Inner Join
An Inner Join returns all rows from both tables where there is a match. If there are rows in Table A that do
not have matches in Table B, those rows wont be listed.

This is the simplest, most understood Join and is the most common. This query will return all of the records
in the left table (table A) that have a matching record in the right table (table B)

Example:
Table A Customers Table:
P_ID

LastName

FirstName

Region

Hansen

Oleg

North

Teller

Tammy

North

Petersen

Karl

South

Table B Orders Table:


O_ID

OrderNo

P_ID

77895

44678

22456

24562

34764

15

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 33 of 66

To create a list with all the customers with any orders:


SELECT Customers.Lastname,Customers.FirstName,Orders.OrderNo from Customer
INNER JOIN Orders
ON Customers.P_Id=Orders.P_Id
ORDER BY Customers.Lastname
Result of above:
LastName

FirstName

OrderNo

Hansen

Oleg

22456

Hansen

Oleg

24562

Petersen

Karl

77895

Petersen

Karl

44678

Full Outer Join


A full outer join combines the results of both left and right outer joins. The joined table will contain all
records from both tables, and fill in NULLs for missing matches on either side.

This Join can also be referred to as a FULL OUTER JOIN or a FULL JOIN. This query will return all of the
records from both tables, joining records from the left table (table A) that match records from the right table
(Table B).
Example:
Table A - Customers Table:
P_ID

LastName

FirstName

Region

Hansen

Oleg

North

Teller

Tammy

North

Petersen

Karl

South

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 34 of 66

Table B - Orders Table:


O_Id

OrderNo

P_Id

77895

44678

22456

24562

34764

15

To list all the customers and their orders, and all the orders with their customers, the SQL script will be:
SELECT Customers.LastName, Customers.FirstName, Orders.OrderNo from Customers
FULL JOIN Orders
ON Customers.P.Id=Orders.P_Id
ORDER BY Customers.LastName

Result of above:
LastName

FirstName

OrderNo

Hansen

Oleg

22456

Hansen

Oleg

24562

Petersen

Karl

77895

Petersen

Karl

44678

Teller

Tammy

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 35 of 66

Outer Join
An Outer join can be either a Left Outer or a Right Outer join.

Left Outer Join


Left outer join produces a complete set of records from Table A, with the matching records (where available)
in Table B. If there is no match, the right side will contain null.

Example:

Table A - Customers Table:


P_ID

LastName

FirstName

Region

Hansen

Oleg

North

Teller

Tammy

North

Petersen

Karl

South

Table B - Orders Table:


O_Id

OrderNo

P_Id

77895

44678

22456

24562

34764

15

To list all the Customers and their orders, the following SQL script can be used:
SELECT Customers.Lastname, Customers.FirstName, Orders.OrderNo from Customers
LEFT JOIN Orders
ON Customers.P_Id=Orders.P_Id
ORDER BY Customers.LastName

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 36 of 66

Result of above:
LastName

FirstName

OrderNo

Hansen

Oleg

22456

Hansen

Oleg

24562

Petersen

Karl

77895

Petersen

Karl

44678

Teller

Tammy
34764

Even though the Customer. Tammy Teller, has no order, she will still be returned.

Right Outer Join


A right outer join is much like a left outer join, except that the tables are reversed. A right outer join returns
all the values from the right table even if there are no matches in the left table.

This query will return all of the records in the right table (table B) regardless if any of those records have a
match in the left table (table A). It will also return any matching records from the left table.

Example
Table A - Customers Table:
P_ID

LastName

FirstName

Region

Hansen

Oleg

North

Teller

Tammy

North

Petersen

Karl

South

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 37 of 66

Table B - Orders Table:


O_Id

OrderNo

P_Id

77895

44678

22456

24562

34764

15

To list all the Orders with Customers, the following SQL script can be used:
SELECT Customers.Lastname, Customers.FirstName, Orders.OrderNo from Customers
RIGHT JOIN Orders
ON Customers.P_Id=Orders.P_Id
ORDER BY Customers.LastName
Result:
LastName

FirstName

OrderNo

Hansen

Oleg

22456

Hansen

Oleg

24562

Petersen

Karl

77895

Petersen

Karl

44678
34764

Primary and Secondary (Foreign) Keys


When creating a relational database design, a unique key or primary key is used to identify each row in a
table. A unique key or primary key is usually a single column or set of columns in a table in the database.
No two rows in a table can have the same value (or combination of values) in this column.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 38 of 66

A unique key or primary key must uniquely identify all possible rows that exist in a table and not only the
currently existing rows.
Examples of unique keys are:

Identity Document numbers (associated with a specific person) or

ISBNs (associated with a specific book).

Employee Numbers

Unique or primary keys can be referenced by secondary (foreign) keys.


The secondary (foreign) key identifies a column in one table that refers to a column in another table.
A table may have multiple secondary (foreign) keys. This can result in a single table having many other
tables that are related to using the secondary (Foreign) key.
Joining tables incorrectly by using the wrong secondary (foreign) key/primary key relationships often results
in report writing errors.
Examples of secondary (foreign) keys are:

Transaction details for customer or product master file tables

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 39 of 66

Creating a Container Using the Graphical Join Tool


To create a container using the graphical join tool, do the following:
1.

From the object window, right-click on the connection.

2.

Select Add Data Containers.

3.

Select Graphical Join.

4.

Select OK.

5.

From the Specify a Name for the Container box, enter in the desired name.

6.

Select OK.

7.

Now select on the Container (Graphical Join).

8.

From the properties window select the Graphical Join Tool button.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 40 of 66

9.

Select the tables youd like use in the graphical join.

10. Select OK. The tables will now appear in the properties window.

NOTE: To resize the tables, drag the lower border. To position the tables, click in a blank area of the
table and drag.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 41 of 66

Joining the Tables


To create an Inner join between the two tables using a common join key, do the following:
1.

Identify the common join key from the one table: Example, ID

2.

Drag the common join key from the one table to the other.

3.

Do the same for all additional tables you have added to the join.

To check the join type:


4.

From the properties window, right-click on the Join Icon

5.

You can select to Set Join Type, Remove Join and you can check that you have joined the corrected
fields.

6.

Select the desired Join Type (Inner, Outer, Full Outer)

7.

Select Apply.

8.

This will return you to the properties window.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 42 of 66

9.

The Join SQL syntax is displayed.

NOTE: To edit the graphical join, select the Graphical Join Tool button to activate the graphical join
tool. To Change the Container Type: You are able to edit the SQL syntax directly by changing the
container type to the SQL Join type, then editing the SQL syntax in the Join SQL text field.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 43 of 66

Adding Expressions to a Graphical Join


Once you have created your Graphical Join container you still need to add expressions to the container.
To add a data field expression, do the following:
1.

From the object window, right-click on the desired container.

2.

Select Add Expressions.

3.

Select the expression type to add: Data Field(s).

4.

Select OK.

5.

Select all the tables in the Join.

6.

Select the desired fields.

7.

Select OK.

The expressions will now be added under the container. Sample any of the expressions from the list:
8.

Right-click on the expression.

9.

Select Sample Data. The data will be displayed in the Properties window.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 44 of 66

Lesson 7: Customizing Expressions


Objective: This lesson will familiarize you with the following:
SQL Functions and their usage
creating a custom SQL expression from a copied expression
customizing expressions using Excel formulas

Custom SQL expressions are expressions that have been customized using SQL functions or operators.
This enables you to apply changes to an expression, such as combining one expression with another, or
applying a mathematical equation to the expression.
SQL functions are commonly used for:

Stripping out parts of a text field.

Casting one data type to another e.g. a date stored as a text field could be cast to a real date.

Performing mathematical operations e.g. summing two fields.

Returning a certain value based on some logic, e.g. returning the text YES whenever a certain Boolean
field is equal to 1.

Linking Information, for example linking the AccountID to the CompanyName.


"Chart"."AccountID" + ' - ' + RTRIM("Company"."CompanyName")

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 45 of 66

The SQL functions available are specific to the ODBC driver used.

For example, the SQL functions available for a Microsoft Access database may be different to those
available for a Pervasive database. For information about the available functions for a connection type see
the help files or documentation provided by the driver.

Why Modify the Expression in the Connector and Not In Excel?


The advantage of modifying the expression through the Connector module, over using Excel to modify an
expression, is that the custom expression is resolved faster in the Connector than it would be in Excel. In
addition, the custom expression is resolved in the Connector and only the value is displayed in the Excel
workbook, not the formula.
Although a SQL expression can be created from scratch by using the Add Expression method, its
preferable to copy an existing expression and modify it. This provides you with an existing expression to
work from.
For example if you need to create a Line Total value and you currently only have the Unit Price and
Quantity purchased, you can create a SQL expression that will multiply the two fields together, then round
the values to two decimal places:
Use the following details in creating your SQL expression:

Expressions used: Unit Price and Qty

Expression name: LineTotal

SQL syntax: Round(Qty*Unit Price,2)

Creating a Custom SQL Expression from a Copied Expression


To create a custom SQL expression from a copied expression, do the following:
1.

From the object window, select the desired container.

2.

Right-click on the expression that youd like to copy.

3.

Select Copy.

4.

Select the container.

5.

Select Paste.

6.

From the properties window, in the Expression Name box, rename the expression.

7.

From the Expression Type drop down arrow, select SQL Expression.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 46 of 66

8.

Select Apply.

From the properties window, you can now edit the Lookup SQL SELECT Statement or make changes to
the expression source.

NOTE: Its always advisable to test and sample your expression.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 47 of 66

Customizing Expressions Using Excel Formulas


Excel Formulas should be a last resort if the end result cannot be achieved through SQL Expressions.
Excel formulas have a negative effect on file size and performance.
There are two ways of using Excel formulae in an Expression.

Add a new Excel formula

Apply an Excel formula to an existing expression

Adding a New Excel Formula Expression


1.

From the object window, right-click on the desired container.

2.

Select Add Expressions.

3.

Select Excel Formula.

4.

Select OK.

5.

Type in the desired name in the Enter a Name for an Excel Expression box.

6.

Select OK.

7.

Type in the desired formula in the Enter the Excel Formula box. Spaces in field names must be
replaced with an underscore. Example, IF(Account_ID="RETINC","RETAINED
EARNINGS",IF(Financial_Type_Code="I","INCOME STATEMENT","BALANCE SHEET"))

8.

Select OK.

Applying an Excel Formula to an Existing Expression


1.

From the object window, select an existing Expression.

2.

From the properties window, change Expression Type to Excel Formula.

3.

In the Expression Source field, type in the correct syntax for the expression type chosen.

4.

Select Apply. outlook.gs.adinternal.com

NOTE: The formula doesnt begin with an equal sign.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 48 of 66

Lesson 8: Using Variables as Expressions


Objective: This lesson will familiarize you with the following:
what Pass Through Variables are
what Pass Through Variables are used for
how to add a Pass Through Variable expression
how to use a Pass Through Variable within another container expression
how to use a Pass Through Variable to filter data in a report
how to use a Pass Through Variable within multiple union sub reports

Pass Through Variables enable the queries (or SQL statements) that are sent to the Database Systems
during report execution to be affected at run time. Where ordinary parameters are used to modify the
filtering element (or WHERE clause) of a query, only Pass Through Variables can be used with parameters
to modify other parts of the query. Pass Through Variables must be used in conjunction with a reports
parameters to be effective.
Pass Through Variables can also be effectively used to pass common parameter values through a series of
union child reports within a union report. In this way a union report may be configured to use one pop up
parameter screen to parameterize a number of union child reports.
Terminology

A Pass Through Variable is a type of Container Expression used to hold a variable value that can be
used within a report.

Pass Through Variable code is the Expression Source property defined as a unique code prefixed
and suffixed with @ symbols. This code can be used in Report Filters, Report Aggregate Filters and
in other Expression Source properties. Where literal values are usually placed in filter comparison
values, the Pass Through Variable code may be substituted.

Pass Through Variable value is the value held within a Pass Through Variable during the execution
of a Report.

NOTE: The value can only be set through a report parameter based on the Pass Through Variable. The
lifetime of the Pass Through Variable value is from when the value is set during report parameterization to
when the report execution completes.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 49 of 66

What can Pass Through Variables be used for?


Pass Through Variables can be used to achieve the following:

Dynamically modifying the outcome of a report column through display fields that are based on
expressions which include variables.

Filter data in a report.

Parameterize multiple reports in a report batch through a single parameter selection.

Apply multiple filters that use a single parameter which is based on a Pass Through Variable.

Create aggregate parameters by using aggregate filters with Pass Through Variable based parameters.

Set stored procedure input arguments.

Adding a Pass Through Variable Expression


1.

Select a data container.

2.

On the Home tab, select Add Expressions.

3.

The Select the Expression Type to Add window will appear.

4.

When prompted for the type of expression select Pass Through Variable.

5.

Select OK.

6.

You will be prompted for a descriptive name for the variable.

7.

Enter the desired name.

8.

You will then be prompted for a code for the Pass Through Variable. The code is a unique identifier for
the Pass Through Variable. The code must be prefixed and suffixed with @ symbols. For example,
@COMPANY@.

TIP: This code that you choose for the Pass Through Variable has no relation to any existing expressions
in the container. The code must however be unique within the container and should preferably be unique
within your intelligence application to prevent conflicts when using Pass Through Variables in union
reports.

NOTE: Having done this you may then use the code @COMPANY@ in any of the containers
expressions or any report filters to dynamically affect queries at report run time.
To set the Pass Through Variable value you must define a parameter on a report that uses the Pass
Through Variable. Add a parameter to a report in the usual way but specifying the defined Pass Through
Variable as the expression to use for the report. When you run the report you will be prompted for a
parameter which will then set the Pass Through Variable value and any occurrences of the variable within
the underlying queries will be replaced with the variable value.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 50 of 66

Using a Pass Through Variable Within Another Container Expression


1.

Modify the Expression Source of the Expression to include the Pass Through Variable code. See the
example below where a SQL Expression has included a Pass through Variable code:

2.

Add a Parameter to your report and select the Pass Through Variable expression as the source.

3.

Run your report and enter a value for the parameter. In this example, the value that you enter for the
parameter will be placed into the variable @COMPANY@ and substituted into the expression
Company & Department.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 51 of 66

Using a Pass Through Variable to Filter Data in a Report


1.

Make sure that the container that is used in your report has Pass Through Variable(s) defined as
explained above.

2.

Add a Parameter to your report based on the Pass Through Variable.

NOTE: Running the report and entering a value for the Pass Through Variable will have no effect on the
report output until the Pass Through Variable code has been added to a filter (or aggregate filter) as in
step 3 below.
3.

Add a filter to the report that you wish to base on an expression that must be filtered in conjunction with
the Pass Through Variable code. Select the relevant comparison method for the filter (for example, Is
Equal To) and then enter the code for the pass through variable (for example, @COMPANY@).

4.

Run the Report. The parameter prompt will be used to set the Pass Through Variable value. This
value will be substituted for the Pass Through Variable code (@COMPANY@) in the filter set in step 3
above and will thus effect the output of the report query (through the SQL WHERE clause).

Using a Pass Through Variable to Filter Aggregated Data in a Report


Follow the steps as outlined in Using a Pass Through Variable to Filter Data in a Report above but in
step 3 use an aggregate filter instead of a standard filter.
Using a Pass Through Variable Within Multiple Union Sub Reports
When a union report runs, the individual union sub report queries are executed and the data is placed into a
single Excel Workbook. Although the underlying queries are executed independently and possibly against
different databases, the Pass Through Variables that are populated become available for the remaining
scope of the union report execution.
This means that a Pass Through Variable defined in a container for the first union sub report is set as the
first union sub report is executed. The variable can then be reused in the subsequent union sub reports.
This can be useful to avoid multiple parameter popup boxes where the union sub reports require similar
parameterizations.
1.

In the Connector, select the container.

Add a Pass Through Expression:


2.

Click Add Expressions.

3.

Select Pass Through Variable.

4.

Type a name for the expression.

5.

Add the unique code beginning and ending with @, for example @CompanyName@

6.

Click OK.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 52 of 66

Add a parameter to the last sub report:


1.

Open the Report Manager.

1.

Select the report.

2.

Select the Parameters tab in the properties window.

3.

Click Add.

4.

In the Choose Filter Fields window that appears, select the Pass Through Variable expression you
created in the connector.

5.

A window to enter an optional default for the parameter will appear.

Add a filter to the last sub report:


1.

Select the Filters tab.

2.

Select Add.

3.

Select the field you want to filter by.

4.

Click OK.

5.

Select Contains in the Choose Comparison Method window.

6.

In the Enter Comparison Value window, type the pass through variable name. Remember the name is
always in the form of @xxxxxx@.

Add the same filter to the other sub reports.


1.

Select the Filters tab.

2.

Select Add.

3.

Select the field you want to filter by.

4.

Click OK.

5.

Select Contains in the Choose Comparison Method window.

6.

In the Enter Comparison Value window, type the pass through variable name. Remember the name is
always in the form of @xxxxxx@.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 53 of 66

Create a Union Report.


1.

Select a folder.

2.

Select Add Report.

3.

Select Union Report.

4.

Name the report.

5.

Select the reports youd like to use in your union report.

6.

Select OK.

7.

Change the Output Sheet Numbers of the reports if required.

Run the Union Report.


1.

Select the Union Report.

2.

Select Run.

3.

In the Enter Report Parameters window, type the required parameters.

4.

Click OK.

5.

The report will open in Excel applying the pass through variable as a filter on the data that is retrieved.

WARNING: Make sure that the order of the union sub reports is correct. The last sub report must
contain the parameter because union Reports use LIFO (Last In First Out) and the Pass Through Variable
will need to be set upfront to be available to the other subreports.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 54 of 66

Lesson 9: Managing Containers and Expressions


Objective: This lesson will familiarize you with the following:

how to move a container

how to check container dependencies

how to rename an expression

how to delete an expression

how to modify the lookup location of an expression

Moving a Container
You are able to move containers from one connection to another to save time.
WARNING: Although you can move a data container to a connection in a completely different connection
type, this may lead to issues around SQL syntax.

To move a container to another connection, do the following:


1.

From the object window in the Connector, right-click on the desired container.

2.

Select Move To.

3.

From the Move Data Container to Connection window, select the connection you want to move the
container to.

4.

Select OK.

Checking Container Dependencies


To check which report utilizes a specific container you can check the dependencies of a container.
To check the dependencies on a container, do the following:
1.

Select the container in the connectors object window.

2.

Right-click on the container.

3.

Select Show Dependencies.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 55 of 66

The reports in the Report Manager that utilize that specific container will be listed.

Renaming an Expression
Its always advisable to use meaningful names in the container and expressions so that the data is easily
identifiable later.
To rename a container or expression, do the following:
1. Select the container or expression.
2. Select Rename.
3. Type in the new name in the Rename dialog box.
4. Select OK.
NOTE: Its always best to rename you expression when you initially set it up because if an expression is
already in use as a field (Column) on a report, and you then rename the expression, it wont automatically
2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 56 of 66

change on the report. Youd have to remove the field from the column property screen of the report and
then add it back again.

Deleting an Expression
To delete an expression, do the following:
1. From the object window, double-click on the desired container to view the expressions.
2. Click on the expression.
3. Select Delete.
4. Confirm by selecting Yes.

NOTE: If an expression is in use on a report then you wont be able to delete the expression. The
column field will need to be removed from the report first, then youll be able to delete it from the
container.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 57 of 66

Modifying the Lookup Location of an Expression


When a report has parameters defined for it, you may use the lookup facility to pick parameters from a
database list. By default the parameter list is pulled directly from the source container of the report. Often
this can be very time consuming and load heavily on the underlying database and often there is a more
logical place to pull the list from.
An example of this might be where your report is pulling information from a large transactional table (for
example, Sales) and a parameter is defined on the report against a Customer Account Code. The
Customer Account Code might also be defined in a smaller reference data table (for example, Customers)
and it would make sense to then define this as the lookup table.
1.

In the Connector, locate the underlying expression for the parameter.

2.

Set the Lookup Type property to the required lookup type and click Apply.

Some of the lookup types Sage Intelligence Reporting supports are:

Direct from Container (Default)


This option will cause lookups to be drawn directly from the source container.

Customized SQL Statement


This option allows you to insert a SQL statement which will be used to define the lookup.

Customized SQL Statement (Code & Desc Pair)


This option allows you to insert a SQL statement which returns a code and description pair for each
data item to be returned in the lookup. The description is displayed in the lookup but the code of the
selected lookup item is used for the parameter value.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 58 of 66

This is useful where the parameter value required is not meaningful to the user. An example would be
where Store Code is required as a parameter value, however users only know stores by the Store
Name. By using a Code & Desc Pair lookup, the store names will be displayed in the lookup list but the
store code will be passed through as the parameter value when a store name is selected from the list.
Using this option requires that you be familiar with SQL and with any SQL specifics of the database
system being accessed. Once you select this option and click Apply, a new property named Lookup
SQL SELECT Statement will appear and you can edit it to customize the lookup.

Text File
This option allows you to specify a text file which will be used to define the lookup. The text file must
contain a single item on each line.
Using text files can be useful when the list provided in a parameter lookup is very specific. Where a
normal SQL lookup might bring back some items which are not relevant to a user then a text file can be
used to populate with just the relevant items.

NOTE: The text files that are used for lookups lie outside of the containers and are not bundled with a
report that is exported for redistribution. The text files would need to be implemented in the target system
manually.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 59 of 66

Lesson 10: Connecting to Multiple Companies


Objective: This lesson will familiarize you with the following:

PICKLISTS

Consolidated Connections

There are two options when connecting to Multiple Companies:

Creating a PICKLIST

Using a Consolidation Connection

PICKLIST
Youd use PICKLIST when you want to run a consolidated report from multiple databases. PICKLISTS are
set up in the Access Database (mdb) textbox in the properties of the connection in the Connector.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 60 of 66

To add a PICKLIST parameter, do the following:


1.

Navigate to the Access Database (mdb) textbox in the properties pane and replace the existing
database details with the following: PICKLISTM=Select from List;MyCompanyA::DataA;
MyCompanyB::DataB; MyCompanyC::DataC; MyCompanyD::DataD
This will give us a PICKLIST showing four companies database connections A through D which we can
choose from.

PICKLIST Variables
PICKLIST=
Presents you with a list of all connections but only allows you to select ONE.
PICKLISTA=
Will automatically run ALL the connections listed in the PICKLIST, thus no popup list to select from. This
option is great for a consolidated Management Pack that consists of all the Companies in the list.
PICKLISTM=
Presents you with a list of all the connections and allows you the option of specifying which connections to
run. Make your choice by checking one or more of the check boxes next to your Company Names.
PICKLISTDSN=
Presents you with a list of all connections available DSN connections but only allows you to select ONE
Select from List;
This is the text that will appear in the popup box and you can change it to whatever you like. Remember to
always end with ; This is only really useful when used with the straight PICKLIST= option, thus you can
safely leave the comments out if you wish provided you still end in ;
e.g. PICKLIST=; MyCompanyA::DataA; MyCompanyB::DataB;
MyCompanyA::DataA; - Defines your various database connections.
MyCompanyA:: - Is your descriptive name so anything goes remember to end in ::
DataA; - is the exact database path and name so it has to be exact remember to end in ;

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 61 of 66

NOTE: There is no ; after the last database entry in the list.

Once the PICKLIST has been added:


1.
2.
3.

Right-click the connection and select Check/Test to ensure the syntax and connection is correct.
Once it is working, export the report that needs to use the PICKLIST from the Report Manager.
Import this report by right-clicking on the PICKLIST connection and selecting Import Report.

Creating a Consolidation Connection


Although not used in the generic Sage Intelligence
Reporting product, the Consolidation Connection can
be created in some products where Sage Intelligence
Reporting is integrated. The Consolidation connection
will be created in the Connector module. (Some
accounting products have the Consolidation
Connection set up as a standard)
To set up a consolidation connection, do the following:
1.

Open the Connector.

2.

Add a new connection under the correct driver.

3.

In the Properties tab of the connector, select Use


Auto Connection System.

4.

Give the connection a name.

5.

Select Apply.

6.

Your new connection will now be listed. Select


your new connection, and in the properties window
click the Show Advanced option.

7.

Select the option Consolidation Connection.

8.

Once you have applied the changes to the


connection, your connection details will appear in
the properties window.

9.

The consolidation connection has now been set up. You now need to import the report youd like to see
consolidated against the new consolidation connection.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 62 of 66

Importing the Report onto the Consolidated Connection


1.

In the Report Manager select the folder youd like to import the report into.

2.

Right-click and select Import Report.

3.

The Select Import Report window will open select the report that you are importing, and click Open.

4.

The Import Report window will open.

5.

You can rename your Report Name, and select the newly created Consolidated Connection.

6.

Click Import

7.

Confirm the Report Source Container by clicking Yes

8.

The newly imported consolidated report will appear in the Report Manager.

9.

You now need to set up the Database Consolidation List in the properties window of the report.
Select the ellipsis button.

10. Select the databases you wish to consolidate. They will then appear in the Database Consolidation
List in the properties window of the report.
11. You can now run your consolidated report into Excel and customize it to suite your specific reporting
requirements.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 63 of 66

Lesson 11: Report Writing Methodology and Best Practices


Objective: This lesson will familiarize you with the following:

Report Writing Methodology

Pre-Requisites

Tips for Creating Containers

Tips for Creating Containers as Joins

Tips for Creating Expressions

Tips for Expression Lookups

Report Writing Methodology


Always bear in mind the following keywords before, during, and on completion of the configuration of the
connector:

Automation

Flexibility

Performance

Ease of use for future support/maintenance

Pre-Requisites
We recommend that prior to configuring the connector, you first create a comprehensive requirement
document in addition to:

Adequate sample data for testing.

A sufficient Data Dictionary (A data dictionary is a collection of descriptions of the data objects or items
in a data model for the benefit of programmers and others who need to refer to them) of the database
being reported off.

Examples of the desired output and layout required.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 64 of 66

Report Writing Best Practices


Connector
The following are tips which when followed in the Connector, will result in the most flexible and efficient
reports.

Tips for Creating Containers


Using the Connector, data becomes available through the addition of data containers and relevant
expressions. The source of the underlying data can be a Table, a View, a Stored Procedure, a SQL Query,
a user defined SQL Join or a Graphical Join. The preferred methods for creating containers are Graphical
Joins and SQL Joins.

Stored procedures and SQL query containers provide less flexibility when creating new or modifying
existing reports off these containers. For example: parameterization of reports built off SQL Query and
Stored Procedure containers can only be achieved using Pass Through Variables which is an advanced
feature of Sage Intelligence Reporting.

Views and Stored Procedures should only be used if designing a report from a database where they are
standard within the database and not client specific. An exception would be if the need arises for an
extremely complex report where the end result cannot be achieved in any other way.

Name containers similar to the report name. This is for ease of use in recognizing the contents of the
container.

Provide meaningful descriptions on containers.

Tips for Creating Containers as Joins

Use Graphical Joins unless you require specific clauses within the join, as this is a graphically intuitive
means of joining tables by linking primary fields in one table to secondary fields in another table.

For performance, its best to join index fields. However, where joins are required on non-indexed fields,
its recommended that you index the required fields.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 65 of 66

Tips for Creating Expressions

Use Data Fields and SQL Expressions as much as possible. SQL Expressions should be used as often
as possible as these have a faster run time as Excel expressions and can also be used in aggregates.

Include expressions with meaningful names in the container that may be useful for future use, even if
they are not required on the report in question.

Pass Through Variables are a powerful feature but can make containers more complex to use. Only
use them when there is no better way to achieve the same result.

Excel Formulas should be a last resort if the end result cannot be achieved through SQL Expressions.
Excel formulas have a negative effect on file size and performance.

Where possible, use SQL expressions to create calculated fields as opposed to using Excel formulas at
the front end within Excel.

Tips for Expression Lookups

Ensure that lookups are working properly on all expressions in the container and not just the
expressions intended to be used in the report, as other users may create reports off the same
container.

Where the functionality of the database allows for the use of the SQL Distinct keyword, ensure that
lookups display a distinct list of values.

For containers that access large data sets, its recommended that the SQL lookup type for all
expressions be changed to Direct from Container or SQL Statement Defined. This will optimize
lookups and minimize the load on the database server.

Where necessary, set the lookup type to a Customized SQL Statement and customize the statement in
order to achieve the preferred end result. The lookup of the expression does not always have to come
from the table listed in the expression source; it can be set to obtain the value from a different table.

2014 Sage Intelligence Reporting

Sage Intelligence 7.3 Reporting Advanced Manual

Page 66 of 66

S-ar putea să vă placă și