Sunteți pe pagina 1din 89

FactSet OnDemand R User Guide

FactSet Research Systems


Version 2.6

Updated February 2014


Table of Contents
Chapter 1. Introduction ............................................................................................................ 4
1.1 Overview ........................................................................................................................ 4
1.2 FactSet Data .................................................................................................................. 4
1.2.1 Company Level Data ............................................................................................ 4
1.2.2 Benchmark/ Index Data ........................................................................................ 5
1.2.3 Economic Data ..................................................................................................... 5
1.3 Data Extraction from FactSet .......................................................................................... 6
1.3.1 Time-Series Access .............................................................................................. 6
1.3.2 Cross-Sectional Access ........................................................................................ 6
1.4 Technology ..................................................................................................................... 6
1.4.1 Defining the Result ........................................................................................... 7
1.4.2 The Ideal Data Structure ................................................................................ 7
Chapter 2. FactSet R Installer ................................................................................................. 8
2.1 Accessing the Installer..................................................... Error! Bookmark not defined.
2.2 Running the Installer....................................................................................................... 8
2.3 Troubleshooting.............................................................................................................11
Chapter 3. Retrieving FactSet data in R ................................................................................12
3.1 Extract Data from FactSet ..............................................................................................12
3.1.1 FactSet Query Language (FQL)...........................................................................12
3.1.2 Screening Language............................................................................................12
3.2 FactSet Functions in R ..................................................................................................14
3.2.1 FF.ExtractFormulaHistory ....................................................................................14
3.2.2 FF.ExtractDataSnapshot......................................................................................24
3.2.3 FF.ExtractBenchmarkDetail .................................................................................38
3.2.4 FF.ExtractEconData ............................................................................................43
Chapter 4. Formula Lookup in R ............................................................................................52
4.1 Launching Formula Lookup in R ....................................................................................52
4.2 Searching for Data ........................................................................................................53
4.2.1 Identifier Lookup ....................................................................................................53
4.2.2 Search for Data Formulas .....................................................................................54
4.2.3 Insert FactSet Formula into R ................................................................................55
Chapter 5. Upload R Data into an OFDB................................................................................58
5.1 Requirements for UploadToOFDB in R..........................................................................59
5.2 OFDB ............................................................................................................................59
5.2.1 Creating a New OFDB .........................................................................................60
5.2.2 Modifying an Existing OFDB ................................................................................60
5.3 FactSet.UploadToOFDB Syntax ....................................................................................60
Chapter 6. Redirect FactSet Data from R to Excel ................................................................62
6.1 FactSet.RedirectToExcel Function ......................................................................................63
6.2 Upload Data from Excel into an OFDB ................................................................................63
Chapter 7. Troubleshooting ...................................................................................................65
7.1 Error Messages ...................................................................................................................65
7.1.1 FactSet Query Error ............................................................................................65
7.1.2 Formula Syntax Error...........................................................................................66
7.2 FactSet Event Logger .........................................................................................................67
7.2.1 FactSet Event Logger Overview ...........................................................................67
7.2.2 Using the FactSet Event Logger in R....................................................................67
7.3 FactSet Help Documentation ..............................................................................................69

2|Page
Appendix .................................................................................................................................71
Script 1: Example of R Script to Break Down a Request ...........................................................71
Table 1: Top 25 most commonly used FactSet Fundamentals formulas ...................................72
Table 2: FactSet Economics Key Indicator Series for G-7 Countries .........................................73
Table 3: Country Identifiers for Standardized Economic Database ............................................80
Table 4: Data Series with Standardized Economics Database ..................................................81
Table 5: UploadToOFDB Error Messages .................................................................................83
Table 6: Error Messages ...........................................................................................................84
Graph 1: Histogram of FF.ExtractFormulaHistory Query Time ..................................................86
Graph 2: Histogram of FF.ExtractDataSnapshot Query Time ....................................................86
FactSet Glossary ......................................................................................................................87
Contact FactSet Support: ..........................................................................................................89

3|Page
Chapter 1. Introduction

1.1 Overview

FactSet supports the major tasks frequently undertaken in an R data mining project,
such as data acquisition, data preparation, modeling, and model execution with
reporting/graphing. The integration of data from FactSet into R allows users to interact
with R directly to retrieve company, portfolio, index, market aggregates, ownership and
economic data from FactSet.

R provides access to FactSet through a connection to the FactSet DataDirect server.


FactSet DataDirect integration with R is done via internet requests that retrieve a bundle
of FactSet data in a variety of tagged or delimited formats. DataDirect uses HTTP basic
authentication over Secure Sockets Layer (SSL).

R users can access reports from FactSet called factlets to retrieve a variety of data sets.
Factlets are functions that encapsulate business logic and data collection procedures. A
factlet can be a simple data request or can invoke complex application logic. The
technology is capable of cross referencing and dealing with time series for a high
amount of data, which can be returned in a variety of tagged or delimited formats.

1.2 FactSet Data

FactSet integrates over 200 databases to analyze markets, companies and industries in
R. For a comprehensive list of databases available on FactSet go to:
www.factset.com/data

Highlighted below are the FactSet owned databases:

1.2.1 Company Level Data

FactSet Fundamentals is updated intra-day and is a comprehensive global database


with extensive coverage and reliable data history. The database provides:

Coverage of more than 66,000 public and private companies with annual history
going back to 1980 in developed market and the early 1990s in emerging
markets.

Access annual restatements beginning in 2004.

Coverage of up to 2,000 data items, including ratios, for more than 70 countries.

4|Page
FactSet Estimates is updated intra-day and provides consensus- and detail-level
estimates and statistics from leading investment banks and research firms. According to
the Wall Street Journals Best on the Street Analysts Survey, a quantitative evaluation
of analysts performance based on the accuracy of buy/sell recommendations, the top
analysts evaluated for the survey are identified using broker recommendation data
sourced from FactSet Estimates. The database provides:

Over 760 contributing brokers, covering more than 16,500 active global
companies: (31% from North America, 27% from Europe, and 35% from Asia).

Historical information is available from 1997 for European companies and from
2000 for companies in the Americas and Asia.

1.2.2 Benchmark/ Index Data

FactSet clients have access to Equity and Fixed Income Benchmarks, which include
Dow Jones, FTSE, MSCI, Russell, S&P, Barclays, and BofA Merrill Lynch, among a
number of others.

FactSet Market Aggregates (FMA), combines data from FactSet Fundamentals,


Estimates and Prices to calculate ratios and per share values on an aggregate level.
Provides access to over 50 metrics for more than 3,500 commercial and exchange
indices.

1.2.3 Economic Data

FactSet Economics database is updated intra-day and provides comprehensive global


coverage. Database includes details such as economic information, exchange rates,
commodities, and interest rates. The database provides:

Coverage of more than 200 countries.

Includes over 1.8 million data series.

In addition to data sourced directly from statistical agencies and organizations,


specialty databases include Eurostat, ICIS, ICAP, International Monetary Fund
(IMF) and the OECD.

5|Page
1.3 Data Extraction from FactSet

As outlined above, FactSet integrates a range of numeric data sets - company


accounts, security data such as price and return, consensus and detail broker
estimates, and economic data are a few of the examples. This range of numeric data is
stored on FactSet in such a way as to make powerful cross-sectional and time-series
analysis possible and thus to facilitate two different data access methods.

The selected data access method depends on the type of data a user wants to get from
FactSet, and what they want to do with that data.

1.3.1 Time-Series Access

The first access method is oriented around time-series data fetches. Given an entity (i.e.
a security or an index) and a data item (i.e. market closing price) the entire history can
be fetched using the FactSet Query Language (FQL). This is an easy way to extract
historical data from our databases.

Some advantages of FQL include:

The ability to specify dates for any database using the same formats.
With FQL, date formats are flexible. You can use a number of consistent date
formats (defined by FQL) for all databases which makes using and combining
data from different databases easier than ever.
The ability to iterate items, formulas, and functions at any frequency.
With FQL, you can iterate items, formulas, and functions at any frequency. For
example, you can request a series of weekly price to earnings ratios.

1.3.2 Cross-Sectional Access

In order to facilitate quick access to a data item as of single time period for a universe of
securities, FactSet offers an optimized cross-sectional data access method with the
Screening Language. Given a data item, for example EPS, and a time period, for
example Q4 2010, that data for every entity in a specified universe can be fetched
using the FactSet Screening Language.

1.4 Technology

The R integration generates a URL that creates an https request. R will request data
over the internet to FactSet DataDirect Servers. The DataDirect servers handle
authentication of the user and the permissioning of data sets. This OnDemand
integration is designed to provide simple, on-the-fly access to FactSet data in
reasonably sized blocks through a web service interface or a direct connection

6|Page
1.4.1 Defining the Result

Requesting a large amount of data requires defining what is needed, breaking it down
into smaller bundles, retrieving them, and reassembling it on the other side. An
application has to focus first on defining what a user wants to receive. Only by targeting
a very well defined result, can the application select what it needs from the database,
break it down, and move it.

1.4.2 The Ideal Data Structure

Given a clients' interest in large amounts of data and the limitation of any package in
terms of memory to store everything "on-the-fly", FactSet defines that an ideal data
structure would have a limit of 1 million rows of output. A large request that is beyond
the 1 million rows of output limit would need to be broken down into smaller pieces in
order to move it and then store it permanently.

There are numerous ways to do build a permanent data structure. One big streaming
download may not be the answer, because there are limitations at both ends and in
between. If there is a relatively inflexible query, streaming might work, but large flexible
queries require time to build and may need to be broken up for efficiency. With a steady
stream of data, the receiving application would have to stop and write it permanently to
the database once in a while. Also, with a large transfer, there is the risk of failure.

The Script 1 sample on page 53 in the Appendix provides an example of the R script to
break down a request, with comments added to explain each line of the script.

7|Page
Chapter 2. FactSet R Installer

The FactSet OnDemand R integration allows users to interact with the statistical
package directly to retrieve FactSet data. Please note that FactSet does not support R
versions prior to R 2.10. If a client requires an earlier version, FactSet will supply the R
2.10 version of files, however custom solutions that are backwards compatible are not
developed. FactSet will continue to support all versions of R moving forward. Older
versions may require a non-standard installation package. Version 3.0 of R is
compatible with version 2.4 of the R Plugin.

Note: Pre-release versions of MATLAB are not officially supported.

The FactSet R integration is installed via the FactSet R Plugin.

Note: The FactSet R Installer is retired 18 months after release. The Plugin will
continue to work after 18 months, but from 15 months and on users are prompted to
upgrade.

The installer makes several changes to a users R install:

1. Creates a directory under the R root directory called FactSet which is


populated with files for the factlet reports that support the Plugin.
2. Adds files to the R function path to support the Plugin.

2.1 Accessing the Installer

FactSet R Installer can be accessed from: www.factset.com/download/statlink

The installer is compressed in a folder named FactSetRPlugin_x86 or


FactSetRPlugin_x64 depending on the computer architecture that a user is running. If
the user is using a 32-bit machine, the user will likely choose the FactSetRPlugin_x86
installer and the FactSetRPlugin_x64 for a 64-bit machine. Both versions are
compatible with Windows XP, Windows Vista & Windows 7.

Note: The .NET framework 3.5 is the minimal requirement necessary to install.

2.2 Running the Installer

The installer will come with a minimum of two files: setup.exe and FactSetRPlugin.msi.
To being the install process, the user can double-click on the .msi. The Windows
Installer will then open the R Plugin Setup Wizard. The user should select next to
continue the install or cancel the install process.

8|Page
In the first step, enter the FactSet Username and Password credentials. To connect to
the FactSet server in R, a username and password are required. These credentials are
different than the FactSet workstation login. New credentials will be provided by a
FactSet representative upon trial or purchase of the R integration.

The Windows Installer will then open the R Plugin Setup Wizard. The user should select
next to continue the install or cancel the install process.

In the first step, enter the FactSet Username and Password credentials. To connect to
the FactSet server in R, a username and password are required. These credentials are
different than the FactSet workstation login. New credentials will be provided by a
FactSet representative upon trial or purchase of the R integration.

In the second step, if applicable, enter the port information.

In the next step, select the install location to apply this Plugin. The installer will suggest
a location such as C:\Program Files\R\: The user should browse to the correct location
by selecting Browse. The user should then select the root directory of the version of R
on which they would like to install the integration.

9|Page
The user should select a root which includes the version folder. For example, the root
could be: C:\Program Files\R\R-2.13.1. This folder is the location in which the files will
be installed. Please note, if the program does not detect a proper root, it will not
install.
Once the install is completed, R will launch and will run startup scripts to finalize the
install.
Additionally, in terms of the firewall specifications:

1. Ensure to whitelist https://*.factset.com on firewalls / URL inspectors / IPS / IDS;

2. Ensure that https:// (TCP 443) is allowed to FactSet's production destination subnets
- 192.234.235.0 (255.255.255.0) and 64.209.89.0 (255.255.255.0)

Note: On the bottom right hand corner tray of the screen a FactSet OnDemand
Windows Quick Launch icon is available once the install is complete. Any changes to
the FactSet R credentials can be updated by selecting this icon > Edit Configuration.
The Username, password and Port information can be updated and saved through this
menu.
The FactSet OnDemand icon subsequently launches every time that a FactSet data
request is made in an open session of R.

In order to upload and download data from FactSet, there is an OnDemand file created
in a temp directory. The location of those files is automatically generated, but in some
instances (such as running through a server) those generated files may be inaccessible
at run time.

If you suspect this to be a problem, it is possible to specify for the Plugin where to
create its upload/download files by setting configuration item number 16:
> FactSet.setConfigurationItem(16, newDirectory)

10 | P a g e
2.3 Troubleshooting
To uninstall the program or apply repairs, go to the Add/Remove Programs (Windows
XP) or Programs (Windows Vista and 7) and view the entry there.

FactSet troubleshooting questions can be directed to FactSet Support at


www.factset.com/services/support or 1-877-FACTSET.

For a global list of FactSet support line numbers please refer to:
http://www.factset.com/services/supportnumbers_list

11 | P a g e
Chapter 3. Retrieving FactSet data in R

3.1 Extract Data from FactSet


FactSet stores all of the available data in proprietary database structures on FactSet
mainframes. This lets FactSet adjust when necessary the way data is stored, so that
clients can access data as efficiently as possible. Most datasets available on FactSet
are stored in two different ways, so as to facilitate two different data access methods.
The options are using FactSet Query Language for time-series requests and the
FactSet Screening Language to efficiently extract data for a large universe of securities
as of a single date.

3.1.1 FactSet Query Language (FQL)


The extraction of a time-series of data from FactSet either for an index or security (i.e.
the last 4 quarters of EPS for the S&P 500 or for Exxon) or macroeconomic data (i.e.
the last 5 years of industrial production for the BRIC countries) can be done using the
FactSet Query Language (FQL). FQL is a proprietary data retrieval language used to
access FactSet data. For more information on FQL, see Online Assistant page 1961.

To request a time-series of data, a start date, end date and frequency needs to be
specified. If a date is not specified, data is returned from the most recent time period. To
request data for a time series, the start date is the first date of the requested time series
of data. The end date is the last date of the time series. The dates can be designated as
absolute dates or relative dates.

3.1.2 Screening Language


Alternatively, the extraction of multiple items for a list of ids for 1 date, both for equity
and fixed income securities can be done using the Screening Language. The FactSet
Screening Language is a way to efficiently extract data for a large universe of securities
as of a single date.

By default, the Screening Language does not allow iteration and therefore cannot be
used to return a time series of data with a single request code. To request data as of a
single historical date, an absolute or relative date must be specified.

Date Format - Absolute Dates


Absolute dates indicate a specific day, month-end, fiscal quarter-end, calendar quarter-
end, fiscal year-end, or calendar year-end as depicted in the examples below:

A day: MM/DD/YYYY (e.g. 7/11/1999)


Note: DD/MM/YYYY is not a valid date format
A month-end: MM/YYYY (e.g. 6/1999)
A fiscal quarter-end: YY/FQ or YYYY/FQ (e.g. 1999/1F, 2000/3F, 2001/2F)

12 | P a g e
A calendar quarter-end: YY/CQ or YYYY/CQ (e.g. 1999/1C, 00/3C, 2001/1C)
A fiscal year-end: YY or YYYY (e.g. 2000, 01, 1999)

Date Format - Relative Dates


Relative dates represent a date relative to the most recently updated period. For
example, 0 (zero) represents the most recently updated period -1 represents the time
period prior to the most recently updated.

The zero date is determined by the default time period or the natural frequency of the
data being requested. Zero (0) when used with monthly data indicates the most recent
month end. Negative one (-1) when used with annual data indicates one fiscal year prior
to the most recently updated fiscal year.
List of Relative Date Arguments:

D 0D is the most recent trading day, -1D is one trading day prior.

AW 0AW is the most recent trading day, -1AW is the one actual week (7 days) prior
to the most recent trading day.

W 0W is the last day of the most recent trading week (usually Friday), -1W is the
last trading day of the prior week.

AM 0AM is the most recent trading day, -1AM is the same day, one actual month
prior.

M 0M is the last trading day of the most recent month, -1M is the last trading day of
the prior month.

AQ 0AQ is the most recent trading day, -1AQ is the same day 3 months prior

Q 0Q is the last trading day of the companys most recent fiscal quarter, -1Q is the
last day of the prior fiscal quarter.

CQ 0CQ is the last trading day of the most recent calendar quarter (March, June,
September, or December), -1CQ is the last trading day of the prior calendar
quarter.

AY 0AY is the most recent trading day, -1AY is one actual year (365 days) prior

Y 0Y is the last trading day of the companys most recent fiscal year, -1Y is the last
trading day of the prior fiscal year.

CY 0CY is the last trading day of the most recent calendar year (the last trading day
in December), -1CY is the last trading day of the prior calendar year.

13 | P a g e
3.2 FactSet Functions in R

FactSet has written a number of R functions that retrieve FactSet data using the FQL or
Screening languages. The data items that are requested, along with an id (identifier)
and date, are stored in a structure. Entities (Security, Index, etc.) and the time
dimensions are stored in arrays, either separately or combined together into one.

3.2.1 FF.ExtractFormulaHistory

The ExtractFormulaHistory function is used in R for extracting one or more items for one
security, an index or a list of securities over time. The function is using the FactSet
Query Language (FQL), which is a proprietary data retrieval language used to access a
time-series of FactSet data.

In R, the syntax for the FF.ExtractFormulaHistory function is:

data <- FF.ExtractFormulaHistory("ids","item(s)","dates {, param,value}")

Note: In the syntax diagram, the braces indicate optional FactSet code
arguments.

where,

data The name of the data structure to create, i.e. titled data or x.
ids A list of one or more security identifiers.
Item(s) A list of one or more FactSet data items represented in FQL.

Optional arguments,

dates Date range and frequency entered using actual or relative dates. A
valid FactSet frequency (e.g. ddates Alternate method of entering
dates entered in start:end:freq format. (e.g.
20101215:20110115:d)

dataType The optional argument allows users to define a data type for a data
item column that is NA for the entire column.

feelback Setting to control data is not falling forward and display NAs instead
of carrying forward values, for those databases that do so (using
'feelback','n').

refresh This will refresh the connection to FactSet servers to capture the
latest database updates. This only needs to be used when a

14 | P a g e
refresh is necessary. It is not recommended to leave this argument
in every request made. To use this, the refresh argument should be
paired with the value Y.

For databases available on FactSet, there are a set of items that represent the piece of
information on the database, such as sales, EPS and market value. Formulas that begin
with FG_ are FactSet Global formulas and are some of the most commonly used
formulas to retrieve prices, estimates, valuation, growth, and fundamentals. The
formulas return data from multiple database sources, based on a client's FactSet
subscription. While the source can be different depending on the selected company, all
formulas for a given company are pulled from the same database source.
In database specific codes, the database is specified in the FQL code, such as in
P_PRICE where the P_ element of the code denotes the pricing database and
FF_SALES denotes the FactSet Fundamentals database with the FF_ element of the
code.

FQL codes used in the item parameter may have their arguments in different positions
of their respective codes, depending on if its a commonly used code, which will start
with an FG_ or a database specific code. This distinction is highlighted in more detail
throughout the following examples.

15 | P a g e
Example 1:
In this example extract the last 6 quarters EPS for Exxon Mobile (ticker XOM) using the
FQL code FG_EPS.

> data <-FF.ExtractFormulaHistory("xom","fg_eps(0Q,-5Q,Q)","");

In this example, the date argument is using relative rather than absolute dates. To
specify relative dates, enter the number of periods and a period code, such as D for
days, W for weeks, or Q for quarters and Y for years. When using relative dates, "0"
refers to the most recent time period. Therefore, 0Q refers to the most recent quarter
end, while -1Q refers to two quarters ago.

Here is the R output:

Summary for ExtractFormulaHistory


Rows:6 Columns:3
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date (Date: MM/DD/YY)
Col (3): Type: double Name: fg.eps (Earnings Per Share)

> data
Id Date fg.eps
1 xom 2012-03-31 8.42
2 xom 2012-06-30 8.28
3 xom 2012-09-30 9.51
4 xom 2012-12-31 9.47
5 xom 2013-03-31 9.70
6 xom 2013-06-30 9.82

Example 2:
In this example extract the price for a number of securities, i.e. Microsoft and IBM using
the FQL code FG_PRICE.

> data <-


FF.ExtractFormulaHistory("msft,ibm","fg_price","20101215:20110115:D");

Here is the R output:

Summary

16 | P a g e
Rows: 44 Columns: 3
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date (Date: MM/DD/YY)
Col (3): Type: double Name: fg.price (Price)

> data
Id Date fg.price Id Date fg.price
1 msft 2010-12-15 27.8500 23 ibm 2010-12-15 144.7200
2 msft 2010-12-16 27.9875 24 ibm 2010-12-16 144.5500
3 msft 2010-12-17 27.9025 25 ibm 2010-12-17 145.0000
4 msft 2010-12-20 27.8100 26 ibm 2010-12-20 144.5100
5 msft 2010-12-21 28.0700 27 ibm 2010-12-21 145.7400

Example 3:
In this example, extract the last 6 periods of pricing and sales data for Statoil (ticker
STL-NO) using the pricing database with the FQL code P_PRICE and the FactSet
Fundamentals database for sales data with the FQL code FF_SALES. Both P_PRICE
and FF_SALES in this example are used in the item parameter.

Because these are database specific codes and not the most commonly used FG_
codes demonstrated in Examples 1 and 2, the arguments for elements such as currency
are positioned differently in the code. For example, in the P_PRICE code, currency is
the 4th argument and in the FF_SALES code, currency is the 6 th argument.

> data <-FF.ExtractFormulaHistory("stl-no","p_price(-5,0,Q,USD),FF_sales(QTR,-


5,0,Q,,USD)","-5:0:Q");
Note: When specifying the items in the request syntax, to ensure most effectively that
that the dates for the items, such as price and sales, align correctly with the dates field,
enter the dates in the items portion of the request syntax as specified above. For
example p_price(-5,0,Q).

See Table 1 in Appendix for the FQL syntax for the top 25 most frequently used codes
from the FactSet Fundamentals database

Here is the R output:


Summary
Rows: 6 Columns: 4
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date (Date: MM/DD/YY)
Col (3): Type: double Name: p.price (Price - Close or Current Intraday)
Col (4): Type: double Name: ff.sales (Sales)
> data

17 | P a g e
Id Date p.price ff.sales
1 stl-no 2012-03-31 27.10355 33652.80
2 stl-no 2012-06-30 23.78689 31611.77
3 stl-no 2012-09-30 25.83496 27953.55

Example 4:
In this example, extract the price for IBM and Google for the date range 12/31/1989 until
12/31/2001 on a monthly frequency. Since there is no available price data for Google
starting in 1989, the data would be NA. When using the ExtractFormulaHistory function
the data type can be specified for treatment of NAs, for example as a double or integer.

By default, the data type returned is determined by the first value of the items being
returned. In the following case the p_price code returned as a character by default
because the values for GOOG are NA (if the request is made for just IBM with the same
date range the p_price data is returned as a double since the data is available for IBM).
But with the addition of the datatype optional argument, it is possible to specify how the
data is returned.

> data <-


FF.ExtractFormulaHistory("goog","p_price(12/31/1989,12/31/2001,M)","","datatype
=double");

Summary for ExtractFormulaHistory


Rows:145 Columns:3
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date (Date: MM/DD/YY)
Col (3): Type: double Name: p.price (Price - Close or Current Intraday)

Example 5:
In this example, retrieve the 60 month beta coefficient for Exxon Mobile relative to the
S&P 500. The FactSet BETA function measures a security or portfolio's volatility relative
to an index. If a security has a beta coefficient greater than one, it is considered more
volatile. If a security has a beta coefficient of less than one, its price can be expected to
rise and fall more slowly. In the FQL syntax, the BETA function returns the coefficient
relative to an index and over any period of time that you specify.
> data <-FF.ExtractFormulaHistory("XOM","BETA(\'SP50\',-0,-59M,M)","");

Note: The syntax for specifying the index, in this case the S&P 500, denoted with the
identifier SP50, when using the FactSet BETA function is to have a backslash in front of
single quotes around the SP50 because it is a string.

Here is the R output:

18 | P a g e
Summary
Rows: 1 Columns: 3
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date (Date: MM/DD/YY)
Col (3): Type: double Name: beta (Beta - Relative to S&P 500 - 5 Yr)
> data
Id Date beta
1 XOM 2 013-09-18 0.5170066

Example 6:
This example is using some of the FQL functions that are available, such as AVG, MAX,
MIN, STD, etc. FactSet offers hundreds of functions and a comprehensive alphabetical
list of functions is available on Online Assistant page 1410.

Extract the average, maximum, minimum, and standard deviation of earnings per share
(EPS) values for General Electric, for the last 6 quarters of history. The EPS values are
coming from the FactSet Fundamentals database using the FQL code FF_EPS(QTR,0,-
5,Q).

> data <-FF.ExtractFormulaHistory("GE","AVG(FF_EPS(QTR,0,-


5,Q)),MAX(FF_EPS(QTR,0,-5,Q)),MIN(FF_EPS(QTR,0,-5,Q)),STD(FF_EPS(QTR,0,-
5,Q))","");

Here is the R output:

Summary
Rows: 1 Columns: 6
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date (Date: MM/DD/YY)
Col (3): Type: double Name: avg (Average)
Col (4): Type: double Name: max (Maximum Value)
Col (5): Type: double Name: min (Minimum Value)
Col (6): Type: double Name: std (Standard Deviation)

> data
Id Date avg max min std
1 GE 2013-09-18 0.33445 0.4068 0.3015 0.03858874

Note: The FactSet AVG function returns the average, or mean, value of the data values
requested and ignores non-available data over the specified time period. For example,
when calculating the average annual sales over the last 10 years, if one out of the 10
years is unavailable, you will still get an average using the 9 years of available data.
The FactSet STD function returns the standard deviation by first finding the average of
the data set. Each data item is then subtracted from the average, and the difference is

19 | P a g e
squared. The sum of the squared values is divided by the number of data items minus
one. The function returns the square root of that value.

Example 7:
In this example, retrieve the last 2 quarters of EPS and price for the current constituents
of the S&P 500 using the FQL codes FF_SALES and P_PRICE and the names of the
companies using the FQL code PROPER_NAME. The universe, which is specified as
the S&P 500, is based on the FQL code ISON_SP500, returns the current constituents
of the S&P 500.

> data <-FF.ExtractFormulaHistory("","proper_name,ff_eps(qtr,0,-1,Q),p_price(0,-


1,q)","","ison=sp500");

Here is the R output:

Summary
Rows:2368 Columns:5
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date (Date: MM/DD/YY)
Col (3): Type: character Name: proper.name (Proper Name for Company)
Col (4): Type: double Name: ff.eps (Earnings Per Share - Fiscal Period)
Col (5): Type: double Name: p.price (Price - Close or Current Intraday)

> data

Id Date proper.name ff.eps p.price


1 17290810 2013-09-18 Cintas Corporation NA NA
2 17290810 2013-02-28 Cintas Corporation 0.6000 43.90000
3 17290810 2013-05-31 Cintas Corporation 0.6900 45.65500
4 41308610 2013-09-18 Harman International Industries, Incorporated NA NA
5 41308610 2013-03-28 Harman International Industries, Incorporated 0.5000 NA

20 | P a g e
Example 8:
In this example, retrieve proprietary data stored uploaded into FactSet and stored in an
Open FactSet Database (OFDB). OFDB is a high-performance multi-dimensional
database system used to securely store proprietary numeric and textual data on
FactSet.

OFDB is ideal for users who manage large portfolios or maintain extensive historical
proprietary databases. OFDB optimizes large, multi-dimensional databases, giving
FactSet users highly flexible, factset access to large volumes of complex data that can
be used in many different applications. OFDB is based upon Online Analytical
Processing technology, which is the basis for multi-dimensional databases.
Retrieve the latest closing price using P_PRICE for the constituents of an OFDB, titled
in this example 401KFUND. To test this example, reference an actual OFDB file that is
stored.

Note: When data is extracted from an OFDB and no directory, such as Client or
Personal is specified, the default path is referencing the Client directory within the
FactSet workstation.

> data <-FF.ExtractFormulaHistory("","P_PRICE(0D)","","ofdb=401KFUND",);

Note: When using the ofdb parameter, the retrieved constituents are current only. In
order to extract a more dynamic universe of constituents of an OFDB as of a specific
date, an ofdbDate argument must be used. The request would thus be set up as:

> data <-


FF.ExtractFormulaHistory("","P_PRICE(0D)","","ofdb=401KFUND","ofdbDate=201
30710");

21 | P a g e
Example 9:
In this example, extract the last 5 month end prices for a universe of 500 securities. The
US_UNIV function is used to narrow down that universe of 500 companies. This
function returns the companies (including research companies and dually-listed
Canadian companies) that pass given screening parameters.
In this example, the securities are screened on specified criteria, as of the most recent
date for each screening item. The 500 selected companies are ranked using the
URANKX function, which returns the absolute rank of the formula evaluated for each
company in the report relative to the companies in the specified universe. The
companies are ranked according to having the following criteria met: having a market
value greater than 10 million USD, price greater than 5 USD and the primary exchange
which they are listed on is in the United States.

Note: This function is most effectively used for extracting a smaller universe of
securities with the ExtractFormulaHistory function.There is a limit of 500 securities that
can returned from a universe using the US_UNIV function with the
ExtractFormulaHistory factlet. When using the US_UNIV function with the
ExtractDataSnapshot factlet, the data is returned as of one specified date but there is
no limit on the number of securities that can be returned from a universe that passes
given screening criteria. However, using the US_UNIV function with the
ExtractFormulaHistory function allows for history to be extracted.

> data <- FF.ExtractFormulaHistory("","p_price(0,-


4,m)","","universe=URANKX((EC_MKT_CAP(0,'CUR=USD')>10 AND
P_PRICE(0,USD)>5 AND CONTAINS(P_EXCOUNTRY,'UNITED STATES'))=1,
EC_MKT_CAP(0,'CUR=USD'))<=500S&uType=US_UNIV");

Here is the R output:

Summary
Rows:2500 Columns:3
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date (Date: MM/DD/YY)
Col (3): Type: double Name: p.price (Price - Close or Current Intraday)

> data
Id Date p.price
1 91301710 2013-04-30 9.129000e+01
2 91301710 2013-05-31 9.490000e+01

22 | P a g e
3 91301710 2013-06-30 9.294000e+01
4 91301710 2013-07-31 1.055700e+02
5 91301710 2013-08-31 1.001000e+02

Example 10:
In this example, for the securities IBM, Microsoft and Nokia, extract the total return from
2 trading days before latest quarterly EPS report date until 2 days after the latest
quarterly EPS report date. In this example demonstrating the use of addition, however,
subtraction, division and multiplication can be performed as well.

> data <-


FF.ExtractFormulaHistory("ibm,msft,nok","P_TOTAL_RETURN(FF_EPS_RPT_DA
TE(QTR,0)-1D,FF_EPS_RPT_DATE(QTR,0)+1D)");

Here is the R output summary:

Summary
Rows:3 Columns:3
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date (Date: MM/DD/YY)
Col (3): Type: double Name: p.total.return (Total Return - Simple)
> data

Id Date p.total.return
1 ibm 2013-07-03 -9.381408
2 msft 2013-07-03 3.261054
3 nok 2013-07-03 -14.245808

23 | P a g e
3.2.2 FF.ExtractDataSnapshot

The ExtractDataSnapshot function is used for extracting in R multiple items for a list of
ids for 1 date, both for equity or fixed income securities. This function is using FactSet
Screening Language. The FactSet Screening Language is a way to efficiently extract
data for a large universe of securities as of a single date.

The data can also be retrieved using a backtest date to avoid having look-ahead bias in
the analysis. The backtest functionality is available to clients who subscribe to one of
FactSets quantitative applications in the workstation, such as Alpha Testing, Portfolio
Simulation or SPAR (Style, Performance, and Risk) Fund Screening.

For a histogram depiction of the difference in time it takes to retrieve data as of one
point in time with ExtractFormulaHistory versus ExtractDataSnapshot, refer to Graphs 1
& 2 in Appendix.

Note: Many formulas in the Screening syntax are current only. If an option for a date
argument is not available when selecting a formula, this means that the formula does
not accept a date reference.

In R, the syntax for the FF.ExtractDataSnapshot function is:

data <- FF.ExtractDataSnapshot("ids","items",{ param,value} );


where,

data The name of the data structure to create, i.e. titled data or x.
ids CellString array with a list of one or more security identifiers.
Item(s) CellString array with a list of one or more FactSet data items in the
Screening language.

optional arguments,

backtestdate The backtest date as of which the data is retrieved. If no date is


specified, a backtest date will not be set. The date can be entered
using a relative date or absolute date.

currency The currency in which the data is to be returned, using a string with
the three character ISO code (e.g. USD or EUR).

Cal Calendar setting, arguments include:

24 | P a g e
LOCAL: Uses the local trading calendar for each security. Local
exchange holidays will be skipped.
FIVEDAY: Displays Monday through Friday, regardless of whether
there were trading holidays.

FIVEDAYEOM: Displays Monday through Friday including a


weekend date if it falls on the last day of the month. Where the
month-end does not fall on a weekend, the calendar will act just as
the standard five-day calendar.

SEVENDAY: Displays Monday through Sunday.


AAM: For Exchange code uses the calendar of a specific
exchange, represented by the exchange code. If there is no
calendar available for a specific exchange, the calendar will default
to FIVEDAY.

Note: The calendar setting does not get applied to the default date
output field when using ExtractDataSnapshot. To display a
corresponding date to the extracted value(s), with calendar settings
applied, a date code must be added as an item in the request
syntax.

25 | P a g e
Example 1:
This example is using the standard Screening syntax to retrieve the quarterly sales
value from the FactSet Fundamentals database for IBM using the Screening code
FF_SALES. The data is retrieved in currency set to Euro, as of 04/01/2011. The RP
default argument in the FactSet Fundamentals database codes reflects that the data is
the Latest Preliminary for the Reported Period (alternative arguments could be for
example RF, for the Latest Fully Reported Period, among others).

> data <-FF.ExtractDataSnapshot("ibm","ff_sales(QTR,20110401,RF,EUR)");

Here is the R output summary:


Summary
Rows: 1 Columns: 3
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date (Date: MM/DD/YY)
Col (3): Type: double Name: ff.sales (Sales)
> data
Id Date ff.sales
1 ibm 2013-09-18 17982.83

Note: See Table 1 in Appendix for the Screening syntax of the top 25 most frequently
used data items from the FactSet Fundamentals database.

Example 2:
This example is using the standard Screening syntax to retrieve the quarterly sales
values in USD from the FactSet Fundamentals database for Exxon Mobile and Statoil
using the Screening code FF_SALES(QTR,20110401).

> data <-FF.ExtractDataSnapshot("xom,stl-


no","ff_sales(QTR,20110401,RF,USD)");

Here is the R output summary:


Summary
Rows: 2 Columns: 3
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date (Date: MM/DD/YY)
Col (3): Type: double Name: ff.sales (Sales)
> data
Id Date ff.sales
1 xom 2011-10-17 101315

26 | P a g e
2 stl-no 2011-10-17 145648
Note: All Screening codes used in the item= parameters have their arguments in
different positions of their respective codes. For example, the currency argument for the
price code from the pricing database using P_PRICE has it in the 2ND position
P_PRICE(-5D,USD) , while the sales code from the FactSet Fundamentals database
using FF_SALES has it in the 4th position FF_SALES(QTR,-1,RP,USD).

Example 3:
In this example, instead of specifying securities in the ids field, as was done in
examples 1 and 2 above, an index universe is specified and the items code, such as
price or sales, is used for extracting data for all of the constituents of for example the
S&P 500. The syntax to extract the price from the pricing database is using the code
P_PRICE(20110401) and sales from the FactSet Fundamentals database is using the
code FF_SALES(QTR,20110401) for the current constituents of the S&P 500 using the
code ISON_SP500.

> data <-


FF.ExtractDataSnapshot("","ff_sales(QTR,20110401),p_price(20110401)","","ison=
sp500");

The universe is specified at the end of the code with the ison & sp500 arguments, which
are broken down from the actual Screening syntax for this universe which is using the
code ISON_SP500.

Here is the R output summary:

Summary
Rows: 500 Columns: 4
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date (Date: MM/DD/YY)
Col (3): Type: double Name: ff.sales (Sales)
Col (4): Type: double Name: p.price (Price - Close or Current Intraday)

> data
Id Date ff.sales p.price
1 17290810 2011-10-17 937.827 30.469999313354
2 41308610 2011-10-17 948.196 46.520000457764
3 80311110 2011-10-17 2220.000 17.89999961853
4 80589M10 2011-10-17 1281.000 39.689998626709
5 50242410 2011-10-17 3601.000 79.099998474121
6 91301710 2011-10-17 13344.000 85.319999694824
7 97665710 2011-10-17 1328.700 30.770000457764
8 00130H10 2011-10-17 4260.000 13.090000152588

27 | P a g e
Example 4:
In this example, retrieve the latest quarterly sales with the FactSet Fundamentals code
FF_SALES in local currency for the specified universe as the constituents of the MSCI
EAFE index. The Screening code for this universe is ISON_MSCI_EAFE(0,1). In the
output, the ID field brings back the CUSIPs of the companies in the index.

> data <-


FF.ExtractDataSnapshot("","ff_sales(QTR,0)","","ison=msci_eafe&isonParams=0,
1");

Here is the R output summary:

Summary
Rows: 942 Columns: 3
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date (Date: MM/DD/YY)
Col (3): Type: double Name: ff.sales (Sales)

Note: The isonParams portion of the code is used when specifying an index, as
demonstrated in this example and in Examples 5 and 6. Further details of the ISON
function options for the Universe specification are in Online Assistant page 2014.

Example 5:
In this example, extract the latest closing price for the specified universe as the
constituents of the MSCI USA index, using the pricing database code P_PRICE. The
Screening code for this Universe is ISON_MSCI_COUNTRY(984000,0,CLOSE,OFF). In
the output, the ID field brings back the CUSIPs of the companies in the index.

> data <-


FF.ExtractDataSnapshot("","p_price(0)","","ison=msci_country&isonParams=984
000");

Here is the R output summary:

Summary
Rows: 603 Columns: 3
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date (Date: MM/DD/YY)
Col (3): Type: double Name: p.price (Price - Close or Current Intraday)

28 | P a g e
Example 6:
In this example, extract the latest annual EPS ratio for the specified universe as the
constituents of the Russell 1000 Index, using the FactSet Fundamentals code FF_EPS.
The Screening code for this Universe is ISON_RUSSELL(1000,0). In the output, the ID
field brings back the CUSIPs of the companies in the index.
> data <-
FF.ExtractDataSnapshot("","ff_eps(ann,0)","","ison=russell&isonParams=1000");

Here is the R output summary:

Summary
Rows: 986 Columns: 3
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date (Date: MM/DD/YY)
Col (3): Type: double Name: ff.eps (Earnings Per Share - Fiscal Period)

Example 7:
In this example, extract the decile ranking of the S&P 500 companies based on the
most recently reported quarterly earnings per share (EPS) using the FactSet
Fundamentals formula FF_EPS. The FactSet UDECILE function returns the decile rank
(1-10) of a company against a specified universe when both the company and the
universe are evaluated for the same formula. The number 1 is the highest rank and is
assigned to the companies which fall within the top decile of the specified universe, in
this case the S&P 500.

> data <-


FF.ExtractDataSnapshot("","udecile(ison_sp500,ff_eps(QTR,0))","","ison=sp500")

Here is the R output summary:

Summary
Rows: 500 Columns: 3
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date (Date: MM/DD/YY)
Col (3): Type: double Name: udecile (Univ Decile Rank)

> data
Id Date udecile
1 17290810 2013-09-18 5
2 41308610 2013-09-18 10
3 80589M10 2013-09-18 6

29 | P a g e
For a comprehensive list of FactSet universe ranking functions that can be used with
the Screening Language, that include RANK, DECILE, PERCENTILE, and
QUARTILE see Online Assistant page 1707.

Example 8:
In this example utilize the backtest functionality to retrieve the latest quarterly sales
value and the corresponding fiscal period end date for a list of securities lagged by 45
days. To retrieve sales the FactSet Fundamentals code is FF_SALES and for
retrieving the Fiscal Period End date in MM/YYYY format the FactSet Fundamentals
code is FF_FP_END_DATE.

When using the lag argument (lag options: specified number of days, weeks, months,
quarters, or years), FactSet retrieves data as it was known at the time of the
rebalance date. For example, if returns are calculated for the universe rebalanced in
December 1990, a custom P/E formula can be set up using the price in December
1990, then lag the date of the earnings (to the most-recently reported quarter at that
point in time), for example, to September. By lagging EPS, it is possible to use the
P/E that was known to the public in December 1990.

A lag argument does not need to be added to pricing and shares formulas to avoid
look-ahead bias, because these are bits of information that would have been publicly
known at the time of the backtest date.

> data <-FF.ExtractDataSnapshot("ibm,hd,pg,fds,f-


it","FF_FP_END_DATE(QTR,0 L45D),FF_SALES(QTR,0 L45D)","20110131");

Note: In order for the backtest date to get set, do not enter backtetdate=20110131,
just 20110131.

Here is the R output summary:

Summary
Rows: 5 Columns: 4
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date (Date: MM/DD/YY)
Col (3): Type: character Name: ff.fp.end.date (Fiscal Period End Date:
MM/YYYY)
Col (4): Type: double Name: ff.sales (Sales)

> data
Id Date ff.fp.end.date ff.sales
1 ibm 2011-01-31 09/2010 24271.000
2 hd 2011-01-31 10/2010 16598.000

30 | P a g e
Alternatively, in order to retrieve the same data but with setting a relative date of -1D
as the backtest date, the following syntax would be used. In this example a backtest
date is set as of 2 trading days ago.

>> data <-FF.ExtractDataSnapshot("ibm,hd,pg,fds,f-


it","FF_FP_END_DATE(QTR,0 L45D),FF_SALES(QTR,0 L45D)","-1D");

Here is the R output:

Summary for ExtractDataSnapshot


Rows:5 Columns:4
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date (Date: MM/DD/YY)
Col (3): Type: character Name: ff.fp.end.date (Fiscal Period End Date:
MM/YYYY)
Col (4): Type: double Name: ff.sales (Sales)

Id Date ff.fp.end.date ff.sales


1 ibm 2014-02-25 12/2013 27699.000
2 hd 2014-02-25 10/2013 19470.000
3 pg 2014-02-25 12/2013 22280.000
4 fds 2014-02-25 11/2013 222.975
5 f-it 2014-02-25 12/2013 24001.000

31 | P a g e
Example 9:
In this example, extract valuation data for 2 bonds the name of the company issuing
the bond with the code FI_NAME_ISS and the value of the bond with the code
FTID_PRICE. The FI_NAME_ISS code retrieves along with the company name the
coupon and maturity date of the bond. The data is retrieved using the bond identifiers
00077TAA for ABN Bank and 88579EAE for 3M. For more details regarding the
FactSet Fixed Income Manager refer to Online Assistant page 15203.

> data <-


FF.ExtractDataSnapshot("88579EAE,00077TAA","FI_NAME_ISS(0),FTID_PRICE(
0)","","universeGroup=DEBT");

Note: Fixed income securities need to use the universeGroup=debt argument.

Here is the R output summary:

Summary
Rows: 2 Columns: 4
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date (Date: MM/DD/YY)
Col (3): Type: character Name: fi.name.iss (Name-Issue)
Col (4): Type: double Name: ftid.price (Price)

> data
Id Date fi.name.iss ftid.price
1 88579EAE 2011-10-24 3M Co. 4.375% 15-AUG-2013 107.767997741699
2 00077TAA 2011-10-24 ABN AMRO Bank NV 7.75% 15-MAY-2023 104.765998840332

32 | P a g e
Example 10:
In this example, retrieve proprietary data stored uploaded into FactSet and stored in
an Open FactSet Database (OFDB). OFDB is a high-performance multi-dimensional
database system used to securely store proprietary numeric and textual data on
FactSet.

OFDB is ideal for users who manage large portfolios or maintain extensive historical
proprietary databases. OFDB optimizes large, multi-dimensional databases, giving
FactSet users highly flexible, factset access to large volumes of complex data that
can be used in many different applications. OFDB is based upon Online Analytical
Processing technology, which is the basis for multi-dimensional databases.
Retrieve the latest closing price using P_PRICE for the constituents of an OFDB,
titled in this example 5002_EAGLE. To test this example, reference an actual OFDB
file that is stored.
> data <-FF.ExtractDataSnapshot("","P_PRICE(0D)","","ofdb=401KFUND");
Note: When using the ofdb parameter, the retrieved constituents are current only. In
order to extract a more dynamic universe of constituents of an OFDB as of a specific
date, an ofdbDate argument must be used. The request would thus be set up as:

> data <-


FF.ExtractDataSnapshot("","P_PRICE(0D)","","ofdb=401KFUND","ofdbDate=20
130710");

33 | P a g e
Example 11:
In this example, extract the price for the universe of 5 comparable companies to IBM
using the Universe argument to returns the companies that pass given screening
parameters.

The Universe argument is combined in this example with the COMPARE_ function,
which generates a list of comparable companies for a specified target company using
a specific database. Depending on which COMPARE database is used, the
corresponding database grouping and comparison formulas must be used as well.
For example, if you choose COMPARE_FF_ADRS, you must use the FactSet
Fundamentals-specific grouping and comparison formulas. For a comprehensive list
of database specific COMPARE functions, refer to Online Assistant page 11213.

The 5 comparable companies to IBM in this example are from the FactSet
Fundamentals database (excluding ADRs), in IBM's FactSet Industry, screened by
net income, using the FactSet Fundamentals database code FF_NET_INC.

> data <-


FF.ExtractDataSnapshot("","P_PRICE","","UNIVERSE=COMPARE_FF_NOADRS
(IBM,PUBLIC:F_FACTSET_INDUS_N,PUBLIC:FF_NET_INC(ANN,0),5)");

Here is the R output summary:

Summary
Rows:5 Columns:3
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date (Date: MM/DD/YY)
Col (3): Type: double Name: p.price (Price - Close or Current Intraday)

> data
Id Date p.price
1 620019 2012-10-07 4145.00
2 620514 2012-10-07 14700.00
3 624185 2012-10-07 108.95
4 658968 2012-10-07 5680.00
5 626705 2012-10-07 6840.00

34 | P a g e
Example 12:
In this example, the PMW function is used to return portfolio-specific information from
valid Portfolio Analysis portfolios (e.g., OFDB, CSTM, ACCT, PRT, and Benchmark
files). These functions are similar to OFDB functions, which can also be used to
return information from OFDB databases, but are tailored for use with holdings
databases used in Portfolio Analysis.

PMWU Returns a universe of companies from a given portfolio.


PMWDB Returns data from a specified column/field within a given portfolio.
PMWAT Returns asset type and asset classification data for a given portfolio.
PMWSM Returns data from the security master file.

By default, PMW* functions return split-adjusted data. They are available in


Screening syntax only and cannot be used with FQL. For further details on the PMW
function refer to Online Assistant page 11677.

Notes: A SHARES field is required within the specified database in order to return
data using PMW* functions. Since Portfolio Analysis is largely driven by the share
positions supplied in holdings databases, PMW* functions also require a SHARES
field to more closely replicate application behavior.

To access data from holdings databases using the PMW* codes, it is necessary to
first add the portfolio in Portfolio List Manager.

> data <-


FF.ExtractDataSnapshot("","PMWDB(#p1,shares,0),PMWAT(#p1,0)","&p1=CLIE
NT:SCCOMP.CSTM&universe=PMWU(#p1,0)=1")

Note: It is necessary to specify within the syntax, the portfolio file (e.g., OFDB,
CSTM, ACCT, PRT, and Benchmark files) as a global variable, denoted in the syntax
example above as p1.

35 | P a g e
Example 13:
In this example, using the SUM function, return the 20-quarter sum of price-to-sales
per share for BNP Paribas, beginning with the latest fully-reported quarter.

> data <- FF.ExtractDataSnapshot("BNP-FR","SUM20(ff_psales(QTR,0))");

Here is the R output summary:


Summary
Rows:1 Columns:3
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date (Date: MM/DD/YY)
Col (3): Type: double Name: sum20

> data

Id Date sum20
1 BNP-FR 2013-07-06 21.23788

Example 14:
In this example, for the securities BNP and Alcatel-Lucent, add the latest annual
operating income to the general industry classification output flag. If that flag output is
a float value equal to 4, will add the operating income to one, if not, add operating
income to zero. In this example demonstrating the use of addition, however,
subtraction, division and multiplication can be performed as well.

> data <- FF.ExtractDataSnapshot("BNP-FR,ALU-


FR","FF_OPER_INC(ANN,0,RF)+IF(FLOAT(FF_GEN_IND)=4,1,0)");

Here is the R output summary:


Summary
Rows:2 Columns:3
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date (Date: MM/DD/YY)
Col (3): Type: double Name: ff.oper.inc (Operating Inc Before Unusual Items)

> data

Id Date ff.oper.inc
1 BNP-FR 2013-07-06 9044
2 ALU-FR 2013-07-06 -490

36 | P a g e
Example 15:
In this example, for the securities 3M and Conoco Phillips, extract the Permanent
Security ID (as defined by the Factset Symbology database).

> data<-FF.ExtractDataSnapshot("mmm,cop","fs_perm_sec_id(\'\')");

Here is the R output:

Summary for ExtractDataSnapshot


Rows:2 Columns:3
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date (Date: MM/DD/YY)
Col (3): Type: character Name: fs.perm.sec.id (Permanent Security ID From X
ID)

Alternatively, for the same securities the following syntax would be used to retrieve
the corresponding CUSIP. And to do that, the dataitemname= and heading=
paramaters must be used.

> data <-


FactSet.ExtractDataSnapshot("mmm,cop","(cusip)","&date=20001130","&headi
ng=,,cusip&dataitemname=,,cusip")

Here is the R output:

Summary for ExtractDataSnapshot


Rows:2 Columns:3
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date (Date: MM/DD/YY)
Col (3): Type: character Name: cusip (Company Cusip)

> data

Id Date cusip
1 mmm 2000-11-30 88579Y10
2 cop 2000-11-30 20825C10

37 | P a g e
3.2.3 FF.ExtractBenchmarkDetail

The ExtractBenchmarkDetail function is used for extracting in R multiple data items


for a benchmark. Benchmark data can be retrieved using other functions, such as
with FF.ExtractFormulaHistory, but the ExtractBenchmarkDetail function allows a
user to retrieve a more comprehensive overview of the index constituent data, without
additional codes or calculations. In the default output, identifiers are sorted in
descending order by weight in the index and each row shows the index id, company
id, date, ticker, and weight. Additional items are displayed at the end.

FactSet clients have access to Equity and Fixed Income Benchmarks, which include
Dow Jones, FTSE, MSCI, Russell, S&P, Barclays, and BofA Merrill Lynch, among a
number of others. Access to benchmarks is based on client subscription to various
benchmark providers.

In addition, FactSet Market Aggregates (FMA), combines data from FactSet


Fundamentals, Estimates and Prices to calculate ratios and per share values on an
aggregate level. FMA comprises over 3,500 benchmarks including S&P, Russell,
MSCI Global, FTSE, STOXX, TOPIX, and many local exchanges. Benchmarks also
include specific sector and industry level indices. This number is constantly
expanding based on client demand.

In R, the syntax for the FF.ExtractBenchmarkDetail function is:

d <-FF.ExtractBenchmarkDetail("ids","items","dates","cutoff");

where,

d The name of the data structure to create, i.e. titled data or x.


ids CellString array with a list of the benchmark identifiers.
Item(s) CellString array with a list of one or more FactSet data item
formulas.
Date(s) Dates can be entered in start:end:freq format. (e.g.
20101215:20110115:d)
Note: If an incorrect or large date range is set, the response time
may be delayed due to the large amount of data being returned.
cutoff Optional number of holdings to display, based on Market Cap.
Default displays to all holdings.

38 | P a g e
Note: Relative dates and frequencies in ExtractBenchmarkDetail differ from the
standard FactSet frequencies.Please see the table below:

Description
B B operates on a five-day calendar and will pull the latest weekday. 0B is the most
recent weekday. -1B is the prior weekday.
D D uses an actual frequency and will pull a daily date based on a seven-day
calendar. 0D is yesterday, regardless of day of the week. -1D is the day prior.
ME ME will pull the last day of the month. 0ME will pull the last trading day of the
latest month based off of a five-day calendar. -1ME will pull the prior month end.
M M uses an actual frequency and will pull the same day every month. 0M will pull
yesterdays date and -1M will pull the same date the month prior.
QE QE will pull the last day of the quarter. 0QE will pull the last trading day of the
latest quarter based off of a five-day calendar.
Q Q uses an actual frequency and will pull the same day every quarter. 0Q will
pull yesterdays date and -1Q will pull the same date the quarter prior.
YE YE will pull the last day of the year. 0YE will pull the last trading day of the year
based off of a five-day calendar. -1YE will pull the prior year end.
Y Y uses an actual frequency and will pull the same day every year. 0Y will pull
yesterdays date and -1Y will pull the same date the year prior.

Example 1:
In this example, extract the constituents of the S&P 500, company name data using
the code FG_COMPANY_NAME and Market Capitalization using the code
FG_MKT_VALUE.

> data <-


FF.ExtractBenchmarkDetail("SP50","items=FG_COMPANY_NAME,FG_MKT_VA
LUE");

Here is the R output:

Summary
Rows:500 Columns:6
Col (1): Type: character Name: BENCHMARK.ID
Col (2): Type: factsetdate Name: DATE (Date: MM/DD/YY)
Col (3): Type: character Name: SECURITY.ID
Col (4): Type: double Name: Weight
Col (5): Type: character Name: fg.company.name (Company Name)
Col (6): Type: double Name: fg.mkt.value (Market Value (Current Only))

39 | P a g e
> data

BENCHMARK.ID Date Security.Id Weight fg.company.name


fg.mkt.value
1 SP50 2011-09-30 03783310 3.429910700 Apple Inc.
89368.90625
2 SP50 2011-09-30 30231G10 3.427453829 Exxon Mobil Corp.
76668.03125
3 SP50 2011-09-30 45920010 2.028842189 IBM.
222840.375
4 SP50 2011-09-30 59491810 1.801355335 Microsoft Corp.
26045.609375
5 SP50 2011-09-30 16676410 1.798635785 Chevron Corp.
197514.15625
6 SP50 2011-09-30 47816010 1.694511873 Johnson & Johnson
174807.1875

Example 2:
In this example, extract the top 10 holdings for the S&P 500 and display the
companies securities price using the pricing database with the code P_PRICE and
the company name using the code PROPER_NAME.

> data <-FF.ExtractBenchmarkDetail


("SP50","&items=p_price,proper_name","&cutoff=10");

Note: The & is needed if there is more than one parameter entered, such as the
items and cutoff. When multiple parameters are entered they need to be separated
by an &.

Here is the R output:

Summary
Rows:10 Columns:6
Col (1): Type: character Name: BENCHMARK.ID
Col (2): Type: factsetdate Name: DATE (Date: MM/DD/YY)
Col (3): Type: character Name: SECURITY.ID
Col (4): Type: double Name: Weight
Col (5): Type: double Name: p.price (Price - Close or Current Intraday)
Col (6): Type: character Name: proper.name (Proper Name for Company)

> data

40 | P a g e
BENCHMARK.ID Date Security.Id Weight p.price
proper.name
1 SP50 2011-09-30 03783310 3.429911 419.989990234375 Apple
Inc.
2 SP50 2011-09-30 30231G10 3.427454 77.470001220703 Exxon Mobil
Corp.
3 SP50 2011-09-30 45920010 2.028842 186.589996337891 IBM
Corp.
4 SP50 2011-09-30 59491810 1.801355 26.979999542236 Microsoft
Corp.
5 SP50 2011-09-30 16676410 1.798636 98.610000610352 Chevron
Corp.
6 SP50 2011-09-30 47816010 1.694512 63.790000915527 Johnson &
Johnson
7 SP50 2011-09-30 74271810 1.684962 64.26000213623 Procter & Gamble
Co.
8 SP50 2011-09-30 00206R10 1.640369 29.020000457764 AT&T
Inc.
9 SP50 2011-09-30 36960410 1.567960 16.229999542236 General Electric
Co.
10 SP50 2011-09-30 19121610 1.505601 67. Coca-Cola
Co.

Example 3:
In this example, extract the price using the pricing database code P_PRICE for the
S&P 500 constituents, denoted with the identifier SP50.

> data <-


FF.ExtractBenchmarkDetail("SP50","items=p_price","&dates=20110115:201101
17:d");

Here is the R output:

Summary
Rows:1500 Columns:5
Col (1): Type: character Name: BENCHMARK.ID
Col (2): Type: factsetdate Name: DATE (Date: MM/DD/YY)
Col (3): Type: character Name: SECURITY.ID
Col (4): Type: double Name: Weight
Col (5): Type: double Name: p.price (Price - Close or Current Intraday)

41 | P a g e
> data

BENCHMARK.ID Date Security.Id Weight p.price


1 SP50 2010-12-31 30231G10 3.22587154
77.839996337891
2 SP50 2010-12-31 03783310 2.58872124
348.480010986328
3 SP50 2010-12-31 59491810 1.83909735
28.299999237061
4 SP50 2010-12-31 36960410 1.70496605
18.817499160767
5 SP50 2010-12-31 16676410 1.60662046
92.830001831055

Example 4:
In this example, extract for the constituents of fixed income index Barclays Capital
EUR Corporate (1-5Y), the names of the constituents which include the fixed income
securities coupon rate and maturity date. The index identifier is LHMN6732.

> data <-


FF.ExtractBenchmarkDetail("lhmn6732","items=lbc_name&universeGroup=deb
t")

Here is the R output:

Summary
Rows:771 Columns:5
Col (1): Type: character Name: BENCHMARK.ID
Col (2): Type: factsetdate Name: DATE (Date: MM/DD/YY)
Col (3): Type: character Name: SECURITY.ID
Col (4): Type: double Name: Weight
Col (5): Type: character Name: lbc.name (Bond Name)
Note: Fixed income indices need to use the universeGroup=debt argument.

Example 5:
In this example, extract the S&P GICS classified sector names for the constituents of
the S&P 500.

42 | P a g e
> data<-
FF.ExtractBenchmarkDetail("sp50","items=_SP_CLASS_GICS(0,,,\'SEC\',\'NAM
E\')","&dates=20120101");

Here is the R output:

Summary for ExtractBenchmarkDetail


Rows:500 Columns:5
Col (1): Type: character Name: BENCHMARK.ID
Col (2): Type: factsetdate Name: DATE (Date: MM/DD/YY)
Col (3): Type: character Name: SECURITY.ID
Col (4): Type: double Name: Weight
Col (5): Type: character Name: sp.class.gics (Classification - GICS Sector,
Industry Group, Industry or Sub-Industry)
> data

BENCHMARK.ID DATE SECURITY.ID Weight sp.class.gics


1 SP50 2011-12-30 30231G10 3.56848516 Energy
2 SP50 2011-12-30 03783310 3.30619579 Information Technology
3 SP50 2011-12-30 45920010 1.90359360 Information Technology
4 SP50 2011-12-30 16676410 1.86116605 Energy
5 SP50 2011-12-30 59491810 1.70714349 Information Technology

Note: The ExtractBenchmarkDetail factlet by default works with Screening codes


entered in the items argument of the syntax. If using an FQL code, enter an _
argument before the FQL items code, as illustrated in this example using
_SP_CLASS_GICS.

3.2.4 FF.ExtractEconData

The ExtractEconData function is used in R to extract a broad array of macroeconomic


content, interest rates and yields, country indices and various exchange rate
measures from both the FactSet Economics and the Standardized Economic
databases.

FactSet Economics is a database of primary-sourced information on the global


economy. The database includes specialty sources such as Eurostat, ICIS, IMF,
LME, NYMEX, and OECD. For a comprehensive list of economic databases available
on FactSet please refer to http://www.factset.com/data/data/economic.

Each data series from the database has a mnemonic identifying that requested
series. For example, GDP published by the National Bureau of Statistics of China
Seasonally Adjusted, will have an id or mnemonic assigned to it thats different from a
mnemonic assigned for Chinas GDP value that is not seasonally adjusted. To find
the mnemonic for a series, use the Series Lookup. For a demonstration covering how
to use the Series Lookup refer to FactSet Online Assistant page 15694.

43 | P a g e
Note: Table 2 in Appendix lists the Key Indicator series from the FactSet Economics
database for the G-7 Countries.

The following sections display the syntax for extracting data for from the FactSet
Economics database, data from the FactSet Economics database with
transformations applied, and data from the Standardized Economic database in R.

I. SYNTAX FOR FACT SET ECONOMICS DATA IN R

The following syntax is for extracting data from the FactSet Economics database in R
without any applied transformations:

data <- FF.ExtractEconData("","DB_SOURCE_DATA ('item mnemonic',


{start date}, {end date}, {frequency}, {optional parameter value for conv,
dist and nfb})");

where,

data The name of the data structure to create, i.e. titled data or x

Place holder for FactSet data fetch channel.

db_source Pertains to the FactSet Economics database.


Note: After specifying a database source, the syntax should be _
DATA for each. (i.e. FDS_ECON_DATA, SPEC_ID_DATA)
FDS_ECON = FactSet Economics
FDS_COM = FactSet Commodities
SPEC_ID = FactSet
IMF_IFS = IMF
OECD_MEI = OECD
EURO_STAT = EuroStat
TCB_CCI = Conference Board
ONS_ECON = UK Office for National Statistics

item String specifying the economic series mnemonic, i.e. US GDP


the mnemonic BEANIPAA191RL1@US from series
FDS_ECON[BEANIPAA191RL1@US]
Note: Table 1 in Appendix lists the Key Indicator series
(dbsource and mnemonic) from the FactSet Economics database
for the G-7 Countries.

44 | P a g e
start date start date entered in mm/dd/yyyy format.
Alternate method of entering dates entered in start:end:freq
format. (i.e. 20101215:20110115:d).

end date end date entered in mm/dd/yyyy format.


Alternate method of entering dates entered in start:end:freq
format. (i.e. 20101215:20110115:d).

frequency String with a valid FactSet frequency (i.e. d,w,m,q,y).


Note: A frequency argument is necessary to retrieve the data.

conv The conversion technique for aggregating periods, when a data


series of a higher frequency is converted to a lower frequency;
for example, converting a quarterly series to an annual series.
(i.e. SUM, AVERAGE, or AVERAGENP which excludes NAs).

dist The distribution technique for spreading over periods when a


data series of a lower frequency is distributed to a higher
frequency; for example, distributing an annual series to a
quarterly series. (i.e. STEP, EVEN, NONE)

nfb NFB is the optional "no feel back" argument in FQL codes. If you
do not use the NFB argument, the returned data series will
contain NAs where the data is not available (default is NFB=1). If
you want the data to "feel back" over NAs to find the last actual
data point and carry this data forward, set the NFB argument to
either 0 or 2.
Example 1:
This example retrieves industrial production data for the United States using the
FactSet Economics database as identified by the FDS_ECON argument in the code,
starting 122 months ago (denoted with -121) until two months ago (denoted with -1).

> ffprod <- FF.ExtractEconData ("","FDS_ECON_DATA('FRBIPSB50001',-121,-


1,M,STEP,AVERAGE,1)");

Here is the R output summary:

Summary
Rows: 121 Columns: 3
Col (1): Type: character Name: Id
Col (2): Type: date Name: Date
Col (3): Type: character Name: fds.econ.data

45 | P a g e
To retrieve the industrial production data enter:

> ffprod

Id Date fds.econ.data
1 fds_econ_data 2002-02-28 87.736701965332
2 fds_econ_data 2002-03-28 88.420600891113
3 fds_econ_data 2002-04-30 88.764198303223
4 fds_econ_data 2002-05-31 89.266998291016
5 fds_econ_data 2002-06-28 90.108901977539

Example 2:
This example retrieves the last 31 days of WTI commodity data using the FactSet
Economics database denoted with SPEC_ID.
> data <- FF.ExtractEconData ("","SPEC_ID_DATA('WTI-FDS:FG_PRICE',0,-
30,D)");

Here is the R output summary:

Summary
Rows: 31 Columns: 3
Col (1): Type: character Name: Id
Col (2): Type: date Name: Date
Col (3): Type: character Name: spec.id.data

> data
Id Date spec.id.data
1 spec_id_data 2012-03-13 106.709999084473
2 spec_id_data 2012-03-14 105.430000305176
3 spec_id_data 2012-03-15 105.110000610352
4 spec_id_data 2012-03-16 107.059997558594
5 spec_id_data 2012-03-19 108.089996337891

Example 3:
In this example, extract multiple data series from the IMF database population for
the United States, denoted with series IMF_IFS[11199Z_F], and population for the
UK, denoted with series IMF_IFS[11299Z_F]. The optional argument tsName can be
used to display the mnemonics for each series in the heading, using the following
syntax:

46 | P a g e
> data <-FF.ExtractEconData("","IMF_IFS_DATA('11199Z_F',31/12/2000,-
1,y),IMF_IFS_DATA('11299Z_F',31/12/2000,-1,y)&tsName=Y");

Here is the R output summary:

Summary
Rows:9 Columns:4
Col (1): Type: character Name: Id
Col (2): Type: factsetdate Name: Date
Col (3): Type: double Name: x11199Z.F
Col (4): Type: double Name: x11299Z.F

> data
Id Date x11199Z.F x11299Z.F
1 imf_ifs_data 2003-12-31 296.928009033203 59.666999816895
2 imf_ifs_data 2004-12-31 299.821014404297 59.958000183105
3 imf_ifs_data 2005-12-30 302.740997314453 60.261001586914
4 imf_ifs_data 2006-12-29 305.696990966797 60.575000762939
5 imf_ifs_data 2007-12-31 308.674011230469 60.898998260498
6 imf_ifs_data 2008-12-31 311.665985107422 61.23099899292
7 imf_ifs_data 2009-12-31 314.658996582031 61.564998626709

Example 4:
In this example, extract multiple data series from the Eurostat and FactSet
Economics database sources. The series are - Consumer Survey Consumer
confidence indicator Balance for the Euro Zone, denoted with series
EURO_STAT[CONSCONFBAL@EUZ], and US Consumer Confidence, denoted with
series TCB_CCI[CCI].

> data <-


FF.ExtractEconData("","EURO_STAT_DATA('CONSCONFBAL@EUZ',0,-
11,M),TCB_CCI_DATA('CCI',0,-11,M)");

Here is the R output summary:

Summary
Rows: 12 Columns: 4
Col (1): Type: character Name: Id
Col (2): Type: date Name: Date
Col (3): Type: character Name: euro.stat.data
Col (4): Type: character Name: tcb.cci.data

47 | P a g e
> data
Id Date euro.stat.data tcb.cci.data
1 euro_stat_data 2011-04-29 -12. 66.019317626953
2 euro_stat_data 2011-05-31 -10.199999809265 61.742794036865
3 euro_stat_data 2011-06-30 -10. 57.618946075439
4 euro_stat_data 2011-07-29 -11.5 59.227939605713
5 euro_stat_data 2011-08-31 -16.799999237061 45.181694030762
6 euro_stat_data 2011-09-30 -19.299999237061 46.368515014648

II. SYNTAX FOR FACT SET ECONOMICS DATA USING FUNCTIONS I N R

FactSet provides functions that are used to easily manipulate and analyze economic
time-series data. ECON_EXPR_DATA is used to wrap a time series expression
around a function. The arguments such as start date, end date, and frequency are
part of the ECON_EXPR_DATA code, and the function calculation is included within
quotes. The syntax for using functions is:

data <-FF.ExtractEconData("",'ECON_EXPR_DATA
(\'FUNCTION(dbsource[item])\', {start date}, {end date}, {frequency},
{optional parameter value})');

Example 1:
This example retrieves the z-score of the Greece unemployment rate with FactSet
Economics series FDS_ECON[GRLM0347861].

> data <-


FF.ExtractEconData('','ECON_EXPR_DATA(\'ZSCORE(FDS_ECON[GRLM034786
1])\',-10,0,m,step,average)');

Here is the R output summary:

Summary
Rows: 11 Columns:3
Col (1): Type: character Name: Id
Col (2): Type: date Name: Date
Col (3): Type: character Name: econ.expr.data
> data
Id Date econ.expr.data

48 | P a g e
1 econ_expr_data 2011-05-31 -0.892607092857
2 econ_expr_data 2011-06-30 -1.167841553688
3 econ_expr_data 2011-07-29 -0.921562194824
4 econ_expr_data 2011-08-31 -0.080500453711

The FactSet ZSCORE function, expressed in units of the distribution's standard


deviation, calculates how far and in what direction the specified series deviates from
the distribution mean of data points in the array.

Example 2:
In this example, extract 10 years of history for the growth of U.S. core inflation by
applying a year-over-year FactSet growth rate function. The FactSet Economics
series FDS_ECON[BLSCUSR0000SA0L1E] has a RETURNS function applied to
calculate the percent change of a specified economic series over a given time
interval. For more details regarding the RETURNS function, refer to Online Assistant
page 11413.

> data <-


FF.ExtractEconData('','ECON_EXPR_DATA(\'RETURNS(FDS_ECON[BLSCUSR0
000SA0L1E], -1AY)\',0,0/0/-10,M)');

Here is the R output summary:

Summary
Rows: 120 Columns: 3
Col (1): Type: character Name: Id
Col (2): Type: date Name: Date
Col (3): Type: character Name: econ.expr.data

> data
Id Date econ.expr.data
1 econ_expr_data 2001-09-28 2.633023262024
2 econ_expr_data 2001-10-31 2.628684043884
3 econ_expr_data 2001-11-30 2.730751037598

Example 3:

49 | P a g e
In this example, extract the year-over-year annualized GDP growth for Greece, with
the FactSet Economics GDP series from the Eurostat database
EURO_STAT[GDPURNS@GR].

> data <-


FF.ExtractEconData('','ECON_EXPR_DATA(\'RETURNS(EURO_STAT[GDPEURN
S@GR], -1AY)\',0/0/-10,0,Y)');

Here is the R output summary:

Summary
Rows: 40 Columns: 3
Col (1): Type: character Name: Id
Col (2): Type: date Name: Date
Col (3): Type: double Name: econ.expr.data

> data
Id Date econ.expr.data
1 econ_expr_data 2002-12-31 6.95708990097
2 econ_expr_data 2003-12-31 10.098779678345
3 econ_expr_data 2004-12-31 7.443261146545
4 econ_expr_data 2005-12-30 4.201591014862
5 econ_expr_data 2006-12-29 8.206796646118

III. SYNTAX FOR STANDARDIZED ECONOMIC DATABASE

The FF.ExtractEconData function also provides access to FactSets


Standardized Economic database. This database includes a wide variety of
commonly-used economic items that are consistently standardized by FactSet across
nearly 100 countries.

When using economic data, you may have problems dealing with various reporting
standards across countries. For example, United States Real GDP has a base year
of 2005, whereas Japan's Real GDP has a base year of 2000. Items are also be
reported in different currencies, making direct country-to-country comparisons
difficult.

Standardization methodology:

50 | P a g e
Base year: 1997;
Currency: USD (GDP and GDPR are exceptions);
All data is expressed at an annual rate;
Seasonally adjusted (SA) data is used whenever possible. However, in
situations where the not seasonally adjusted data (NSA) is updated in a
timelier manner or contains more history, NSA data may be used instead.

To create each standardized economic data item, FactSet first searches the FactSet
Economics databases to find the appropriate primary source data series for each
country. If a data series cannot be found for a given country, it is constructed using
other series wherever possible, and any necessary mathematical transformations are
applied. The standardized data items may combine data from the country statistical
agency or central bank, Eurostat, the IMF, or the OECD in order to provide as much
history as possible.

Note: For a table of country identifiers and standardized codes see Tables 3 and 4 in
Appendix. Not all standardized economic data items are available for all countries.

The following syntax is used to retrieve the FactSet Economics standardized


data:

data <-FF.ExtractEconData("",'ECON_EXPR_DATA
(\'DB_SOURCE[Country Id:item]\', {start date}, {end date}, {frequency},
{optional parameter value})');

Example 1:
This example retrieves standardized Current Account Balance, in Billions of Dollars at
Year End for the UK using the country identifier CC_GB and the standardized
FactSet Economics code FDS_ECON_BOPCURR_Y.

> data <-


FF.ExtractEconData('','ECON_EXPR_DATA(\'SPEC_ID[CC_GB:FDS_ECON_BOP
CURR_Y]\',-10,-1,Y)');

Here is the R output summary:

Summary
Rows: 10 Columns: 3
Col (1): Type: character Name: Id
Col (2): Type: date Name: Date

51 | P a g e
Col (3): Type: character Name: econ.expr.data

> data
Id Date econ.expr.data
1 econ_expr_data 2000-12-29 -38.800300598145
2 econ_expr_data 2001-12-31 -30.280799865723
3 econ_expr_data 2002-12-31 -27.858200073242
4 econ_expr_data 2003-12-31 -30.002000808716

Chapter 4. Formula Lookup in R


Sidebar is a formula lookup that provides a robust way of searching for FactSet data
formulas along with formula details and definitions. The integration of Sidebar into R
provides a seamless way of finding FactSet Query Language (FQL) and Screening
request codes directly in R. Upon launching the GUI, it is possible to search for
identifiers and formulas, select multiple identifiers and a single formula at a time
would then be inserted into R, translated into the appropriate request syntax.

4.1 Launching Formula Lookup in R


The command prompt to launch the formula lookup in R is:
FactSet.SideBar();

Note: It is necessary to be logged into the FactSet workstation for Sidebar to load. If
not already logged in, will be prompted to log into the FactSet workstation when
running the FactSet.SideBar() command.

52 | P a g e
The following Sidebar GUI will launch:

4.2 Searching for Data


The FactSet formula lookup allows users to streamline the process of creating
FactSet formulas. It features targeted search results, type-ahead search functionality
for identifiers, and function-building capability.

4.2.1 Identifier Lookup


The process of searching for and extracting data in Sidebar involves entering
identifiers for equities, indices and yields, among other categories. The identifier can
be entered directly in the Enter ID field which utilizes type-ahead functionality or
searched for by launching the Identifier Lookup magnifying glass, as displayed in the
screenshot below.

53 | P a g e
4.2.2 Search for Data Formulas
Data Items are searched for by entering keywords in the Formula Lookup section.
There is a thesaurus built in, so that the data item search is not a text search for the
entered keyword. By default, the returned list of formulas will match all of the
databases based on a users subscription.

To limit search results to FactSet Recommended formulas only, click the FactSet
Recommended button . To control which formula libraries are being searched,
click the Filter button . The option is available to toggle between FQL and
Screening codes.

Once a formula is selected, a Formula Arguments section loads, in which it is


possible to specify the report basis, date, frequency, currency, and other formula
arguments that are specific to the data item selected, using the drop-down menus.

54 | P a g e
A Definition section can also be expanded to view the formula name, data source,
and description. Once an identifier and data item are selected, the Formula
Workspace section can be expanded to add a function.

Using Insert Formula, the formula is then inserted into R, translated into the
appropriate FactSet function request syntax.

Note: The economic data has not yet been integrated into Sidebar and the Series
Lookup in the workstation still needs to be used to search for this data and set up the
FF.ExtractEconData function. Additionally, multiple identifiers but one data item can
be selected and inserted at one time.

4.2.3 Insert FactSet Formula into R


Once the formula is inserted into R, the selected formula is translated into the
appropriate FactSet request syntax, as discussed in Chapter 3.

For example, when in FQL mode and selecting five years of annual sales history for
Exxon Mobile and Statoil in USD, the inserted formula gets translated into the
FF.ExtractFormulaHistory function request syntax, as demonstrated below:

55 | P a g e
Alternatively, when switching to the Screening mode to extract data for multiple
securities as of one date, the most recent fiscal year-end sales in USD for Exxon
Mobile and Statoil, the inserted formula gets translated into the
FF.ExtractDataSnapshot function request syntax, as demonstrated below:

56 | P a g e
Note: The following is the comprehensive list of factlets that can get returned when
data items are inserted from Sidebar into R.

FF.CorporateActionsDividends
FF.CorporateActionsSplits

57 | P a g e
FF.ExtractBenchmarkDetail when an equity or fixed income index identifier is
selected in Screening mode the selected item will be inserted in the
ExtractBenchmarkDetail factlet. To extract index data using the
ExtractFormulaHistory factlet, FQL mode must be selected.
FF.ExtractDataSnapshot
FF.ExtractEconData only data from the standardized economic database is
returned. To extract data from the FactSet Economics Global database, using the
ExtractEconData factlet, the syntax can still be set up manually, as discussed in
section 3.3.4 above.
FF.ExtractFormulaHistory
FF.ExtractOptionsSnapshot
FF.LSD_Ownership
FF.FactSetEstimatesActuals
FF_FactSetEstimatesBrokerDetail
FF.FactSetEstimatesConsensus
FF.FactSetEstimatesGuidance
FF.FactSetEstimatesSurprise

Chapter 5. Upload R Data into an OFDB


The UploadToOFDB functionality allows clients to upload R data into an OFDB file
stored in Data Central in the FactSet workstation.

58 | P a g e
OFDB, which stands for Open FactSet Database, is a high-performance multi-
dimensional database system used to securely store proprietary numeric and textual
data on FactSet and can be time-series or non-time series databases. OFDB is ideal
for users who manage large portfolios or maintain extensive historical proprietary
databases. OFDB optimizes large, multi-dimensional databases, giving FactSet users
highly flexible, fast access to large volumes of complex data that can be used in
many different applications.

Note: The optimal use of the UploadToOFDB functionality from R is for ad-hoc and
smaller scale data uploads and would not replace a clients needs for FTP processes
or production services, for larger scale or holdings uploads into FactSet.

5.1 Requirements for UploadToOFDB in R

The following are the necessary requirements to upload R data into an OFDB:

Data set must have at least 1 ID, Date and Items field;
o Fields uploaded can be iterated of any frequency or non-iterated;
o Date types can be High Precision, Integer, or Text;
o Dates need to be uploaded as integers in YYYYMMDD format.

Data Central subscription in the FactSet workstation is necessary;

o Basic data storage access available to all clients with a premium


FactSet workstation in Data Central is 1GB of storage space. Additional
data storage is available and should be discussed with a FactSet sales
representative.
o If attempting to upload data to a full OFDB file and thus exceeding data
storage space access, there will be an error message after running an
upload from R notifying that data storage access is full. The error
message -"Client Data Space is Full" will be displayed in R,
o FactSet does not need to be launched when uploading data into an
OFDB.

Note: A Comprehensive list of error messages is available in Table 5 in the


Appendix.

5.2 OFDB

59 | P a g e
5.2.1 Creating a New OFDB
The following details are regarding the behavior of an OFDB file that is created
through R:

If the OFDB does not already exist, it will be created.


If created by UploadToOFDB, all fields will be Iterated with Daily Frequency
and data type High Precision for numbers and Text(32) for strings.
OFDB schemas define the database. If another schema is required for the
OFDB file, it should first be created in Data Central. For more details regarding
creating or editing schemas refer to Online Assistant page 11502 within the
FactSet workstation.
Once an OFDB is created, no changes to the schema can be made through
the UploadToOFDB functionality. A new OFDB would need to be created to
make the necessary changes.

5.2.2 Modifying an Existing OFDB


The following details are regarding modifying an OFDB file that is created through R,
when adding additional dates or values to that file:

Data for an additional date can be appended for existing securities in an OFDB
file.

Data for additional securities can be appended to an OFDB file for the existing
dates in the file or for a new date range.

New Data items cannot be appended to an existing OFDB through the


UploadtoOFDB functionality.

5.3 FactSet.UploadToOFDB Syntax

Before uploading R data into an OFDB, it is necessary to first create an R data frame
object, similar to the structure of the results returned by a Factlet request. As a
reference, a comprehensive list of R OnDemand functions is available Online
Assistant page 15240.

In R, the syntax for the FactSet.UploadToOFDB functionality is:

60 | P a g e
FactSet.UploadToOFDB("OFDB",R_Data_Frame)

where,

OFDB = The name to specify for the OFDB file to which the data is getting
uploaded, for example AlphaRankings, (can specify subdirectories
where file gets saved as well).

R Data Frame = The R data frame object that is uploaded into an OFDB.

Example 1:

In the following example, a MATLAB data structure is created, using price and
volume projections for the securities FDS and XOM, for the dates 4/10/2014-
4/12/2014.

> dates=c('4/10/14','4/11/14','4/12/14')
> date=c('4/10/14','4/11/14','4/12/14')
> my_price=c(93.23,NA,92.65)
> my_volume=c(388.205,0,359.396)
> fds_data =
data.frame(Id='FDS',Date=dates,my_price=my_price,my_volume=my_volume)
> my_price=c(88.68,NA,89.22)
> my_volume=c(14826.0,0,14989.0)
> xom_data =
data.frame(Id='XOM',Date=dates,my_price=my_price,my_volume=my_volume)
> data = rbind(fds_data,xom_data)

Once the R data frame is created, using the UploadToOFDB syntax, the object titled
data is uploaded to an OFDB file titled Analyst Forecast.

> FactSet.UploadToOFDB("Analyst_Forecast",data)

Here is the R output when the data is sent from R to get uploaded to the OFDB:

Found the following names and types.


1 : Id factor
2 : Date factor

61 | P a g e
3 : my_price numeric
4 : my_volume numeric

2013-07-09 15:52:37 Data sent.


Uploaded 133 byes in 1.111000 seconds.
[1] 0

And the OFDB file titled Analyst_Forecast gets created in the Client directory and can
be accessed in the OFDB.

Note: When creating a data frame from scratch in R, it is possible that the Symbol,
Ticker and Company name columns get assigned a factor value instead of the
specified char value that is needed. By running the following code in R, all columns
with factor data type will get converted to char:

> DF2 <- sapply(DF, is.factor)


> DF[DF2] <- lapply(DF[DF2], as.character)
> result <-FactSet.UploadToOFDB('up_test', DF)

Chapter 6. Redirect FactSet Data from R to Excel


FactSet data extracted in R can also be opened in Excel. This capability allows
clients to view large volumes of data that may be easier to see in an Excel

62 | P a g e
environment. Clients may also use this feature to aid their archival of R results in
Excel.

6.1 FactSet.RedirectToExcel Function


The FactSet.RedirectToExcel function allows for data that is extracted in R to be
redirected and opened in Excel as well.

For example, extract the securities that make up the S&P 500, and their
corresponding Company Name using the code FG_COMPANY_NAME and Market
Cap using the code FG_MKT_VALUE.

> FactSet.RedirectToExcel()

> data <-


FF.ExtractBenchmarkDetail("SP50","items=FG_COMPANY_NAME,FG_MKT_VA
LUE");

In the first step the FactSet.RedirectToExcel() is entered and in the second step the
regular syntax to extract the data from FactSet is entered. The data request runs in R
and at the same time launches the extracted data in Excel. It is setup with the
headings for each column, as the screenshot below illustrates.

6.2 Upload Data from Excel into an OFDB


The data extracted from R that is redirected to Excel can also be archived from Excel
into an Open FactSet Database (OFDB) within the FactSet workstation. An OFDB is
a high-performance multi-dimensional database system used to securely store
proprietary numeric and textual data on FactSet. OFDB files can be time-series or
non-time series databases and can be fully integrated with FactSet's library of
databases.

OFDB is ideal for users who manage large portfolios or maintain extensive historical
proprietary databases. OFDB optimizes large, multi-dimensional databases, giving
FactSet users highly flexible, fast access to large volumes of complex data that can
be used in many different applications within the workstation or extracted in R. By

63 | P a g e
storing the data extracted in R in an OFDB, users can maintain, if need be, a static
snapshot of data that is unrevised for their model and analysis.

In order to upload data from R that is opened in Excel, a user must go to the FactSet
menu in Excel > select Utilities > Data Central Upload Current Worksheet.

If the opened file was not saved, it will prompt to save that file. The upload wizard will
then get launched and the selected Type of Upload should remain set to OFDB.
The PC Source File and Save Online as File will reference the Excel file that was
saved to upload into the OFDB and the title for it to display within the FactSet
workstation.

The database format that needs to be specified allows for the column headings for
the selected file to be specified. In order to set one up select FORMAT and the
wizard will allow for the Headings for each data column in the Excel file that gets
uploaded to be specified as well as the Field Type such as text, numeric, etc. For a
comprehensive overview of the upload steps, refer to Online Assistant page 12604.
Note: By default, the FactSet workstation base fee provides storage space for up to
1GB of data. For additional storage, a FactSet representative can provide pricing
information.

64 | P a g e
Chapter 7. Troubleshooting

7.1 Error Messages


The following are some possible errors when accessing FactSet data in R. For a
comprehensive list of error messages refer to Table 6 in the Appendix.

7.1.1 FactSet Query Error

The FactSet Query Error indicates in R that the correct arguments are not being
entered in the syntax to extract data from FactSet.

Example 1:
In this example, the error message FactSet Query Error : No Ids were selected
indicates that there was no security identifier(s) entered in the query. This error
message is based on the example using the ExtractFormulaHistory function as
discussed on page 14.

> data <-FF.ExtractFormulaHistory("","fg_price","20101215:20110115:D");

FactSet Query Error : No Ids were selected.

The correct syntax would be to enter an identifier, such as IBM, so that the query
reads:

> data <-FF.ExtractFormulaHistory("IBM","fg_price","20101215:20110115:D");

Example 2:
In this second example, the error message FactSet Query Error: No Items were
selected indicates that items, such as price, eps or GDP need to be entered in the
request syntax to extract the data from FactSet.

> data <-FF.ExtractFormulaHistory("IBM","","20101215:20110115:D");

FactSet Query Error : No Items were selected.

The correct syntax would be to enter an item so that the query reads:
> data <-FF.ExtractFormulaHistory("IBM","p_price","20101215:20110115:D");

65 | P a g e
7.1.2 Formula Syntax Error

In this example there is no error message retrieved however the data retrieved
comes back as NA. This will occur if the order of the parameters is entered correctly,
but there may be a typo in one of the parameters. The retrieved NA then reflects a
formula syntax error.

For example using the query:


> data <-FF.ExtractFormulaHistory("ibm","ag_price","20101215:20110115:D");

Summary
Rows:23 Columns:3
Col (1): Type: character Name: Id
Col (2): Type: date Name: Date
Col (3): Type: character Name: ag.price

> data
Id Date ag.price
1 ibm 2010-12-15 <NA>
2 ibm 2010-12-16 <NA>
3 ibm 2010-12-17 <NA>
4 ibm 2010-12-20 <NA>
5 ibm 2010-12-21 <NA>

The summary output indicated that the request syntax is recognized in R correctly,
however no data is retrieved. The formula syntax error is made in the request, where
instead of entering the price code FG_PRICE, it is entered as AG_PRICE.

66 | P a g e
7.2 FactSet Event Logger
The FactSet Event Logger (FFEL) is installed as a part of the FactSet R Plugin. This
feature provides reporting services that will allow FactSet to troubleshoot more
efficiently errors in R requests for FactSet data.

7.2.1 FactSet Event Logger Overview


The FactSet Event Logger allows a user to track the data request steps as the data is
transferred using the functions discussed in Chapter 3.

Some common things that the FFEL would note are:


The FactSet username and password that is being used in R.
The FactSet Query Language string or Screening code request that is entered
in R.
How the requested FactSet data is parsed into R native structures.

7.2.2 Using the FactSet Event Logger in R


By default, the FFEL is inactive in terms of logging the data requests. Once the FFEL
is activated the FactSet reports have virtually the same run-time performance as
before the activation of the FFEL. If a user wishes to enable the FFEL, they may do
so and generate a report from it. The Event Logger adds tags to the FactSet reports
which indicated a note passed to the FFEL from the report.

A sample of a FFEL log is shown below:

67 | P a g e
On the bottom right hand corner tray of the screen a x is available when R is open
and the FactSet Plugin is properly installed. The FactSet OnDemand icon
subsequently launches every time that a FactSet data request is made in an open
session of R. The Event Logger can be accessed through this icon by selecting View
Event Logger.

The Event Logger can get activated by checking off the Is Logging option. And the
event log output is accessed by selecting Generate Event Log. This will launch a new
internet browser window with the Event log. The Maximum Logs and Log Reduction
fields are the default FactSet settings which should not be modified.

For more granular debugging information, a FactSet support representative may


request for Verbose Mode to be turned on which is not necessary for most general
debugging questions.

68 | P a g e
7.3 FactSet Help Documentation
The FF.Help command in R returns a comprehensive list of FactSet functions and
their descriptions that are available in R. For more detailed documentation on each
function enter the corresponding number for each function that is displayed in the R
output below.

> FF.Help();

Here is the R output summary:

Welcome to FactSet's Help Documentation Function

1: R User Guide
The general user guide for the FactSet R Plug-in.

2: FF.ExtractAlphaTestingSnapshot
Function is used in R for extracting data from AlphaTesting model results, used to assess
the relationship between one or more variables and subsequent returns over time. A
subscription to Alpha Testing in FactSet is necessary to extract this data in R.

3: FF.ExtractBenchmarkDetail
Function is used in R for extracting multiple data items for a benchmark. By default
retrieves index id, constituent security id, date, ticker, and security weight.

4: FF.ExtractDataSnapshot
Function is used in R for efficiently extracting multiple items as of a single date, for a
universe of both equity and fixed income securities.

5: FF.ExtractEconData
Function is used in R for extracting a broad array of macroeconomic content, interest
rates and yields, country indices and various exchange rate measures from the FactSet
Economics database.

6: FF.ExtractFormulaHistory
Function is used in R for extracting one or more data items for one security, an index or a
list of securities over time.

7: FF.ExtractOFDBItem
Function is used in R for extracting a list of securities and data items stored on FactSet in
a single Open FactSet Database (OFDB).

8: FF.ExtractOFDBUniverse
Function is used in R for extracting a list of securities stored on FactSet in a single Open
FactSet Database (OFDB) file

69 | P a g e
9: FF.ExtractOptionsSnapshot
Function is used in R for extracting U.S. options data. A subscription to the FactSet-
Options Derived Values database is necessary to extract this data in R.

10: FF.ExtractScreenUniverse
Function is used in R for extracting a list of CUSIPS stored in a single FactSet screen. In
the FactSet workstation, can screen for equity and fixed income securities based on
specified criteria and to store a list of companies using Equity and Debt Screening.

11: FF.ExtractSPARData
Function is used in R for displaying SPAR data for specified funds from databases that
includes S&P, Lipper, Morningstar, Russell, eVestment, Nelson, Rogerscasey, and PSN.
A subscription to SPAR in FactSet is necessary to be able to extract this data in R.

12: FF.LSD_Ownership
Function is used in R for extracting global equity ownership data for institutions, mutual
fund portfolios, and insiders/stake holders from the FactSet LionShares database.

18: FF.EstimatesOnDemand
Function is used in R to access the Actuals, BrokerDetail, BrokerSnapshot, Consensus,
Guidance and Surprise reports from the FactSet Estimates database, A subscription to the
FactSet Estimates database is necessary to be able to extract this data.

19: FF.CorporateActionsSplits
Function is used in R for extracting stock split information.

20: FF.CorporateActionsDividends
Function is used in R for extracting stock dividend information.

Note: On the bottom right hand corner tray of the screen a FactSet OnDemand
Windows Quick Launch icon is available when R is open and the FactSet Plugin is
properly installed. The FactSet OnDemand icon launches every time that a FactSet
data request is made in an open session of R. The PDF documents for each of the
FactSet functions available in R can be accessed through this menu by selecting
view Help Menu.

70 | P a g e
Appendix

Script 1: Example of R Script to Break Down a Request


## Get SP500 benchmark
dfBenchmark = FF.ExtractBenchmarkDetail('SP50')
## Filter and just get CUSIPS
dfBenchmarkCUSPIPs = dfBenchmark[3]
## Number of CUSIPS
numCUSIPSs = nrow(dfBenchmarkCUSPIPs)
## Decide how many requests to break it up into
numOfRequestChunks = 7
## Create a list of indicies from the benchmark
listOfIndicies = c()
for( i in 1:nrow( dfBenchmarkCUSPIPs ) ){
listOfIndicies = c( listOfIndicies, dfBenchmarkCUSPIPs[[1]][[i]] );
}
## Split up vectors into chunks - keep even as possible
chunks = split(listOfIndicies,
rep(1:numOfRequestChunks,
ceiling(length(listOfIndicies)/numOfRequestChunks),
length.out = length(listOfIndicies)))
dfResult = NULL; # Declare blank data frame
for( i in 1:length(chunks) ){ # For each chunk and get data
currentIDsString = paste(chunks[[i]], collapse = ", "); #Build and ID string
currentDataChunk =
FF.ExtractDataSnapshot( currentIDsString, 'p_name,p_price,p_volume,ff_eps,ff_sales')
if( i != 1 ){ ## Then append all the data together into one final frame
dfResult<-rbind(dfResult, currentDataChunk)
} else {
dfResult<-currentDataChunk
}
}
dfResult = dfResult[order(dfResult$p.name),]
cat('Final result, dfResult, has ', nrow( dfResult ), ' rows and ', ncol(dfResult),' columns.\n',sep='');

71 | P a g e
Table 1: Top 25 most commonly used FactSet Fundamentals formulas
Description FF.ExtractDataSnapshot FF.ExtractFormulaHistory Syntax
Syntax
Acquisition of Business FF_ACQ_BUS_CF(QTR,0) FF_ACQ_BUS_CF(QTR,0,-4,,,USD)
(Cash Flow)
Capital Expenditures FF_CAPEX_FIX(ANN,0) FF_CAPEX_FIX(ANN,0,-5AY,,,USD)
(Fixed Assets)
Capital Expenditures FF_CAPEX_OTH(ANN,0) FF_CAPEX_OTH(ANN,0,-5AY,,,USD)
(Other Assets)
Cash Dividends Paid FF_DIV_CF(ANN,0) FF_DIV_CF(ANN,0,-5AY,,,USD)

Cash Flow from FF_FIN_CF(ANN,0) FF_FIN_CF(ANN,0,-5AY,,,JPY)


Financing Activity - Net
(Cash Flow)
Cash Flow from FF_INVEST_CF(ANN,0) FF_INVEST_CF(ANN,0,-5AY,,,USD)
Investing Activity - Net
(Cash Flow)
Cash Flow from FF_FUNDS_OPER_GROSS(ANN,0) FF_FUNDS_OPER_GROSS(ANN,0,-
Operating Activity - Net 5AY,,,USD)
(Cash Flow)
Changes in Working FF_WKCAP_CHG(ANN,0) FF_WKCAP_CHG(ANN,0,-5AY,,,USD)
Capital
Common Equity (Total) FF_COM_EQ(QTR,0) FF_COM_EQ(QTR,-10,0,,,EUR)

Cost of Goods Sold FF_COGS_XDEP(ANN,0) FF_COGS_XDEP(ANN,0,-5AY,,,JPY)


Excluding Depreciation
& Amortization
Depreciation & FF_DEP_EXP_CF(ANN,0) FF_DEP_EXP_CF(ANN,0,-5AY,,,USD)
Amortization (Cash
Flow)
Extraordinary Items FF_XORD_CF(ANN,0) FF_XORD_CF(ANN,0,-5AY,,,CAD)
(Cash Flow)
Funds from Operations FF_FUNDS_OPER_GROSS(ANN,0) FF_FUNDS_OPER_GROSS(ANN,0,-
5AY,,,USD)
Issuance of LT Debt FF_DEBT_LT_ISS_CF(ANN,0) FF_DEBT_LT_ISS_CF(ANN,0,-5AY,,,USD)

Long Term Debt FF_DEBT_LT_XCAP(ANN,0) FF_DEBT_LT_XCAP(ANN,0,-5AY,,,USD)


excluding Capital Lease
Obligations
Minority Interest - FF_MIN_INT_ACCUM(ANN,0) FF_MIN_INT_ACCUM(ANN,0,-5AY,,,USD)
Accumulated
Preferred Stock - FF_PFD_STK(QTR,0) FF_PFD_STK(QTR,0,-10,,,USD)
Carrying Value
Price - Close for FF_PRICE_CLOSE_CP(ANN,0) FF_PRICE_CLOSE_CP(ANN,0,-
Calendar Period End 5AY,,,USD)
Purchase of FF_INVEST_PURCH_CF(ANN,0) FF_INVEST_PURCH_CF(ANN,0,-
Investments 5AY,,,USD)
Reduction of LT Debt FF_DEBT_LT_REDUCT_CF(ANN,0) FF_DEBT_LT_REDUCT_CF(ANN,0,-
5AY,,,USD)
Repurchase of FF_STK_PURCH_CF(ANN,0) FF_STK_PURCH_CF(ANN,0,-5AY,,,USD)
Common & Pref Stock
Sale of Common & Pref FF_STK_SALE_CF(ANN,0) FF_STK_SALE_CF(ANN,0,-5AY,,,USD)
Stock
Sales or Revenues - FF_SALES(ANN,0) FF_SALES(ANN,0,-5AY,,,USD)
Net
Short-Term Debt (incl. FF_DEBT_ST(ANN,0) FF_DEBT_ST(ANN,0,-5AY,,,USD)
Current Portion of LTD)

72 | P a g e
Table 2: FactSet Economics Key Indicator Series for G-7 Countries

DBSOURCE ITEM-MNEMONIC COUNTRY DESCRIPTION


FDS_CANSIM V2415197 Canada Average hourly wage rate, Total employees, CAD -
Canada
FDS_CANSIM V1597104 Canada Average Weekly Earnings, Industrial aggregate excl.
unclassified, CAD, SA - Canada
FDS_CANSIM V114421 Canada BOP, Current Account, Balance, CAD, SA - Canada
FDS_CANSIM V4667 Canada Building Permits, Total, CAD, SA - Canada
FDS_CANSIM V7688 Canada Business leading indicators, Composite index of 10
indicators, 1992=100, Smoothed - Canada
FDS_CANSIM V4331081 Canada Capacity Utilization, Total industrial, Percent -
Canada
FDS_CANSIM V41692942 Canada Core CPI (All items excl. the 8 most volatile
components), 2002=100, NSA - Canada
FDS_CANSIM V499681 Canada Corporation profits after taxes, CAD, SAAR -
Canada
FDS_CANSIM V41690973 Canada CPI, All items, 2002=100, NSA - Canada
FDS_CANSIM V2062811 Canada Employment, Total, Persons, SA - Canada
FDS_CANSIM V41590956 Canada Export Price Index, Total, Paasche current weighted,
2002=100, NSA - Canada
FDS_CANSIM V41881175 Canada GDP by Industry, All industries, Chained 2002
dollars, SAAR - Canada
FDS_CANSIM V499722 Canada Gross domestic product (GDP) at market prices,
CAD, NSA - Canada
FDS_CANSIM V498086 Canada Gross domestic product (GDP) at market prices,
CAD, SAAR - Canada
FDS_CMHC CMHCDT00001@CA Canada Housing Starts, Total Dwelling Units, All Areas,
Canada, Thousands of Units, SAAR - Canada
FDS_CANSIM V41590548 Canada Import Price Index, Total, Paasche current weighted,
2002=100, NSA - Canada
FDS_CANSIM V53384992 Canada Industrial Product Prices, Total, All Commodities,
2002=100 - Canada
FDS_CANSIM V1409153 Canada Labour Productivity, Business Sector, Labour
productivity, 2002=100, SA - Canada
FDS_CANSIM V803227 Canada Manufacturers' Inventories, All Manufacturing
Industries, CAD, SA - Canada
FDS_CANSIM V800913 Canada Manufacturers' New Orders, All Manufacturing
Industries, CAD, SA - Canada
FDS_CANSIM V800450 Canada Manufacturers' Shipments, All Manufacturing
Industries, CAD, SA - Canada
FDS_CANSIM V800450 Canada Manufacturers' Shipments, All Manufacturing
Industries, CAD, SA - Canada
FDS_CANSIM V191490 Canada Merchandise Exports, Total, CAD, SA - Canada
FDS_CANSIM V183406 Canada Merchandise Imports, Total, CAD, SA - Canada
FDS_CANSIM V41552786 Canada Money Supply, M2, CAD - Canada
FDS_CANSIM V53600422 Canada New housing price index, Total (house and land),
2007=100 - Canada
FDS_CANSIM V42169912 Canada New motor vehicle sales, Total, Units, SA - Canada
FDS_CANSIM V53434748 Canada Raw Material Prices, Total, 2002=100 - Canada
FDS_CANSIM V52367097 Canada Retail sales, All trade groups, NAICS, CAD, SA -
Canada
FDS_CANSIM V52367119 Canada Retail sales, Motor vehicle and parts dealers,
NAICS, CAD, SA - Canada
FDS_CANSIM V2062815 Canada Unemployment Rate, Total, Percent, SA - Canada
FDS_ECON FRBP0013337 France Balance of Payments, Current Account, Net, Mil Eur

73 | P a g e
EURO_STAT ECONSENTNR2@FR France Business Survey, Economic sentiment indicator,
Nace R2, SA - France
FDS_ECON FRSU0013609 France Business Survey, Industry, Total, Business
sentiment indicator, SA,% - France
FDS_ECON FRSU0013621 France Business Survey, Industry, Total, Capacity utilisation
rate, SA,% - France
FDS_ECON FRSU0111884 France Business Survey, Manufacturing industry, Synthetic
Index - France
FDS_ECON FRSU1335083 France Consumer Confidence Survey, Consumer prices,
Synthetic index, Balance, WDA/SA, % - France
FDS_ECON FRPR0403230 France CPI, Total excluding energy, 1998=100, Index -
France
FDS_ECON FRPR0067552 France CPI, Total, NSA, 1998=100, Index - France
FDS_ECON FRLM0066761 France Employment, Total (excluding agriculture), SA -
France
FDS_ECB ECBGGDEF%GDP@FR France General govt deficit/surplus, incl. UMTS proceeds,
Non-financial flows, Current Prices (ESA95, % of
GDP) - France
EURO_STAT GDS13%GDP@FR France Government Consolidated Gross Debt, General
Government, % of GDP - France
FDS_ECON FRPR1172435 France Harmonized CPI, Index - France
FDS_ECON FRIN0066438 France Industrial Production, Industry, SA/WDA (2005=100)
- France
FDS_ECON FRFT0414480 France International Trade, Balance, Total FOB/FOB
(including military equipment), Million EUR, SA/WDA
- France
FDS_ECON FRNA0062321 France NA, Household consumption expenditure, Total,
chain-linked volumes, Bil. EUR, TD/SA - France
FDS_ECON FRNA0061958 France National Accounts, Gross Domestic Product,
Chained Prices, WDA/SA, Bil EUR - France
FDS_ECON FRNA0061974 France National Accounts, Gross Domestic Product, Current
Prices, WDA/SA, Bil EUR - France
FDS_ECON FRNA0988432 France National Accounts, Households consumption
expenditures, Manufactured goods, Base 2005, EUR
- France
FDS_ECON FRSA0312432 France New Passenger Cars Registration, Total, Numbers -
France
FDS_ECON FRSA0111775 France New vehicles registrations, SA/WDA, Thous EUR -
France
FDS_ECON FRPR0111776 France PPI, Total Industry , 2005=100 - France
FDS_ECON FRSU0013519 France Retail Trade Survey, Total Trade, Value, SA, Index -
France
FDS_ECON FRLM0111772 France Unemployment Rate by Sex and Age, Total, SA, % -
France
FDS_ECON FRLM0988436 France Unemployment Rate, Total, Metropolitan and DOM,
Percent - France
FDS_ECON FRLM0111773 France Unemployment, Total Population, SA, Thous of
Persons - France
FDS_ECON DEBP0386292 Germany BOP, Balance On Current Account, Mil. EUR -
Germany
FDS_ECON DEBP0386292 Germany BOP, Balance On Current Account, Mil. EUR -
Germany
FDS_ECON DEBP0386308 Germany BOP, Exports, Total, Thou. EUR - Germany
FDS_ECON DEBP0386310 Germany BOP, Imports, Total, Thou. EUR - Germany
FDS_ECON DEBP0386263 Germany BOP, Trade In Goods, External Trade, Balance, Mil.
EUR - Germany
EURO_STAT UCAP@DE Germany Business Survey - Industry, Current level of capacity
utilization (%), Balance, SA - Germany
EURO_STAT ECONSENTNR2@DE Germany Business Survey, Economic sentiment indicator,
Nace R2, SA - Germany

74 | P a g e
FDS_ECON DESU0083141 Germany Business Surveys, IFO, Main Index, Business
Climate, Trade and Industry (2005=100), Index, SA -
Germany
FDS_ECON DESU0933978 Germany Business Surveys, ZEW, Economic Expectations,
Germany (ZEW Indicator), Balance, % - Germany
EURO_STAT CONSCONF@DE Germany Consumer Survey - Consumer confidence indicator,
Balance, SA - Germany
FDS_ECON DEPR0988455 Germany CPI, All Items excluding fuel, NSA, Index 2005=100 -
Germany
FDS_ECON DEPR0422832 Germany CPI, Total (2005=100) - Germany
FDS_ECON DELM0987186 Germany Employment, Overall, SA, Thous - Germany
FDS_ECB ECBGGDEF%GDP@DE Germany General govt deficit/surplus, incl. UMTS proceeds,
Non-financial flows, Current Prices (ESA95, % of
GDP) - Germany
EURO_STAT GDS13%GDP@DE Germany Government Consolidated Gross Debt, General
Government, % of GDP - Germany
FDS_ECON DEPR0422980 Germany HICP, Total, 2005=100 - Germany
FDS_ECON DENA0436208 Germany NA, Real, Consumption & Investment, Private
Consumption Expenditure - Households, SA/CA, X-
12-ARIMA, Chain Index, 2000=100 - Germany
FDS_ECON WDSA0161561 Germany New Passenger Car Registrations, Germany - World
FDS_ECON DENA0435181 Germany Nominal GDP, Total, NSA, Bil EUR, 2005=100 -
Germany
FDS_ECON DEPR0992887 Germany PPI, Total Industry, 2005=100 - Germany
FDS_ECON DEIN0992522 Germany Production, Industry, SA/CA, 2005=100 - Germany
FDS_ECON DEIN0992528 Germany Production, Manufacturing Excluding Construction,
SA/CA, 2005=100 - Germany
FDS_ECON DENA0435202 Germany Real GDP, Total, SA/CA X12-ARIMA, 2005=100 -
Germany
FDS_ECON DEPR1422754 Germany Retail Prices, Retail and Motor Trade, Including
VAT, 2005=100, Index - Germany
FDS_ECON DESA0988452 Germany Retail Sales, Total Excluding Motor Vehicles, Real,
NSA, Index 2005=100 - Germany
FDS_ECON DELM0987184 Germany Unemployment Rate, Overall, SA, % - Germany
FDS_ECON ITBP0062460 Italy BOP, Current Account Balance, Mil EUR - Italy
EURO_STAT UCAP@IT Italy Business Survey - Industry, Current level of capacity
utilization (%), Balance, SA - Italy
EURO_STAT ECONSENTNR2@IT Italy Business Survey, Economic sentiment indicator,
Nace R2, SA - Italy
FDS_ECON ITSU1026964 Italy Business Surveys, Manufacturing, Total, Confidence
Indicator (2005=100), SA - Italy
EURO_STAT CONSCONFBAL@IT Italy Consumer Survey - Consumer confidence indicator,
Balance, SA - Italy
FDS_ECON ITPR0027835 Italy CPI, Total (excl. tobacco) (2010=100) - Italy
FDS_ECON ITPR0027834 Italy CPI, Total (including tobacco) (2010=100) - Italy
FDS_ECON ITLM0073816 Italy Employment, by Geographical Area & Sex, Total,
Thousands - Italy
FDS_ECON ITFT0069219 Italy Foreign trade, Balances, Total balance, Total,
Millions of Eur - Italy
FDS_ECON ITFT0069225 Italy Foreign trade, Exports, Total exports, Total, Millions
of Eur - Italy
FDS_ECON ITFT0069229 Italy Foreign trade, Imports, Total imports, Total, Millions
of Eur - Italy
FDS_ECB ECBGGDEF%GDP@IT Italy General govt deficit/surplus, incl. UMTS proceeds,
Non-financial flows, Current Prices (ESA95, % of
GDP) - Italy
EURO_STAT GDS13%GDP@IT Italy Government Consolidated Gross Debt, General

75 | P a g e
Government, % of GDP - Italy
FDS_ECON ITLM0069240 Italy Hourly wages, per employee, Total - Italy
FDS_ECON ITIN0069198 Italy Industrial new orders, Total new orders index, Total
industry excluding Construction (2005=100) - Italy
FDS_ECON ITIN0036245 Italy Industrial production, Total industry excluding
construction, SA (2005=100) - Italy
FDS_ECON ITNA0027276 Italy National Accounts, Chained Volumes, Gross
domestic product at market prices, Eur, SA - Italy
FDS_ECON ITNA0027318 Italy National Accounts, Current Prices, Gross domestic
product at market prices, Eur, SA - Italy
FDS_ECON ITNA0027318 Italy National Accounts, Current Prices, Gross domestic
product at market prices, Eur, SA - Italy
FDS_ECON WDSA0161564 Italy New Passenger Car Registrations, Italy - World
FDS_ECON ITPR0069203 Italy PPI, Total industry excluding Construction
(2005=100) - Italy
FDS_ECON ITPR1294953 Italy Prices, HICP, Base 2005=100, Index - Italy
FDS_ECON ITSA0069242 Italy Retail Sales, Total, NSA (2005=100) - Italy
FDS_ECON ITLM0074794 Italy Unemployment Rate, Total SA - Italy
FDS_ECON JPBP0577771 Japan BOP, Current Account, Current Account- Sa - Japan
FDS_ECON JPSU0311674 Japan Business Sentiment, Small And Medium-Sized
Companies, All Industries, Index - Japan
FDS_ECON JPSU0087044 Japan Consumer Confidence Survey, Total, SA, Index -
Japan
FDS_ECON JPSU0590365 Japan Consumer Surveys, Family Income & Expenditures,
Workers HHs, Average Propensity to Consume, % -
Japan
FDS_ECON JPSU0590299 Japan Consumer Surveys, Real Family Income &
Expenditures, Workers HHs, Consumption,
2005=100, SA - Japan
FDS_ECON JPPR0582659 Japan Corporate Goods Price Index, Domestic, All
commodities, 2005=100 - Japan
FDS_ECON JPPR0988546 Japan CPI, Tokyo, Total Ex. Fresh Food, 2010=100, Index
- Japan
FDS_ECON JPPR0988545 Japan CPI, Tokyo, Total, 2010=100, Index - Japan
FDS_ECON JPPR0382789 Japan CPI, Total Ex. Fresh Food, 2010=100, Index - Japan
FDS_ECON JPPR0382786 Japan CPI, Total, NSA, 2010=100, Index - Japan
FDS_ECON JPNA0068561 Japan GDP Deflator, GDP Total, 2000=100 - Japan
FDS_ECON JPIN0590229 Japan Industrial Orders, Machinery, Total Ex. Volatile
Orders - Japan
FDS_ECON JPIN0322658 Japan Industrial Production Index(IPI), Production, By
Goods, Mining & manufacturing, (2005=100), Sa -
Japan
FDS_ECON JPIN0943453 Japan Industry Activity Indices, Indices of All Industry
Activity (except Agriculture,Forestry and Fisheries),
SA, 2005=100 - Japan
FDS_ECON JPFT0558218 Japan International Trade, Exports, Total, NSA, JPY -
Japan
FDS_ECON JPFT0558219 Japan International Trade, Imports, Total, NSA, JPY -
Japan
FDS_ECON JPLI0420280 Japan Leading Index, Total Composite, 2005=100 - Japan
FDS_ECON JPLI0087084 Japan Leading Indicators, Sales Forecast D.I. of Small
Businesses, % - Japan
FDS_ECON JPLM0988459 Japan LFS, Unemployment Rate, %, SA, Percent - Japan
FDS_ECON JPLM0938143 Japan LM, Active Job Opening, Persons - Japan
FDS_ECON JPLM0938144 Japan LM, New Job Openings. Number Of - Japan

76 | P a g e
FDS_ECON JPMA0337151 Japan Money Stock, M1, Average - Japan
FDS_ECON JPMA0337149 Japan Money Stock, M2, Average - Japan
FDS_ECON JPNA0067856 Japan Nominal GDP, Expenditure Approach, Total - Japan
FDS_ECON JPNA0068194 Japan Nominal GDP, Expenditure Approach, Total, SA -
Japan
FDS_ECON JPBC0587691 Japan Outstanding of Deposits and Loans, Loans and
Discounts, Total of Banks and Shinkin Banks -
Japan
FDS_ECON JPGV0341530 Japan Public Finance, National Government Debt, Total -
Japan
FDS_ECON JPGV0341530 Japan Public Finance, National Government Debt, Total -
Japan
FDS_ECON JPNA0068239 Japan Real GDP, Expenditure Approach, Total, SA - Japan
FDS_ECON JPNA0068239 Japan Real GDP, Expenditure Approach, Total, SA - Japan
FDS_ECON JPSU0353978 Japan Tankan Business Conditions Diffusion Index, Large
Enterprises, Manufacturing, Actual result - Japan
FDS_ECON JPSU0354014 Japan Tankan Business Conditions Diffusion Index, Large
Enterprises, Nonmanufacturing, Actual result -
Japan
ONS_ECON IKBL United Kingdom Balance of Payments: Imports: Total Trade in Goods
& Services: CVM SA - United Kingdom
ONS_ECON HBOP United Kingdom BoP Current Account Balance SA Mil. of GBP -
United Kingdom
FDS_BOE BOELPVTVJ United Kingdom Changes of Total Sterling Net Secured Lending to
Individuals & Housing Associations, Mil. GBP, SA -
United Kingdom
ONS_ECON D7BT United Kingdom CPI INDEX 00, ALL ITEMS- estimated pre-97
2005=100 - United Kingdom
ONS_ECON DKC9 United Kingdom CPI INDEX: Excluding energy & seasonal food (SP)
2005=100 - United Kingdom
ONS_ECON NMRY United Kingdom General Government: Final consumption
expenditure: P3: CVM SA - United Kingdom
ONS_ECON YBGB United Kingdom Gross Domestic Product (Expenditure) at market
prices deflator: SA - United Kingdom
ONS_ECON YBHA United Kingdom Gross Domestic Product at market prices: Current
price: Seasonally adjusted - United Kingdom
ONS_ECON YBHA United Kingdom Gross Domestic Product at market prices: Current
price: Seasonally adjusted - United Kingdom
ONS_ECON ABJR United Kingdom Household final consumption expenditure, National
concept CVM NAYear SA - United Kingdom
ONS_ECON NRJS United Kingdom Households & NPISH: Households saving ratio: CP
SA - United Kingdom
FDS_ECON GBHC1137972 United Kingdom Housing and Construction, Construction Output,
Total output, Total, 2005 Prices, SA, Mil GBP -
United Kingdom
ONS_ECON CGBZ United Kingdom Income based: Gross operating surplus of
corporations, Total: CP SA - United Kingdom
ONS_ECON BEAO United Kingdom LFS: ILO redundancy level: UK: All: SA - United
Kingdom
ONS_ECON MGRZ United Kingdom LFS: In employment: UK: All: Aged 16&: 000s: SA:
Annual = Spring qtr (Mar to May) - United Kingdom
ONS_ECON MGSX United Kingdom LFS: Unemployment rate: UK: All: Aged 16 and
over: %: SA - United Kingdom
ONS_ECON LRYC United Kingdom Manufacturing PNFCs net rate of return (%) - United
Kingdom
FDS_ECON GBSA0313873 United Kingdom New Car Registrations, Total - United Kingdom
FDS_BOE BOELPVTVX United Kingdom Number of Total Sterling Approvals for House
Purchase to Individuals (Thous), SA - United
Kingdom

77 | P a g e
ONS_ECON LRWM United Kingdom PNFCs net operating surplus in Mil. of GBPillion -
United Kingdom
ONS_ECON K646 United Kingdom PPI: 6207000050: All mfg (materials & fuel
purchased) (Net sector input prices) - United
Kingdom
ONS_ECON J5C4 United Kingdom RSI: Value Seasonally Adjusted: All Retailers inc
fuel: All Business Index - United Kingdom
ONS_ECON LRYQ United Kingdom Service sector PNFCs net rate of return (%) - United
Kingdom
ONS_ECON BCJD United Kingdom Total Claimant count SA (UK) - thousands - United
Kingdom
ONS_ECON RLMH United Kingdom Total consumer credit: Net lending: SA - United
Kingdom
ONS_ECON AP2Y United Kingdom UK Vacancy Survey C-O - avg 3 month level -
United Kingdom
ONS_ECON DYDC United Kingdom UK Workforce jobs (SA), Total - thousands (LMT
table B11) - United Kingdom
ONS_ECON LNNK United Kingdom Unit Wage Costs, whole economy SA: Index
2002=100: UK - United Kingdom
FDS_ECON BLSCES0000000001 United States All Employees, Total Nonfarm Payroll, Thousands of
Persons, SA - United States
FDS_ECON BLSCES0500000008 United States Average Hourly Earnings Of Production And
Nonsupervisory Employees Total Private SA -
United States
FDS_ECON FFFL152090005 United States Balance sheet of households & nonprofit
organizations - Net worth, B.100 - United States
FDS_BEA BEABOPT1L76@US United States BOP Current Account balance, SA - United States
FDS_FRB FRBUTLB50001 United States Capacity Utilization, Total index, NSA - United
States
FDS_BEA BEANIPADPCCRG3@US United States Chain-Type Price Index for PCE, Excl. Food &
Energy, Price Index, 2005=100, SA - United States
FDS_BEA BEANIPADPCERG3@US United States Chain-Type Price Index for PCE, Price Index,
2005=100, SA - United States
TCB_BCI G0M910 United States Composite index of 10 leading indicators (2004=100)
FDS_FRB CRED@US United States Consumer Credit Outstanding, Total, SA (Bil.
Dollars) - United States
FDS_BLS BLSCUSR0000SA0L1E United States CPI-U All Items Less Food And Energy U.s. City
Average SA 1982-84=100 - United States
FDS_BLS BLSCUSR0000SA0 United States CPI-U All Items U.s. City Average SA 1982-84=100 -
United States
FDS_BLS BLSCUSR0000SA0 United States CPI-U All Items U.s. City Average SA 1982-84=100 -
United States
FDS_ECON BLSCIS1010000000000I United States Employment Cost Index Total Compensation All
Civilian All Workers SA Dec. 2005=100 - United
States
FDS_ECON FFLA314104005 United States Federal government - Credit market instruments, D.3
- United States
FDS_BEA BEANIPAA191RV1@US United States Gross Domestic Product, %Chg P/P in Price Index,
SAAR - United States
FDS_BEA BEANIPAA191RC1@US United States Gross Domestic Product, Bil. $, SAAR - United
States
FDS_BEA BEANIPAA191RL1@US United States Gross Domestic Product, Real %Chg P/P - United
States
FDS_CENSUS CENHAUTHBP@US United States Housing Units Authorized by Building Permits, Total,
SA - United States
FDS_CENSUS CENSTARTS@US United States Housing Units Started, Total, SA - United States
FDS_FRB FRBIPSB50001 United States Industrial Production, Total index, SA - United States
FDS_ISM ISMPMI@M United States ISM (NAPM) Manufacturing, Purchasing Managers
Index - United States
FDS_ISM ISMNMI@NM United States ISM (NAPM) Non-Manufacturing Index - United

78 | P a g e
States
FDS_FRB FRBM2@US United States M2 Money Supply, SA - United States
FDS_BEA BEANIPAA051RC1@US United States National Income, Corporate Profits with IVA &
CCAdj, Bil. $, SAAR - United States
FDS_CENSUS CENAMTMNO United States New Orders, NAICS, Total Manufacturing, SA -
United States
FDS_CENSUS CENHSOLDTOT@US United States New Residential Sales, New Houses Sold, Total, SA
- United States
FDS_FRB FRBJXRATEM@US United States Nominal Trade-Weighted Exchange Rate Index,
Major Currencies, 3/1973=100 - United States
FDS_BEA BEANIPAA466RC1@US United States Nonfinancial Corporate Business, Profits After Tax
(Without IVA & CCAdj), Bil. $, SAAR - United States
FDS_ECON BLSPRS85006092 United States Output Per Hour Nonfarm Business All Persons %
Change Quarter Ago, At Annual Rate SA - United
States
FDS_BEA BEANIPADPCERC1@US United States Personal Consumption Expenditures, Bil. $, SAAR -
United States
FDS_BEA BEANIPADPCERL1@US United States Personal Consumption Expenditures, Real %Chg
P/P - United States
FDS_BEA BEANIPAA065RC1@US United States Personal Income, Bil. $ - United States
FDS_BEA BEANIPAA072RC1@US United States Personal Income, Personal Saving As A Percentage
Of Disposable Personal Income, Bil. $, SAAR -
United States
TCB_BCI G0M940 United States Ratio, coincident index to lagging index (1996=100)
FDS_FRB FRBJXRATEMR@US United States Real Trade-Weighted Exchange Rate Index, Major
Currencies, 3/1973=100 - United States
FDS_CENSUS CENRETAIL@US United States Retail Sales, NAICS, Total, SA (Incl. in Advance
Release) - United States
FDS_CENSUS CENRETAIL&FS@US United States Retail Sales, Retail & Food Service Sales, NAICS,
SA (Incl. in Advance Release) - United States
FDS_CENSUS CEN10010 United States Total Construction Put in Place, Mil. USD, SA -
United States
FDS_CENSUS CENAMTMTI United States Total Inventories, NAICS, Total Manufacturing, SA -
United States
FDS_CENSUS CENTRBT@US United States U.S. International Trade - Balance Total G&S, BOP
Basis, Mil. USD, SA - United States
FDS_CENSUS CENTRXT@US United States U.S. International Trade - Exports Total G&S, BOP
Basis, Mil. USD, SA - United States
FDS_ECON BLSLNS14000000 United States Unemployment Rate - Percent, SA - United States
FDS_ECON BLSLNS14000000 United States Unemployment Rate - Percent, SA - United States
FDS_BEA BEADETSAARD3@US United States Unit Auto Sales, Domestic, Millions of Vehicles,
SAAR - United States
FDS_BEA BEADETSAARF3@US United States Unit Auto Sales, Foreign, Millions of Vehicles, SAAR
- United States
FDS_ECON BLSPRS85006112 United States Unit Labor Costs Nonfarm Business All Persons %
Change Quarter Ago, At Annual Rate SA - United
States
FDS_BEA BEADETTEMG3@US United States Unit Truck Sales, Light Trucks (14,000 Lbs. GVW &
Under), Imports, Millions of Vehicles, SAAR - United
States
FDS_CENSUS CENAMTMVS United States Value of Shipments, NAICS, Total Manufacturing,
SA - United States
FDS_BLS BLSWPSSOP3520 United States WPI Stage Of Processing, Finished Goods Less
Energy SA 1982=100 - United States
FDS_BLS BLSWPSSOP3000 United States WPI Stage Of Processing, Finished Goods SA
1982=100 - United States

79 | P a g e
Table 3: Country Identifiers for Standardized Economic Database

The following list includes the 78 country identifiers that work with the standardized
codes for the FactSet Economics database.

Country Country Code Country Country Code


Argentina CC_AR Lithuania CC_LT
Australia CC_AU Luxembourg CC_LU
Austria CC_AT Malaysia CC_MY
Azerbaijan CC_AZ Malta CC_MT
Bangladesh CC_BD Mexico CC_MX
Belarus CC_BY Morocco CC_MA
Belgium CC_BE Netherlands CC_NL
Bolivia CC_BO New Zealand CC_NZ
Brazil CC_BR Nigeria CC_NG
Bulgaria CC_BG Norway CC_NO
Canada CC_CA Pakistan CC_PK
Chile CC_CL Panama CC_PA
China CC_CN Paraguay CC_PY
Colombia CC_CO Peru CC_PE
Costa Rica CC_CR Philippines CC_PH
Croatia CC_HR Poland CC_PL
Cyprus CC_CY Portugal CC_PT
Czech Republic CC_CZ Romania CC_RO
Denmark CC_DK Saudi Arabia CC_SA
Dominican Republic CC_DO Russia CC_RU
Ecuador CC_EC Singapore CC_SG
Egypt CC_EG Slovakia CC_SK
Estonia CC_EE Slovenia CC_SI
Finland CC_FI South Africa CC_ZA
France CC_FR South Korea CC_KR
Germany CC_DE Spain CC_ES
Greece CC_GR Sri Lanka CC_LK
Hong Kong CC_HK Sweden CC_SE
Hungary CC_HU Switzerland CC_CH
Iceland CC_IS Taiwan CC_TW
India CC_IN Thailand CC_TH
Indonesia CC_ID Turkey CC_TR
Ireland CC_IE Ukraine CC_UA
Israel CC_IL United Kingdom CC_GB
Italy CC_IT United States CC_US
Japan CC_JP Uruguay CC_UY
Jordan CC_JO Uzbekistan CC_UZ
Kazakhstan CC_KK Venezuela CC_VE
Latvia CC_LV Vietnam CC_VN

80 | P a g e
Table 4: Data Series with Standardized Economics Database

There are 223 codes available with the standardized economic database. The data is
available on monthly, quarterly and annual frequencies as is denoted with the _M,
_Q, _Y endings in the code. The following list is reflecting annual series.

Description Code
BOP Current Account Balance - Bil $ AR Yr End FDS_ECON_BOPCURR_Y
BOP Current Account Balance % GDP - AR Yr End FDS_ECON_CA_GDP_Y
BOP Trade Balance - Goods - Bil $ AR Yr End FDS_ECON_BOPGBAL_Y
BOP Trade Balance - Services - Bil $ AR Yr End FDS_ECON_BOPSBAL_Y
BOP Trade Balance - Total - Bil $ AR Yr End FDS_ECON_BOPTBAL_Y
Brent Crude Oil - US$/barrel Yr End FDS_ECON_BRENT_Y
Cons Expenditure Growth - $ - %Chg YOY Yr End FDS_ECON_RCP_USD_Y
Cons Expenditure Growth - Local - %Chg YOY Yr End FDS_ECON_RCP_Y
Consumer Price Index - 1997=100 Yr End FDS_ECON_CPI_Y
Employment - Millions of Persons Yr End FDS_ECON_EMP_Y
Employment Growth - %Change Year-over-Year Yr End FDS_ECON_REMP_Y
Exchange Rate - %Change Year-over-Year Yr Avg FDS_ECON_RXRATE_Y
Exchange Rate - per US$ Yr Avg FDS_ECON_XRATE_Y
Exports - Customs value basis, Bil $ AR Yr End FDS_ECON_EXCIF_Y
Exports - National Accounts, Bil $ AR Yr End FDS_ECON_EXNA_USD_Y
Fixed Investment Growth - $ - %Chg YOY Yr End FDS_ECON_RIFX_USD_Y
Fixed Investment Growth - Local - %Chg YOY Yr End FDS_ECON_RIFIX_Y
Fixed Investment, Bil $ AR Yr End FDS_ECON_IFIX_USD_Y
Foreign Exchange Reserves - Bil $ Yr End FDS_ECON_RESFOR_Y
FX Reserves Growth - %Change Year-over-Year Yr End FDS_ECON_RRESFOR_Y
GDP Growth - Local - %Chg YOY Yr End FDS_ECON_RGDP_Y
Government Budget Balance as % GDP AR Yr End FDS_ECON_GBAL_GDP_Y
Government Budget Balance, Bil $ AR Yr End FDS_ECON_GBAL_Y
Government Debt as % GDP AR Yr End FDS_ECON_GDBT_GDP_Y
Government Debt, Bil $ AR Yr End FDS_ECON_GDEBT_Y
Government Expenditure, Bil $ AR Yr End FDS_ECON_CG_USD_Y
Govt Expenditure Growth - $ - %Chg YOY Yr End FDS_ECON_RCG_USD_Y
Govt Expenditure Growth - Local - %Chg YOY Yr End FDS_ECON_RCG_Y
Gross Domestic Product - Bil $ AR Yr End FDS_ECON_GDP_USD_Y
Gross Domestic Product - Local - AR Yr End FDS_ECON_GDP_Y
Gross Domestic Product Growth - $ - %Chg YOY Yr End FDS_ECON_RGDP_USD_Y

81 | P a g e
Gross Domestic Product Per Capita Yr End FDS_ECON_GDP_POP_Y
Henry Hub Natural Gas - US$/BTU Yr End FDS_ECON_HHNATGAS_Y
Housing Starts - Units Yr End FDS_ECON_STARTS_Y
Housing Starts Growth - %Chg YOY Yr End FDS_ECON_RSTARTS_Y
Implicit GDP Price Deflator - Base yr=100 Yr End FDS_ECON_PGDP_Y
Imports - Customs value basis, Bil $ AR Yr End FDS_ECON_MCIF_Y
Imports - National Accounts, Bil $ AR Yr End FDS_ECON_MNA_USD_Y
Industrial Production Growth - %Chg YOY Yr End FDS_ECON_RINDPRD_Y
Industrial Production Yr End FDS_ECON_INDPRD_Y
Inflation - CPI %Change Year-over-Year Yr End FDS_ECON_RCPI_Y
Inflation - GDP Price Deflator - %Chg YOY Yr End FDS_ECON_RPGDP_Y
Inflation - WPI %Change Year-over-Year Yr End FDS_ECON_RWPI_Y
Interest Rate - Long-Term Yr End FDS_ECON_RATELT_Y
Interest Rate - Short-Term - Legacy Currency Yr End FDS_ECON_RATESTL_Y
Interest Rate - Short-Term Yr End FDS_ECON_RATEST_Y
Labor Force - Millions of Persons Yr End FDS_ECON_LABFOR_Y
Labor Force Growth - %Change Year-over-Year Yr End FDS_ECON_RLABFOR_Y
Manuf. Productivity Growth - %Chg YOY Yr End FDS_ECON_RPRODM_Y
Manufacturing Productivity Index - 1997=100 Yr End FDS_ECON_PRODM_Y
Money Supply (M2) - Bil $ Yr End FDS_ECON_MONEY_Y
Money Supply Growth - %Chg YOY Yr End FDS_ECON_RMONEY_Y
Net Exports (Customs Basis) % GDP Yr End FDS_ECON_EX_GDP_Y
NIA Export Growth - $ - %Chg YOY Yr End FDS_ECON_RXNA_USD_Y
NIA Export Growth - Local - %Chg YOY Yr End FDS_ECON_REXNA_Y
NIA Import Growth - $ - %Chg YOY Yr End FDS_ECON_RMNA_USD_Y
NIA Import Growth - Local - %Chg YOY Yr End FDS_ECON_RMNA_Y
Personal Consumption Expenditure, Bil $ AR Yr End FDS_ECON_CP_USD_Y
Population - Millions of Persons Yr End FDS_ECON_POPUL_Y
Population Growth - %Change Year-over-Year Yr End FDS_ECON_RPOPUL_Y
Real Gross Domestic Product - Local - AR Yr End FDS_ECON_GDPR_Y
Real Gross Domestic Product Growth - %Chg YOY Yr End FDS_ECON_RGDPR_Y
Real Gross Domestic Product, Bil 1997$ AR Yr End FDS_ECON_GDPR_USD_Y
Retail Sales Growth - %Change Year-over-Year Yr End FDS_ECON_RRETAIL_Y
Retail Sales Index - 1997=100 Yr End FDS_ECON_RETAIL_Y
Unemployment Rate Yr End FDS_ECON_RUNEMP_Y
West Texas Intermediate Crude Oil - US$/barrel Yr End FDS_ECON_WTI_Y
Wholesale Price Index - 1997=100 Yr End FDS_ECON_WPI_Y

82 | P a g e
Table 5: UploadToOFDB Error Messages

"One or more required parameters are not set"


"First column must be labeled 'Id' and be type 'Id'"
"Second column must be labeled 'Date' and be type 'Date'"
"Client Data Space is Full"
"Invalid data type in column #: <TYPE>"
"Invalid dates (#) starting on row #: '<VALUE>'"
"Invalid field names for this OFDB starting with: <FIELDNAME>"

83 | P a g e
Table 6: Error Messages
Error Message Error Error Fix
Meaning
Invalid Credentials Invalid Check credentials
Credentials
Connection Error : HTTPS Connection Internet Ensure internet works. Ensure
Failed. Check configuration connection proxy settings are properly
error of some configured. Contact FactSet in
sort. case it is an error on their end

Library error : Serious Application Error. Crucial files are Contact FactSet or recover
Unable to locate libcurl.dll, libeay32.dll and/or missing. those files
ssleay32.lib. Check that these files are the
correct architecture and in the
C:\\Windows\\System32 folder.
Connection Error : Failed to resolve host. The host URL Clients should not see this. If
Check DataDirect URL. is not correct they do something is wrong
with FactSets URL and they
should contact FactSet
Connection Error : Failed to resolve proxy. The Proxy URL Ensure proxy settings are
Check Proxy Server Name. is not correct propely configured (including
authentication)
Connection Error : Failed to receive data No data was Ensure proxy settings are
from network. Check Proxy Authentication and received. properly configured (including
Connection. authentication). Ensure latest
version of plugin (versions less
than 2.5 get this error due to
keepalive issue)
Connection Error : Failed to connect. Check Couldnt Ensure proxy settings are
Proxy Server Settings. connect to properly configured (including
proxy. authentication). If
authentication other than plain
text is required, ensure using
2.6
Connection Error : Connection Timeout. Timeout Adjust timeout setting or
Adjust timeout setting or decompose query into decompose query into smaller
smaller queries. queries
FactSet Data Frame Error : Unable to parse Internal Error Clients should not see this.
factlet result. Contact FactSet
FactSet Data Frame Error : Bad column index.
FactSet Data Frame Error : Bad row index.
FactSet Data Frame Error : Bad value index.
FactSet Data Frame Column Error : Bad value
index.
FactSet Data Frame Column Error : Bad value
assignment.
FactSet Data Frame Manager Error :
Attempted to spawn non-existent frame.
FactSet Library Error : Failed to load cURL
library.
FactSet Library Error : cURL Library Function
failed

84 | P a g e
Connection Error : Unknown HTTPS Error. Internet error Ensure internet works. Check
proxy settings. Check login
credentials. Contact FactSet
FactSet Data Frame Error : Unable to parse
factlet result - result not tabular.
FactSet Data Frame Error : Unable to parse
factlet result - not enough rows.
FactSet Data Frame Error : Unable to parse
factlet result - unknown parse error.
FactSet Query Error : No Data Exists.
FactSet Data Frame Error : Value unable to be
created.
FactSet Data Frame Error : Column unable to
be created.
FactSet Data Frame Error : Column unable to
be reserved.
FactSet Data Frame Error : Column unable to
be deleted due to iterator overflow.
FactSet Data Frame Error : Column delete
exception.
FactSet Job Execute Error : Null Job Created.
FactSet Date Range Error : Date out of range. Date errors Ensure date input is formatted
FactSet Date Range Error : Date conversion correctly. Contact FactSet
failed.
FactSet Date Range Error : Date conversion
format not known.
Configuration Setting Error : Throttle must be in Throttle has Set throttle between 1 and 25
range 1 to 25. bad value
Configuration Setting Error : Timeout must be Timeout has Set timeout to between 1 and
in range 1 to 3600. bad value 3600
Matrix Builder : First item not entity. Transform Make ID first item of matrix
attempted on
matrix without
ID being first
item
Matrix Builder : Second item not date. Transform Made date second item of
attempted on matrix
matrix without
date being
second item
Configuration Setting Error : NTLM not NTLM is on, Turn off NTLM (one of
supported in this version. but not factsets settings)
supported
Configuration Setting Error : HTTPS Retries HTTPS Retries Set HTTPS retries between 1
must be in range 0 to 10. settings has and 10
bad value
Sidebar Executable Not Located. Sidebar Ensure workstation is installed
executable on computer
cant be found

85 | P a g e
The histograms depict the difference in time it takes to retrieve data as of one point in
time with ExtractFormulaHistory versus ExtractDataSnapshot functions.

Graph 1: Histogram of FF.ExtractFormulaHistory Query Time

Graph 2: Histogram of FF.ExtractDataSnapshot Query Time

86 | P a g e
FactSet Glossary
Factlet =
A factlet is a FactSet report that retrieves a raw table of data in R. These reports or
functions are application components that encapsulate business logic and data
collection procedures. Factlets consist of built in multiple result formats that a user
can choose from (i.e. XML, Delimited, Excel). The data can then be cleaned up (i.e.
converted to data set) in R.

FactSet DataDirect =
DataDirect provides synchronous access to FactSet data via the standard HTTPS
protocol. Data can be returned in a number of formats, such as XML or CSV file.
There are many reports and services available. A user can make custom requests by
changing the request URL to contain the needed parameters.

DataDirect uses HTTP basic authentication over Secure Sockets Layer (SSL).

FactSet Economics =
FactSet database of primary-sourced information on the global economy. Includes
specialty sources such as Eurostat, ICIS, IMF, LME, NYMEX, and OECD.
Data from this database can be retrieved most effectively in R using the
FF.ExtractEconData function.

FactSet Fundamentals =
FactSet database includes coverage of more than 66,600 companies from over 70
countries, 20 years of historical data and up to 2,000 data elements on each
company record. Comprised of annual and interim/quarterly data, detailed historical
financial statement content, per share data, calculated ratios, and pricing.
Data from this database can be retrieved most effectively in R using the
FF_ExtractFormulaHistory function for a time-series of data request and using the
FF_ExtractDataSnapshot function for a single date data request.

FQL (FactSet Query Language) =


FQL is a proprietary data retrieval language used to access FactSet data. Requesting
data with FQL is powerful, flexible, and versatile. Some advantages of FQL include:

The ability to specify dates for any database using the same formats.
With FQL, date formats are flexible. You can use a number of consistent date
formats (defined by FQL) for all databases which makes using and combining
data from different databases easier than ever.

87 | P a g e
The ability to iterate items, formulas, and functions at any frequency.
With FQL, you can iterate items, formulas, and functions at any frequency. For
example, you can request a series of weekly price to earnings ratios

To download the Introduction to FQL manual see the FactSet Online Assistant page
1961.

FactSet Workstation =
FactSet platform that is installed on a clients desktop and provides an interface to
access content and analytical tools to easily examine a range of data, including
prices, financials, estimates, research reports, news, and a clients proprietary data.
The data accessible in a workstation can be extracted in R using the factlet reports.
Analytical tools include an interface for performing company analysis, viewing market
data in real time, generating investment ideas, and managing portfolios.

Online Assistant =
Online Assistant is a utility available in the FactSet workstation and is a rich
information network designed to provide a one-stop source for comprehensive
documentation on all of FactSet's applications and databases.

Screening Language =

The FactSet Screening syntax is way to efficiently extract data for a large universe of
securities. By default, the Screening syntax does not allow iteration and therefore
cannot be used to return a time series of data with a single request code. To request
data as of a single historical date, a date must be specified. If a date is not specified,
data is returned from the most recent time period.

88 | P a g e
Contact FactSet Support:

United States and Canada India Spain


+1.877.FACTSET 000.800.440.1703 900.811.921
support@factset.com support@factset.com support@factset.com

United Kingdom Italy South Africa


0800.169.5954 800.510.858 0800 166 509
support@factset.com support@factset.com support@factset.com

Australia Japan South Korea


1800.33.28.33 0120.779.465 080.411.0880
support@factset.com support@factset.com support@factset.com

Belgium Mexico Sweden


080094108 +1.888.542.9899 0200.110.263
support@factset.com support@factset.com support@factset.com

Brazil Middle Eastern Switzerland


0800 8917850 +44.(0)20.7374.4445 0800.881.720
support@factset.com support@factset.com support@factset.com

Denmark Netherlands United Arab Emirates


8060 1698 0800.228.8024 80004440014
support@factset.com support@factset.com support@factset.com

France Norway Other Asian Countries


0800.484.414 800.30365 +852.3011.4888
support@factset.com support@factset.com support@factset.com

Germany Republic of Ireland Other European + Russia


0800.200.0320 1800.409.937 +44.(0)20.7374.4445
support@factset.com support@factset.com support@factset.com

Hong Kong Singapore


3011.4888 800.61.61.724
support@factset.com support@factset.com

89 | P a g e

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