Upload
vuongque
View
213
Download
0
Embed Size (px)
Citation preview
Sage 300 ERP Intelligence Reporting Connector
Advanced Customized Report Writing
Sage Intelligence Connector Welcome
Sage Intelligence Reporting Created July 2013 Student Curriculum i-2
Notice
This document and the Sage software may be used only in accordance with the accompanying Sage End User
License Agreement ("License Agreement"). You may not use, copy, modify, or transfer the Sage software or this
document except as expressly provided in the License Agreement.
© 2013 Sage Software, Inc. All rights reserved. Sage Software, Sage logos, and the Sage product and service
names mentioned herein are registered trademarks or trademarks of Sage Software, Inc., or its affiliated
entities. All other trademarks are the property of their respective owners.
07/2013 Book Version 2011
Sage Intelligence Connector Welcome
Sage Intelligence Reporting Created July 2013 Student Curriculum i-3
Contents
Welcome ............................................................................................................. 4
Course Objective ............................................................................................... 4
Course Outline ................................................................................................... 5
Lesson 1 – Overview of Sage 300 ERP Intelligence ........................................ 7
Lesson 2 – Overview of the Connector .......................................................... 14
Lesson 3 – The Connector Module ................................................................. 18
Lesson 4 – Data Connections ......................................................................... 30
Lesson 5 – Data Containers ............................................................................ 47
Lesson 6 – Data Expressions ......................................................................... 59
Lesson 7 – Maintaining Expressions ............................................................. 82
Lesson 8 – Working with Data Containers ..................................................... 86
Lesson 9 – Creating Multiple Table Containers ............................................. 91
Lesson 10 – Connecting to Multiple Companies ......................................... 106
Lesson 11 – Using Excel as a Data Source for Reports .............................. 118
Lesson 12 - Report Writing Methodology .................................................... 123
Sage Intelligence Connector Welcome
Sage Intelligence Reporting Created July 2013 Student Curriculum i-4
Welcome
This Sage Intelligence Connector Advanced Customized Report Writing course is designed to deepen your knowledge of the Connector Module. .
With your instructor’s assistance and your efforts, you will become familiar with this Sage product through “hands on” classroom training.
Course Objective
The objective of this course is to provide you with advanced report writing techniques for Sage 300 ERP Intelligence Connector Module. You will explore the power of this tool and gain insight into your business.
Topics covered include:
The Layout of the Connector Module
Navigating the Connector Module
Understanding Data Connections, Data Containers and Expressions
How to work with Data Containers and maintain Expressions
Creating multiple table Containers (Graphical Joins)
PICKLIST Consolidations
Consolidation Connections
Connecting to Excel as a data source
Report Writing Methodology
Sage Intelligence Connector Course Outline
Sage Intelligence Reporting Created July 2013 Student Curriculum i-5
Course Outline
The Sage 300 ERP Intelligence Advanced Customized 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
1: Sage 300 ERP
Intelligence Overview
This lesson provides you with an overview of Sage 300 ERP
Intelligence.
2: Layout of the Connector This lesson introduces you to the Connector module.
3: The Connector Module This lesson will provide you with an understanding of how to
Navigate and work with the Sage 300 ERP Intelligence
Connector Module.
4: Data Connections This lesson will provide you with an understanding of how to
Navigate and work with the Sage 300 ERP Intelligence Data
Connections
5: Data Containers This lesson will provide you with an understanding of the
functionality and use of the Sage 300 ERP Intelligence
Connector Module and the Data Container
6: Data Expressions This lesson will provide you with an understanding of the
Data Expressions within a Data Container
7: Maintaining Expressions This lesson will provide you with an understanding of the
maintenance of Data Expressions.
8: Working with Data
Containers
This lesson will provide you with some useful tips when
working with Data Containers and the data they reference
9: Creating Multiple Table
Containers
This Lesson will provide you with an understanding of how
to use the Graphical Join Tool to create a Multiple Table
container
10: Connecting to Multiple
Companies
This Lesson will provide you with an understanding of how
to use the Connector to Connect to Multiple Companies
11: Connecting to Excel as a
Data Source
This lesson will provide you with the understanding of how to
use Excel as a Data source.
12: Report Writing
Methodology
This lesson provides you with the best practices on writing a
report from the Container, to the Report Manager, to the end
result in the Excel Template.
Sage Intelligence Connector Course Outline
Sage Intelligence Reporting Created July 2013 Student Curriculum i-6
Sage Intelligence Connector Module Lesson 1 – Overview of Sage 300 ERP Intelligence
© 2013 Sage Software, Inc. Student Curriculum 7
Lesson 1 – Overview of Sage 300 ERP
Intelligence
This lesson will provide you with an understanding of the Sage 300 ERP Intelligence product and its functionality.
In this lesson, you will learn how to:
• Define Sage 300 ERP Intelligence
• Describe How Sage 300 ERP Intelligence Works
• Activate Sage 300 ERP Intelligence in Sage 300 ERP
• Understand the Difference Between the Connector and Report Manager
Sage Intelligence Connector Module Lesson 1 – Overview of Sage 300 ERP Intelligence
© 2013 Sage Software, Inc. Student Curriculum 8
What is Sage 300 ERP Intelligence?
Sage 300 ERP Intelligence is a simple and easy to use powerful reporting solution that is built into Sage 300 ERP as an add-on product. Sage 300 ERP Intelligence taps into your current Microsoft Excel knowledge to make the Sage 300 ERP reporting experience as simple as possible.
Business Intelligence, or 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.
Sage 300 ERP Intelligence is classified as a BI application because the data extraction and manipulation tools, coupled with Excel’s 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 300 ERP focuses on Sage 300 ERP Intelligence for businesses whose market dictates that BI solutions are rapidly deployed in a cost effective manner so that companies realize their returns early. Sage 300 ERP is well placed to deliver on this initiative as its product suite, training and service offerings grow.
With Microsoft Excel as the front-end for Sage 300 ERP Intelligence, it is well-placed to take advantage of the enhanced functionality available in Excel 2007 and beyond (though the software suite is compatible with Excel versions 2000 and later). 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 300 ERP Intelligence 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, like Crystal Reports.
Sage Intelligence Connector Module Lesson 1 – Overview of Sage 300 ERP Intelligence
© 2013 Sage Software, Inc. Student Curriculum 9
Sage 300 ERP Intelligence 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.
Available in English, Sage 300 ERP Intelligence comes in three editions, Report Manager, Report Viewer and Connector.
Report Manager:
Contains ready-to-use reports which automatically connect to one Sage 300 ERP company
Allows report interactions such as sorting, filter & drilling down on the reports
Provides for the creation of new reports, or modification of existing reports, using a standard containers
Uses Security Manager to assign users and rights
Connector:
Provides the same features in Standard, plus:
Provides for the creation of new containers, new reports, or modification of existing reports, using any Sage 300 ERP database field, the advanced edition allows you to access any tables or fields in the database including user defined fields.
Can consolidate data from multiple Sage 300 ERP Accounting companies and modules
Allows the creation of new reports from different types of data sources
Sage Intelligence Connector Module Lesson 1 – Overview of Sage 300 ERP Intelligence
© 2013 Sage Software, Inc. Student Curriculum 10
Installation and Licensing
Sage 300 ERP Intelligence is installed with Sage 300 ERP, and appears on the Reports & forms menu, as shown below:
In order to experience the potential of Sage 300 ERP, Sage ships with 1 free Report Manager license.
Modules
There are four modules of Sage 300 ERP Intelligence: Report Manager, Connector, and Security Manager & 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.
Sage Intelligence Connector Module Lesson 1 – Overview of Sage 300 ERP Intelligence
© 2013 Sage Software, Inc. Student Curriculum 11
Connector
The Connector is the primary module of the Advanced edition of Sage 300 ERP Intelligence. It maintains the connectivity between Sage 300 ERP Intelligence and the Sage 300 ERP database (or other) data sources. The groups of connections are called containers, and the administration of these is the primary focus of this course.
Security Manager
Security Manager controls the accessibility of Sage 300 ERP Intelligence reports by the various users. Separate security access is established for reports in Security Manager. This module is discussed in the Basic & Advanced Report Writing course.
Sage Intelligence Connector Module Lesson 1 – Overview of Sage 300 ERP Intelligence
© 2013 Sage Software, Inc. Student Curriculum 12
License Manager
The License Manager maintains the licenses installed for Sage 300 ERP Intelligence. This is discussed in the Standard course.
Sage Intelligence Connector Module Lesson 1 – Overview of Sage 300 ERP Intelligence
© 2013 Sage Software, Inc. Student Curriculum 13
Glossary Add-Ins – functions supplied with Sage 300 ERP Intelligence which extend the functionality
of Sage 300 ERP Intelligence with Microsoft Excel. Add-ins are supplied with Sage 300
ERP Intelligence and are self-documenting within the Add-In Function Builder.
Columns – the Expressions selected to be displayed in a report
Container – a published Table, View, Stored Procedure or Dataset (based on a join) that
can be made available to allow reports to be written in the Report Manager module. By
default, Sage 300 ERP Intelligence ships with several containers for Sage 300 ERP.
Containers can be modified in the Connector, allowing you to access additional data from
Sage 300 ERP, or from other data sources. The source of this data can be a database
table, view, stored procedure or a custom join based on two or more tables/views in a
database.
Data Set – the organized collection of data for a specific use. For example, all company
information and settings within Sage 300 ERP are stored in a database (or data set),
which is organized into tables. Individual pieces of data are referred to as records in the
database.
Expression – a field (derived from one or more fields in the database) in a Container.
Filter – static criteria used to limit the data that is returned by a report.
Joins – the method used to connect two or more tables in a database.
Microsoft Excel Macro – programming code used to perform specific actions or controls
within Microsoft Excel
Microsoft Excel PivotTable – a tool in Microsoft Excel used to summarize, analyze, explore
and present summary data
Parameter – user-specified (at run time) criteria used to limit the data that is returned by a
report
Report – a collection of Columns, Filters, Parameters and other information which, when
run, output the information to an Excel workbook
Standard Report – a report which uses Fields from a Standard Container
Template – an Excel workbook which is used by a report to produce similar formatting each
time the report is run
Union Report – a report which combines multiple Standard Reports for simultaneous output
to Microsoft Excel
Sage 300 ERP Intelligence Connector Module Lesson 2 – Overview of the Connector
© 2013 Sage Software, Inc. Student Curriculum 14
Lesson 2 – Overview of the Connector
This lesson will provide you with an understanding of the Sage 300 ERP Intelligence Connector Module & its functionality.
In this lesson, you will learn how to:
• Explain the Functionality and Use the Sage 300 ERP Intelligence Connector Module
Sage 300 ERP Intelligence Connector Module Lesson 2 – Overview of the Connector
© 2013 Sage Software, Inc. Student Curriculum 15
What is Connector Module? The Connector establishes and maintains data links which are used to create an orderly structure of Containers in order to support standard, new or customized reports in the Report Manager module. Main Functions
The Connector is used to connect to all ODBC compliant data sources e.g. MSSQL, Oracle, Access, Pervasive SQL etc. and has an explorer type window outlay. This functionality is used to configure, manage and maintain connections between Sage 300 ERP Intelligence and the various company databases. It’s also used to create new or customize standard Containers and define their Expressions which are used by the Reports as configured within the Report Manager module. Working in the Connector module will be the starting point when a new report needs to be created of which the fields could not be found within any specific existing Container.
Data Access Components
In order to better understand the two main Connector module functionalities discussed above, let’s first look at major concepts that deal with data links and extraction from the company data base. They play a significant role in the Connector modules’ inner workings and relationships between components.
Database Driver
A database driver is a collection of program files (usually DLLs) that allow connectivity to a set of data in a database or set of data files. Sage 300 ERP Intelligence uses Connection Types to allow connections via database drivers. These drivers are usually of one of two types namely ODBC (Open Database Connectivity) drivers or OLEDB (Object Linking and Embedding Data Base) Providers.
ODBC
ODBC is a standard database access method. The goal of Open DataBase Connectivity is to make it possible to access any data source through an ODBC-compliant application and an ODBC-compliant Database Management System, by inserting a database driver, between the application and the database management system.
Sage 300 ERP Intelligence Connector Module Lesson 2 – Overview of the Connector
© 2013 Sage Software, Inc. Student Curriculum 16
Connection Type
Various database sources such as Pervasive SQL, Microsoft SQL, Oracle, Access etc. are in use today. However, the Connector module makes use of very specific sub-type data source links, also referred to as Connection Types.
Connection
A Connection holds the relevant connection information to connect to a supported ODBC or OLEDB compliant Connection Type. Each separate Connection entity is linked to a specific Connection Type. Only one relevant selected Connection is required for multiple database connections of the same Connection Type when an Automatic Connection System is used. The user cannot delete or create any new Connection Types, but an unlimited number of Connection Objects per the supplied Connection Types can be added and configured if Connections to other data sources are required.
Container
A Container is the set of selected Expressions which are made available by Connector module. The source of this data can be a database table, a view, a stored procedure, a SQL query or a join based on two or more tables/views. The Connector module enables you to create as many Containers as would be required or customize the existing ones. These containers are then selectable for report creation / customization using the Report Manager Module interface, limited to each Sage 300 ERP Intelligence report using only one Container.
Typical Examples
Set of general ledger transaction records
List of customer records with their credit limits
Expressions
Expressions are those fields in a Container specifically selected in the Connector module to be available through the Report Manager Module interface. The report designer could choose which fields of the relevant joined tables should be available in the Container to be used for report creation in the Report Manager module. An Expression can also be a SQL Expression or a Microsoft Excel formula.
Note that not all Expressions are necessarily included in the final generated Microsoft Excel report.
Sage 300 ERP Intelligence Connector Module Lesson 2 – Overview of the Connector
© 2013 Sage Software, Inc. Student Curriculum 17
Summary Key Points
The Connector module consists of the following areas:
Data Access Components
Database Drivers
ODBC connections
Connection Types
Connection Objects
Expressions
Sage 300 ERP Intelligence Connector Module Lesson 3 – The Connector Module
© 2013 Sage Software, Inc. Student Curriculum 18
Lesson 3 – The Connector Module
This lesson will provide you with an understanding of how to Navigate and work with the Sage 300 ERP Intelligence Connector Module
In this lesson, you will learn how to:
Navigate to the Connector Module
Understand the Layout of the Connector Module
Sage 300 ERP Intelligence Connector Module Lesson 3 – The Connector Module
© 2013 Sage Software, Inc. Student Curriculum 19
Opening the Connector Module
Method
1. Select Sage 300 ERP Intelligence from the system tree.
2. Select Connector
Sage 300 ERP Intelligence Connector Module Lesson 3 – The Connector Module
© 2013 Sage Software, Inc. Student Curriculum 20
The Layout of the Connector To effectively use the Connector Module, you need an understanding of the Connector interface and how to perform actions. The layout of the interface is uncomplicated. The software layout is divided into 2 main areas: The Object Window The Properties Window
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 you would rename a file in Windows Explorer Properties Window: You are able to view and update the properties of a selected object using the properties window. For example, you are able to add your own custom description of the object in the object's properties
Sage 300 ERP Intelligence Connector Module Lesson 3 – The Connector Module
© 2013 Sage Software, Inc. Student Curriculum 21
Object Window The Object window is on the left and shows the different objects available for selection.
Method
1. From the Object window, double click on the desired object to expand or
collapse the Objects
2. The Object will then expand to show detail
Sage 300 ERP Intelligence Connector Module Lesson 3 – The Connector Module
© 2013 Sage Software, Inc. Student Curriculum 22
Object Window in Detail
The Object window is displayed on the left of the Connector module window and separate entities within it are referred to as 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 on top of it or, with the focus on the upper level, right click and select Open to open the level below. To collapse a level, double click on the level above it. Level 1: Enterprise(Sage 300 ERP) Level 2: Connection Types Level 3: Connections Objects Level 4: Containers Level 5: Expressions
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 Expression - if there are any Reports in the Report Manager that use it
Sage 300 ERP Intelligence Connector Module Lesson 3 – The Connector Module
© 2013 Sage Software, Inc. Student Curriculum 23
The Enterprise Object
When the Connector module is opened, the Enterprise object, (Sage 300 ERP) is the only object available at the top of the screen. All functionality is then accessed from this object.
Enterprise Object Options
All but the first three options on the Enterprise Shortcut menu, are also to be found on the Menu Bar and Toolbar with the focus being on the Enterprise object. The Open, Properties and Refresh options are also available on the Shortcut menu of all other selected objects.
Method
1. From the Object window, right click on Enterprise
2. Select the desired option
Sage 300 ERP Intelligence Connector Module Lesson 3 – The Connector Module
© 2013 Sage Software, Inc. Student Curriculum 24
Properties Window The Properties Window on the right displays the properties of whichever object is selected on the left. To maintain or view the fields first select the relevant object (i.e. a 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 one for the Enterprise Object (only has read-only display fields).
Method
1. From the Object window, select the desired Object 2. From the Properties window, view the desired Properties
Sage 300 ERP Intelligence Connector Module Lesson 3 – The Connector Module
© 2013 Sage Software, Inc. Student Curriculum 25
Properties Windows in Detail 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. All selected Objects’ (except those for Enterprise and Expressions) Properties windows also have a Show Advanced option box on the bottom left of their relevant Properties windows to display even more Property setting options.
Method
1. From the Object window, select the desired item 2. Select Show Advanced if necessary 3. From the Properties window make the necessary changes
4. Select Apply
Sage 300 ERP Intelligence Connector Module Lesson 3 – The Connector Module
© 2013 Sage Software, Inc. Student Curriculum 26
Properties of the Enterprise Object As the Enterprise, (Sage 300 ERP), object is the only object available when Connector is opened, it is worth looking at what properties are applicable to the Enterprise object.
Method
1. From the Object window, select Sage Accpac 2. From the Properties window, view the Properties
3. This read-only field indicates the location of the .svd file
Sage 300 ERP Intelligence Connector Module Lesson 3 – The Connector Module
© 2013 Sage Software, Inc. Student Curriculum 27
Additional Functionality Navigation In addition to using the Object and Properties windows you can also use the Menu Bar, Toolbar and Shortcut menu to navigate around the Connector module. Most functionality is generally shared between the Connector module’s Menu Bar, Toolbar and Shortcut menu. However, this section focuses on the Toolbar and Shortcut menu functionality options as most options on the Menu Bar items are also included in them. Two options (Backup Metadata and Templates and Compact Metadata) as exclusively found on the Main Menu are discussed later in this manual. Option availability is dependent on where the current focus is. The Shortcut menu and Toolbar shows different options when the focus is on the Enterprise or on Pervasive ODBC Client Interface objects on the left.
Notice that the greyed out fields (open the window to see as this manual is not necessarily colour printed) such as Server Name and Database Name indicate read-only and no changes are available on it.
Sage 300 ERP Intelligence Connector Module Lesson 3 – The Connector Module
© 2013 Sage Software, Inc. Student Curriculum 28
Menu Commands
There are three ways to access menu commands within the Connector interface:
Using the Menu bar
Using the Toolbar
Using the Shortcut menu
Menu Bar: Use your Mouse or Keyboard shortcut to select a task from the menu
Bar
Toolbar: Use your mouse to select a task from the toolbar
Shortcut Menu: Right click on an object in the object window and you will be able to
select a command quickly
To view an object's associated elements, double click on the object. This action is called drilling down. 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, thereby hiding the additional information.
Sage 300 ERP Intelligence Connector Module Lesson 3 – The Connector Module
© 2013 Sage Software, Inc. Student Curriculum 29
Toolbar Menu All of the Toolbar icons below have their own Tool Tip that is displayed upon mouse over:
Add Enables the user to add a Data Connection, Data
Container or a Data Expression
Delete Enables the user to delete their selection
Properties Displays context specific field properties
Refresh Refreshes on screen properties of the selected object
Copy Copies the selected object to the clipboard
Paste Paste an object from the clipboard into the selected
object
Move to Moves a connection or a container
Check/Test Checks that the object will function correctly
Help Launches the SAI Help files
Import Report Enables the import of reports
Sample Data Displays a 50 row sample from the selected Source
Data Container
Model Graphical
Joins
Display the Graphical join Model
PVS.SQL Database
Manager
Apply Metabase
Update
Manually apply updates to the Metabase
Summary Key Points
The SAI Connector module screen is divided into two areas:
The Object window
The Properties window Additional Navigation Functionalities are available:
The Shortcut menu
The Toolbar
The Menu Bar
Sage 300 ERP Intelligence Connector Module Lesson 4 – Data Connections
© 2013 Sage Software, Inc. Student Curriculum 30
Lesson 4 – Data Connections
This lesson will provide you with an understanding of how to Navigate and work with the Sage 300 ERP Intelligence Data Connections
In this lesson, you will learn how to:
Add Connections
Identify the different types of Connections
Connect to disparate databases
Sage 300 ERP Intelligence Connector Module Lesson 4 – Data Connections
© 2013 Sage Software, Inc. Student Curriculum 31
Steps in the Data Connection Process
The Connection comprises of three processes. These processes are shown below:
Method
1. Add a Connection The connection is the connection to the database. The questions to be asked before creating the connection are: Where is the database (path) and do I need a user ID and password to connect to the database?
2. Add a Container
The container allocates either tables, views or joins to the connection.
3. Add Expressions The expressions are either the selected fields from a table or custom SQL function or Microsoft Excel formula related to one or more fields.
CONNECT TO AN
EXTERNAL
DATABASE:
Name the
Connection
State the
Location
Enter a User ID
(If Required)
Check the
Connection
ADD A DATA
CONTAINER:
Select Type of
Container
Select Database
Tables
Name the
Container
Check the
Container
ADD AN
EXPRESSION TO
THE CONTAINER:
Select the type
of Expression
Select Fields
Check the
Expression
Sage 300 ERP Intelligence Connector Module Lesson 4 – Data Connections
© 2013 Sage Software, Inc. Student Curriculum 32
Connection Type A Connection Type is a specialized configured connection to a Database Management
System and is also referred to as a sub-type data source link. The one relevant to extract
data from Sage 300 ERP is called Pervasive ODBC Client Interface or ODBC Driver SQL
Server
Select the Show Advanced button at the bottom left of the Properties screen to open all
the originally hidden configuration settings.
Sage 300 ERP Intelligence Connector Module Lesson 4 – Data Connections
© 2013 Sage Software, Inc. Student Curriculum 33
Adding a Connection A Connection is the actual link to your data source. This object is created under the
Connection Type.
A connection holds the relevant connection information to connect to a supported ODBC or
OLEDB compliant data source. This Connection is then used for all connections to this data
source. By adding a connection, the SAI Connector module can make data available from
this data source.
Method
1. From the Object window, double click on Sage 300 ERP
2. Right-click on ODBC Driver for Pervasive ODBC
3. Select Add Connection
4. In the Connection Name box, enter in the desired Name
5. Since we have a local installation, this field will not be available
6. In the Database Name box, select
7. Select the PVS.SQL database or create a new one
Sage 300 ERP Intelligence Connector Module Lesson 4 – Data Connections
© 2013 Sage Software, Inc. Student Curriculum 34
7. For Example: Select SAMLTD
8. Select Add, the new connection is now available under the Pervasive ODBC Client
Interface.
Sage 300 ERP Intelligence Connector Module Lesson 4 – Data Connections
© 2013 Sage Software, Inc. Student Curriculum 35
Configuring Links to other ODBC Databases
During this course, we only use the Sage 300 Database which is a Pervasive ODBC Client
Interface Database or the ODBC Driver SQL SERVER. The Connector Module is released
with an extended data linking infrastructure that includes various standard Connection Types
for which relevant connections can be created. This enables establishing links to other
applications’ (e.g. Access and MS SQL) data sources, create and even run new reports on
them, all of this done using Connector Module.
The user cannot create any new Connection Types but an unlimited number of Connections
can be added and configured to establish links to different data sources.
The standard list of Connection Types as found in the SAI Connector Module:
Method
1. Open the Connector Module
2. Double click on Sage 300 ERP
3. The list of available Connection Types will be shown
Sage 300 ERP Intelligence Connector Module Lesson 4 – Data Connections
© 2013 Sage Software, Inc. Student Curriculum 36
Linking to another Data Set As an example, let’s look at setting up a data link to an Access database using Connector
Module.
Since we are now going to connect to an Access Database, we can no longer use the
Pervasive ODBC Client Interface/ ODBC Driver SQL Server
Method
1. Create or identify the relevant Access database and its location
2. The location may be on any network location
3. Open Connector Module and double click on Enterprise
4. From the Object window, right click on ODBC Driver for Access
5. Select Add Connection
6. Enter in the desired information into the Connection Info dialog box:
a. Connection Name: Enter in the desired Name
b. Server Name: Keep it blank as we’re for now accessing a Access
database on the local PC
c. Database Name: Use the browse button on the right to the relevant
location and select the relevant company from the list that opens.
Example: RKL Trading
d. Select OK
e. Then select Add
Sage 300 ERP Intelligence Connector Module Lesson 4 – Data Connections
© 2013 Sage Software, Inc. Student Curriculum 37
f. Select Add
7. The User ID and Password fields are generally left blank unless specified by the
database Connector and are then compulsory fields to be entered here
8. The new Connection will be available as a child to the ODBC Driver for Access
Sage 300 ERP Intelligence Connector Module Lesson 4 – Data Connections
© 2013 Sage Software, Inc. Student Curriculum 38
Connection Properties
Method
1. From the Object window, select Pervasive ODBC Client Interface
2. From the Properties window, select Show Advanced
3. Make the necessary changes to the Properties
4. Select Apply
Sage 300 ERP Intelligence Connector Module Lesson 4 – Data Connections
© 2013 Sage Software, Inc. Student Curriculum 39
The most significant fields of the Connection Type’s Properties window are explained below,
note that the default settings for the following options should not be changed (under normal
conditions) as that could negatively influence the data link’s integrity. These are further
options that also require advanced SQL skills to understand and only changed when the
user knows exactly what they are doing.
Connection
Type ID
Indicates the selected Connection Type’s own unique ID key. Note that although only 25 Connection Types
are displayed on the Object Window, there are in fact a total of 36 available.
Connection
Type
Confirms the selected Connection Type.
SQL Style Indicates the SQL Style which is most suitable for the selected Connection Type. There are 8 different
styles to select from but never change the default. Advanced SQL Skills are required when selecting the
best style when setting up a new data link to specific types of database.
Connection
String Format
Displays in string format how the current connection is structured. Requires advanced SQL skills to
understand.
Default Date
Format (to
pass to Driver)
Default Date
Delimiter (to
pass to Driver)
Different database systems store and recognize dates in different formats. SAI attempts to hide this detail
from its end users by translating dates at run time into a recognizable format before passing the date to the
underlying Database System. In order for SAI to know how the relevant Database System is expecting the
dates, this property needs to be correctly pre-configured. Additionally, different Database Systems expect
dates to be delimited with different characters.
The list below shows date formats and their delimiters that are recognized by some of the more common
Database Systems.
Date Format Date Delimiter
Pervasive M/DD/YYYY '
DBASE YYYY/MM/DD #
SQL Server DD-MMM-YYYY '
Access M/DD/YYYY #
Oracle DD-MMM-YYYY '
Therefore, simply don’t change the default date format value of M/DD/YYYY or the delimiter value for the
(Auto Connect) Connection Type.
Sage 300 ERP Intelligence Connector Module Lesson 4 – Data Connections
© 2013 Sage Software, Inc. Student Curriculum 40
Shortcut Menu Options for Connection Types
Method
1. From the Object window, right click on the desired Connection Type
2. Select the desired Option
Open This option is used to display all depending Connection Objects of the
selected Connection Type.
Add Connection Allows you to create a new Connection of the same data type as the
selected Connection Type. As will be demonstrated, it’s possible to
configure a link and run live reports on companies that’s on different
servers and/or not even currently logged onto. All of this made
possible by not selecting the Use Auto Connection System option
and complete the relevant fields as can be seen in the following
screenshot:
Sage 300 ERP Intelligence Connector Module Lesson 4 – Data Connections
© 2013 Sage Software, Inc. Student Curriculum 41
Properties Merely shows the already opened Properties screen on the right of the
screen again but its Show Advanced option at the bottom right is
unselected and therefore only the Connection Type Id and
Connection Type values are shown.
Refresh Refreshes on screen properties for the selected Connection Type.
PVS.SQL DB Manager Opens the Pervasive SQL Database Name Manager
Sage 300 ERP Intelligence Connector Module Lesson 4 – Data Connections
© 2013 Sage Software, Inc. Student Curriculum 42
Connection The most significant options available on the right click menu when adding a Connection are
explained below:
Open Displays all the dependent Containers linked to the selected
Connection.
Rename Allows the user to rename the selected Connection.
Delete Allows the user to delete the selected Connection. Remember, it’s not
permitted to delete a Connection if there are Containers linked to it that
are used in current SAI reports.
Sage 300 ERP Intelligence Connector Module Lesson 4 – Data Connections
© 2013 Sage Software, Inc. Student Curriculum 43
Add Containers
Allows the creation of new Containers by one of 6 different ways as
can be seen on the following screenshot:
Check/Test Performs a link validation on the selected Connection. In short, it tests
that the Connection can be established. A positive validation message
should look like this :
Properties Merely shows the already opened Properties screen on the right of the
screen again but its Show Advanced option at the bottom right is
unselected and therefore not all the property fields are by default
Sage 300 ERP Intelligence Connector Module Lesson 4 – Data Connections
© 2013 Sage Software, Inc. Student Curriculum 44
displayed.
Refresh Refreshes on screen properties for the selected Connection.
Move to
Opens the Move Connection to Connection Type window on which
the selected Connection parent Connection Type can be easily
selected in order to move it.
Sage 300 ERP Intelligence Connector Module Lesson 4 – Data Connections
© 2013 Sage Software, Inc. Student Curriculum 45
Connection Driver
Properties
Displays the connection properties of the selected Connection
database driver, in grid format. An example of the first 30 of a
Connection’s Properties.
PVS.SQL DB Manager Opens the PVS.SQL Database Name manager
Sage 300 ERP Intelligence Connector Module Lesson 4 – Data Connections
© 2013 Sage Software, Inc. Student Curriculum 46
Summary
A Connection Type is the ODBC connection required to connect to your database
A Connection is the actual connection to your database
The Connector module can be used to connect to any other Database.
The only limitation is that the database needs to be able to use an ODBC connection.
Sage 300 ERP Intelligence Connector Module Lesson 5 – Data Containers
© 2013 Sage Software, Inc. Student Curriculum 47
Lesson 5 – Data Containers
This lesson will provide you with an understanding of the functionality and use of the Sage 300 ERP Intelligence Connector Module and the Data Container
In this lesson, you will learn how to:
Define a Data Container
Add a Data Container to a Connection
Identify the Properties of a Container
Sage 300 ERP Intelligence Connector Module Lesson 5 – Data Containers
© 2013 Sage Software, Inc. Student Curriculum 48
What is a Container?
A Container is a set of data 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, stored procedure or a custom join based on two or
more tables/views.
Examples of containers include:
Dashboard Financials
Financial Analysis Container
Inventory Master
Purchase Master
Sage 300 ERP Intelligence Connector Module Lesson 5 – Data Containers
© 2013 Sage Software, Inc. Student Curriculum 49
Locating a Data Container
Method
1. Open the Connector module
2. Double click on the Enterprise object
3. Double click on the Pervasive ODBC Client Interface/ ODBC Driver SQL Server
4. Double click on the Sage 300 ERP (Auto Connect) Connection
5. Below your connection you will see the preloaded SAI Containers
Sage 300 ERP Intelligence Connector Module Lesson 5 – Data Containers
© 2013 Sage Software, Inc. Student Curriculum 50
Types of Containers Table
This is where you want to create a Container from a single Table.
SQL Join
This is where you want to create a Container by specifying Tables through a manual SQL
join.
View
This is where you want to create a Container from an Existing database View or Query
Graphical Join
This is where you want to specify tables and joins Graphically
Stored Procedure
You create a container from an existing database stored procedure.
SQL Query
Where you want create a Container using free text SQL command.
Creating a Container
Method
1. From the Object window, right click on the Sage 300 ERP (Auto Connect)
Connection. Select Add Data Containers
Sage 300 ERP Intelligence Connector Module Lesson 5 – Data Containers
© 2013 Sage Software, Inc. Student Curriculum 51
2. Select the desired Container Type. (Table, SQL Join, View, Graphical Join,
Stored Procedure, SQL Query)
3. Select OK. Select the desired Table(s)
4. Select OK. The Table(s) will now be added under the Container
Sage 300 ERP Intelligence Connector Module Lesson 5 – Data Containers
© 2013 Sage Software, Inc. Student Curriculum 52
Properties of a Container The most significant property fields for a Container, that have been setup with the Graphical
Join Tool, are explained below (ensure to select the Show Advanced option box to see all
fields):
Container ID Indicates the selected container’s unique ID key. In total. Each new container that’s created
receives the next available container ID Key. Once a container is deleted, that specific ID key
number can never be used again.
Published Container
Name
The name assigned by the System Connector for the Data Container
Description Displays the editable description of the selected Container.
Connection ID Indicates the ID key of the relevant Connection to which the selected Container is linked to.
Source Container Type Indicates the method that was used when the Container has been created. Besides swopping
between Graphical Join and SQL Query don’t change to any other option type as the following
message, as an example, could then be displayed:
Graphical Join Tool Opens the window in which connections between 2 or more tables can be graphically maintained.
For example, even after a new 2 table Container has been created, a third table can be added to it
if more expressions need to be added to it later.
Join SQL Shows the SQL script equivalent of the joining of the multiple table data container.
Timeout Enquiries After
(Seconds)
Displays the maximum time allowed to run any reports that make use of the selected Container.
This setting can be configured with the PLConfig.exe utility.
Sage 300 ERP Intelligence Connector Module Lesson 5 – Data Containers
© 2013 Sage Software, Inc. Student Curriculum 53
Viewing the Properties of a Container
Method
1. Double click on the Pervasive ODBC Client Interface/ ODBC Driver SQL Server
2. Double click on your Connection. Select the preloaded Container (Sales Master)
3. View the Container properties on the Properties window on the right hand side of your
screen
Sage 300 ERP Intelligence Connector Module Lesson 5 – Data Containers
© 2013 Sage Software, Inc. Student Curriculum 54
Shortcut Menu Options for the Container The following provides an outlay of the Shortcut menu options of those not already covered
above.
Method
1. From the Object window, right-click on the desired Container
2. Select the desired Option
Sage 300 ERP Intelligence Connector Module Lesson 5 – Data Containers
© 2013 Sage Software, Inc. Student Curriculum 55
Add Expressions Shows a list from which to select one of 4 different expression types to ultimately flow through
to the final report as report fields:
Copy Copy the selected Expression to the Windows Clipboard. The user may then select the relevant
target Connection, right-click on it and select Paste in order to have an exact copy.
Sample Data A very effective way of generally testing the Connection Type and Connection, and to see the
broad contents of the un-filtered sample records of selected Container. The same can also be
accomplished by the relevant icon on the Toolbar ( ), or on the Main Menu / Tools Menu /
Sample Data). As can be seen below from the Container Properties window, the following
example grid will be displayed:
Note that the number of sample records is depending on the setting in the PLConfig.exe utility.
Count Rows Displays the total number of records of the selected Container.
Sage 300 ERP Intelligence Connector Module Lesson 5 – Data Containers
© 2013 Sage Software, Inc. Student Curriculum 56
This option is only available for single table Containers.
Model Graphical Joins Displays the links between 2 or more tables in graphical format. This option is only available for
Containers that have been created using the Graphical Join Tool option has been selected.
Show
Dependencies
Shows a list of all reports that are depending on the selected Container, as
could be found in the Report Manager.
Show Indexes Shows the index and primary key in a table. Using indexes can speed up
the database search capabilities. This option is only available for Containers
that have been created using the Table option.
Sage 300 ERP Intelligence Connector Module Lesson 5 – Data Containers
© 2013 Sage Software, Inc. Student Curriculum 57
Find and Replace Quick way of changing table names etc. in a container, with the option to
select which expressions to effect
Sage 300 ERP Intelligence Connector Module Lesson 5 – Data Containers
© 2013 Sage Software, Inc. Student Curriculum 58
Summary The Connector Module consists of the following areas:
Database Drivers
Database Connection
Data Containers
A Container is created on your connection and contains the links to the
database tables
Sage 300 ERP Intelligence Connector Module Lesson 6 – Data Expressions
© 2013 Sage Software, Inc. Student Curriculum 59
Lesson 6 – Data Expressions
This lesson will provide you with an understanding of the Data Expressions within a Data Container
In this lesson, you will learn how to:
Define the types of Expressions
Add and Expression to a Container
Identify the Properties of an Expression
Sage 300 ERP Intelligence Connector Module Lesson 6 – Data Expressions
© 2013 Sage Software, Inc. Student Curriculum 60
Expressions
An Expression is normally a selection from the available fields of the selected Container. In addition to a data field from the Container, an expression can be:
Data Field
This is an Expression that is directly linked to the database Container; the data reflected in this Expression will reflect exactly what is in the database table.
SQL expression
Returns data from a field or combination of fields based on an SQL Expression; the data reflected in this Expression is based on the SQL syntax entered into the Expression.
Microsoft Excel formula
Returns data based on a Microsoft Excel function or formula; the data reflected in this expression is based on the Excel syntax entered into the Expression.
Pass Through Variables
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 reports Parameters to be effective.
Pass Through Variables are an advanced report writing facility and require a strong understanding of the Connector Module Functions and of basic database query concepts. Pass Through Variables are a special type of Container Expression and are defined within containers in the Connector Module.
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 parameterise a number of Union Child Reports
Sage 300 ERP Intelligence Connector Module Lesson 6 – Data Expressions
© 2013 Sage Software, Inc. Student Curriculum 61
Properties of an Expression
As the contents of the above expression types’ Property windows vary, let’s have a look at the most common Expression Type, namely Data Field:
Expression ID Indicates the unique expression ID key.
Expression Name Displays the editable expression name value.
Expression Source Displays the SQL equivalent location of the selected expression.
Expression Type Indicates the relevant method used the expression came into being. Only change if it’s incorrect and need to be fixed.
Allow Viewing Individually enabling viewing, filtering, sorting of the selected expression in the relevant report on the Report Manager Module. The Allow Lookup option refers to a report runtime parameter that is making use of the
Sage 300 ERP Intelligence Connector Module Lesson 6 – Data Expressions
© 2013 Sage Software, Inc. Student Curriculum 62
Allow Filtering
Allow Sorting
Allow Lookups
selected expression.
Lookup Type Sets where the Parameter Lookup List dataset is pulled from.
Lookup SQL SELECT Statement
Displays the SQL equivalent string for the lookup.
Data Type Indicates the selected expression’s relevant database field data type e.g. Char, Currency, Date etc.
Sage 300 ERP Intelligence Connector Module Lesson 6 – Data Expressions
© 2013 Sage Software, Inc. Student Curriculum 63
Viewing the Properties of an Expression
Method
1. Double click on a preloaded Sage 300 ERP Intelligence Container
2. Select one of the Expressions under the Container
View the Expression properties on the Properties window on the right hand side of
your screen
Sage 300 ERP Intelligence Connector Module Lesson 6 – Data Expressions
© 2013 Sage Software, Inc. Student Curriculum 64
Expression Object Options To view the Expression object options right select on the Expression
Open Opens the expression
Rename Allows you to rename the Expression
Delete Deletes the Expression from the Container
Check/Test Tests Expression
Properties Opens up the Expression properties window
Refresh Refreshes the Expression
Copy Allows you to Copy the Expression
Sample Data Displays a Sample of the data being extracted by the Expression
Test Lookup Displays a Number of Records to be found in the selected
Expression. This number is limited to the setting in the PLConfig.exe
utility
Sage 300 ERP Intelligence Connector Module Lesson 6 – Data Expressions
© 2013 Sage Software, Inc. Student Curriculum 65
Adding a Data Field Expression
Method
1. From the Object window, right-click on the desired Container
2. Select Add Expressions
3. Select the desired Expression Type (Data Field(s))
4. Select OK
5. Select the desired Fields
Sage 300 ERP Intelligence Connector Module Lesson 6 – Data Expressions
© 2013 Sage Software, Inc. Student Curriculum 66
6. Select OK. The Fields will now be added under the Container
Sage 300 ERP Intelligence Connector Module Lesson 6 – Data Expressions
© 2013 Sage Software, Inc. Student Curriculum 67
Adding a SQL Expression
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
For Example linking the CATCODE to the CATNAME
RTRIM("ICCATG"."CATEGORY") +' - '+ RTRIM("ICCATG"."DESC")
Sage 300 ERP Intelligence Connector Module Lesson 6 – Data Expressions
© 2013 Sage Software, Inc. Student Curriculum 68
Are the SQL Functions the same for all ODBC Drivers?
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.
Using Microsoft Excel Functions or SQL to Modify the Expression?
The advantage of modifying the expression through Connector module over using Microsoft Excel to modify an expression is that the custom expression is resolved faster in Connector than would be in Microsoft Excel. In addition, the custom expression is resolved in Connector and only the value is displayed in the Microsoft Excel workbook, not the formula.
Although a SQL expression can be created from scratch by using the Add Expression method, it is preferable to copy an existing expression and change it accordingly. This provides you with an existing expression to work with.
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*UnitPrice,2)
Sage 300 ERP Intelligence Connector Module Lesson 6 – Data Expressions
© 2013 Sage Software, Inc. Student Curriculum 69
SQL Syntax
In many ways, the SELECT statement is the real heart of SQL. It lets you find and view your data in a variety of ways. You use it to answer questions based on your data: how many, where, what kind of, even what if.
The first clause of the SELECT statement—the one that begins with the keyword SELECT—is required in all SELECT statements. The keywords ALL and DISTINCT, which specify whether duplicate rows are to be included in the results, are optional.
The select_list specifies the columns you want to see in the results. It can consist of these items individually or together:
An asterisk, shorthand for all the columns in the table, displayed in CREATE TABLE order
One or more column names, in any order
One or more character constants (such as Total) used as display headings or text embedded in the results
One or more SQL functions (AVG) and arithmetic operators, generally used with columns (price * 1.085)
You can mix these elements freely. As mentioned earlier, columns, constants, functions, and combinations of these elements, with or without arithmetic operators, are collectively called expressions. Separate each element in a SELECT list from the following element with a comma.
Sage 300 ERP Intelligence Connector Module Lesson 6 – Data Expressions
© 2013 Sage Software, Inc. Student Curriculum 70
Example 1 - Choosing All Columns: SELECT *
The asterisk (*) has a special meaning in the select_list. It stands for all the column names in all the tables in the table list. The columns are displayed in the order in which they appeared in the CREATE TABLE statement(s). Most people read a SELECT * statement as Select Star. Use it when you want to see all the columns in a table.
The general syntax for selecting all the columns in a table is this:
SELECT *
FROM table/view_list
Because SELECT * finds all the columns currently in a table, changes in the structure of a table (adding, removing, or renaming columns) automatically modify the results of a SELECT *.
Listing the columns individually gives you more precise control over the results, but SELECT * saves typing. SELECT * is most useful for tables with few columns because displays of many columns can be confusing. It also comes in handy when you want to get a quick look at a table's structure (what columns it has and in what order they appear).
The following statement retrieves all columns in the table and displays them. Because no WHERE clause is included, this statement retrieves every row:
SELECT *
FROM Customers
Sage 300 ERP Intelligence Connector Module Lesson 6 – Data Expressions
© 2013 Sage Software, Inc. Student Curriculum 71
Example 2 - Choosing Specific Columns
To select certain of the columns in a table, list the columns you want to see in the SELECT list:
SELECT column_name [, column_name]...
FROM table_list
Separate each column name from the following column name with a comma:
SELECT custcode, custname
FROM customers OR
SELECT custcode Customer Code, custname
FROM customers OR
SELECT custcode as Customer Code, custname
FROM customers
Sage 300 ERP Intelligence Connector Module Lesson 6 – Data Expressions
© 2013 Sage Software, Inc. Student Curriculum 72
Example 3 - Selecting Rows: The WHERE Clause
The WHERE clause is the part of the SELECT statement that specifies the search conditions. These conditions determine exactly which rows are retrieved.
The general format is this:
SELECT select_list
FROM table_list
WHERE search_conditions OR
SELECT Cust_Name
FROM Customers
WHERE Cust_Name = “Joe Soap”
When you run a SELECT statement with a WHERE clause, your system searches for the rows in the table that meet your conditions.
Sage 300 ERP Intelligence Connector Module Lesson 6 – Data Expressions
© 2013 Sage Software, Inc. Student Curriculum 73
Creating a Custom SQL Expression from a Copied
Expression
Method
1. From the Object window, select the desired Container
2. Right click on the desired Expression that you would like to copy
3. Select Copy
4. Select the desired 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
Sage 300 ERP Intelligence Connector Module Lesson 6 – Data Expressions
© 2013 Sage Software, Inc. Student Curriculum 74
8. Select Apply
From the Properties window, you can now edit the Lookup SQL SELECT Statement
• • NOTE: It is always suggested to sample your expression
Sage 300 ERP Intelligence Connector Module Lesson 6 – Data Expressions
© 2013 Sage Software, Inc. Student Curriculum 75
Adding a Microsoft Excel Formula Expression
There are two ways of using Microsoft Excel formulae in an Expression. You can either choose to add a Microsoft Excel formula from the add Expression field or you can add a normal Field and then change its properties to a Microsoft Excel formula.
New Microsoft Excel Formula
Method
1. From the Object window, right click on the desired Container
2. Select Add Expressions. Select Excel Formula
3. Select OK. Type in the desired name in the Enter a Name for an Excel Expression dialog box. E.g. GLCATDESC. Select OK
Sage 300 ERP Intelligence Connector Module Lesson 6 – Data Expressions
© 2013 Sage Software, Inc. Student Curriculum 76
4. Type in the desired formula in the Enter the Excel Formula dialog box. E.g. IF(TYPE="R","Retained Earnings",IF(ISNA(INDEX(Categories!D:F,MATCH(GLCatCode,Categories!E:E,0),3)),0,INDEX(Categories!D:F,MATCH(GLCatCode,Categories!E:E,0),3)))
5. Select OK
Sage 300 ERP Intelligence Connector Module Lesson 6 – Data Expressions
© 2013 Sage Software, Inc. Student Curriculum 77
Apply Microsoft Excel Formula to an Existing Expression
Method
1. From the Object window, select an existing Expression. For Example Customer Account Number is Data Field Expression Type
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 Select Apply
4. Here the standard Microsoft Excel CONCATENATE function has been used to combine the contents of the two Fields Customers and AccountNumber and with a space in between them
• • NOTE: The formula does not begin with an equal sign
Adding a Pass through Variable Expression
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 report’s Parameters to be effective.
Pass Through Variables are an advanced report writing facility and require a strong understanding of the Connector Module’s Functions and of basic database query concepts. Pass Through Variables are a special type of
Sage 300 ERP Intelligence Connector Module Lesson 6 – Data Expressions
© 2013 Sage Software, Inc. Student Curriculum 78
Container Expression and are defined within containers in the Connector module.
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 parameterise a number of Union Child Reports.
Terminology
Pass Through Variable = A special type of Container Expression used to hold a variable value that can be used within a report.
Pass Through Variable Code = 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 = The value held within a Pass Through Variable during the execution of a Report.
•
NOTE:
• Note that the value can only be set through a Report Parameter based on the Pass Through Variable.
• Note that the lifetime of the Pass Through Variable Value is from when the value is set during report parameterization to when the report execution completes.
Sage 300 ERP Intelligence Connector Module Lesson 6 – Data Expressions
© 2013 Sage Software, Inc. Student Curriculum 79
What can Pass Through Variables be used for?
Pass Through Variables can thus be used to achieve the following:
Dynamically modify the outcome of a Report Column through Display Fields that are based on Expressions which include Variables
To filter data in a report: Parameterise multiple Union Child Reports in a Report through a single Parameter selection
Parameterise 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
Sage 300 ERP Intelligence Connector Module Lesson 6 – Data Expressions
© 2013 Sage Software, Inc. Student Curriculum 80
Method
1. Add an Expression to a Container
2. When prompted for the type of expression choose “Pass Through Variable"
3. Select OK
4. You will be prompted for a Descriptive Name for the Variable
5. Enter the desired Name e.g. Company Name
6. 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. E.g. @COMPANY@. 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 variable value.
Sage 300 ERP Intelligence Connector Module Lesson 6 – Data Expressions
© 2013 Sage Software, Inc. Student Curriculum 81
Summary
A Container consists of various types of Expressions
A Field expression comes directly from the database table
A Excel expression is created in the Container but only gets resolved when the expression is sent to Microsoft Excel
A Pass Through Variable is an “empty” expression that gets populated at the time that the report is run.
Sage Intelligence Connector Module Lesson 7 – Maintaining Expressions
© 2013 Sage Software, Inc. Student Curriculum 82
Lesson 7 – Maintaining Expressions
This lesson will provide you with an understanding of the maintenance of Data Expressions
In this lesson, you will learn how to:
Rename an Expression
Delete Expressions
Copy an Expression
Sage Intelligence Connector Module Lesson 7 – Maintaining Expressions
© 2013 Sage Software, Inc. Student Curriculum 83
Renaming an Expression
Method
1. From the Object window, select the desired Container
2. Right click on the desired Expression
3. Select Rename
4. Type in the new name in the Rename dialog box
5. Select OK
6. From the Properties window, the new name will appear in the Expression Name
dialog box
NOTE: If an expression is already in use as a field (Column) on a report and you then
rename the expression it will not automatically change on the report. You would have to
remove the field from the column property screen of the report and then add it back again
Deleting an Expression
Method
1. From the Object window, select the desired Container 2. Right click the desired Expression 3. Select Delete
Sage Intelligence Connector Module Lesson 7 – Maintaining Expressions
© 2013 Sage Software, Inc. Student Curriculum 84
4. Select Yes
NOTE: If an expression is in use on a report then you will not be able to delete the
expression from the container. The Connector Module will display a warning advising you
that it is in use if you attempt to delete it. The field would need to be removed from the
report first, then from the container.
Copying an Expression You might want to copy an Expression for double use in a Container.
Method
1. From the Object window, select the desired Container
2. Right click the desired Expression
3. Select Copy
4. Right click on the Container where you would like to copy to
5. Select Paste
6. The copied Expression will now appear in the Container
7. When copying an Expression the copy of the expression takes on the
name of the original expression prefixed with the words Copy of
NOTE: An expression can be copied and pasted into different containers under the same
connection type.
Sage Intelligence Connector Module Lesson 7 – Maintaining Expressions
© 2013 Sage Software, Inc. Student Curriculum 85
Summary Expressions can be modified to meet the requirements of different
businesses; the modification of Expressions is particularly useful when the
Database Field names don’t correspond to the names that you understand in
your business processes
Note: You are now ready to complete Connector Exercises Part 1
Sage Intelligence Connector Module Lesson 8 – Working with Data Containers
© 2013 Sage Software, Inc. Student Curriculum 86
Lesson 8 – Working with Data Containers
This lesson will provide you with some useful tips when working with Data Containers and the data they reference:
In this lesson, you will learn how to:
Test that a Data Container works
Sample the Data in a Container
Move a Container from one Connection to another
Sage Intelligence Connector Module Lesson 8 – Working with Data Containers
© 2013 Sage Software, Inc. Student Curriculum 87
Testing the Container Works Once you have created the Container and added the Expressions it is a good idea to check
that the Container is able to connect to your data and that the expressions all work.
Method
1. From the Object window, right click on the desired Container
2. Select Check/Test. Select OK. This will check/Test the Container.
3. To Check/Test all the Expressions in the Container, Select the container and choose Check/Test all Expressions.
4. This will execute each of the SQL expressions against the container & makes sure you have no SQL syntax errors.
Sampling Data in the Container Once you have tested the Container it is a good idea to sample the data to check that the
Container is requesting the correct data.
Sage Intelligence Connector Module Lesson 8 – Working with Data Containers
© 2013 Sage Software, Inc. Student Curriculum 88
Method
1. From the Object window, right click on the desired Container
2. Select Sample Data
3. The Sample Data will appear in the Properties window
From the Properties window, select Close
Sage Intelligence Connector Module Lesson 8 – Working with Data Containers
© 2013 Sage Software, Inc. Student Curriculum 89
Moving a Container You are able to move Containers from one connection to another to save time when creating
Containers.
Method
1. From the Object window, right click on the desired Container
2. Select Move To
3. From the Move Data Container to Connection, select the Connection you want to
move the container to
4. Select OK
Checking Container Dependencies
To check which reports utilize a specific container you can check the dependencies of a container.
Method
1. Select the Container in the Connector Object window
2. Right select on the Container
Sage Intelligence Connector Module Lesson 8 – Working with Data Containers
© 2013 Sage Software, Inc. Student Curriculum 90
3. Select Show dependencies
4. The Reports in the Report Manager that utilize that specific container will be listed.
Summary It is important to always Check/Test your Containers to make sure that they work
BEFORE you start to write Reports
Looking at the sample data in your Container will give you an idea of what your final
report data will look like.
Sage Intelligence Connector Module Lesson 9 – Creating Multiple Table Containers
© 2013 Sage Software, Inc. Student Curriculum 91
Lesson 9 – Creating Multiple Table
Containers This Lesson will provide you with an understanding of how to use the Graphical Join Tool to
create a Multiple Table container:
Understand the Graphical Join Tool
Understand different types of joins
Understand Primary and Secondary keys
Sage Intelligence Connector Module Lesson 9 – Creating Multiple Table Containers
© 2013 Sage Software, Inc. Student Curriculum 92
Graphical Join & SQL Join Up to this point on the course 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.
It is possible, in Connector module, to create the join using SQL script, but if you are
unfamiliar with SQL script, then 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.
Joins in More Detail Using the Connector module, 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 or a user
defined SQL Join or a Graphical Join.
To create a container based on a SQL Join, the Connector module should add a container,
selecting the option SQL Join from the Select Container Type window and providing a
name for the container. Then, before adding expressions, you would 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 choose to Add
Expressions. The expression list will then include all Fields from all the Tables in the Join.
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 might work. It is recommended
where possible to use Syntax 2 (the newer ANSI style Join).
Sage Intelligence Connector Module Lesson 9 – Creating Multiple Table Containers
© 2013 Sage Software, Inc. Student Curriculum 93
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
• NOTE: Some systems allow tables to have names, which include space characters. Where this is the case then it is necessary to surround table names and field names with square brackets.
The matrix below shows which styles of joins are supported by the most common Database
Systems.
Pervasive ODBC 32
Pervasive ODBC Interface
DBASE SQL Access Oracle
Joins (Old WHERE style)
Joins (New ANSI)
No No
Sage Intelligence Connector Module Lesson 9 – Creating Multiple Table Containers
© 2013 Sage Software, Inc. Student Curriculum 94
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 Join.
Inner Join
An Inner Join returns all rows from both tables where there is a match. If there are rows in
Table 1 that do not have matches in Table 2, those rows will NOT 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
1 Hansen Oleg North
2 Teller Tammy North
3 Petersen Karl South
Table B - Orders Table:
O_Id OrderNo P_Id
1 77895 3
2 44678 3
3 22456 1
4 24562 1
5 34764 15
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
Sage Intelligence Connector Module Lesson 9 – Creating Multiple Table Containers
© 2013 Sage Software, Inc. Student Curriculum 95
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).
Table A - Customers Table:
P_ID LastName FirstName Region
1 Hansen Oleg North
2 Teller Tammy North
3 Petersen Karl South
Table B - Orders Table:
O_Id OrderNo P_Id
1 77895 3
2 44678 3
3 22456 1
4 24562 1
5 34764 15
We want to list all the customers and their orders, and all the orders with their customers.
SELECT Customers.LastName, Customers.FirstName, Orders.OrderNo from Customers
FULL JOIN Orders
Sage Intelligence Connector Module Lesson 9 – Creating Multiple Table Containers
© 2013 Sage Software, Inc. Student Curriculum 96
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
34764
Outer Join
An Outer join can be either a left outer or a right outer join.
Left or Right Joins
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
Table A - Customers Table:
P_ID LastName FirstName Region
1 Hansen Oleg North
2 Teller Tammy North
3 Petersen Karl South
Table B - Orders Table:
O_Id OrderNo P_Id
1 77895 3
2 44678 3
3 22456 1
Sage Intelligence Connector Module Lesson 9 – Creating Multiple Table Containers
© 2013 Sage Software, Inc. Student Curriculum 97
4 24562 1
5 34764 15
To list all the Customers and their orders:
SELECT Customers.Lastname, Customers.FirstName, Orders.OrderNo from Customers
LEFT JOIN Orders
ON Customers.P_Id=Orders.P_Id
ORDER BY Customers.LastName
Sage Intelligence Connector Module Lesson 9 – Creating Multiple Table Containers
© 2013 Sage Software, Inc. Student Curriculum 98
Result of above:
LastName FirstName OrderNo
Hansen Oleg 22456
Hansen Oleg 24562
Petersen Karl 77895
Petersen Karl 44678
Teller Tammy
Even though the Customer Tammy Teller has no order, she will still be returned.
Right 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.
Table A - Customers Table:
P_ID LastName FirstName Region
1 Hansen Oleg North
2 Teller Tammy North
3 Petersen Karl South
Sage Intelligence Connector Module Lesson 9 – Creating Multiple Table Containers
© 2013 Sage Software, Inc. Student Curriculum 99
Table B - Orders Table:
O_Id OrderNo P_Id
1 77895 3
2 44678 3
3 22456 1
4 24562 1
5 34764 15
To list all the Orders with Customers:
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
Sage Intelligence Connector Module Lesson 9 – Creating Multiple Table Containers
© 2013 Sage Software, Inc. Student Curriculum 100
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.
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 masterfile tables
Sage Intelligence Connector Module Lesson 9 – Creating Multiple Table Containers
© 2013 Sage Software, Inc. Student Curriculum 101
Creating a Container Using the Graphical Join Tool
Method
1. From the Object window, right click on the your connection
2. Select Add Data Containers
Select Graphical Join
3. Select OK
4. From the Specify a Name for the Container box, enter in the desired Name
5. Select OK
6. Now select on the Container (Graphical Join)
7. From the properties window select the Graphical Join tool button
Sage Intelligence Connector Module Lesson 9 – Creating Multiple Table Containers
© 2013 Sage Software, Inc. Student Curriculum 102
8. Select the Tables you would like use in the graphical join.
9. Select ok. The Tables will now appear in the Properties Screen.
• NOTE: To resize the tables, drag the lower border. To position the tables, click in a blank area of the table and drag
•
Joining the Tables
Method
1. Create an Inner join between the two tables using a common join key
Sage Intelligence Connector Module Lesson 9 – Creating Multiple Table Containers
© 2013 Sage Software, Inc. Student Curriculum 103
2. Identify the common join key from the one table: Example CUSTOMER: IDCUST
3. Drag the common join key from the one table to the other
4. Do the same for all additional tables you have added to the join
5. To check the join Join Type
6. From the Properties window, right click on the Join Icon
7. You can select to Set Join Type, Remove Join and you can check that you have joined the corrected fields.
8. Select the desired Join Type (Inner, Outer, Full Outer)
9. Select Apply
10. This will return you to the Properties window
11. The Join SQL syntax is displayed
Sage Intelligence Connector Module Lesson 9 – Creating Multiple Table Containers
© 2013 Sage Software, Inc. Student Curriculum 104
12. To sample the join Container, right click the Container
13. Select Sample Data
14. Close the Sample window
• NOTE: To edit the graphical join, select the graphical join tool button to activate the graphical join tool. Change 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.
Adding Expressions to a Graphical Join
Once you have created your Graphical Join container you still need to add expressions to the container.
Method
1. From the Object window, right click on the desired Container with the Join
2. Select Add Expression
3. Select Data Field(s)
Sage Intelligence Connector Module Lesson 9 – Creating Multiple Table Containers
© 2013 Sage Software, Inc. Student Curriculum 105
4. Select OK
5. Select all the tables in the Join
6. Select OK
7. Select the Expressions required from the tables
8. Select OK
9. The Expressions will now be added under the Container
10. Sample any of the Expressions from the list:
11. Right click on the Expression
12. Select Sample Data
13. Select OK
Sage Intelligence Connector Module Lesson 10 – Connecting to Multiple Companies
© 2013 Sage Software, Inc. Student Curriculum 106
Summary In this lesson you learned that:
The Graphical Join Tool allows you to join tables from single database that have data in common with one another.
These tables can be joined in various fashions based either on an Inner, Outer or Full joins.
Note: You are now ready to complete Connector Exercises Part 2
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 and:
Understand the Concept of the Consolidation Connection (Like Data)
Understand the concept of PICKLISTS (Like Data)
Understand the Concept Union Reports (Unlike Data)
Sage 300 ERP Intelligence Lesson 10 – Connecting to Multiple Companies
V3.0 Student Curriculum 107
Connecting to Multiple Companies
There are 2 options when connecting to Multiple Companies:
1. Creating a Consolidation Connection
2. Creating a PICKLIST
Consolidation Connection Sage 300 ERP Intelligence ships with a Consolidation Connection in the Connector module.
1. Open the Connector
2. You will find the Sage 300 ERP Consolidation Connection under the Pervasive ODBC Client Interfaceif you are using Pervasive or under the ODBC SQL Server if you are using SQL database.
3. The Consolidation Connection been automatically been set up.
4. There are 2 options for creating a consolidated report:
i. Importing the Report onto the Consolidated Connection.
ii. Moving a container from the Sage 300 ERP(Auto Connect) to the Sage 300 ERP Consolidation Connection.
Importing the Report onto the Consolidated Connection
1. In the Report Manager Select the Folder you would like to Import the Report Into
2. Select the Report that you are Importing. The Import Report Window will open.
Sage 300 ERP Intelligence Lesson 10 – Connecting to Multiple Companies
V3.0 Student Curriculum 108
3. You can rename your report Consolidated Sales Report, and choose the Target Connection – Sage 300 ERP Consolidated.
4. The Newly imported Consolidated Report will appear in the Report Manager.
5. You now need to set up the Database Consolidation List in the Properties window of the Report. Select on the ellipsis button.
6. Select on the Databases you wish to Consolidate, they will then appear in the Database Consolidation List in the properties window of the report. Note: You have to have opened a company in Sage 300 ERP Intelligence for it to appear on the Database consolidation list.
7. You can now run your consolidate report into Excel and customize to suite your specific reporting requirements.
Sage 300 ERP Intelligence Lesson 10 – Connecting to Multiple Companies
V3.0 Student Curriculum 109
Creating a Picklist
You would use Picklists when you want to run a consolidated report from multiple
databases. Picklists are set up in the “Database Name” textbox under
Connections in the Connector.
Let us assume that we have created a new connection called
Sage_300_ERP_Consolidation and have set up the connection details in the
conventional way.
We now navigate to the “Database Name” 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 company database connections A through
D
Sage 300 ERP Intelligence Lesson 10 – Connecting to Multiple Companies
V3.0 Student Curriculum 110
PICKLIST - has the following 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 ”;”
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 name so it has to be exact – remember to end in ;
NOTE – There is no ; after the last database entry in the list.
Once the Picklist is setup as a connection under the Connector, right click the
connection and do a check/test to ensure the syntax and connection is correct. If
it is working, export the report that needs to use the picklist from the Report
Manager.
Now import this by right clicking the connection and import the report.
Sage 300 ERP Intelligence Lesson 10 – Connecting to Multiple Companies
V3.0 Student Curriculum 111
Moving a container from the Sage 300 ERP(Auto Connect)
to the Sage 300 ERP Consolidation Connection
1. Open the Connector Module
2. Select the Container under the Sage 300 ERP (Auto Connect) that you would like to use for the consolidated report.
3. Right select on the Container & select Move to Sage 300 ERP Consolidation
4. The Container will now appear under the Sage 300 ERP Consolidation Connection.
5. The Report using this Container will now be consolidating multiple companies.
Sage 300 ERP Intelligence Lesson 10 – Connecting to Multiple Companies
V3.0 Student Curriculum 112
Defining Union Reports (Unlike Data)
A Union Report is a group of standard reports running together in a specified order, with the control to deliver all the sub reports’ data into one workbook. This is critical as it eliminates the need to consolidate information from multiple Microsoft Excel workbooks into a single workbook.
Although Union Reports are a series of sub-reports, they are treated as a single entity. This means they can be exported as a single report, and all of the sub reports are automatically included. The same applies when a union report is imported; one import and all the sub reports are automatically imported.
When to use Union Reports
You use Union Reports when you need to:
Present data together in one workbook that is unrelated, or comes from various sources.
Report data together that may be related, but cannot be extracted easily via a standard query statement – for example a combination of sales history data combined with inventory levels used to determine stock replenishment
Consolidate information from different companies into one workbook.
Report data together from disparate sources on different databases.
Remember that a Union Report runs each sub report individually at the time of reporting. If you wish to view the sub report, you need to go to the sub report in the report list; however, a sub- report cannot be accessed from the union report.
Examples of existing Union Reports
Actually, many of the reports that come with Sage Intelligence are Union
Reports. You can tell by the green icon ; double click on the union report in order to see the union sub reports.
Sage 300 ERP Intelligence Lesson 10 – Connecting to Multiple Companies
V3.0 Student Curriculum 113
Creating a Union Report
To create a Union Report, complete the following steps:
1. From the Object window, right-click on the desired folder.
2. Select Add Union Report.
3. Enter a Name for the Union Report.
4. Select OK.
5. Select the Reports you would like to Join.
Sage 300 ERP Intelligence Lesson 10 – Connecting to Multiple Companies
V3.0 Student Curriculum 114
6. Select OK.
The Union Report appears under the folder.
Sage 300 ERP Intelligence Lesson 10 – Connecting to Multiple Companies
V3.0 Student Curriculum 115
Change the Order of Union Worksheets
By default the data from the Union Sub-Reports are output into the same worksheet. This behaviour can be overridden though, by setting the Output Sheet property for the individual Union Sub-Reports.
If the data is configured (or defaulted) to the same worksheet for the Sub-Reports then it makes sense that the data is comparable. Although you could specify any reports to be the Sub-Reports for the Union Report, it only makes sense to specify Union Sub-Reports that have comparable data and with the corresponding Display Fields laid out in the same order in all the Sub-Reports to go to the same Output Sheet, so that in the final Workbook there is similar data in each column. If the data is not similar then it should be output to different worksheets.
Complete the following steps to re-order the worksheets in a Union Report.
1. From the Properties window, select the desired Union report.
2. From the Properties window, in the Output Sheet Number, enter in the worksheet number.
3. Select Apply.
Sage 300 ERP Intelligence Lesson 10 – Connecting to Multiple Companies
V3.0 Student Curriculum 116
Hiding Sub Reports
You are able to hide any existing report from view; this is useful for hiding reports that normally do not need to be run as separate reports such as Union Sub-Reports.
Being able to see the hidden report does not remove the hidden attribute from a report.
To hide reports, complete the following steps:
1. From the Object window, select the desired report.
2. From the Properties window, select Show Advanced.
3. From the Properties window, select Report Hidden.
4. Select Apply.
5. This report will not show in your list of available reports.
Showing Hidden Reports
To show a hidden report, complete the following steps:
1. From the Object window, right-click on the Home object.
2. Select Show Hidden Reports.
3. Refresh all objects to then view them.
Sage 300 ERP Intelligence Lesson 10 – Connecting to Multiple Companies
V3.0 Student Curriculum 117
Hiding Hidden Reports
To re-hide hidden reports, a setting at the folder level can be set, as shown below:
Summary
In this lesson you learned that:
Multiple Company Databases can be consolidated by using PICKLIST functionality and by utilizing the Consolidation Connection within the Connector Module.
Consolidate Unlike Data Using Union Reporting
Sage Intelligence Connector Module Lesson 11 – Using Excel as a Data Source for Reports
© 2013 Sage Software, Inc. Student Curriculum 118
Lesson 11 – Using Excel as a Data Source
for Reports In order 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 in anyway.
Note: If you are using Excel 2007 or Excel 2010, save you Excel workbook as an Excel 2003 compatible workbook before using it as a data source.
Method
Excel Data Source
1. Open the workbook in Excel
2. Make sure that the data is stored with accurate headings so that when expressions
are added, the data remains meaningful
3. Select the data required for report writing purposes by highlighting it
4. Select Formulas, Name Manager
Sage Intelligence Connector Module Lesson 11 – Using Excel as a Data Source for Reports
© 2013 Sage Software, Inc. Student Curriculum 119
1. Select New
2. Give the data a name, and select the data you are naming
3. You have now given the data a Named Range
Sage Intelligence Connector Module Lesson 11 – Using Excel as a Data Source for Reports
© 2013 Sage Software, Inc. Student Curriculum 120
5. This range will now be available for selection when you add new data containers
within the Connector module
Creating a new connection to the Excel Workbook 1. 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.
2. Open the Connector
3. Select the ODBC driver for Excel
4. Click on the Add Icon which will display the Connection Info window
Sage Intelligence Connector Module Lesson 11 – Using Excel as a Data Source for Reports
© 2013 Sage Software, Inc. Student Curriculum 121
5. Connection Name – give the connection a name. i.e. Sales
6. Excel Workbook: Browse to the Excel Workbook
7. Name the connection and specify 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
8. Click Add
9. Now add the data container
10. Select Table
Sage Intelligence Connector Module Lesson 11 – Using Excel as a Data Source for Reports
© 2013 Sage Software, Inc. Student Curriculum 122
11. The option to select the table, (the data that you named in Excel workbook- DATA),
will come up. Select ok
12. Right select on the container and select add expressions. Select All.
13. If you sample the container you will see all the data from your Excel workbook
is available to report on.
14. Check/ Test the Container.
15. You can now use this container and create reports off it in the Report
Manager.
Sage Intelligence Connector Module Lesson 12 - Report Writing Methodology
© 2013 Sage Software, Inc. Student Curriculum 123
Lesson 12 - Report Writing Methodology The purpose of this lesson is to provide the best possible guidelines on effective report
writing.
Report Writing Methodology
Report Writing Best Practices
Sage Intelligence Connector Module Lesson 12 - Report Writing Methodology
© 2013 Sage Software, Inc. Student Curriculum 124
PRE-REQUISITES Prior to developing a template it is recommend that a comprehensive requirement document
be completed in addition to the following:
Completion of Connector, Advanced & Basic Intelligence Training.
Completion of the Excel on Steroids training.
Adequate sample data.
SQL knowledge is recommended for Connector tool usage.
A sufficient Data Dictionary of the database being reported off.
ODBC drivers are installed if required for the application in question.
Examples of the desired output and layout required.
Sage Intelligence Connector Module Lesson 12 - Report Writing Methodology
© 2013 Sage Software, Inc. Student Curriculum 125
Note: "Graphical Joins”, existing “SQL views” and “SQL Joins" are the
preferred methods for creating containers and that wherever possible these
should be used. Stored procedures and SQL query containers provide less
flexibility for end users 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.
CONNECTOR
CONTAINERS: When developing a container the following criteria should be borne in mind:
1. Type of join to be used (e.g. SQL join, graphical join etc.).
2. Name containers as per the report name or similar to. This is for ease of use in
recognising the contents of the container.
3. Provide meaningful descriptions on containers.
4. Include expressions with meaningful names in the container that may be useful to the
client for future use even if they are not required on the report in question.
JOINS:
1. Use Graphical Joins unless you require specific clauses within the join, as this
creates a visual entity relationship diagram.
2. Views and Stored Procedures should only be used if designing a report from a
database where such Views or Stored Procedures 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.
3. For performance it is best to use index fields. However, where joins are required on
non-indexed fields it is recommended that the developer index the required fields.
Sage Intelligence Connector Module Lesson 12 - Report Writing Methodology
© 2013 Sage Software, Inc. Student Curriculum 126
EXPRESSIONS:
1. Use data fields and SQL expressions as much as possible.
2. 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.
3. Where possible use SQL expressions to create calculated fields as opposed to using Excel formulas at the front end within Excel
4. 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.
5. 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.
6. Provide meaningful names for expressions and data fields, as often database fields
are presented in a cryptic manner.
LOOKUPS:
1. 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 container.
2. Where the functionality of the database allows for the use of the SQL distinct
keyword, ensure that lookups display a distinct list of values.
3. For containers that access large data sets it is recommended that the SQL lookup
type for all expressions be changed to ”Direct from Container” or “SQL Statement
Defined”. This will optimise lookups and minimise the load on the database server.
4. Where necessary, set the lookup type to a Customised SQL Statement and
customise 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.
Sage Intelligence Connector Module Lesson 12 - Report Writing Methodology
© 2013 Sage Software, Inc. Student Curriculum 127
REPORT MANAGER 1. The type of report being developed needs to be determined, e.g. a standalone report,
union report etc.
2. It is recommended to document the reasoning for the use of a specific method in the
developing of a report for future reference e.g. Union Report used because X and Y
table could not be joined in a container.
3. Keep the number of reports per container to a minimum. It is recommended to
duplicate a container if it is to be used for more than one report. This eliminates room
for error when editing an expression. If numerous reports are using the same
container and the same expression, changing the expression for the purpose of one
report could result in a negative impact on the other reports.
4. Assign a unique report code to each report:
Report codes are added to reports in the report Manager on the Advanced
properties screen of the report (i.e. select Show Advanced, then scroll down)
The report code should be made up as follows:
The abbreviation of the application and application version, the database type,
the system class followed by a number, then the report version e.g. for a Sage
300 ERP SQL version 6 General Ledger report the code would be similar to this
AE-SQL-GL01-2-0
PARAMETERS
1. Rename parameter fields on the parameters properties screen where necessary to
provide more meaningful options to the user at runtime. Set “Parameters on Second
Sheet” on. Having the parameter values within the workbook can be extremely useful
in report headings.
2. Where possible, insert system variables in the report parameter defaults e.g.
@MONTHEND@ to eliminate possible errors at run time.
Figure 1: Report Parameter Defaults
3. Set each parameter field’s “Mandatory” tick box on
Sage Intelligence Connector Module Lesson 12 - Report Writing Methodology
© 2013 Sage Software, Inc. Student Curriculum 128
Note: Union Sub reports run in Reverse Order (LIFO) within a union report.
Always bear in mind that if the ““Parameters on Second Sheet” has been
selected, no sub reports should be assigned to Sheet 2 of the report
Figure 2: Selecting the mandatory parameter option
UNION REPORTS
1. Place all parameters on the first union sub report which runs. Should filtering be
required on subsequent sub reports, Pass Through Variables can be used to pass
these values to filters in the sub reports. This will eliminate parameter pop ups later in
the run process.
2. When adding a sub report to a union report, the reports are all set to run out on
Sheet 1. The sub report run order can be amended by changing the “Output Sheet
Number” on each union sub report.
Figure 3: Setting the sub report run order
Sage Intelligence Connector Module Lesson 12 - Report Writing Methodology
© 2013 Sage Software, Inc. Student Curriculum 129
3. When running out the report as seen in the graphic below, the Dashboard Sub
report will be on sheet 1, the parameters on Sheet 2, the Dashboard Financials
Grp Sub report on sheet 3, etc.
Figure 4: Report output order
UNION SUB REPORTS
1. Set “Report Hidden” on for all Sub reports, to eliminate confusion between the
report and the sub reports making up that report. By doing this, the Sub report
will not appear on the menu, but still be accessible via the tools menu.
2. Sub Report properties have an option to “Abort Union Report if No Data”. This
option should be checked on for any sub reports that must return data for a report
output to make sense. Standard reports by default give a “No data” message
when there is no data but since a union report pulls data from more than one
report (e.g. a dashboard) you may still want to see the report even though some
data is not there. There are however union reports that you would not want to run
out if 1 or more of the Sub Reports don’t return data. An example would be a
Financial report that is a Union report. In these scenarios you should check this
option for the Sub Reports. If there is no data for the sub report(s) then the report
aborts.
Figure 5: Abort Union Report option
Sage Intelligence Connector Module Lesson 12 - Report Writing Methodology
© 2013 Sage Software, Inc. Student Curriculum 130
3. “Make Available in SDK” needs to be selected on the relevant reports. This
option must not be selected for drill-down and sub reports. This will ensure that
the report is available through the SDK for use in application menus.
Figure 6: Making Report available in the SDK
4. It is recommended that all Sub Reports to have the word “Sub” at the end of the
report name to differentiate them from standalone reports that are intended to be
run. Sub reports are not intended to be run as standalone.
Sage Intelligence Connector Module Lesson 12 - Report Writing Methodology
© 2013 Sage Software, Inc. Student Curriculum 131
EXCEL TEMPLATE FILE
When developing a template, it is recommended to do so using Excel 2003 and to link the
template back as an .xlt file. This will ensure that the template is compatible on all versions
of Excel. Any Report Designer templates created need to be developed using Excel
2007and linked back as an .xltx file.
PIVOT TABLES
When using a PivotTable in the template file take the following into account:
1. PivotTable Limitations – ensure that you do not display too many row fields that could
cause the pivot table limitation to be reached. Use report filter/page fields where
necessary to further summarise data.
2. When pivoting data from a source data sheet where the data was rendered by Sage
Intelligence, always use the named range Sheetname!RawData. This will ensure that
the full range of data extracted is always available for use within the pivot table.
When adding new columns to a report, these new columns of data will then
automatically be included in the pivot table range.
Figure 7: Selecting PivotTable Data Range
3. Turn off the feature “Save data with table layout”. This is a pivot table option which
affects the file size when turned on, resulting in unnecessarily large template files.
4. Use the feature “Clean Template Pivot Fields” in the Report Manager to clear out
pivot table items before exporting the report for delivery. This will ensure that the user
of the report does not view items within the pivot table that were used in the
development of the report.
Sage Intelligence Connector Module Lesson 12 - Report Writing Methodology
© 2013 Sage Software, Inc. Student Curriculum 132
5. Suggested PivotTable settings:
Set the following footers on each page:
At the bottom left, set the date and time
At the bottom right, set page numbering
Set print titles to have row headings repeated at the top of each page.
Set print titles to have columns repeated at the left of each page where
necessary.
Preview the report and adjust the scaling where necessary, but to a minimum
of 75%.
Reset margins where necessary.
6. Formatting should be uniform on all reports to ensure the end product has a
consistent feel.
7. When formatting a pivot, the use of bright colours should be avoided. It should also
be taken into account that colour schemes may vary on different systems.
8. It is recommended that the “Quick Pivot” & “Format Pivot” tool be used to format all
pivot tables. This can be found under the “Add-Ins tab in excel.
Sage Intelligence Connector Module Lesson 12 - Report Writing Methodology
© 2013 Sage Software, Inc. Student Curriculum 133
Figure 8: PivotTable format menu
Figure 9: Standardizing the format of PivotTables
PIVOT CHARTS
When creating pivot charts it is recommended that formatting be set to “automatic”. This will
ensure that a pivot chart automatically reformats when used in different Excel versions.
Sage Intelligence Connector Module Lesson 12 - Report Writing Methodology
© 2013 Sage Software, Inc. Student Curriculum 134
Figure 10: Pivot Chart format menu
All areas of a pivot chart can be formatted. To format the various sections of a pivot chart:
Vertical and Horizontal Axis – right click on the axis labels and select Format Axis
Figure 111: Format Axis
Right click on the vertical wall of the pivot chart to select Gridlines and the Vertical
Axis
Sage Intelligence Connector Module Lesson 12 - Report Writing Methodology
© 2013 Sage Software, Inc. Student Curriculum 135
Figure 122: Format Axis & Gridlines
Click inside the pivot chart to select the back wall
Figure 133: Format Walls
Right click on the series to format the data series
Figure 144: Format Data Series
Sage Intelligence Connector Module Lesson 12 - Report Writing Methodology
© 2013 Sage Software, Inc. Student Curriculum 136
Right click in the legend to format
Figure 155: Format Legend
After selecting the relevant format menu, the following should be set to Automatic
Fill
Figure 166: Set Fill to Automatic
Border colour
Figure 176: Set Border Color to Automatic
Sage Intelligence Connector Module Lesson 12 - Report Writing Methodology
© 2013 Sage Software, Inc. Student Curriculum 137
EXCEL FORMATTING
1. Set report headings at the top of each worksheet that is used as a final end result.
Include parameter values within the report headings where necessary.
2. Set “Freeze panes” to enable easy scrolling around the worksheet without losing
view of report headings etc.
3. Hide the display of zero values on the worksheets.
4. Hide the display of gridlines on the worksheets.
5. Adjust the zoom display if necessary but to a minimum of 75%.
6. Ensure the correct worksheets in the workbook have been hidden.
7. The template is to be saved on the correct worksheet with the cursor position in the
first blank cell.
USING SLICERS AND SPARKLINE’S IN EXCEL TEMPLATES
When developing a template, it is recommended to do so using Excel 2003 and to link the template back as an .xlt file. This will ensure that the template is compatible on all versions of Excel. However if you want to use Sparkline’s are slicers in your reports you need to make you templates Excel 2010 compatible.
1. Run out you standard report into Excel from the Report Manager
2. Go back your Report Manager and right select on the report you have run.
3. Select Un-link template
4. The Excel Template is no longer linked to the report.
5. Right select on the Report again and select Create & Link Template
Sage Intelligence Connector Module Lesson 12 - Report Writing Methodology
© 2013 Sage Software, Inc. Student Curriculum 138
6. The select a workbook to Covert Template screen will open, select the workbook from the list. Select OK
7. Select Yes, to place Parameters on the Second Sheet
8. Select the Template File Format to use. This time select Excel 2007 (.xltx) this will ensure the template is compatible with Excel 2007 and Excel 2010. Allowing you now to use slicers and Sparkline’s in your reports.
Sage Intelligence Connector Module
© 2013 Sage Software, Inc. Student Curriculum 139
9. Specify the Template name, you will notice it is now a (.xltx)
10. The Excel Template will be linked to the report as an Excel 2007 Template (*.xltx)
Note: You are now ready to complete Connector Exercises Part 3