Analytics Scripting PDF
Analytics Scripting PDF
Getting started 26
Getting started 27
What is Analytics? 28
What is ACL for Windows? 33
Getting started with Analytics (non-Unicode edition) 38
Getting started with Analytics (Unicode edition) 72
Get help with Analytics 106
Commands 1626
Commands overview 1627
ACCEPT command 1641
ACCESSDATA command 1647
ACTIVATE command 1661
AGE command 1663
APPEND command 1668
ASSIGN command 1677
BENFORD command 1680
CALCULATE command 1684
CLASSIFY command 1687
CLOSE command 1693
CLUSTER command 1695
COMMENT command 1699
COUNT command 1701
CREATE LAYOUT command 1704
CROSSTAB command 1706
CVSEVALUATE command 1711
CVSPREPARE command 1715
CVSSAMPLE command 1720
DEFINE COLUMN command 1724
DEFINE FIELD command 1727
DEFINE FIELD . . . COMPUTED command 1734
DEFINE RELATION command 1740
DEFINE REPORT command 1743
DEFINE TABLE DB command 1744
DEFINE VIEW command 1748
DELETE command 1750
DIALOG command 1754
DIRECTORY command 1762
DISPLAY command 1768
DO REPORT command 1773
DO SCRIPT command 1774
DUMP command 1777
DUPLICATES command 1779
ESCAPE command 1786
EVALUATE command 1788
EXECUTE command 1793
EXPORT command 1801
EXTRACT command 1818
FIELDSHIFT command 1824
FIND command 1827
FUZZYDUP command 1829
FUZZYJOIN command 1835
GAPS command 1843
GROUP command 1847
HB_API_DELETE command 1854
HB_API_GET command 1859
HB_API_PATCH command 1865
HB_API_POST command 1871
HB_API_PUT command 1877
HELP command 1883
HISTOGRAM command 1884
IF command 1889
IMPORT ACCESS command 1891
IMPORT DELIMITED command 1894
IMPORT EXCEL command 1903
IMPORT GRCPROJECT command 1912
IMPORT GRCRESULTS command 1920
IMPORT LAYOUT command 1930
IMPORT MULTIDELIMITED command 1932
IMPORT MULTIEXCEL command 1941
IMPORT ODBC command 1949
IMPORT PDF command 1953
IMPORT PRINT command 1962
IMPORT SAP command 1971
IMPORT XBRL command 1978
IMPORT XML command 1983
INDEX command 1988
JOIN command 1992
LIST command 2000
LOCATE command 2003
LOOP command 2007
MERGE command 2010
NOTES command 2015
NOTIFY command 2017
OPEN command 2024
OUTLIERS command 2027
PASSWORD command 2036
PAUSE command 2039
PREDICT command 2041
PRINT command 2044
PROFILE command 2046
QUIT command 2048
RANDOM command 2050
RCOMMAND command 2053
REFRESH command 2061
RENAME command 2065
REPORT command 2067
RETRIEVE command 2071
SAMPLE command 2073
SAVE command 2082
SAVE LAYOUT command 2084
SAVE LOG command 2089
SAVE TABLELIST command 2091
SAVE WORKSPACE command 2093
SEEK command 2095
SEQUENCE command 2098
SET command 2102
SIZE command 2118
SORT command 2123
STATISTICS command 2130
STRATIFY command 2134
SUMMARIZE command 2140
TOP command 2149
TOTAL command 2150
TRAIN command 2153
VERIFY command 2158
Functions 2162
Functions overview 2163
ABS( ) function 2180
AGE( ) function 2181
ALLTRIM( ) function 2187
ASCII( ) function 2189
AT( ) function 2191
BETWEEN( ) function 2194
BINTOSTR( ) function 2203
BIT( ) function 2205
BLANKS( ) function 2207
BYTE( ) function 2209
CDOW( ) function 2211
CHR( ) function 2215
CLEAN( ) function 2217
CMOY( ) function 2219
COS( ) function 2222
CTOD( ) function 2224
CTODT( ) function 2229
CTOT( ) function 2234
CUMIPMT( ) function 2239
CUMPRINC( ) function 2241
DATE( ) function 2243
DATETIME( ) function 2248
DAY( ) function 2253
DBYTE( ) function 2256
DEC( ) function 2258
DHEX( ) function 2261
DICECOEFFICIENT( ) function 2263
DIGIT( ) function 2270
DOW( ) function 2272
DTOU( ) function 2275
EBCDIC( ) function 2278
EFFECTIVE( ) function 2280
EOMONTH( ) function 2282
EXCLUDE( ) function 2285
EXP( ) function 2288
FILESIZE( ) function 2290
FIND( ) function 2292
FINDMULTI( ) function 2296
FREQUENCY( ) function 2301
FTYPE( ) function 2303
FVANNUITY( ) function 2305
FVLUMPSUM( ) function 2309
FVSCHEDULE( ) function 2312
GETOPTIONS( ) function 2314
GOMONTH( ) function 2316
HASH( ) function 2319
HEX( ) function 2324
HOUR( ) function 2326
HTOU( ) function 2329
INCLUDE( ) function 2331
INSERT( ) function 2333
INT( ) function 2335
IPMT( ) function 2336
ISBLANK( ) function 2338
ISDEFINED( ) function 2340
ISFUZZYDUP( ) function 2342
LAST( ) function 2348
LEADING( ) function 2350
LEADINGZEROS( ) function 2352
LENGTH( ) function 2356
LEVDIST( ) function 2358
LOG( ) function 2362
LOWER( ) function 2364
LTRIM( ) function 2366
MAP( ) function 2368
MASK( ) function 2373
MATCH( ) function 2375
MAXIMUM( ) function 2383
MINIMUM( ) function 2386
MINUTE( ) function 2390
MOD( ) function 2393
MONTH( ) function 2395
NOMINAL( ) function 2398
NORMDIST( ) function 2400
NORMSINV( ) function 2402
NOW( ) function 2403
NPER( ) function 2405
OCCURS( ) function 2408
OFFSET( ) function 2411
OMIT( ) function 2413
PACKED( ) function 2417
PI( ) function 2420
PMT( ) function 2422
PPMT( ) function 2425
PROPER( ) function 2427
PROPERTIES( ) function 2429
PVANNUITY( ) function 2433
PVLUMPSUM( ) function 2437
PYDATE( ) function 2440
PYDATETIME( ) function 2442
PYLOGICAL( ) function 2445
PYNUMERIC( ) function 2447
PYSTRING( ) function 2449
PYTIME( ) function 2452
RAND( ) function 2454
RATE( ) function 2456
RDATE( ) function 2459
RDATETIME( ) function 2462
RECLEN( ) function 2465
RECNO( ) function 2466
RECOFFSET( ) function 2468
REGEXFIND( ) function 2470
REGEXREPLACE( ) function 2478
REMOVE( ) function 2487
REPEAT( ) function 2490
REPLACE( ) function 2492
REVERSE( ) function 2496
RJUSTIFY( ) function 2497
RLOGICAL( ) function 2498
RNUMERIC( ) function 2501
ROOT( ) function 2504
ROUND( ) function 2506
RSTRING( ) function 2508
RTIME( ) function 2511
SECOND( ) function 2514
SHIFT( ) function 2517
SIN( ) function 2519
SORTWORDS( ) function 2521
SOUNDEX( ) function 2526
SOUNDSLIKE( ) function 2530
SPLIT( ) function 2533
STOD( ) function 2537
STODT( ) function 2542
STOT( ) function 2547
STRING( ) function 2551
SUBSTR( ) function 2555
TAN( ) function 2559
TEST( ) function 2561
TIME( ) function 2563
TODAY( ) function 2569
TRANSFORM( ) function 2571
TRIM( ) function 2573
UNSIGNED( ) function 2575
UPPER( ) function 2577
UTOD( ) function 2579
VALUE( ) function 2583
VERIFY( ) function 2586
WORKDAY( ) function 2588
YEAR( ) function 2593
ZONED( ) function 2596
ZSTAT( ) function 2600
Using Analytics
Analytics provides you with a wide-ranging set of tools for working with data. Beginning with the
import of data, Analytics gives you numerous options for progressing through the data analysis
cycle.
Analytics does not impose or require any particular data analysis workflow. The commands,
functions, and other tools in Analytics can be assembled into whatever workflow you arrive at for
analyzing a particular data set and achieving your analysis objectives.
That said, understanding the general data analysis cycle can help you structure your work in
Analytics.
Tip
To get an understanding of how the data analysis cycle can work in Analytics, do the
introductory tutorial: "Getting started with Analytics (non-Unicode edition)" on
page 38
Planning your data analysis work is an important precursor to actually beginning the
analysis in Analytics.
"Plan your work" on
page 39 Make sure to review "Plan your work" on page 39.
Import the data You must import data into Analytics before you can analyze it.
Often you must perform one or more data preparation tasks before data is ready to
Prepare the data analyze.
You perform analysis in Analytics by using commands and other tools to gain general
Analyze the data insights about the data you are investigating, and to answer specific questions.
Once your data analysis is complete, Analytics gives you several different ways to report
Report the results or present your results.
Getting started
This section of the Analytics Help provides a variety of introductory and overview information,
including:
"What is Analytics?" on the A high-level overview of Analytics features, and the end-to-end process of
facing page analyzing data using Analytics.
"What is ACL for Windows?" on Information about the ACL for Windows installation package and the ACL for
page 33 Windows main screen.
"Get help with Analytics" on Where to go for help as you are using Analytics.
page 106
"The Analytics user interface" An overview of the Analytics interface, including customizable elements.
on page 109
"Analytics projects" on Information about Analytics projects, which you use to contain and organize your
page 169 work in Analytics.
What is Analytics?
Analytics is a data analysis application that provides a powerful combination of data access, data
analysis, and integrated reporting, while also ensuring data integrity. Perform ad hoc analysis using
the Analytics interface, or automate your analysis to run locally or in the cloud with the integrated
ACL scripting language.
l Data access – Import a wide variety of different types of data from file-based data sources,
databases, or cloud data services.
l Data analysis – Use Analytics commands, functions, and other tools to gain general insights
about the data you are investigating, and to answer specific questions. You can perform data
analysis ad hoc with the user interface, or automate your analysis using ACLScript, the
powerful scripting language in Analytics.
l Reporting – Report your findings using native reporting features in Analytics, or import
Analytics data into a third-party reporting tool such as Tableau.
l Export capabilities – Export findings, or any other data, to popular file types such as Excel or
delimited text. You can also upload records to the Results app in the HighBond platform for
processing and issue remediation using workflow automation tools, and for data visualization.
Basic workflow
The diagram below shows the basic workflow associated with Analytics:
1. Import data to an Analytics table
2. Analyze the data and output a results table
3. Export the analysis results, or import them to a reporting tool
The third step is optional. You can also use native reporting features in Analytics.
Note
Access to each component is determined by your Diligent subscription.
Components
Number Component Description
1 Organization Switch between accounts (organizations) you have access to using this drop-down
selector list.
2 Toolbar Profile – Update your profile or sign out of ACL for Windows.
3 Recent
View recently accessed files in Analytics. Click Refresh List to update the list
Analytics Files
of files, or press F5.
5 Create o Analytic Project – Create a new Analytics project and open it in Analytics.
o Workflow – Open collections in Results for viewing, or build a new workflow for
organizing, tracking, and remediating exceptions
6 Sample Files Open pre-built Analytics projects that include a variety of sample data.
1. In ACL for Windows, select Sign Out and close from the profile drop-down list .
You are signed out of your current instance.
2. Double-click the ACL for Windows shortcut on the desktop.
The Launchpad sign-in screen opens.
3. Sign in using your HighBond account, by entering your user name (email) and password and
clicking Sign In.
4. Select the appropriate instance from the drop-down list and click Activate Analytics.
ACL for Windows opens. Any activities you perform involving HighBond now use the instance
you just selected.
Do this version of the tutorial if you're using the non-Unicode edition of Analytics.
Do the right version of the If you're using the Unicode edition, do "Getting started with Analytics (Unicode edition)"
tutorial on page 72.
Tip
To find out which edition of Analytics you're using, on the Analytics main menu, click
Help > About to open the Analytics dialog box. The edition designation appears
after the version number.
Note
The Chinese and Japanese user interfaces are Unicode-only.
Scenario
After you've analyzed the data, you want to present the results of your analysis visually, to
better engage your audience.
Optional section
You're told that from now on, reviewing corporate credit card transactions will be a recurring
responsibility.
To allow yourself, or someone else, to perform future reviews quickly and accurately, you
decide to create a script to automate some of the work.
Planning guidelines
Develop clear, specific objectives
What is the intended end product of your analysis?
You need clearly defined objectives in order to be able to plan how to achieve them. For example, in
this tutorial, your specific objectives are:
l identify the count, and total amount, of corporate credit card transactions in each merchant
category
l identify any transactions in prohibited categories
Import data
You must import data into Analytics before you can analyze it.
We'll familiarize with the import process by using the Data Definition Wizard to import three Excel
worksheets. Importing from Excel is one of the most common methods for acquiring data for
analysis in Analytics. However, Analytics supports importing data from a wide variety of data
sources.
Steps
1. Double-click the ACL for Windows shortcut on your desktop.
2. In the ACL for Windows screen, under Open, click Analytic Project.
3. Navigate to C:\Users\user_account_name\Documents\ACL Data\Sample Data Files
and double-click Sample Project.ACL.
Sample Project.ACL opens in Analytics.
If you did not install the Sample Data Files folder in the default location when you installed
Analytics, navigate to the location where you installed it.
l Trans2_May$
5. Make sure Use first row as Field Names is selected, click Next, and then click Finish.
The two Excel worksheets are imported into two separate Analytics tables.
Note
You're making adjustments to a data field in the Data Definition Wizard, during
the import process. You can also make adjustments later, after you have
completed importing the data. You'll see the reason for the adjustments in the
next section of the tutorial.
6. Click Next, in the File name field type Trans_Apr, and click Save.
7. Click Finish, and then click OK.
The third Excel worksheet is imported into an Analytics table.
You should now have three new Analytics tables in the Overview tab of the Navigator. These tables
contain read-only copies of the Excel data. They do not contain the Excel source data itself.
Prepare data
Often you must perform one or more data preparation tasks before data is ready to analyze.
For this tutorial, you'll perform two preparation tasks:
l make additional adjustments to harmonize data fields
l combine the three new Analytics tables into a single table for analysis
As well, as a best practice, you should always verify the validity of imported data before performing
analytical work. Even a small amount of invalid data in a table can invalidate all your subsequent
data analysis.
Key point
The time you spend importing and preparing data may exceed the time you spend on the
actual analysis. However, they are critical initial stages, and provide the foundation that your
analysis is built on.
CODES ASCII
AMOUNT PRINT Enter 2 in the Dec. field to specify that numeric values display
two decimal places.
When you're finished, the May table layouts should look like the layout below.
Note
The date format (YYYY-MM-DD) isn't shown in the layout summary. The
DESCRIPTION field length is different in the two May layouts.
Note
We're verifying the data after updating the data types. When you verify data in
Analytics, you're checking that all the values in a field conform to the requirements of
the field's data type. So it makes sense to verify data only once the data types are
finalized.
Steps
1. Open the Trans_Apr table.
2. From the Analytics main menu, select Data > Verify.
3. In the Verify dialog box, select all the fields in the field list.
Tip
Use Shift+click to select multiple adjacent fields.
4. Click OK.
The result should be: 0 data validity errors detected.
Learn more
Did you notice that Analytics automatically translated the action you performed in the
user interface into the ACLScript VERIFY command? Every command-level action you
perform in the user interface is automatically translated into its corresponding
ACLScript command, and captured and stored in the command log that accompanies
each Analytics project.
This automatic generation of valid, runnable script syntax is one of the most powerful
features in Analytics. We'll be looking at scripting in an optional section at the end of
the tutorial.
5. In the Navigator, double-click the Trans1_May table to open it, and repeat the steps to verify
the data.
6. Do the same for the Trans2_May table.
Both tables should not contain any data validity errors.
Note
If you get an error message stating Maximum error limit reached, check that
you correctly changed the format of the Date field in the table layout to YYYY-
MM-DD.
Learn more
If you want to see what happens when Analytics does identify data validity errors, open
Tables\Badfile and run the verification process.
4. Select Use Output Table so that the output table with the combined data opens automatically
after you run the command.
5. In the To field, type Trans_All and click OK.
Note
Don't worry about the notification. The append command performs some
automatic harmonization of numeric fields, which saves you time and effort.
The new Trans_All table is created, and contains all the records from the three input tables.
The record count in the status bar at the bottom of the Analytics interface should say
Records: 481.
You're now ready to move on to some actual data analysis.
Analyze data
You perform analysis in Analytics by using commands and other tools to gain general insights about
the data you are investigating, and to answer specific questions.
Note
The analysis stage is where the strength of your earlier planning becomes apparent.
If you've formulated clear objectives regarding your investigation, you'll have a
clearer idea of the types of analysis to perform.
3. In the Summarize dialog box, select the following fields and options:
Tab Field or option Select or type
4. Click OK.
The new Trans_All_Grouped table is created. The table contains 110 records, one for each
unique merchant category code in the Trans_All table. The COUNT field tells you how many
source records are in each group.
Tip
Right-click the table view and select Resize All Columns to make the view
more compact.
What was the total amount o Select the Total AMOUNT header.
charged by employees o Select Analyze > Total.
during April and May?
Total expenditure was $187,177.13.
Where did employees o Right-click the Total AMOUNT header and select Quick Sort Descending
spend the most money?
The Description field shows you that the most money was spent on:
o Caterers
o Eating places and Restaurants
o Hilton International
What were the largest o Right-click the Maximum AMOUNT header and select Quick Sort Descending
single expenditures?
The Description and Maximum AMOUNT fields show you that the largest single
expenditure was a Club Med amount of $1999.06.
Is Club Med an authorized merchant code for the corporate credit card? If the credit card
limit is $2000, was an employee charging an amount just under the limit?
What does an examination o Right-click the COUNT header and select Quick Sort Ascending
of infrequently used codes
Five categories had only a single charge each. Are some of them prohibited categories?
reveal?
Perhaps one or more employees thought that misusing a company card only very
occasionally would allow them to escape detection.
o Cigar Stores & Stands
o Dating & Escort Svcs.
o Babysitting services
o Amusement Parks
o Civic, Fraternal, and Social Associations
Are any of the categories o Right-click the DESCRIPTION header and select Quick Sort Ascending to
prohibited? alphabetize the field values for easier scanning
o Scan down the field looking for suspicious categories
Perhaps one or more of these categories are prohibited?
o Babysitting services
o Betting (including Lottery Tickets, Casino)
o Civic, Fraternal, and Social Associations
o Dating & Escort Svcs.
o Massage Parlors
o Precious Stones and Metals, Watches and Jewel
o Video Game Arcades/Establishments
Note
Manual scanning is impractical for all but small data sets. We'll look at a
more practical, more reliable method next.
Learn more
Perhaps you just want to perform some quick analysis and you don't want to output the
results to a new table. When you summarized the Trans_All table, instead of selecting File in
the Summarize dialog box, you could select Screen, and output the results to the
Analytics display area.
Outputting to screen is only practical for smaller data sets. However, it has the advantage of
providing an easy way to drill-down on individual groups and see only the source records in
each group.
A general review of the corporate credit card transactions alerted you to some possible prohibited
transactions. You decide to confirm whether any transactions are prohibited by matching a list of
prohibited merchant category codes against the data.
Steps
Note
Make sure you copy the entire string, including all quotation marks.
l
Click Edit View Filter to open the Expression Builder, double-click the filter name in
the Filters list, and click OK.
Tip
The Filter history list holds a maximum of 10 filters, so at times you may
need to use the Expression Builder method for reapplying a saved filter.
Learn more
Beyond filters
Filters work well if the number of criteria or conditions contained by the filter are manageable.
The filter you created in this tutorial contains only 9 codes. But what if your list of prohibited
merchant category codes was several dozen, or more?
A more efficient approach would be to join an Analytics table containing the prohibited codes
with the transactions table. Every match in the joined output table would be a prohibited
transaction.
Joins are beyond the scope of this tutorial, but they are a frequently used feature in Analytics.
Report results
Once your data analysis is complete, Analytics gives you several different ways to report or present
your results.
Traditional reports with columns of data are available, but we'll look at conveying results using the
more engaging data visualization described below.
Treemap visualization
This treemap visualization shows the grouped credit card transactions you output in the Trans_All_
Grouped table. The relation between groups is conveyed in two different ways:
l size of the box – indicates the count of individual transactions in each group
The larger the box, the greater the number of transactions. The boxes are arranged in size
from top left to bottom right.
l color intensity of the box – indicates the total amount of each group
The darker the box, the greater the total amount.
So, for example, the size of the Club Med box, in the bottom right quadrant, indicates only a small
number of transactions, but the color indicates that the total transaction amount is significant.
Steps
1. Go to Launchpad (www.highbond.com).
2. Enter your HighBond account credentials (e-mail and password) and click Sign In.
Launchpad opens.
3. Click Results.
The Results homepage opens.
Note
If you cannot access Results, you may not be assigned an appropriate
subscription or Results role. Use one of the alternative report creation methods
listed in "Other reporting methods in Analytics" on page 61.
If you would like to access Results, contact your company’s Analytics account
administrator.
Create a Collection
Steps
1. From the Results homepage, click New Collection.
2. On the New Collection page, in the Name field, enter or copy ACL Tutorial.
3. At the bottom of the page, click Create Collection.
The Collection settings page opens.
Create an Analysis
Steps
1. At the bottom of the Collection settings page, under What's Next?, click create your first
Data Analysis.
The Analysis Details page opens.
2. On the Analysis Details page, in the Name field, enter or copy Sample Report.
3. Click Create Analysis.
The new ACL Tutorial Collection opens with the empty Sample Report Analysis that you just
created.
Note
Leave Results open. You will be coming back to create the data visualization.
4. Click To, and in the Select Destination Test dialog box navigate to the Sample Report
Analysis container you just created and double-click to open it.
5. In the New data analytic field enter or copy Trans_All_Grouped and click Create.
You are returned to the Export dialog box and an ID number and data center code are
prefilled in the To text box.
6. Click OK.
The data in the Trans_All_Grouped table is exported to Results.
4. In the Configure Visualization panel, select the fields and options shown below.
Note
5. Click Apply.
The Treemap visualization is generated.
You can hover your mouse over the individual boxes in the treemap to see the embedded
data.
If you change the size of the browser window, the treemap dynamically updates by
repositioning boxes, and by displaying and suppressing a different selection of associated
descriptions.
Publish to Storyboards
Create a storyboard to display the visualization you just created. A storyboard is a communication
platform that displays multiple visualizations and rich text content in a single presentation.
Steps
1. Open the Storyboards app.
2. Click Add Storyboard.
3. Enter a descriptive title for your storyboard. Storyboard titles can be a maximum of 80
characters.
4. Click Add and select Add Chart
5. Select one of the following options:
l To display table view from the interpretation, select the parent table entry , Tutorial
visualizations.
l
To display visualization from the interpretation, select the child chart entry , Transaction
Treemap.
You can enter a keyword or phrase into the search field to filter the list of available visualiz-
ations.
6. In the top right-hand corner, click Save > Save.
Legacy Analytics charts Analytics contains a legacy charting and graphing capability that allows you
to create basic visual reports.
For more information, see "Working with Analytics graphs" on page 1407.
Traditional columnar reports In some cases, a traditional text- and number-based report with rows and
columns of data is all you need.
For more information, see "Formatting and generating Analytics reports" on
page 1401.
Third-party reporting tool You can use a third-party reporting tool such as Tableau or Microsoft BI and
import data directly from Analytics.
For more information, see "Connecting to Analytics from a third-party
reporting application" on page 1419.
Exporting data to Excel or CSV You can export data to Excel, or to a comma-separated file, and use the
reporting capabilities of Excel, or of any tool that can work with a CSV file.
For more information, see "Exporting data" on page 208.
You're finished
Congratulations! You've completed your end-to-end introduction to analyzing data using Analytics.
Where to next?
You have several options for continuing to learn about Analytics:
Academy offers a range of courses for various experience levels. Foundations of analyzing
data in Analytics program (ACL 101) is a series of six mini-courses that teaches
Analytics basics for new users.
Academy is the Diligent online training resource center. Go to the course catalog to see the
available courses.
Academy Academy courses are included at no extra cost for any user with a subscription.
You're currently in the Analytics and ACLScript Help. The Help provides reference-style
conceptual material, step-by-step instructions, and ACLScript syntax for all aspects of
Analytics.
Analytics and For example, here are the Help topics for the append operation, which formed part of the
ACLScript Help tutorial you just completed:
You can gain a lot of value using Analytics in an ad hoc or manual fashion without ever writing a
script. For the most part, anything that can be done in a script can be done in the user interface, and
vice versa. However, to gain the most value, power, and efficiency from Analytics, you need to
script.
The good news is that Analytics provides tools to make scripting relatively easy, even for a novice.
Save time
The basic review process is standardized. With each review cycle, you can spend time
repeating the basic process manually, or you can save time by automating the process.
What is a script?
An Analytics script is a series of ACLScript commands that perform a particular task, or several
related tasks. For example, everything that you just did manually in the first part of this tutorial could
also be performed using a script.
ACLScript is the command language that forms the basis of Analytics. Scripts are stored in
Analytics projects. Individual scripts appear in the Navigator, and are prefaced by the script icon
.
If you've just finished the first part of this tutorial, the log contains a list of all the actions you've
just performed in the user interface.
2. In the log, locate and click the SUMMARIZE command that outputs results to a new table.
The command prefills the Command Line near the top of the Analytics interface, just below
the toolbar.
Note
If the Command Line isn't visible, select Window > Command Line from the
Analytics main menu.
With a minimal amount of effort you re-performed all your earlier manual work required to
summarize the Trans_All table. Running a command from the command line is like running a
simple one-line script.
Note
We're going to skip over some scripting best practices in order to keep this
introduction to scripting brief. The goal is to demonstrate how easy it is for even new
users to create scripts in Analytics.
Steps
1. In the log, locate and select the following commands:
2. Right-click the log and select Save Selected Items > Script.
3. In the Save Script As dialog box, enter the script name Append_and_filter and click OK.
4. In the Overview tab of the Navigator, double-click the newly created Append_and_filter
script to open it in the Script Editor.
The script opens and contains the complete syntax of the three commands you selected in the
log.
5. Take a moment to read the syntax for each command.
Do you see how the actions you previously performed in the user interface correspond to
individual pieces of ACLScript syntax? For example, after the APPEND command, there are the
names of the three tables you appended:
You're adding _2 to avoid name conflicts with the table and filter you already created
manually.
Note
You can also run a script by right-clicking it in the Navigator and selecting Run.
A script does not have to be open to be run.
Note
The script assumes that the Sample Data Files folder is installed in the default
location. If the folder is installed in a different location, you need to modify the
navigation paths in the script to point to the correct location.
The tables created by the script are appended with _s so that they don't overwrite the
tables you created manually.
Steps
Note
It's important that you select the entire script and don't miss any lines.
Alternately, you can download a text file with the script here: Getting started
tutorial (non-Unicode edition)
3. Click in the Script Editor window and press Ctrl+V to paste the script syntax into the empty
Getting_Started_tutorial script.
2. Click Save the Open Project , and click Yes in the prompt that appears.
If you do not find the save icon, select Window > Toolbar in the Analytics main menu to
enable the toolbar.
Note
If you haven't worked with scripts before, the script syntax may look overwhelming at
first. Keep in mind that almost all the syntax was simply copied from the Analytics
log.
The syntax for the interactive notifications in the script (DIALOG commands) was
auto-generated by another relatively simple Analytics tool.
The green COMMENT commands walk you through the script at a high level. You'll
recognize the tasks that you just completed in the preceding tutorial.
COMMENT
*** Non-Unicode Edition ***
This script performs all the actions that you performed manually in the "Get-
ting Started with ACL Analytics" tutorial.
END
""
COMMENT Adjusts the table layouts of the three new Analytics tables.
OPEN Trans_Apr_s
DELETE FIELD CARDNUM OK
DEFINE FIELD CARDNUM ASCII 1 16 WIDTH 19
DELETE FIELD CODES OK
DEFINE FIELD CODES ASCII 33 4 WIDTH 7
OPEN Trans1_May_s
DELETE FIELD CODES OK
DEFINE FIELD CODES ASCII 20 4 WIDTH 7
DELETE FIELD AMOUNT OK
DEFINE FIELD AMOUNT PRINT 144 9 2 WIDTH 9
DELETE FIELD DATE OK
DEFINE FIELD DATE DATETIME 24 10 PICTURE "YYYY-MM-DD" WIDTH 27
OPEN Trans2_May_s
DELETE FIELD CODES OK
DEFINE FIELD CODES ASCII 20 4 WIDTH 7
DELETE FIELD AMOUNT OK
DEFINE FIELD AMOUNT PRINT 204 9 2 WIDTH 9
DELETE FIELD DATE OK
DEFINE FIELD DATE DATETIME 24 10 PICTURE "YYYY-MM-DD" WIDTH 27
OPEN Trans_Apr_s
VERIFY FIELDS CARDNUM AMOUNT DATE CODES CUSTNO DESCRIPTION ERRORLIMIT 10
IF WRITE1=0 DIALOG (DIALOG TITLE "User Dialog" WIDTH 490 HEIGHT 100 )
(BUTTONSET TITLE "&OK;&Cancel" AT 360 12 DEFAULT 1 ) (TEXT TITLE "Trans_Apr_
s table: 0 data validity errors detected" AT 12 28 )
IF WRITE1>0 DIALOG (DIALOG TITLE "User Dialog" WIDTH 490 HEIGHT 100 )
(BUTTONSET TITLE "&OK;&Cancel" AT 360 12 DEFAULT 1 ) (TEXT TITLE "Trans_Apr_
s table: %WRITE1% data validity errors detected" AT 12 28 )
OPEN Trans1_May_s
VERIFY FIELDS CARDNUM CODES DATE CUSTNO DESCRIPTION AMOUNT ERRORLIMIT 10
IF WRITE1=0 DIALOG (DIALOG TITLE "User Dialog" WIDTH 490 HEIGHT 100 )
(BUTTONSET TITLE "&OK;&Cancel" AT 360 12 DEFAULT 1 ) (TEXT TITLE "Trans1_
May_s table: 0 data validity errors detected" AT 12 28 )
IF WRITE1>0 DIALOG (DIALOG TITLE "User Dialog" WIDTH 490 HEIGHT 100 )
(BUTTONSET TITLE "&OK;&Cancel" AT 360 12 DEFAULT 1 ) (TEXT TITLE "Trans1_
May_s table: %WRITE1% data validity errors detected" AT 12 28 )
OPEN Trans2_May_s
VERIFY FIELDS CARDNUM CODES DATE CUSTNO DESCRIPTION AMOUNT ERRORLIMIT 10
IF WRITE1=0 DIALOG (DIALOG TITLE "User Dialog" WIDTH 490 HEIGHT 100 )
(BUTTONSET TITLE "&OK;&Cancel" AT 360 12 DEFAULT 1 ) (TEXT TITLE "Trans2_
May_s table: 0 data validity errors detected" AT 12 28 )
IF WRITE1>0 DIALOG (DIALOG TITLE "User Dialog" WIDTH 490 HEIGHT 100 )
(BUTTONSET TITLE "&OK;&Cancel" AT 360 12 DEFAULT 1 ) (TEXT TITLE "Trans2_
May_s table: %WRITE1% data validity errors detected" AT 12 28 )
COMMENT Appends the three new Analytics tables into a single combined table.
APPEND Trans_Apr_s Trans1_May_s Trans2_May_s TO "Trans_All_s" OPEN
DIALOG (DIALOG TITLE "User Dialog" WIDTH 630 HEIGHT 100 ) (BUTTONSET TITLE
"&OK;&Cancel" AT 500 12 DEFAULT 1 ) (TEXT TITLE "The combined transactions
table (Trans_All_s) contains %WRITE1% records" AT 12 28 )
You're finished
That's the end of this brief introduction to scripting. We hope you've seen enough to be convinced of
the value of scripting and that you want to learn more.
Where to next?
You have several options for learning more about scripting in Analytics:
Community Community is a web-based platform with a variety of customer resources, including a customer
forum where Analytics scripting is frequently discussed in depth.
Do this version of the tutorial if you're using the Unicode edition of Analytics.
Do the right version of the If you're using the non-Unicode edition, do "Getting started with Analytics (non-Unicode
tutorial edition)" on page 38.
Tip
To find out which edition of Analytics you're using, on the Analytics main menu, click
Help > About to open the Analytics dialog box. The edition designation appears
after the version number.
Note
The Chinese and Japanese user interfaces are Unicode-only.
Scenario
After you've analyzed the data, you want to present the results of your analysis visually, to
better engage your audience.
Optional section
You're told that from now on, reviewing corporate credit card transactions will be a recurring
responsibility.
To allow yourself, or someone else, to perform future reviews quickly and accurately, you
decide to create a script to automate some of the work.
Planning guidelines
Develop clear, specific objectives
What is the intended end product of your analysis?
You need clearly defined objectives in order to be able to plan how to achieve them. For example, in
this tutorial, your specific objectives are:
l identify the count, and total amount, of corporate credit card transactions in each merchant
category
l identify any transactions in prohibited categories
Import data
You must import data into Analytics before you can analyze it.
We'll familiarize with the import process by using the Data Definition Wizard to import three Excel
worksheets. Importing from Excel is one of the most common methods for acquiring data for
analysis in Analytics. However, Analytics supports importing data from a wide variety of data
sources.
Steps
1. Double-click the ACL for Windows shortcut on your desktop.
2. In the ACL for Windows screen, under Open, click Analytic Project.
3. Navigate to C:\Users\user_account_name\Documents\ACL Data\Sample Data Files
and double-click Sample Project.ACL.
Sample Project.ACL opens in Analytics.
If you did not install the Sample Data Files folder in the default location when you installed
Analytics, navigate to the location where you installed it.
l Trans2_May$
5. Make sure Use first row as Field Names is selected, click Next, and then click Finish.
The two Excel worksheets are imported into two separate Analytics tables.
Note
You're making adjustments to a data field in the Data Definition Wizard, during
the import process. You can also make adjustments later, after you have
completed importing the data. You'll see the reason for the adjustments in the
next section of the tutorial.
6. Click Next, in the File name field type Trans_Apr, and click Save.
7. Click Finish, and then click OK.
The third Excel worksheet is imported into an Analytics table.
You should now have three new Analytics tables in the Overview tab of the Navigator. These tables
contain read-only copies of the Excel data. They do not contain the Excel source data itself.
Prepare data
Often you must perform one or more data preparation tasks before data is ready to analyze.
For this tutorial, you'll perform two preparation tasks:
l make additional adjustments to harmonize data fields
l combine the three new Analytics tables into a single table for analysis
As well, as a best practice, you should always verify the validity of imported data before performing
analytical work. Even a small amount of invalid data in a table can invalidate all your subsequent
data analysis.
Key point
The time you spend importing and preparing data may exceed the time you spend on the
actual analysis. However, they are critical initial stages, and provide the foundation that your
analysis is built on.
CODES UNICODE
AMOUNT PRINT Enter 2 in the Dec. field to specify that numeric values display
two decimal places.
When you're finished, the May table layouts should look like the layout below.
Note
The date format (YYYY-MM-DD) isn't shown in the layout summary. The
DESCRIPTION field length is different in the two May layouts.
Note
We're verifying the data after updating the data types. When you verify data in
Analytics, you're checking that all the values in a field conform to the requirements of
the field's data type. So it makes sense to verify data only once the data types are
finalized.
Steps
1. Open the Trans_Apr table.
2. From the Analytics main menu, select Data > Verify.
3. In the Verify dialog box, select all the fields in the field list.
Tip
Use Shift+click to select multiple adjacent fields.
4. Click OK.
The result should be: 0 data validity errors detected.
Learn more
Did you notice that Analytics automatically translated the action you performed in the
user interface into the ACLScript VERIFY command? Every command-level action you
perform in the user interface is automatically translated into its corresponding
ACLScript command, and captured and stored in the command log that accompanies
each Analytics project.
This automatic generation of valid, runnable script syntax is one of the most powerful
features in Analytics. We'll be looking at scripting in an optional section at the end of
the tutorial.
5. In the Navigator, double-click the Trans1_May table to open it, and repeat the steps to verify
the data.
6. Do the same for the Trans2_May table.
Both tables should not contain any data validity errors.
Note
If you get an error message stating Maximum error limit reached, check that
you correctly changed the format of the Date field in the table layout to YYYY-
MM-DD.
Learn more
If you want to see what happens when Analytics does identify data validity errors, open
Tables\Badfile and run the verification process.
4. Select Use Output Table so that the output table with the combined data opens automatically
after you run the command.
5. In the To field, type Trans_All and click OK.
Note
Don't worry about the notification. The append command performs some
automatic harmonization of numeric fields, which saves you time and effort.
The new Trans_All table is created, and contains all the records from the three input tables.
The record count in the status bar at the bottom of the Analytics interface should say
Records: 481.
You're now ready to move on to some actual data analysis.
Analyze data
You perform analysis in Analytics by using commands and other tools to gain general insights about
the data you are investigating, and to answer specific questions.
Note
The analysis stage is where the strength of your earlier planning becomes apparent.
If you've formulated clear objectives regarding your investigation, you'll have a
clearer idea of the types of analysis to perform.
3. In the Summarize dialog box, select the following fields and options:
Tab Field or option Select or type
4. Click OK.
The new Trans_All_Grouped table is created. The table contains 110 records, one for each
unique merchant category code in the Trans_All table. The COUNT field tells you how many
source records are in each group.
Tip
Right-click the table view and select Resize All Columns to make the view
more compact.
What was the total amount o Select the Total AMOUNT header.
charged by employees o Select Analyze > Total.
during April and May?
Total expenditure was $187,177.13.
Where did employees o Right-click the Total AMOUNT header and select Quick Sort Descending
spend the most money?
The Description field shows you that the most money was spent on:
o Caterers
o Eating places and Restaurants
o Hilton International
What were the largest o Right-click the Maximum AMOUNT header and select Quick Sort Descending
single expenditures?
The Description and Maximum AMOUNT fields show you that the largest single
expenditure was a Club Med amount of $1999.06.
Is Club Med an authorized merchant code for the corporate credit card? If the credit card
limit is $2000, was an employee charging an amount just under the limit?
What does an examination o Right-click the COUNT header and select Quick Sort Ascending
of infrequently used codes
Five categories had only a single charge each. Are some of them prohibited categories?
reveal?
Perhaps one or more employees thought that misusing a company card only very
occasionally would allow them to escape detection.
o Cigar Stores & Stands
o Dating & Escort Svcs.
o Babysitting services
o Amusement Parks
o Civic, Fraternal, and Social Associations
Are any of the categories o Right-click the DESCRIPTION header and select Quick Sort Ascending to
prohibited? alphabetize the field values for easier scanning
o Scan down the field looking for suspicious categories
Perhaps one or more of these categories are prohibited?
o Babysitting services
o Betting (including Lottery Tickets, Casino)
o Civic, Fraternal, and Social Associations
o Dating & Escort Svcs.
o Massage Parlors
o Precious Stones and Metals, Watches and Jewel
o Video Game Arcades/Establishments
Note
Manual scanning is impractical for all but small data sets. We'll look at a
more practical, more reliable method next.
Learn more
Perhaps you just want to perform some quick analysis and you don't want to output the
results to a new table. When you summarized the Trans_All table, instead of selecting File in
the Summarize dialog box, you could select Screen, and output the results to the
Analytics display area.
Outputting to screen is only practical for smaller data sets. However, it has the advantage of
providing an easy way to drill-down on individual groups and see only the source records in
each group.
A general review of the corporate credit card transactions alerted you to some possible prohibited
transactions. You decide to confirm whether any transactions are prohibited by matching a list of
prohibited merchant category codes against the data.
Steps
Note
Make sure you copy the entire string, including all quotation marks.
l
Click Edit View Filter to open the Expression Builder, double-click the filter name in
the Filters list, and click OK.
Tip
The Filter history list holds a maximum of 10 filters, so at times you may
need to use the Expression Builder method for reapplying a saved filter.
Learn more
Beyond filters
Filters work well if the number of criteria or conditions contained by the filter are manageable.
The filter you created in this tutorial contains only 9 codes. But what if your list of prohibited
merchant category codes was several dozen, or more?
A more efficient approach would be to join an Analytics table containing the prohibited codes
with the transactions table. Every match in the joined output table would be a prohibited
transaction.
Joins are beyond the scope of this tutorial, but they are a frequently used feature in Analytics.
Report results
Once your data analysis is complete, Analytics gives you several different ways to report or present
your results.
Traditional reports with columns of data are available, but we'll look at conveying results using the
more engaging data visualization described below.
Treemap visualization
This treemap visualization shows the grouped credit card transactions you output in the Trans_All_
Grouped table. The relation between groups is conveyed in two different ways:
l size of the box – indicates the count of individual transactions in each group
The larger the box, the greater the number of transactions. The boxes are arranged in size
from top left to bottom right.
l color intensity of the box – indicates the total amount of each group
The darker the box, the greater the total amount.
So, for example, the size of the Club Med box, in the bottom right quadrant, indicates only a small
number of transactions, but the color indicates that the total transaction amount is significant.
Steps
1. Go to Launchpad (www.highbond.com).
2. Enter your HighBond account credentials (e-mail and password) and click Sign In.
Launchpad opens.
3. Click Results.
The Results homepage opens.
Note
If you cannot access Results, you may not be assigned an appropriate
subscription or Results role. Use one of the alternative report creation methods
listed in "Other reporting methods in Analytics" on page 95.
If you would like to access Results, contact your company’s Analytics account
administrator.
Create a Collection
Steps
1. From the Results homepage, click New Collection.
2. On the New Collection page, in the Name field, enter or copy ACL Tutorial.
3. At the bottom of the page, click Create Collection.
The Collection settings page opens.
Create an Analysis
Steps
1. At the bottom of the Collection settings page, under What's Next?, click create your first
Data Analysis.
The Analysis Details page opens.
2. On the Analysis Details page, in the Name field, enter or copy Sample Report.
3. Click Create Analysis.
The new ACL Tutorial Collection opens with the empty Sample Report Analysis that you just
created.
Note
Leave Results open. You will be coming back to create the data visualization.
4. Click To, and in the Select Destination Test dialog box navigate to the Sample Report
Analysis container you just created and double-click to open it.
5. In the New data analytic field enter or copy Trans_All_Grouped and click Create.
You are returned to the Export dialog box and an ID number and data center code are
prefilled in the To text box.
6. Click OK.
The data in the Trans_All_Grouped table is exported to Results.
4. In the Configure Visualization panel, select the fields and options shown below.
Note
5. Click Apply.
The Treemap visualization is generated.
You can hover your mouse over the individual boxes in the treemap to see the embedded
data.
If you change the size of the browser window, the treemap dynamically updates by
repositioning boxes, and by displaying and suppressing a different selection of associated
descriptions.
Publish to Storyboards
Create a storyboard to display the visualization you just created. A storyboard is a communication
platform that displays multiple visualizations and rich text content in a single presentation.
Steps
1. Open the Storyboards app.
2. Click Add Storyboard.
3. Enter a descriptive title for your storyboard. Storyboard titles can be a maximum of 80
characters.
4. Click Add and select Add Chart
5. Select one of the following options:
l To display table view from the interpretation, select the parent table entry , Tutorial
visualizations.
l
To display visualization from the interpretation, select the child chart entry , Transaction
Treemap.
You can enter a keyword or phrase into the search field to filter the list of available visualiz-
ations.
6. In the top right-hand corner, click Save > Save.
Legacy Analytics charts Analytics contains a legacy charting and graphing capability that allows you
to create basic visual reports.
For more information, see "Working with Analytics graphs" on page 1407.
Traditional columnar reports In some cases, a traditional text- and number-based report with rows and
columns of data is all you need.
For more information, see "Formatting and generating Analytics reports" on
page 1401.
Third-party reporting tool You can use a third-party reporting tool such as Tableau or Microsoft BI and
import data directly from Analytics.
For more information, see "Connecting to Analytics from a third-party
reporting application" on page 1419.
Exporting data to Excel or CSV You can export data to Excel, or to a comma-separated file, and use the
reporting capabilities of Excel, or of any tool that can work with a CSV file.
For more information, see "Exporting data" on page 208.
You're finished
Congratulations! You've completed your end-to-end introduction to analyzing data using Analytics.
Where to next?
You have several options for continuing to learn about Analytics:
Academy offers a range of courses for various experience levels. Foundations of analyzing
data in Analytics program (ACL 101) is a series of six mini-courses that teaches
Analytics basics for new users.
Academy is the Diligent online training resource center. Go to the course catalog to see the
available courses.
Academy Academy courses are included at no extra cost for any user with a subscription.
You're currently in the Analytics and ACLScript Help. The Help provides reference-style
conceptual material, step-by-step instructions, and ACLScript syntax for all aspects of
Analytics.
Analytics and For example, here are the Help topics for the append operation, which formed part of the
ACLScript Help tutorial you just completed:
You can gain a lot of value using Analytics in an ad hoc or manual fashion without ever writing a
script. For the most part, anything that can be done in a script can be done in the user interface, and
vice versa. However, to gain the most value, power, and efficiency from Analytics, you need to
script.
The good news is that Analytics provides tools to make scripting relatively easy, even for a novice.
Save time
The basic review process is standardized. With each review cycle, you can spend time
repeating the basic process manually, or you can save time by automating the process.
What is a script?
An Analytics script is a series of ACLScript commands that perform a particular task, or several
related tasks. For example, everything that you just did manually in the first part of this tutorial could
also be performed using a script.
ACLScript is the command language that forms the basis of Analytics. Scripts are stored in
Analytics projects. Individual scripts appear in the Navigator, and are prefaced by the script icon
.
If you've just finished the first part of this tutorial, the log contains a list of all the actions you've
just performed in the user interface.
2. In the log, locate and click the SUMMARIZE command that outputs results to a new table.
The command prefills the Command Line near the top of the Analytics interface, just below
the toolbar.
Note
If the Command Line isn't visible, select Window > Command Line from the
Analytics main menu.
With a minimal amount of effort you re-performed all your earlier manual work required to
summarize the Trans_All table. Running a command from the command line is like running a
simple one-line script.
Note
We're going to skip over some scripting best practices in order to keep this
introduction to scripting brief. The goal is to demonstrate how easy it is for even new
users to create scripts in Analytics.
Steps
1. In the log, locate and select the following commands:
2. Right-click the log and select Save Selected Items > Script.
3. In the Save Script As dialog box, enter the script name Append_and_filter and click OK.
4. In the Overview tab of the Navigator, double-click the newly created Append_and_filter
script to open it in the Script Editor.
The script opens and contains the complete syntax of the three commands you selected in the
log.
5. Take a moment to read the syntax for each command.
Do you see how the actions you previously performed in the user interface correspond to
individual pieces of ACLScript syntax? For example, after the APPEND command, there are the
names of the three tables you appended:
You're adding _2 to avoid name conflicts with the table and filter you already created
manually.
Note
You can also run a script by right-clicking it in the Navigator and selecting Run.
A script does not have to be open to be run.
Note
The script assumes that the Sample Data Files folder is installed in the default
location. If the folder is installed in a different location, you need to modify the
navigation paths in the script to point to the correct location.
The tables created by the script are appended with _s so that they don't overwrite the
tables you created manually.
Steps
Note
It's important that you select the entire script and don't miss any lines.
Alternately, you can download a text file with the script here: Getting started
tutorial (Unicode edition)
3. Click in the Script Editor window and press Ctrl+V to paste the script syntax into the empty
Getting_Started_tutorial script.
2. Click Save the Open Project , and click Yes in the prompt that appears.
If you do not find the save icon, select Window > Toolbar in the Analytics main menu to
enable the toolbar.
Note
If you haven't worked with scripts before, the script syntax may look overwhelming at
first. Keep in mind that almost all the syntax was simply copied from the Analytics
log.
The syntax for the interactive notifications in the script (DIALOG commands) was
auto-generated by another relatively simple Analytics tool.
The green COMMENT commands walk you through the script at a high level. You'll
recognize the tasks that you just completed in the preceding tutorial.
COMMENT
*** Unicode Edition ***
This script performs all the actions that you performed manually in the "Get-
ting Started with ACL Analytics" tutorial.
END
""
COMMENT Adjusts the table layouts of the three new Analytics tables.
OPEN Trans_Apr_s
DELETE FIELD CARDNUM OK
DEFINE FIELD CARDNUM UNICODE 1 32 WIDTH 35
DELETE FIELD CODES OK
DEFINE FIELD CODES UNICODE 65 8 WIDTH 11
OPEN Trans1_May_s
DELETE FIELD CODES OK
DEFINE FIELD CODES UNICODE 39 8 WIDTH 11
DELETE FIELD AMOUNT OK
DEFINE FIELD AMOUNT PRINT 287 18 2 WIDTH 9
DELETE FIELD DATE OK
DEFINE FIELD DATE DATETIME 47 20 PICTURE "YYYY-MM-DD" WIDTH 27
OPEN Trans2_May_s
DELETE FIELD CODES OK
DEFINE FIELD CODES UNICODE 39 8 WIDTH 11
DELETE FIELD AMOUNT OK
DEFINE FIELD AMOUNT PRINT 407 18 2 WIDTH 9
DELETE FIELD DATE OK
DEFINE FIELD DATE DATETIME 47 20 PICTURE "YYYY-MM-DD" WIDTH 27
OPEN Trans_Apr_s
VERIFY FIELDS CARDNUM AMOUNT DATE CODES CUSTNO DESCRIPTION ERRORLIMIT 10
IF WRITE1=0 DIALOG (DIALOG TITLE "User Dialog" WIDTH 490 HEIGHT 100 )
(BUTTONSET TITLE "&OK;&Cancel" AT 360 12 DEFAULT 1 ) (TEXT TITLE "Trans_Apr_
s table: 0 data validity errors detected" AT 12 28 )
IF WRITE1>0 DIALOG (DIALOG TITLE "User Dialog" WIDTH 490 HEIGHT 100 )
(BUTTONSET TITLE "&OK;&Cancel" AT 360 12 DEFAULT 1 ) (TEXT TITLE "Trans_Apr_
s table: %WRITE1% data validity errors detected" AT 12 28 )
OPEN Trans1_May_s
VERIFY FIELDS CARDNUM CODES DATE CUSTNO DESCRIPTION AMOUNT ERRORLIMIT 10
IF WRITE1=0 DIALOG (DIALOG TITLE "User Dialog" WIDTH 490 HEIGHT 100 )
(BUTTONSET TITLE "&OK;&Cancel" AT 360 12 DEFAULT 1 ) (TEXT TITLE "Trans1_
May_s table: 0 data validity errors detected" AT 12 28 )
IF WRITE1>0 DIALOG (DIALOG TITLE "User Dialog" WIDTH 490 HEIGHT 100 )
(BUTTONSET TITLE "&OK;&Cancel" AT 360 12 DEFAULT 1 ) (TEXT TITLE "Trans1_
May_s table: %WRITE1% data validity errors detected" AT 12 28 )
OPEN Trans2_May_s
VERIFY FIELDS CARDNUM CODES DATE CUSTNO DESCRIPTION AMOUNT ERRORLIMIT 10
IF WRITE1=0 DIALOG (DIALOG TITLE "User Dialog" WIDTH 490 HEIGHT 100 )
(BUTTONSET TITLE "&OK;&Cancel" AT 360 12 DEFAULT 1 ) (TEXT TITLE "Trans2_
May_s table: 0 data validity errors detected" AT 12 28 )
IF WRITE1>0 DIALOG (DIALOG TITLE "User Dialog" WIDTH 490 HEIGHT 100 )
(BUTTONSET TITLE "&OK;&Cancel" AT 360 12 DEFAULT 1 ) (TEXT TITLE "Trans2_
May_s table: %WRITE1% data validity errors detected" AT 12 28 )
COMMENT Appends the three new Analytics tables into a single combined table.
APPEND Trans_Apr_s Trans1_May_s Trans2_May_s TO "Trans_All_s" OPEN
DIALOG (DIALOG TITLE "User Dialog" WIDTH 630 HEIGHT 100 ) (BUTTONSET TITLE
"&OK;&Cancel" AT 500 12 DEFAULT 1 ) (TEXT TITLE "The combined transactions
table (Trans_All_s) contains %WRITE1% records" AT 12 28 )
You're finished
That's the end of this brief introduction to scripting. We hope you've seen enough to be convinced of
the value of scripting and that you want to learn more.
Where to next?
You have several options for learning more about scripting in Analytics:
Community Community is a web-based platform with a variety of customer resources, including a customer
forum where Analytics scripting is frequently discussed in depth.
Context-sensitive Help
Press F1 from any location in Analytics, or click the Help button from most locations, to
open a Help topic that explains the currently active window, dialog box, tab, or wizard screen.
From this initial Help topic you can often click links to access additional, more detailed information in
the online Help.
Community
Go to Community, a web-based platform with a variety of customer resources, including a customer
forum where you can post questions about Analytics features and functionality.
Support
(Account sign-in required)
From the Analytics main menu, select Help > Contact Galvanize to open a web browser and
connect to Support.
Open Analytics
To open Analytics, double-click the ACL for Windows desktop shortcut, then click an option in ACL
for Windows:
l New Analytic Project – create a new, empty Analytics project
l Open Analytic Project – open an existing Analytics project
l Under Recent Analytics Files, or Sample Files – open a recently opened or a sample
Analytics project (.acl)
Close Analytics
To close Analytics, select File > Exit.
If any unsaved changes are detected in your project, you are prompted to save them before you exit.
Click Yes in the confirmation dialog box to save your changes and exit.
l Dialog Builder
Understanding the organization and function of the various user interface elements helps you work
effectively with Analytics.
Title Bar Displays the name of the open Analytics project, and the ACL for Windows
1 component name.
Main Menu Provides access to most Analytics features, including menu commands for:
o Working with Analytics projects
o Performing data analysis
2 o Configuring options and connection settings
Toolbar Buttons in the toolbar are shortcuts to common actions. Analytics enables
buttons that are relevant to your current activity.
To display or to hide the toolbar, select Window > Tool bar.
Note
You can customize the buttons contained in the toolbar. For more
3 information, see "Customize the Analytics toolbar" on page 155.
Navigator Displays information in three tabs about the open Analytics project:
o Overview tab – displays all items that belong to the project
You can right-click any project item to perform an action. To organize items in
the Overview, right-click the project icon and select New > Folder. You can
drag any project item into the folders that you create in the Overview.
o Log tab – displays the Analytics command log
All actions you take associated with the project are recorded and organized
chronologically in the log. Double-click log entries to open them, and right-
click log entries to perform an action.
o Variables tab – displays the names, values, and data categories of any
variables in the project
The contents of the tab are dynamically updated as variables are created,
deleted, or changed in value. Variable names are listed alphabetically.
Tip
To resize the Navigator, drag the divider between the Navigator
and the display area. You can also double-click the divider to
4 close or open the Navigator.
Filter and Quick A text box and drop-down list that allow you to perform two different tasks:
Search o Apply a filter to the data in the View tab
o Enter one or more search terms to perform a quick search of the data in the
6 View tab
Index Allows you to apply existing indexes to the table and to see if an index is
7 currently applied
Tip
To resize the display area, drag the divider between the display
area and the Navigator. You can also double-click the divider to
close or open the Navigator.
Note
The options in the dialog boxes vary somewhat depending on the operation you
select. There are a number of standard options, explained below, that appear for
most operations.
Options that are not standard are explained elsewhere in the Analytics and
ACLScript Help.
field list or lists Specify the input field or fields for the operation
Subtotal Fields Specify one or more numeric fields to optionally subtotal as part of the operation
Presort Specify that the input field is automatically sorted before the operation is performed
Specify an IF statement that excludes records that do not meet the specified condition from the
If operation
Specify the name and location of the Analytics table that will contain the output results
Note
To
Appears on the Output tab (as Name) in command dialog boxes that have an
(not shown) Output tab
Specify that an Analytics table containing output results opens automatically upon completion
of the operation
Use Output Table Appears on either the Main tab or the More tab.
Append To Existing Specify that output results contained in an Analytics table or text file are added to the bottom of
File an existing Analytics table or text file
Specify an Analytics table or a text file when you save output results to a file
Depending on the operation, you may be able to save to either a table or a text file, or to only
File Type one of these options
Specify the name and location of the Analytics table or text file that will contain the output
results
Name Appears on the Main tab (as To) in command dialog boxes that do not have an Output tab
Specify whether to save an Analytics table with output results locally or to the server (only
enabled when connected to a server table)
Local Appears on either the Main tab or the Output tab
Customizing Analytics
Analytics is installed with a standard set of configuration settings that define the default behavior of
the application. You can change any of these settings in the Options dialog box (Tools > Options) to
modify application behavior, including:
l turning features on or off
l changing how data is displayed
l controlling some aspects of command output
Script Editor
For information about customizing the Script Editor, see "Customizing the Script Editor" on
page 1619.
Caution
Clicking Factory sets all options on all Options tabs to their default settings, not just
the options on the active tab.
Steps
1. From the Analytics main menu, select Tools > Options.
2. Click the tab with the option that you want to change and modify the setting.
The following tabs are used to group related options:
l System tab
l Interface tab
l Table tab
l View tab
l Command tab
l Numeric tab
l Print tab
System options
Use the option in the System tab to control how memory is used for sorting and indexing operations.
Additional information
l If Analytics is unable to determine the number of records in a file being sorted or indexed, a
memory mapped file is not used for the operation, even if Use Additional System Resources
for Sorting and Indexing is selected.
l Using additional system resources for sorting and indexing may slow down other tasks while
sorting or indexing is in progress.
l Unlike all other options in the Options dialog box, the setting for this option is not stored in the
Analytics preferences file. The option applies only to the computer on which it is set.
For more information about options stored in the preferences file, see "How Analytics
preferences files work" on page 149.
Interface options
Use the options in the Interface tab to specify some of the basic behavior of Analytics.
Note
This option controls script syntax checking only. It does not control analytic header
validation, which is a separate process that cannot be disabled.
Table options
Use the options in the Table tab to specify how Analytics processes tables.
Note
Tables with numeric fields will open more slowly with this option on.
Caution
Be careful when turning this option on. It may be an original data file that is deleted
along with the table.
Data files are deleted outright. They are not sent to the Windows Recycle Bin.
You can also use the SET DELETE_FILE command in a script or on the command line to turn this
option on or off.
If you change the setting using the Delete Data File with Table checkbox, the change remains in
effect until you specifically change it again. If you use the SET DELETE_FILE command to change the
setting, the change remains in effect for the duration of the Analytics session only.
Changes to this setting are recorded in the log using the following syntax:
SET DELETE_FILE {ON|OFF}
If you deselect this option, a single table layout can be shared by multiple data files or data sources
with an identical record structure. The feature works with only those Analytics operations that can
output results to an Analytics table with an identical record structure – extracting, sorting, sampling,
and merging – and with copying table layouts.
When sharing of table layouts is permitted, multiple source data files (e.g., Analytics data files (.fil))
or data sources that have the same record structure share a single set of field definitions. When you
add a physical or computed field to a shared table layout, add a column to an associated view, or
add a view, the added field, column, or view is automatically added to all the Analytics tables that
use the shared table layout. When you delete a field, column, or view, it is no longer available to any
of the Analytics tables that use the shared table layout.
Generally, you should maintain a separate table layout for each data file. However, sharing a single
table layout can save labor if multiple data files with the same record structure require an identical
set of field definitions, and any updates to the table layout will apply to all the data files. For example,
extracting records from an annual transactions table into twelve separate monthly tables produces a
total of thirteen tables with the same record structure. If the Don’t Share Table Layouts checkbox is
selected, each table has its own layout. If the Don’t Share Table Layouts checkbox is deselected,
all the tables share the original table’s layout and the layout can be managed centrally.
Deleting a shared table layout from one of the tables that uses it does not perform a global deletion.
The shared table layout is still available to the other tables that use it.
Sharing does not extend beyond individual Analytics projects. If you copy a table to another project,
a new table layout is created, regardless of how Don’t Share Table Layouts is set.
Note
Blank spaces are treated like characters.
If the option is on
If the option is on, comparison strings must be exactly identical to be a match. When comparing two
strings of unequal length, Analytics pads the shorter string with trailing blank spaces to match the
length of the longer string.
Applicability
Some Analytics operations and functions are affected by the Exact Character Comparisons option
and some are not:
Log entry
Changes to this setting are recorded in the log using the following syntax:
SET EXACT {ON|OFF}
Buffer Size
This option specifies the size of the data block read. The default is 33K (kilobytes), which is the
recommended buffer size for most applications.
Acceptable values range from 5 to 255. Changing the buffer size may provide small performance
improvements in certain environments. You should only change this setting if you are advised to do
so by Support.
Changes to this setting are recorded in the log using the following syntax:
SET READAHEAD value
Sort Memory
This option specifies the maximum amount of system resources to be allocated for sorting and
indexing processes. The sort memory can be any value from 0 to 2000MB (megabytes), in 20MB
increments. To optimize Sort performance, set the sort memory according to the available physical
memory in the system. This enables Analytics to use the necessary amount of memory to sort a
table up to this maximum, if required.
If the sort memory is left as 0, Analytics uses the system resources currently available.
Sort Order
This option sets the sort sequence for character fields.
Choose the locale from the drop-down list. The default is “System Default” for the non-Unicode
edition of Analytics and “Mix Languages (UCA)” for the Unicode edition. By default, Analytics sorts
data in ascending order based on the byte order of each character in its character set. The Sort
Order option affects sort order when sorting or indexing, or performing a quick sort, and when
testing sequential order.
Changes to this setting are recorded in the log using the following syntax:
SET ORDER values
View options
Use the options in the View tab to specify how Analytics displays views.
Redraw Seconds
This option displays the maximum amount of time in seconds that Analytics takes to redraw the
view. If redrawing takes longer than the specified amount of time, Analytics interrupts processing
and displays a message. The maximum you can specify is 100 seconds. The default time is 10
seconds.
You may need to increase the redraw time when using restrictive filters that select very few records,
especially when working with very large files. When you increase the redraw time, you may have to
wait longer to view the data. To reduce the waiting time, turn off the Hide Filtered Records option.
Command options
Use the options in the Command tab to specify how Analytics executes commands.
Autoexecute Commands
If you turn this option on, Analytics immediately executes certain commands using the selected field
in the view as input. You cannot edit the command or apply a local filter. The option applies only to
some command, and the selected input field must be the data type required by the command.
Intervals
This option indicates the number of intervals chosen by default for a stratification or histogram. Enter
a number from 1 to 255. The default is 10.
Error Limit
This option sets the default number of errors after which Analytics stops processing the Sequence or
Verify commands. Enter a number from 1 to 255. The default is 10.
Specifies the number of times Analytics attempts to import or export data if the initial attempt is
unsuccessful. Enter a number from 0 to 255. If you enter 0, no additional attempts are made after an
initial failure. The default is 0.
There is no waiting period between retry attempts. Each successive attempt is made immediately
after a preceding failure.
The ability to specify retry attempts is useful when connecting to databases or cloud data services,
which can be temporarily unavailable.
Changes to this setting are recorded in the log using the following syntax:
SET RETRY num
Applies to the following commands:
Import o ACCESSDATA
o IMPORT GRCPROJECT
o IMPORT GRCRESULTS
o REFRESH
(for tables initially created using ACCESSDATA or IMPORT SAP only)
Maximum Categories
This option specifies the maximum number of unique values that can occur in a character key field
used as input for the Train command. Enter a number from 1 to 255.
Notify Settings
Retry Attempts
This option specifies the number of times the Notify operation will attempt to send an email if the
initial attempt is unsuccessful. Enter a number from 0 to 255. If you enter 0, no additional attempts
are made after an initial failure. The default is 5.
One possible reason for the Notify operation failing to send an email is that the email server is
unavailable.
Date Settings
Day, Month, Year
Use the Day, Month, and Year text boxes to specify the characters that represent these
components of date and datetime formats. The default values are ‘D’ for Day, ‘M’ for Month, and ‘Y’
for Year, but you can specify different characters for languages other than English. The characters
you specify must be uppercase, they must all be different, and ‘D’, ‘M’, and ‘Y’ can only be used in
their default positions.
Note
This option has no effect on how Analytics reads dates from data sources. To specify
how Analytics reads dates, use the Data Definition Wizard, or the Format field in
the Table Layout dialog box. For more information, see "Formats of date and time
source data" on page 360.
DD/MM/YY 31/12/14
DD/MM/YYYY 31/12/2014
MM/DD/YY 12/31/14
MM/DD/YYYY 12/31/2014
YYYYDDD 2014365
YYYY-MM-DD 2014-12-31
DD Day (1 – 31)
MM Month (1 – 12)
Note
If you specify a date display format that does not display all the available source
data, quick filtering by date or datetime is disabled. For example, if you specify the
format MMM YYYY for dates that have day, month, and year data, quick filtering on a
date or datetime value in a view returns zero results.
Changes to the date display format are recorded in the log using the following syntax:
SET DATE value
Start of Century
Many data files use only two digits to represent the year, which means the century in which the year
occurs is unspecified. The two-digit year denoting the earliest year assigned to the 20th century can
vary from one set of data files to the next. This year is often called the start-of-century year or the
pivot year.
The pivot year applies to two-digit years only, and does not affect data that uses four digits to
represent the year. Analytics can read four-digit years from 1900 to 9999.
The default Start of Century setting is 40. With this setting, Analytics interprets two-digit years 40 to
99 as 1940 to 1999, and two-digit years 00 to 39 as 2000 to 2039.
To change the pivot year, enter a number from 0 to 99. For example, if you want to set 1950 as the
pivot year, enter 50 in the Start of Century text box. The table below provides examples of different
pivot years.
00 00 to 99 1900 to 1999
When working with data files that use a different pivot year from the Start of Century year, you can
use an expression to create a computed field that correctly interprets the two-digit year or converts it
to a four-digit year.
Changes to the Start of Century setting are recorded in the log using the following syntax:
SET CENTURY value
Aging Periods
This option sets the default aging periods for the Age dialog box. If you use a specific set of aging
periods frequently, you can enter the set in the Aging Periods text box and Analytics uses the
setting as the default aging periods in the Age dialog box. If necessary, you can still override the
periods in the Age dialog box.
Enter the periods in days, separated by commas without spaces. You can set as many aging
periods as you want.
Changes to this setting are recorded in the log using the following syntax:
SET PERIODS values
Time Settings
Hour, Minute, Second
Use the Hour, Minute, and Second text boxes to specify the characters that represent these
components of time and datetime formats. The default values are ‘h’ for Hour, ‘m’ for Minute, and ‘s’
for Second, but you can specify different characters for languages other than English. The
characters you specify must be lowercase, they must all be different, and ‘h’, ‘m’, and ‘s’ can only be
used in their default positions.
Note
This option has no effect on how Analytics reads times from data sources. To specify
how Analytics reads times, use the Data Definition Wizard, or the Format field in
the Table Layout dialog box. For more information, see "Formats of date and time
source data" on page 360.
Note
If you specify a time display format that does not display all the available source
data, quick filtering by datetime or time is disabled. For example, if you specify the
format hh:mm for times that have hour, minute, and seconds data, quick filtering on a
datetime or time value in a view returns zero results.
Changes to the time display format are recorded in the log using the following syntax:
SET TIME value
Conversion of local time to UTC is for display purposes only, and does not affect the source data,
which continues to contain the UTC offset. You can change back and forth between the two different
display modes whenever you want to.
When Analytics performs calculations on local time data with a UTC offset, the UTC offset is
automatically incorporated and the calculation is performed on the UTC equivalent of the local time.
If Display Times with UTC Offset as UTC is checked, you see the actual time data that is being
used in a calculation, which can make the results easier to understand. For more information, see
"How UTC offsets affect datetime expressions" on page 903.
About UTC
UTC is a global time standard that has replaced Greenwich Mean Time (GMT). For most purposes,
the two standards are equivalent. The final portion of UTC-based time data (for example, -05:00, or
+01:00) is a UTC offset that indicates how far behind or ahead the local time value is compared to
UTC. For example:
l 31/12/2014 10:30:15-05:00 represents December 31, 2014, 10:30:15 AM, Eastern Standard
Time (North America).
l 31/12/2014 15:30:15 (UTC) represents the same point in time at zero degrees longitude.
For UTC-based datetime data, if conversion to UTC goes forward or backward across the boundary
of midnight, the date is adjusted by one day.
Note
The UTC offset is also referred to as the time zone offset, although the two are not
exactly the same. More than one time zone can have the same UTC offset.
‘Display Times with UTC Offset as ‘Display Times with UTC Offset as
Source data UTC’ selected (default setting) UTC’ not selected
‘Display Times with UTC Offset as ‘Display Times with UTC Offset as
Source data UTC’ selected (default setting) UTC’ not selected
Numeric options
Use the options in the Numeric tab to specify how Analytics processes and displays numeric data.
Verify Data
If you turn this option on, every time you process a field while a table is open, Analytics automatically
checks whether the contents of a data field correspond to the field’s data type in the table layout
(Character, Numeric, Datetime, Logical). Processing stops when an error occurs, unless the Blank
Invalid Data option is also on. In the view, affected fields display ### ERR ###.
If you turn this option off, Analytics does not test for data validity, therefore improving processing
speed.
Changes to this setting are recorded in the log using the following syntax:
SET VERIFY {ON|OFF|BLANK}
Changes to this setting are recorded in the log using the following syntax, where BLANK indicates
that the option is selected and ON means that the Verify Data option is selected, but Blank Invalid
Data is not:
SET VERIFY (BLANK|ON}
Thousands Separator
Analytics uses a comma as the default thousands separator for numeric output. You can change the
default setting to either a period or a space by entering the new character in the text box. The
thousands separator cannot be the same as the decimal separator.
List Separator
Analytics uses a comma as the default list separator, which is used primarily to separate function
parameters. You can change the default setting to either a semi-colon (;) or a space by entering the
new character in the text box. The list separator cannot be the same as the decimal separator.
Print options
Use the options in the Print tab to specify the default print settings for reports and margin settings for
printed output.
Margins
The Left Margin, Top Margin, Right Margin, and Bottom Margin text boxes allow you to specify the
margins for all printed output. To change a value, enter the new value in the text box, or click the up
and down arrows beside the text box to increase or decrease the value.
If you specify a margin that exceeds your printer’s printable area, Analytics uses the maximum of
your printer’s printable area as the margin.
Changes to each of the individual margin settings are recorded in the log using the following syntax:
SET MARGIN {LEFT|RIGHT|TOP|BOTTOM} value
Fixed-width Font
Analytics uses fixed-width fonts for information displayed in the Table Layout, Script, and
Workspace windows. The default fixed-width font is Courier New. You can choose another font from
the list box.
Proportional Font
Analytics uses proportional fonts in views and reports, and to display information such as the project
file name, the table, and the record count in the status bar. The default proportional font is Arial. You
can choose another font from the list box.
Language Version
Analytics allows letters, numbers, and the underscore character to be used in field names. The
default Standard language version setting accommodates Western European characters for field
names. The Thai setting allows Thai characters to be used in addition to English.
The settings for the configurable options in Analytics – that is, the Options dialog box settings – are
stored in a preferences file (.prf file) called aclwin16.prf (non-Unicode edition) or acl16.prf
(Unicode edition).
Any changes you make in the Options dialog box are automatically saved to the .prf file. The
changes remain in effect unless you specifically change them again.
Note
The application data folder may be hidden by the Windows operating system. If
required, enable the Windows folder option to show hidden files and folders.
The .prf file in the application data folder contains the global preference settings for Analytics. Any
changes you make in the Options dialog box are saved to this global .prf file, unless you are using a
project-specific .prf file.
The global .prf file is used when:
l you open Analytics without opening an Analytics project
l you open a project that does not have a project-specific .prf file
l you close a project without closing Analytics.
Caution
If you copy the global .prf file, be careful not to inadvertently move the file rather than
copy it. If you move the file, any global preference settings you have created will be
lost, and replaced by the default configuration settings.
Note
If you have different versions of Analytics installed side-by-side, make sure to copy
the correct version of the .prf file.
The Analytics project file with the .acl extension and the project-specific .prf file must be in the same
folder for the association between the two to take effect. When the project is open, the preference
settings specified in the project-specific .prf file are used. Any changes you make in the Options
dialog box are saved to the project-specific .prf file rather than the global .prf file.
Note
You must use the Plus, Minus, and 0 keys on the number pad, not on the main
keyboard. On laptops, press Fn+Ctrl+ the appropriate key on the number pad.
Note
Once you click Close the changes are saved and Reset does not reverse
them. You can revert to the default toolbar settings by selecting Tools >
Options > Factory.
Note
If you want other Analytics users to have the custom menu items, give them the
*.mnu file with instructions about where to locate the file.
Sub-menu entries
Each *.mnu file creates a separate sub-menu entry under the Applications menu. For example,
Account scripts.mnu creates the Account scripts sub-menu entry and this menu structure:
Applications > Account scripts.
Sub-menu entries appear in alphanumeric order on the Applications menu.
Tip
Users can become disoriented by too many sub-menu levels. A best practice is to
limit sub-menu levels to three.
Tip
Create or edit your menu files in a text editor such as Notepad++ with all non-printing
characters displayed so that you can see exactly what characters are contained in
the file.
Use a monospaced or fixed-width font so that individual characters align vertically.
A sample menu file, Template.mnu, is included in the Sample Data Files folder installed with
Analytics.
l Template.mnu creates the sub-menu entry Template in the Applications menu in Sample
Project.acl, and in the three other sample Analytics projects contained in the Sample Data
Files folder.
l The Template sub-menu entry contains six custom menu items at the first level.
l One of the first-level custom menu items, Margin Analysis, contains four custom menu items
at the second level.
l Most of the custom menu items in Template.mnu are simply placeholders to illustrate the
concept of menu files.
Content of Template.mnu
MAIN MENU 6 .
Margins Analysis 8 menu_def .
Inventory Analysis PAUSE 'SAMPLE INVENTORY ANALYSIS BATCH' .
Accounts Payable Analysis PAUSE 'LAUNCH YOUR A/P BATCH(ES)' .
Accounts Receivable Analysis PAUSE 'DO A/R BATCH(ES) HERE' .
Internal Audit Functions PAUSE 'SAMPLE INTERNAL AUDIT PROCESSES' .
Quit ACL QUIT .
.
MARGINS ANALYSIS 4 .
Exception Listing PAUSE 'DO Batch where margin<=0' .
High Margin Products PAUSE 'Sample Batch top 5 margins' .
Low Margin Products PAUSE 'Calculate lowest 5 margins' .
Margin Statistics STATISTICS .
Each line of the menu file must be exactly the same length.
Although not required, it is good practice to use a period (.) to visually mark the end of each
Line length line, immediately before the line break.
The lines in the menu file are counted from zero (0).
Keep this numbering scheme in mind whenever you specify line number references in the
menu file syntax. If the text editor you are using displays and counts line numbers beginning at
1, you need to decrement the text editor line number by 1 when you specify menu file line
number references.
In the example above, the Margins Analysis menu item appears on line 1, and the MARGINS
Line numbering ANALYSIS sub-menu syntax block appears on lines 8 through 12.
Blank lines can appear between syntax blocks but not within syntax blocks.
Blank lines, composed of space characters, must be the same length as the other lines in the
menu file.
Although not required, one or more blank lines between syntax blocks provides visual
Blank lines separation in the menu file.
Syntax blocks define each group of custom menu items. You can use multiple syntax blocks to
create multiple menu levels.
o The left side of the block contains the names of the menu items, one per line. These are the
names that appear on the menu in Analytics.
o Names can be a maximum of 35 characters.
o The right side of the block contains either an ACLScript command or a line reference to a
Syntax blocks lower-level block of syntax.
Property Requirement
o Lines on the right side of the block must all start at character position 37.
o Use only space characters to align text elements. Do not use tab characters.
Note
Even one tab character in a menu file will cause the file to be ignored. Use a
text editor that can display tab characters so you can check for their
presence.
A reference from a menu item to a lower-level block of syntax takes the form num menu_def. num
specifies the line number on which the lower-level block of syntax starts – that is, the heading
line of the lower-level syntax block.
Reference to a
lower-level block of In the example above, line 1 contains the Margins Analysis menu item, which refers to the line
syntax on which the MARGINS ANALYSIS lower-level syntax block starts ( 8 menu_def ).
Note
The script must be included in the Analytics project in which the custom menu
item appears.
Short commands can be entered directly in the .mnu file. Longer commands with multiple
Custom menu parameters should be saved in a script, which can be referenced using the DO SCRIPT
items command.
l Before you edit any menu file, make a backup copy of it.
l If you add or remove lines, make sure to adjust any line number references appropriately.
l Wherever possible, add new items at the end of the menu file in order to maintain the existing
line references.
1. Copy Template.mnu from the Analytics Sample Data Files folder to a working location.
Caution
Do not edit the original template file. If you run into problems you can recopy
the original file and start again.
Note
If you are creating a menu file from scratch, change the file extension to .mnu.
3. Open the renamed file in a text editor such as Notepad++ and edit it to build sub-menus and
custom menu items.
Follow the "Menu file syntax requirements" on page 158 above exactly.
4. Do one of the following:
l Save the file in the folder containing the Analytics project in which you want the custom
Tip
You can create both project-level and global menu files, if required.
Analytics includes a language called ACLScript that is used throughout the application to process
commands and record analysis steps. For example, when you select Analyze > Count from the
main menu and complete the required information in the Count dialog box, Analytics automatically
converts the information you entered to a command statement that is used to run the command and
record the action in the log.
Steps
1. If the Command Line text box is not visible, select Window > Command Line.
2. Enter the command text using one of the following methods:
l Type in the command using the required syntax.
l Click an entry in the Log tab in the Navigator to add the command to the command line.
You can run the command as is, or edit it before running the command.
Copy the command syntax from an existing Analytics script, or other text file, and paste it in
l
the Command Line text box. You can run the command as is, or edit it before running the
command.
3. Optional. If the command has a dialog box associated with it in the Analytics user interface,
click Edit Command to display the associated dialog box, which you can use to modify the
parameter settings for the command.
4. Click Run or press Enter to run the command.
The Run, Clear Entry, and Edit Command options are also available by right-clicking in the
Command Line text box.
You can send email notification messages from Analytics to one or more recipients. Messages can
include attached data files and Analytics projects.
A common use of email notifications is to alert the appropriate personnel when a script fails unexpec-
tedly.
Use the Analytics user interface to set up email notification using an authenticated connection with
an SMTP mail server. Most modern email systems require authenticated connections.
The benefit of setting up the connection through the user interface is that Analytics creates the
ACLScript syntax for you. Once you have configured a connection that works, you can copy the
syntax from the command log to a script.
1. From the Analytics main menu, select Tools > Notify by Email.
The Notify dialog box opens.
2. Select SMTP and complete the following information:
l SMTP User (optional) – Enter the name of the user account to authenticate against and
The password is automatically encrypted by Analytics and the encrypted version appears in
the log. For more information, see "Generating an encrypted password" on page 2021.
l Mailbox Path – Enter the domain name of the SMTP server to use to send the email
message.
Note
Enter a maximum of 1020 characters.
l Cc – Optional. Enter the email address of one or more carbon copy recipients. Separate
multiple email addresses with a comma.
Note
Enter a maximum of 1000 characters.
l Bcc – Optional. Enter the email address of one or more blind carbon copy recipients.
Separate multiple email addresses with a comma.
l Subject – Enter the subject line of the email message.
l Text – Enter the body text of the email message.
The message is plain text and does not support HTML. If you want to insert a line break in
the message, use two carat characters: ^^
l Attachment – Optional. Specify the path and file name of one or more attachments, or click
Browse to open the Select File dialog box.
You do not have to specify a path if the file is located in the same folder as the Analytics
project.
Specify multiple attachments by entering a comma-separated list of files. For
example: result1.csv,result2.csv
Note
In a comma-separated list, make sure there are no spaces after the
commas.
4. Click OK.
Analytics submits the email to the SMTP mail server to be relayed to the recipients.
If the connection attempt between Analytics and the mail server fails, Analytics automatically
retries the connection for a specified number of times. For more information, see "How
Analytics responds to failed connection attempts" on page 2022.
The password is automatically encrypted by Analytics and the encrypted version appears in
the log. For more information, see "Generating an encrypted password" on page 2021.
l Mailbox Path – Enter the domain name of the SMTP server to use to send the email
message.
For example: smtp.example.com
If you are using a local mail system, enter the path to a local mailbox or click Browse to
open the Browse for Folder dialog box.
l To – Enter the email address of one or more recipients. Separate multiple email addresses
with a comma.
Note
Enter a maximum of 1020 characters.
l Cc – Optional. Enter the email address of one or more carbon copy recipients. Separate
multiple email addresses with a comma.
Note
Enter a maximum of 1000 characters.
l Bcc – Optional. Enter the email address of one or more blind carbon copy recipients.
Separate multiple email addresses with a comma.
l Subject – Enter the subject line of the email message.
l Text – Enter the body text of the email message.
The message is plain text and does not support HTML. If you want to insert a line break in
the message, use two carat characters: ^^
l Attachment – Optional. Specify the path and file name of one or more attachments, or click
Browse to open the Select File dialog box.
You do not have to specify a path if the file is located in the same folder as the Analytics
project.
Specify multiple attachments by entering a comma-separated list of files. For
example: result1.csv,result2.csv
Note
In a comma-separated list, make sure there are no spaces after the
commas.
4. Click OK.
Analytics submits the email to the SMTP mail server or the local mail system to be relayed to
the recipients.
If the connection attempt between Analytics and the mail server or the mail system fails,
Analytics automatically retries the connection for a specified number of times. For more
information, see "How Analytics responds to failed connection attempts" on page 2022.
Analytics projects
Analytics projects are the highest level of organization in Analytics, and they store the information
associated with a data analysis project.
The main Analytics project file (.ACL) stores most of the project information. A set of additional files
store particular types of information about the project, such as the log or indexes. Data is stored
outside the project in native Analytics data files, or in a database.
The Analytics project you are currently working with is displayed in the Overview tab in the
Navigator. The contents of the log are displayed in the Log tab. Only one project can be open at a
time.
Sample Project.ACL appears below in the Navigator.
Table An Analytics table, which consists of two parts: a table layout and an associated
data source.
The table layout contains information about how to display the data, such as record
length and field names. The data source is a file or data set (e.g., database table)
that contains the content of the table. The data source exists outside the Analytics
project.
Server Table A table with a table layout that resides locally in Analytics, and an associated data
source on a server. The table layout connects to the data source using a database
profile and/or server profile.
Script A series of ACLScript commands that can be run from within the Analytics project.
Server Script An ACLScript file (.aclscript, formerly .bat) that is located on a server.
Workspace An Analytics project item that contains one or more field definitions that have been
saved for reuse with other tables.
Project The top-level entry in the treeview is the Analytics project. Projects are stored in
physical files with a .ACL file extension.
Log A record of the commands issued when working with the Analytics project.
Folder A folder inside the Analytics project. These folders exist only in the Analytics project
file (.ACL). They are not physically created as Windows folders.
Session entry Individual sessions indicated by date and time. Sessions are created whenever you
open the project, or when you create a session manually.
File type
(extension) Description
Analytics Project file The Analytics project file is where all of the critical information for your data analysis
project is stored:
(.ACL/.acl)
o table layout and view definitions
o scripts
o project folders
o command syntax that updates tables using the Refresh from Source command.
o table history
o workspaces
Analytics Project autosave A temporary autosave file is created each time the project is opened.
file
The purpose of the file is to record all unsaved changes to the Analytics project, so that
(.ac) the changes can be recovered if Analytics closes unexpectedly.
If the project is saved and closed normally, the .ac file is deleted, otherwise you are
prompted to restore your project from this file.
Analytics data file In many cases, when you define an Analytics table from a data source, the data is copied
from the data source into a new Analytics data file with a .fil file extension.
(.fil)
For a list of data source types that copy data to .fil files, see "Data sources you can
access with Analytics" on page 240.
Log file The log file records all commands executed by Analytics while the project is open.
(.log) The default log is assigned the same name as the Analytics project file, with a .log
extension. If necessary, you can specify a custom log file name.
Log index file An index file used to associate log entries with particular sessions. Sessions are created
each time you open a project, and can also be created manually at any time.
(.lix)
Index file An index file is created when you index an Analytics table. The file name is the same as
the name of the index in Analytics, with an .inx extension.
(.inx)
An index file is also created when you use the Quick Sort Ascending or Quick Sort
Descending commands on a table. The filename for indexes created by quick sort
commands is ACLQSTMP.inx
These file types are not required by the project, however if they exist, you may want to include them
in any backup process.
File type
(extension) Description
Note
The combined length of the Analytics project path and the project name, including
the file extension (.acl), cannot exceed 259 characters.
o Script
o Workspace
Note
When you copy a table, you are copying the table layout only, not the source
data file (.fil).
3. In the Locate Project File dialog box, locate and select the Analytics project you want to copy
the project items from and click Open.
4. In the Import dialog box, complete any of the following tasks to add project items to the To
project_name list:
o Double-click an individual project item.
o Ctrl+click multiple project items and then click the right-arrow button.
o Click Add All to add all the project items.
You can remove project items from the To project_name list by double-clicking an individual
project item, by using Ctrl+click to select multiple project items and then clicking the left-arrow
button, or by clicking Clear All.
5. Click OK to copy the project item or items into the current project.
If an item with the same name already exists in the project, the copied item is given an
incrementing numeric suffix.
2. In the Project dialog box, locate and select the appropriate file type and click Open.
File types and project items correspond as follows:
.rpt view
.aclscript script
.wsp workspace
view .rpt
script .aclscript
workspace .wsp
Show me how
Note
Limit the item name to 64 alphanumeric characters, not including the file extension,
to ensure that the name is not truncated when the item is imported back into
Analytics.
The name can include the underscore character ( _ ), but do not use any other
special characters, or any spaces, or start the name with a number. Special
characters, spaces, and a leading number are all replaced by the underscore
character when the item is imported.
Export a view
1. Open the table associated with the view.
2. In the Overview tab of the Navigator, right-click the table and select Properties > Views.
3. Select the view, and click Export.
4. In the Save As dialog box, choose a location to save the view, rename the view if required,
and click Save.
5. Click OK in the confirmation dialog box.
The view is exported to the location you specified.
Only matches with exactly matching upper and lower case are found.
For example, a search for “Comment” does not match “COMMENT” if this option is
Match case selected, but it would otherwise.
3. Right-click in the Log tab and select Save Selected Items > [Export Type] where Export
Type is one of the following options:
Note
If the Command Line isn't visible, select Window > Command Line from the
Analytics main menu.
Table layout notes appear in printed Analytics reports if Include Report History with Reports is
selected in the Options dialog box (the default setting). For more information, see "Print options" on
page 147.
Show me how
Note icon
Records that have a note attached are identified by a note icon next to the record number in the view
. Tables that have one or more records with a note are identified in the Overview tab in the
Navigator with a note icon in the bottom left corner of the standard table icon .
Steps
Show me how
Tip
To add or edit multiple record notes simultaneously, use the NOTES command.
1. Right-click the appropriate record number in the record number column in the View tab (the
grey, first column on the far left) and select Edit Note.
2. Enter a new note or edit the existing note.
To delete the note, delete all the text.
3. If you want to create a link to a related file, do the following:
a. Position the cursor at the location in the note where you want to insert the link.
2. Click Run .
Show me how
Note
Individually deleting all the record notes in a table does not delete the auto-
generated RecordNote field from the table layout, which means the note icon
continues to appear with the table icon in the Overview tab in the Navigator.
If your intention is to delete all the record notes in a table, use the method for
deleting all record notes, which also deletes the RecordNote field.
2. Click Run .
Show me how
1. Select Edit > Table Layout.
2. In the Edit Fields/Expressions tab, double-click the field you want to add a note to.
Note
If you choose to print the command log, the entire log is printed, which could be
numerous pages depending on the size of the log.
o Preferences – prints a list of the currently selected preference settings in the Options
dialog box
o Project Notes – prints any notes recorded for the project
o Log – prints the entire command log
o Page Break after each Category – inserts a page break after each project item category,
and after preferences, project notes, and log entries. If the checkbox is not selected, each
category is listed immediately after the previous category.
o Page Break after each Item – inserts a page break after each item within a category. For
example, if you have selected three scripts, a page break will be inserted after each of the
script definitions. If the checkbox is not selected, each item is listed immediately after the
previous item in the category.
5. Click Print.
6. In the Print dialog box, configure any necessary printer settings and click Print. You can use
the Print dialog box to modify settings, such as the printer to send the print job to and printer-
specific options such as the page size and page orientation.
Guidelines
When you attempt to open a project that closed unexpectedly, an ACL Analytics dialog box is
displayed presenting you with three options for recovering the project file. Select the appropriate
option from the following:
l Click Working if you made modifications to project items or performed analysis steps after
you last saved the project and you do not want to lose the log entries for these operations.
Note
The Working copy has the most complete information, but it may be corrupted
if Analytics closed while a command was being processed.
l Click Last-saved if any unsaved changes in the project are not important to you.
l Click Cancel if you want to retain the option of using either version of the project file. After you
close the dialog box, navigate to the Windows folder where the project files are stored and
create a backup of both the Working copy and the Last-saved version using different file
names.
Note
Analytics tables include a table layout, visible in the Navigator, and an associated
source data file with a .fil extension, not visible in the Navigator, stored in a Windows
folder.
Understanding the difference between the table layout and the source data file can
be important when saving results and specifying output folders.
For more information, see "The structure of Analytics tables" on page 118.
Saving results
When saving results to an Analytics table or a text file, you have the following options:
l Save – save the results to a new Analytics table or a text file
l Append – append the results to an existing Analytics table or a text file
l Overwrite – overwrite an existing Analytics table or a text file
Appending updates the source data file but does not alter the table layout. Overwriting replaces both
the source data file and the table layout.
Note
Some Analytics operations support saving result to either an Analytics table or a text
file, but not both.
Caution
Before saving results in this manner, you should be certain that overwriting source
data in another project is your intended outcome.
Table layout o the Analytics project folder containing the active table (the default)
o an Analytics project folder other than the active table folder, specified using the SET FOLDER
command
Source data file o the Windows folder containing the Analytics project (the default)
(.fil) o a Windows folder other than the folder containing the Analytics project
o the Prefix folder on AX Server (server tables only; the default)
o a folder on AX Server other than the Prefix folder (server tables only)
The output folder remains as whatever you set it – until you reset it, or close the project. When you
reopen the project, the output folder reverts to the default of the active table folder.
Note
File paths specified in the SET FOLDER command must use a forward slash.
SET FOLDER /Results The table layout is placed in the Results Analytics project folder rather than the active
table folder.
SET FOLDER /Result- The table layout is placed in the Duplicates Analytics project subfolder rather than the
s/Duplicates active table folder.
SET FOLDER / The table layout is placed in the Analytics project root directory rather than the active
table folder.
SET FOLDER Resets the output folder to the default of the active table folder.
Save results to new Analytics table Table layout added to same Table layout added to Analytics
Analytics project folder as active project folder specified by
table SET FOLDER command
Append results to existing Analytics Existing table layout not moved Existing table layout not moved
table in project
Save results and overwrite existing Table layout moved to same Table layout moved to Analytics
Analytics table in project Analytics project folder as active project folder specified by
table, unless already in same folder SET FOLDER command, unless
already in same folder
Append results to existing Analytics Table layout added to same Table layout added to Analytics
table in another project Analytics project folder as active project folder specified by
table SET FOLDER command
Tip:
To ensure the table layout is saved in the appropriate Analytics project folder,
begin the import process by right-clicking the folder.
4. Prior to performing an operation that saves results to an Analytics table, if necessary, use the
SET FOLDER command to specify the appropriate Analytics project folder for the resulting
table layout.
For more information, see "Saving results and specifying output folders" on page 194.
5. In the dialog box associated with the operation, specify the appropriate Windows folder for the
source data file using an absolute or relative file path, or by navigating to the folder.
For example: C:\Results\Classify.fil, or Results\Classify.fil.
Extracting data
Extracting allows you to copy some or all of the records or fields from an Analytics table to a new
Analytics table.
The new table can be:
l an identical copy containing all the source table records and fields
l a subset of the records in the source table
l a subset of the fields in the source table
l a subset of both the records and the fields in the source table
The existing sort order in the source table is maintained in the new table.
Note
Extracting data and appending it to the end of an existing Analytics table is a data
combining technique. It is explained in the section on combining data. For more
information, see "Extracting and appending data" on page 943.
Only fields that are currently displayed in the view are extracted. Any additional fields that are
part of the table layout but not displayed in the view are not extracted.
All fields in the view are extracted. If you want to extract a subset of fields, remove the
Which fields are unwanted fields from the view, create a new view with just the required fields, or use extract by
extracted? fields instead of extract by view.
The fields are extracted in the order they appear in the view. If you want to extract the fields in a
different order, rearrange them in the view, or create a new view with the fields in the desired
Field order order, prior to extracting.
Filtering If a filter is currently applied to the view, only the data that meets the filter criteria is extracted.
Records notes are extracted only if the RecordNote column has previously been added to the
Record notes view.
If any alternate column titles are specified at the view level, extract by view preserves the view-
Alternate column level titles. If you use the syntax in the command log to rerun the extract command, alternate
titles column titles specified in the table layout are used, and view-level titles are ignored.
Specifying extract by view is not supported in scripts or from the command line. When rendered
Scripts
in ACLScript, extract by view is actually an extract by fields ( EXTRACT FIELDS ) using all the
Command line fields in the active view, in the order in which they appear in the view.
Steps
You can extract some or all of the records or fields from an Analytics table and output them to a new
Analytics table.
Note
Extracting data and appending it to the end of an existing Analytics table is a data
combining technique. It is explained in the section on combining data. For more
information, see "Extract and append data" on page 948.
Show me how
1. Open the table from which you want to extract records or fields.
2. Select Data > Extract.
3. On the Main tab, select one of the following:
l Record – extract entire records
The fields in the record are extracted in the order they appear in the table layout.
l View – extract all the fields in the current view
The fields are extracted in the order they appear in the view.
l Fields – extract a selection of individual fields
The fields are extracted in the order you select them.
If you want to extract data from a child table in a table relation, select Fields, or select View if
the child table fields have previously been added to the view. You cannot extract child table
data using the Record option.
Note
If you are extracting one or more computed fields, selecting Record preserves
the extracted fields as computed expressions.
Selecting View or Fields converts the extracted fields to physical fields of the
appropriate data type and populates them with the actual computed values.
Note
The If condition is evaluated against only the records remaining in a table after
any scope options have been applied (First, Next, While).
o Click To and specify the name of the new Analytics table, or select an existing table in the
Save or Save File As dialog box to overwrite the table.
If Analytics prefills a table name, you can accept the prefilled name, or change it.
You can also specify an absolute or relative file path, or navigate to a different folder, to save
the new table or overwrite an existing table in a location other than the project location. For
example: C:\Results\GL_2011.fil or Results\GL_2011.fil. Regardless of where you
save or overwrite the table, it is added to the open project if it is not already in the project.
Note
Analytics table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
number.
7.l IfSelect
you are
Local
connected
to save to
thea output
server table
table,todothe
one
same
of the
location
following:
as the project, or to specify a path
or navigate to a different local folder.
l Leave Local deselected to save the output table to the Prefix folder on a server.
Note
For output results produced from analysis or processing of Analytics
Exchange server tables, select Local. You cannot deselect the Local setting
to import results tables to Analytics Exchange.
Select Use Output Table if you want the output table to open automatically upon completion
of the operation.
8.
9. Click the More tab.
10. Select the appropriate option in the Scope panel:
l All
l First
l Next
l While
Show me more
All This option is selected by default. Leave it selected to specify that all records in the view are
processed.
First Select this option and enter a number in the text box to start processing at the first record in the
view and include only the specified number of records.
Next Select this option and enter a number in the text box to start processing at the currently selected
record in the view and include only the specified number of records. The actual record number in
the leftmost column must be selected, not data in the row.
While Select this option to use a WHILE statement to limit the processing of records in the view based on
a particular criterion or set of criteria. You can enter a condition in the While text box, or click While
to create a WHILE statement using the Expression Builder.
A WHILE statement allows records in the view to be processed only while the specified condition
evaluates to true. As soon as the condition evaluates to false, the processing terminates, and no
further records are considered. You can use the While option in conjunction with the All, First, or
Next options. Record processing stops as soon as one limit is reached.
Note
The number of records specified in the First or Next options references either the physical or
the indexed order of records in a table, and disregards any filtering or quick sorting applied to
the view. However, results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
11. If required, select EOF (End of file processing) to force the extract operation to execute one
more time when the end of a table is reached.
The EOF parameter is usually used if you are extracting records as part of a larger analytic
process and the Extract command occurs inside a group in a script. If you are extracting
records based on a comparison between sequential records, you may need to use EOF to
ensure the final record in a table is extracted.
12. Click OK.
13. If the overwrite prompt appears, select the appropriate option.
Exporting data
You can export Analytics data to other file formats so that you can use the data in other applications:
l Microsoft Excel (*.xlsx, *.xls)
l Text (*.txt)
l Delimited text (*.del)
l Comma-separated values (*.csv)
l Microsoft Access (*.mdb)
l XML (*.xml)
l JSON (*.json)
l dBASE III PLUS (*.dbf)
l Windows clipboard for pasting into other documents or applications
Note
You must have 32-bit Microsoft Access Database Engine installed to export to older
Excel files (*.xls) and Microsoft Access files (*.mdb). For more information, see
"Exclude optional Microsoft Access Database Engine" on page 2689.
Exporting to Excel
You can export Analytics tables as individual Excel worksheets in newly created or existing Excel
files. Exporting to an existing Excel file is supported for *.xlsx only.
Limit Details
Number of records o Excel 2007 and later (*.xlsx) – a maximum of 1,048,576 records by 16,384 fields
(maximum worksheet size supported by Excel)
o Excel 97 and 2003 – a maximum of 65,536 records
Analytics tables that exceed these maximums export successfully, but the excess
records are ignored and not exported.
Steps
You can export some or all of the records or fields in an Analytics table to use in other applications.
Show me how
When you select this option, the fields are exported using the physical field names in the
table layout.
For information about renaming fields, see "Rename a field in a table layout" on page 823.
l View – export all fields in the current view
When you select this option, the fields are exported using the column display names. The
fields are exported in the same order as they appear in the view.
For information about renaming columns, see "Rename columns in a view" on page 852.
3. If you chose Fields, do one of the following:
l Select the field(s) to export from the Export Fields list.
Tip
To export to a comma-separated values file (*.csv), select Delimited
and make sure to select a comma , in the Column Separator drop-down
list. When specifying the export file name in the To field, include the .csv
file extension. For example: vendors.csv
Note
If you specify a worksheet name, it can contain only alphanumeric
characters or the underscore character ( _ ). The name cannot contain
special characters, spaces, or start with a number.
You can overwrite a worksheet in an existing Excel file, but only if the
worksheet was originally created by exporting from Analytics to Excel.
You cannot overwrite worksheets that were created directly in Excel,
or any worksheet that has been renamed.
XML o Optionally select Export with XML Schema to include the XML Schema in the
exported XML file.
The XML Schema contains metadata that describes the structure of the XML file,
including the data type of the fields. You can validate the file against the Schema
once the file has been exported.
Note
The Unicode option is available only when you export to Clipboard,
Delimited, Text, or XML.
For more information, see "Diligent Unicode products" on page 2698.
HighBond o See "Exporting exceptions to the Results app in HighBond" on page 214.
(HighBond users only)
Robots o See "Exporting data to the Robots app in HighBond" on page 222.
(HighBond users only)
Note
The If condition is evaluated against only the records remaining in a table after
any scope options have been applied (First, Next, While).
The IF statement considers all records in the view and filters out those that do not meet the
specified condition.
2. Do one of the following:
o In the To text box, specify the name of the file that will contain the exported data.
o Click To and specify the file name, or select an existing file in the Save or Save File As
dialog box.
If Analytics prefills a table name, you can accept the prefilled name, or change it.
Note
If you are exporting data to the clipboard, the To text box is disabled because
you are not saving the data in a file.
l While
Show me more
All This option is selected by default. Leave it selected to specify that all records in the view are
processed.
First Select this option and enter a number in the text box to start processing at the first record in the
view and include only the specified number of records.
Next Select this option and enter a number in the text box to start processing at the currently selected
record in the view and include only the specified number of records. The actual record number in
the leftmost column must be selected, not data in the row.
While Select this option to use a WHILE statement to limit the processing of records in the view based on
a particular criterion or set of criteria. You can enter a condition in the While text box, or click While
to create a WHILE statement using the Expression Builder.
A WHILE statement allows records in the view to be processed only while the specified condition
evaluates to true. As soon as the condition evaluates to false, the processing terminates, and no
further records are considered. You can use the While option in conjunction with the All, First, or
Next options. Record processing stops as soon as one limit is reached.
Note
The number of records specified in the First or Next options references either the physical or
the indexed order of records in a table, and disregards any filtering or quick sorting applied to
the view. However, results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
5. If you are exporting to a delimited file or a text file, optionally select Append To Existing File if
you want to append the exported data to the end of an existing file.
6. Click OK.
7. If the overwrite prompt appears, select the appropriate option.
If you use HighBond, you can export exception data in an Analytics table to a table in Results. To
export exceptions, you use the standard procedure for exporting data from Analytics, with some
minor differences.
Results is a remediation and workflow automation app that manages exception data, adds human
context through questionnaires, and makes your monitoring continuous with triggers and metrics.
For more information, see Working with data in Results.
Security requirements
The ability to export exception data to a control test in Results requires a specific HighBond role
assignment, or administrative privileges:
l Users with a Professional User or Professional Manager role for a Results collection can
export results to any control test in the collection.
Note
Only users with the Professional Manager role can overwrite existing data in a
control test.
l HighBond account admins and Results admins automatically get a Professional Manager role
in all collections in the HighBond instances they administer.
For more information, see Results app permissions.
Export limits
The limits that apply when exporting to a control test in Results are shown below.
Within these limits, you can export multiple times to the same control test. If data already exists in
the control test, you have the option of overwriting it, or appending the new data.
Note
Although you can export up to 100,000 records to a control test, a better approach is
to create smaller, more focused exception sets.
Item Maximum
Note
When you append data to questionnaire fields, the display name of the column in
Results remains the name that is specified in the questionnaire configuration, even if
you changed the display name in Analytics.
Overwrite option not exported data is appended to the existing o matching value – if a matching value
selected Results table exists in the primary key field in
Results and the corresponding field
exported from Analytics, the record in
Results is updated with the values
present in the exported record
o no matching value – if a matching
value does not exist in the primary key
field in Results and the corresponding
field exported from Analytics, the
record in Results is not updated and
the exported record is appended to the
table
Overwrite option selected exported data replaces (overwrites) the exported data replaces (overwrites) the
existing Results table existing Results table
When you select this option, the fields are exported using the physical field names in the
table layout.
For information about renaming fields, see "Rename a field in a table layout" on page 823.
l View – export all fields in the current view
When you select this option, the fields are exported using the column display names. The
fields are exported in the same order as they appear in the view.
For information about renaming columns, see "Rename columns in a view" on page 852.
Tip
You can Ctrl+click to select multiple non-adjacent fields, and Shift+click to
select multiple adjacent fields.
If you want to append the exported data to the existing table in Results leave Overwrite
deselected.
Note
Analytics fields can only be appended to existing Results fields if they have
matching physical field names, regardless of their display name in either
application. In Analytics, the physical field name is the name in the table
layout.
The order of fields within the two applications does not affect field name
matching.
Exported fields with physical names that do not match the physical name of
a field in the Results table create new columns in the table.
Include field display Field name in Results is the field name from Analytics. Display name in Results is the
name selected display name from Analytics.
Include field display Field name and display name in Results Field name and display name in Results
name not selected are the field name from Analytics. are the display name from Analytics.
Note
Do not select Include field display name if you are appending a view to a
Results table that was initially created by exporting a view from an Analytics
version older than 14.1. Doing so may export columns with field names that are
not the same as the names in Results, which will create new columns
in Results and misalign the data between applications.
Note
The If condition is evaluated against only the records remaining in a table after
any scope options have been applied (First, Next, While).
The IF statement considers all records in the view and filters out those that do not meet the
specified condition.
2. Do one of the following:
If you know the ID number of the table you are exporting to:
Enter the number in the To text box.
l Enter the number without any quotation marks – for example, 99
l Enter only the number. Do not enter a file name.
l If you are exporting to a data center other than North America (US), you must also specify
the data center code. The control test ID number and the data center code must be
separated by the at sign (@) – for example, 99@eu. The data center code specifies which
regional HighBond server you are exporting the data to.
l af – Africa (South Africa)
l ap – Asia Pacific (Singapore)
l au – Asia Pacific (Australia)
l ca – North America (Canada)
l eu – Europe (Germany)
l jp – Asia Pacific (Tokyo)
l sa – South America (Brazil)
l us – North America (US)
You can use only the data center code or codes authorized for your organization's instance
of HighBond. The North America (US) data center is the default, so specifying @us is
optional.
If you do not know the ID number of the table you are exporting to, or if you want to create
a new table:
a. Click To, and in the Select Destination Test dialog box navigate to the appropriate
analysis folder.
l Enter a name in the New data analytic field and click Create.
You are returned to the Export dialog box and the control test ID number and data center
code are prefilled in the To text box.
3. Click the More tab.
4. Select the appropriate option in the Scope panel:
l All
l First
l Next
l While
Show me more
All This option is selected by default. Leave it selected to specify that all records in the view are
processed.
First Select this option and enter a number in the text box to start processing at the first record in the
view and include only the specified number of records.
Next Select this option and enter a number in the text box to start processing at the currently selected
record in the view and include only the specified number of records. The actual record number in
the leftmost column must be selected, not data in the row.
While Select this option to use a WHILE statement to limit the processing of records in the view based on
a particular criterion or set of criteria. You can enter a condition in the While text box, or click While
to create a WHILE statement using the Expression Builder.
A WHILE statement allows records in the view to be processed only while the specified condition
evaluates to true. As soon as the condition evaluates to false, the processing terminates, and no
further records are considered. You can use the While option in conjunction with the All, First, or
Next options. Record processing stops as soon as one limit is reached.
Note
The number of records specified in the First or Next options references either the physical or
the indexed order of records in a table, and disregards any filtering or quick sorting applied to
the view. However, results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
5. Click OK.
A progress indicator appears while the exception data is exported to Results. When the export
operation is complete, an entry is created in the log.
Password requirement
Password not required
You do not need to specify a password to export to Results if you used online activation to activate
your copy of Analytics. The password is automatically created and sent to Results based on
activation information stored on your computer.
Password required
You need to specify a password to export to Results in either of these situations:
l you used offline activation to activate your copy of Analytics
l you use a script to export to Results, and you run the script in Robots
The required password value is a HighBond access token.
l In the Script Editor, right-click and select Insert > HighBond Token.
The Manage API tokens page opens in your browser. You may be required to first sign in to
HighBond.
Tip
Access to the Manage API tokens page through Analytics is a convenience
feature. You can also sign in to HighBond and access the page through your
user profile without using Analytics.
to use and enter your HighBond account password. The unmasked token is displayed.
Tip
Use an existing token unless you have a reason for creating a new one. If the
existing token does not work, create a new one.
Using an existing token cuts down on the number of tokens you need to
manage.
l Create a new token – Click Create token > Analytics and enter your HighBond account
password.
A new Analytics token is created.
3. Click Copy to copy the token.
Tip
Do not close the dialog box containing the token until you have successfully
pasted the token.
4. Depending on which data access and password definition method you are using, do one of
the following:
Analytics user interface
Paste the copied token into a password prompt that appears when accessing HighBond
manually.
Analytics script
l PASSWORD command – Paste the copied token into a password prompt that appears
during script execution.
l SET PASSWORD command – Paste the copied token at the appropriate point in the SET
PASSWORD command syntax in a script.
5. In Launchpad, close the dialog box containing the token.
If you created a new token, a partially masked version of the token is added to the top of your
list of tokens.
For more information, see Creating and managing access tokens.
If you use the Robots app in HighBond, you can export (upload) the data in a local Analytics table to
a compressed CSV file (*.csv.gz) in Robots. You can export to the Working data tab in either a
HighBond robot or a Workflow robot, where you can use Python/HCL scripting to analyze or process
the data. You cannot export to an ACL robot.
For organizations that use ACL scripts and an on-premise Robots Agent, this capability allows you
to build integrated ACLScript-Python/HCL data automation workflows that move data from your
local network to your cloud-based Robots instance.
For more information about how to access the compressed CSV file after exporting it to Robots, see
load_working_file() method. For an overview of the Robots app, see Automating work with Robots.
Note
Data uploaded to Robots is stored in secured AWS data centers and is encrypted in
transit and at rest. For more information, see Diligent Trust Center.
Security requirements
The ability to upload a compressed CSV file to the Robots app requires a specific robot role
assignment, or administrative privileges:
l Users with an Editor or Owner role for a robot can upload a compressed CSV file to the robot.
Users with a Reviewer role cannot upload.
l Robots Admins are automatically a collaborator for every robot, with the role of Owner.
l A HighBond System Admin with a Professional subscription is automatically a Robots Admin.
For more information, see Robots app permissions.
When you select this option, the fields are exported using the physical field names in the
table layout.
For information about renaming fields, see "Rename a field in a table layout" on page 823.
l View – export all fields in the current view
When you select this option, the fields are exported using the column display names. The
fields are exported in the same order as they appear in the view.
For information about renaming columns, see "Rename columns in a view" on page 852.
4. If you chose Fields, do one of the following:
l Select the field(s) to export from the Export Fields list.
Tip
You can Ctrl+click to select multiple non-adjacent fields, and Shift+click to
select multiple adjacent fields.
Note
Fields are exported in the order that you select them.
Note
Appending data to an existing *.csv.gz file is not supported. If Overwrite is
deselected and a file with the same name already exists in the destination
robot, the export fails with an error.
Note
The If condition is evaluated against only the records remaining in a table after
any scope options have been applied (First, Next, While).
The IF statement considers all records in the view and filters out those that do not meet the
specified condition.
2. Click To, and in the Select Destination dialog box navigate to the appropriate robot.
Robots are listed in alphabetical order, with HighBond robots listed first, followed by Workflow
robots.
3. Select the robot.
When you select a robot, a notification beneath the list of robots includes the robot type.
4. Under Environment, select either Development or Production to specify which robot mode
the file is exported to.
5. Click OK.
You are returned to the Export dialog box and the HighBond API URL for the destination robot
is prefilled in the To text box.
6. Click the More tab.
7. Select the appropriate option in the Scope panel:
l All
l First
l Next
l While
Show me more
All This option is selected by default. Leave it selected to specify that all records in the view are
processed.
First Select this option and enter a number in the text box to start processing at the first record in the
view and include only the specified number of records.
Next Select this option and enter a number in the text box to start processing at the currently selected
record in the view and include only the specified number of records. The actual record number in
the leftmost column must be selected, not data in the row.
While Select this option to use a WHILE statement to limit the processing of records in the view based on
a particular criterion or set of criteria. You can enter a condition in the While text box, or click While
to create a WHILE statement using the Expression Builder.
A WHILE statement allows records in the view to be processed only while the specified condition
evaluates to true. As soon as the condition evaluates to false, the processing terminates, and no
further records are considered. You can use the While option in conjunction with the All, First, or
Next options. Record processing stops as soon as one limit is reached.
Note
The number of records specified in the First or Next options references either the physical or
the indexed order of records in a table, and disregards any filtering or quick sorting applied to
the view. However, results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
8. Click OK.
A progress indicator appears while the data is exported to Robots. When the export operation
is complete, an entry is created in the log.
If the data export was successful, a file with the name <Analytics table name>.csv.gz
appears in the Working data tab in the destination robot.
Password requirement
Password required
You need to specify a password to export to Robots in either of these situations:
l you use a script to export to Robots, and you run the script in Robots
l you used offline activation to activate your copy of Analytics
The required password value is a HighBond access token.
l In the Script Editor, right-click and select Insert > HighBond Token.
The Manage API tokens page opens in your browser. You may be required to first sign in to
HighBond.
Tip
Access to the Manage API tokens page through Analytics is a convenience
feature. You can also sign in to HighBond and access the page through your
user profile without using Analytics.
to use and enter your HighBond account password. The unmasked token is displayed.
Tip
Use an existing token unless you have a reason for creating a new one. If the
existing token does not work, create a new one.
Using an existing token cuts down on the number of tokens you need to
manage.
l Create a new token – Click Create token > Analytics and enter your HighBond account
password.
A new Analytics token is created.
3. Click Copy to copy the token.
Tip
Do not close the dialog box containing the token until you have successfully
pasted the token.
4. Depending on which data access and password definition method you are using, do one of
the following:
Analytics user interface
Paste the copied token into a password prompt that appears when accessing HighBond
manually.
Analytics script
l PASSWORD command – Paste the copied token into a password prompt that appears
during script execution.
l SET PASSWORD command – Paste the copied token at the appropriate point in the SET
PASSWORD command syntax in a script.
5. In Launchpad, close the dialog box containing the token.
If you created a new token, a partially masked version of the token is added to the top of your
list of tokens.
For more information, see Creating and managing access tokens.
were primary or unique keys in a source database. However, Analytics does not contain this
information.
The same situation is true when you directly access database tables using an Analytics database
profile. Analytics retains no information about which fields are key fields in the database, and you
may need to know this information yourself when constructing a database query.
Concatenating fields
If your analysis requires testing or processing two or more fields in a table as a single data element,
you can create a computed field that concatenates (adds together) the fields. You can then test or
process the combined data in the computed field.
For example, you could concatenate first, middle, and last name fields into a single field containing
full names, or concatenate vendor ID and location code fields to produce unique identifiers for each
outlet of every retail chain in a table.
Note
You can concatenate only character fields. If necessary, use Analytics functions to
convert non-character data prior to concatenating.
7. Click Accept Entry and click Close to exit the Table Layout dialog box.
For information about how to add the computed field to the view, see "Add columns to a view"
on page 850.
You can use Analytics to generate a set of random numbers. You can specify certain parameters,
such as the size of the set, and the range.
Typically, the set of generated values is used for applications outside Analytics, such as drawing a
random selection of hard-copy files.
Note
If you require a random selection to be statistical valid or representative of the entire
population, you need to follow a more formal sampling process. For more
information, see "Sampling data" on page 1023.
Note
You should not select Unique when the specified size of the set of random
numbers exceeds 75 percent of the range between Minimum and
Maximum. Doing so can result in too many random number selections
being discarded.
o Sorted – Specifies that the set of random numbers is displayed in ascending order.
By default, the numbers are displayed in the order in which they are randomly selected.
o Append To Existing File – Specifies that the output results should be appended to the end
of an existing file instead of overwriting the existing file.
3. Click the Output tab.
4. Select the appropriate output option in the To panel:
o Screen – displays the set of random numbers in the Results tab in the Analytics display
area.
o File – saves the set of random numbers to a text file.
5. If you selected File as the output type, specify the file name in the Name text box in the As
panel, or click Name and browse to select an existing file.
If the Append To Existing File checkbox is selected the output is appended to a file with the
same name, if found, otherwise you are prompted to either overwrite the file or append the
output.
You can also specify an absolute or relative file path, or navigate to a different folder, to save
or append the output to a file in a location other than the project location. For example:
C:\Output\random.txt or Output\random.txt.
6. Click OK.
Steps
1. Open the table from which you want to randomly select records.
2. From the main menu, select Sampling > Record/Monetary Unit Sampling > Sample.
3. Under Sample Type, select Record.
4. Under Sample Parameters, select Random.
5. Specify the following values:
l Size – the number of records that you want to randomly select
l Seed – (optional) a seed value to initialize the Analytics random number generator
The seed value can be any number. You can recreate the same random selection of
records by respecifying the same seed value.
Enter a seed value of ‘0’, or leave the seed blank, if you want Analytics to randomly select a
seed value.
Population – the total number of records in the table
l
6. Click OK.
Navigate or con- Navigate to a source data file, or connect to a file or a database containing the source
1 nect data.
Define the source data, which means: specify information about the structure and
characteristics of the source data so that Analytics can read it.
Note
Analytics automatically defines certain source data formats so that user
2 Define definition of the data is not required.
Import or read dir- Import the source data into a native Analytics data file, or read the data directly from
3 ectly the source without creating an Analytics data file.
Name and save the Name and save the automatically created Analytics table.
4 Analytics table
Note
When connecting to any data source, or importing from any data source, Analytics is
strictly read-only. For more information, see "Data access by Analytics is read-only"
on page 241.
No Yes
Import multiple tables (Yes for Excel) (up to 5)
Yes Yes
(basic) (modern interface, easily
Preview data import refreshable)
Note
The maximum record length supported by an Analytics data file (.fil) is 32 KB. Any
record that exceeds 32 KB causes the import process to fail.
Note
Certain requirements or prerequisites exist when using the Data Access window to
connect to a database or a cloud data service. For more information, see "Before
you connect to a database or a cloud data service" on page 370.
HighBond
External Definition
Note
You can use the Data Access window to access any ODBC-compliant data source,
not just the data sources listed below. For more information, see "Using the Data
Access window to access any ODBC data source" on page 240.
o Amazon Athena
o Amazon DynamoDB
o Amazon Redshift
o Apache Cassandra
o Apache Drill
o Apache HBase
o Apache Hive
Big Data and NoSQL o Apache Phoenix
o Apache Spark
o Azure Data Catalog
o Azure Data Lake Storage
o Azure Table
o CockroachDB
o Couchbase
o Elasticsearch
o Google BigQuery
o IBM Cloudant
o MarkLogic
o MongoDB
o Parquet
o Presto
o Snowflake
o Concur
o Dynamics 365 Business Central
o Dynamics 365 Finance and Operations
o Dynamics 365 Sales
o Dynamics CRM
o Epicor ERP
o Exact Online
o NetSuite
o Odoo
o Oracle HCM Cloud
o Salesforce
o SAP
o SAP ByDesign
o ServiceNow
o SugarCRM
o SuiteCRM
ERP and CRM systems o Workday
o ADP
o Dynamics GP
o Dynamics NAV
o QuickBooks
o QuickBooks Online
o QuickBooks POS
o Sage 50 UK
o Sage Cloud Accounting
o Sage Intacct
Accounting tools o SAP Concur
o Google Analytics
o LinkedIn
o Marketo
o Oracle Eloqua
o Oracle Sales Cloud
o Splunk
o SurveyMonkey
Marketing and analytics o Twitter
o Active Directory
o Airtable
o AWS Data Management
o Azure Management
Collaboration solutions o Basecamp
o DocuSign
o Email
o Excel
o Excel Online
o Exchange
o Google Contacts
o Google Sheets
o Jira
o Kintone
o Microsoft Teams
o SAP SuccessFactors
o SharePoint
o Slack
o Zendesk
o Amazon S3
o Box
o CSV
o DigitalOcean
o Dropbox
o Google Cloud Storage
o Google Drive
o JSON
o LDAP
o Microsoft OneDrive
o OData
o REST Services
o RSS/ATOM
File and API integration o SFTP
o Edgar Online
o Open Exchange Rates
o ShipStation
o Square
o Stripe
o UPS
E-commerce solutions o USPS
o Qualys
Security tools o Tenable.sc
Note
You can also import data using the Data Access window. For more information, see
"Importing data using the Data Access window " on page 366.
When connecting to any data source, or importing from any data source, Analytics is
strictly read-only. For more information, see "Data access by Analytics is read-only"
on page 241.
Defining data
You may be required to define the data as you import it, which means to specify metadata such as:
l field names
l field lengths
l field data types
l format of numeric and datetime values
The image below shows the definition of the DATE field in an Excel worksheet being imported using
the Data Definition Wizard.
Import Microsoft Excel data to Analytics for analysis using a variety of different tools.
Note
You must have 32-bit Microsoft Access Database Engine installed to import from
older Excel files (*.xls). For more information, see "Exclude optional Microsoft
Access Database Engine" on page 2689.
How it works
You use the Data Definition Wizard to select one or more Excel files, specify one or more
worksheets to import, and import the Excel data to Analytics. The imported data creates one or more
new Analytics tables and associated data files (.fil). Each imported worksheet creates a separate
Analytics table.
The Analytics data file contains a copy of the Excel data that is completely separate from the original
Excel file.
You can import data from an Excel file even if you do not have Microsoft Excel installed on your
computer.
Tip
To reduce labor, try combining the multiple tables first before making any required
adjustments to the data definition in the new combined table.
Guidelines
Review the guidelines below to assist you with importing Excel data.
Note
When the new table opens in Analytics, a maximum of 256 columns are displayed in
the default view. If the table contains additional columns, you can manually add
them to the view, if required.
Excel 97 – 2003
The import of .xls files (Excel 97 - 2003) uses an older type of processing, and is subject to the
following maximums:
l 255 columns
l 255 characters per field
l 32 KB per record
l 65,000 rows
Same "Output Path" as existing source Different "Output Path" from existing source
data file data file
Same "Output Path" as existing source Different "Output Path" from existing source
data file data file
o new table layout and source data file o new table layout and source data file
created, with numeric suffix created, with numeric suffix
For example: For example:
l table layout –Table_A2 l table layout –Table_A2
l source data file –Table_A2.fil l source data file –Table_A2.fil
"Overwrite existing o existing table layout and source data file o existing table layout and source data file
tables" not selected preserved preserved
Same "Output Path" as existing source Different "Output Path" from existing source
data file data file
o new table layout created o new table layout and source data file
o existing source data file overwritten created
"Overwrite existing o new and existing table layouts both linked o existing table layout and source data file
tables" selected to source data file preserved
o new table layout and source data file o new table layout and source data file
created, with numeric suffix created
o existing table layout and source data file
For example:
preserved
l table layout –Table_A2
l source data file –Table_A2.fil
"Overwrite existing o existing table layout and source data file
tables" not selected preserved
Same "Output Path" as existing source Different "Output Path" from existing source
data file data file
o existing table layout overwritten, linked to o existing table layout overwritten, linked to
new source data file new source data file
o new source data file created o new source data file created
"Overwrite existing o existing source data file preserved, o existing source data file preserved,
tables" selected unlinked unlinked
o new table layout and source data file o new table layout and source data file
created, with numeric suffix created, with numeric suffix
For example: For example:
l table layout –Table_A2 l table layout –Table_A2
l source data file –Table_A2.fil l source data file –Table_A2.fil
"Overwrite existing o existing table layout and source data file o existing table layout and source data file
tables" not selected preserved preserved
Note
Make sure the Excel file is closed before you begin the import process.
Note
To see any named ranges, deselect System Table Only.
Worksheets are identified with a dollar sign ($) appended to the worksheet name. The dollar
sign is added temporarily, and does not appear in the Analytics table name.
2. Review the default settings on the page, make any required updates, and click Next.
Setting Description
Values in the first row in the worksheet or the named range are used as field names
in the Analytics table.
Note
Use first row as Field If you use this setting, the row used as field names is whatever line
Names number is specified in Start On Line.
Note
The start line for a named range is always the first line in the named
Start On Line range, regardless of the Start On Line setting.
Import all fields as Assigns the Character data type to all the imported fields.
character type
Setting Description
Tip
Assigning the Character data type to all the imported fields
simplifies the process of importing Excel files.
Once the data is in Analytics, you can assign different data types,
such as Numeric or Datetime, to the fields, and specify format
details.
Import all fields as character type is useful if you are importing a
table with identifier fields automatically assigned the Numeric data
type by Analytics when in fact they should use the Character data
type.
Analytics uses only the first 100 records in the worksheet or the named range to
determine the data type of fields, and the length of fields, in the Analytics table.
With large Excel files, using First 100 records significantly speeds up the import
process.
Caution
Select this option only if you are confident that values in the first 100
records accurately reflect the data type and length of all subsequent
values.
If any values after the first 100 records are of a different data type,
or are longer, the resulting Analytics table will contain inaccurate or
truncated data.
Inaccurate or truncated data in critical fields will very likely
First 100 records invalidate the results of subsequent data analysis.
Analytics uses all the records in the worksheet or the named range to determine
the data type of fields, and the length of fields, in the Analytics table.
With large Excel files, using all the records to determine data type and field length
significantly slows down the import process.
Note
Entire Excel Worksheet Select this option if you are uncertain about the consistency of the
or Named Range data types or the length of values in the Excel data.
Property Description
Column Title The column title for the field in the default Analytics view.
If you do not specify a column title, the Name value is used.
Length The length of the field in the table layout. Specify the length in characters.
If a datetime field has no time data and displays 00:00:00 after the date, you can shorten the
length of the field to omit the empty time data.
Note
Maximum field length is 32,767 characters (non-Unicode edition) or 16,383
characters (Unicode edition). The entire field length, up to the maximum, is
imported into Analytics, but only the first 256 characters are displayed in the
table view. The remainder of the data is present, and can be analyzed, but it is
not visible in the view. To see all the data, open the Table Layout dialog box.
Tip
Increase the length of a field if you selected First 100 records in the previous
screen, but you are uncertain about the length of subsequent values in the
field.
Note
If you selected Import all fields as character type in the Data Source page, the options below do not
apply and are disabled.
Value A read-only property that displays the first value in the field.
The value dynamically updates based on any edits you make.
Decimal Numeric fields only. The number of decimal places in the source data.
Note
The Decimal text box appears automatically when you select a Numeric data
type.
Input Format Datetime fields only. The format of datetime values in the source data.
Select a format that matches the data, or if necessary create a format to match the data. The
format you specify must exactly match the format in the source data.
For more information about date and time formats, see "Formats of date and time source data"
on page 360.
Property Description
Note
The Input Format text box appears automatically when you select a Datetime
data type.
Note
Analytics table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
number.
Note
Make sure all Excel files are closed before you begin the import process.
All first rows in the worksheets and named ranges that you import should use a
consistent approach. First rows should be either field names, or data, across all data
sets. Avoid mixing the two approaches in a single import operation.
If the data sets have an inconsistent approach to first rows, use two separate import
operations.
Note
To see any named ranges, deselect System Table Only.
Select individual worksheets or named ranges, or select the first checkbox if you want to
select all the worksheets and named ranges in the Excel file or files.
Worksheets are identified with a dollar sign ($) appended to the worksheet name. The dollar
sign is added temporarily, and does not appear in the resulting Analytics table name.
2. Review the settings assigned by Analytics, make any required updates, and click Next.
Setting Description
Note
The table name applies to both the new table layout and the new source
Table Name data file created when importing the data.
Use first row as Values in the first row in each worksheet or named range are used as field names in the
Field Names resulting table layouts.
Setting Description
Note
If you use this setting, the row used as field names is whatever line
number is specified in Start On Line.
This setting applies globally to all worksheets and named ranges that you
import.
Existing tables with identical names in the Analytics project are overwritten.
Overwrite existing
tables For detailed information, see "How overwriting works" on page 249.
Note
The start line for a named range is always the first line in the named
Start On Line range, regardless of the Start On Line setting.
Prepend the Excel file name to the name of the Analytics table or tables.
Tip
If worksheets in different files have the same name, prepending the
Include File Name Excel file name allows you to avoid table name conflicts.
Tip
Assigning the Character data type to all the imported fields simplifies the
process of importing Excel files.
Once the data is in Analytics, you can assign different data types, such
as Numeric or Datetime, to the fields, and specify format details.
Import all fields as character type is useful if you are importing a table
Import all fields as with identifier fields automatically assigned the Numeric data type by
character type Analytics when in fact they should use the Character data type.
Analytics uses only the first 100 records in the worksheet or named range to determine
the data type of fields, and the length of fields, in the resulting Analytics tables.
With large Excel files, using First 100 records significantly speeds up the import
First 100 records process.
Setting Description
Caution
Use this option only if you are confident that values in the first 100
records accurately reflect the data type and length of all subsequent
values.
If any values after the first 100 records are of a different data type, or are
longer, the resulting Analytics table will contain inaccurate or truncated
data.
Inaccurate or truncated data in critical fields will very likely invalidate the
results of subsequent data analysis.
Analytics uses all the records in the worksheet or named range to determine the data
type of fields, and the length of fields, in the resulting Analytics tables.
With large Excel files, using all the records to determine data type and field length signific-
antly slows down the import process.
Specifies the folder where the new Analytics data files (.fil) are saved.
If you leave Output Path blank, the Analytics data files are saved in the folder containing
Output Path the Analytics project.
Note
If a numeric suffix has been added to a Table Name in the Final page, a table with
the same name already exists in the Analytics project and you have chosen not to
overwrite existing tables.
For detailed information, see "How overwriting works" on page 249.
You can create an Analytics table by defining and importing a Microsoft Access database file.
The Access file can be any version from Access 2000 to Access 2010. To import a file from an
earlier version of Access you can save the file in another file format that Analytics can define and
import.
You can import an Access file even if you do not have Microsoft Access installed on your computer.
Note
You must have 32-bit Microsoft Access Database Engine installed to import from a
Microsoft Access database file. For more information, see "Exclude optional
Microsoft Access Database Engine" on page 2689.
9. Enter a name for the Analytics table you are adding to your project and click OK.
Note
Analytics table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
number.
Import a delimited text file to Analytics for analysis using a variety of different tools.
How it works
You use the Data Definition Wizard to select one or more delimited text files and import the data to
Analytics. The imported data creates one or more new Analytics tables and associated data files
(.fil). Each imported delimited text file creates a separate Analytics table.
The Analytics data file contains a copy of the delimited data that is completely separate from the
original delimited text file.
You can import delimited text files located on your local computer or on a network drive. Users of
Analytics Exchange can also access delimited text files located on an Analytics Server.
Tip
To reduce labor, try combining the multiple tables first before making any required
adjustments to the data definition in the new combined table.
First_Name,Last_Name,CardNum,EmpNo,HireDate,Salary,Bonus_2011
Lila,Remlawi,8590122497663807,000008,12/28/2007,52750,"$1,405.40"
Vladimir,Alexov,8590122281964011,000060,10/5/2007,41250,"$4,557.43"
Alex,Williams,8590124253621744,000104,8/12/2010,40175,"$7,460.02"
Same "Output Path" as existing source Different "Output Path" from existing source
data file data file
"Overwrite existing o error message "Existing file or table o error message "Existing file or table
tables" not selected names detected" appears names detected" appears
Same "Output Path" as existing source Different "Output Path" from existing source
data file data file
o new table layout created o new table layout and source data file
o existing source data file overwritten created
"Overwrite existing o new and existing table layouts both linked o existing table layout and source data file
tables" selected to source data file preserved
o error message "Existing file or table o new table layout and source data file
names detected" appears created
"Overwrite existing o existing table layout and source data file
tables" not selected preserved
Same "Output Path" as existing source Different "Output Path" from existing source
data file data file
o existing table layout overwritten, linked to o existing table layout overwritten, linked to
new source data file new source data file
o new source data file created o new source data file created
"Overwrite existing o existing source data file preserved, o existing source data file preserved,
tables" selected unlinked unlinked
"Overwrite existing o error message "Existing file or table o error message "Existing file or table
tables" not selected names detected" appears names detected" appears
Start on Line The line number on which to start reading the file.
This setting allows you to skip lines at the beginning of a file that contain information you
do not want to import. For example, if the first three lines of a file contain header
information, enter 4 to start reading data on the fourth line.
Field Width For the selected column heading in the preview table, specifies the length of the field in
the resulting table layout. Specify the length in characters.
Analytics automatically assigns a length that matches the longest value in the field. You
can keep the assigned length, or specify a different length. Field values that exceed the
specified field length are truncated in the resulting Analytics table.
Tip
If you intended to periodically refresh the resulting Analytics table from
updated source data, or re-use the import command, enter a longer field
length than the one assigned by Analytics.
A longer field length provides extra space if updated values in the source
data are longer than any of the current values.
Note
Maximum field length is 32,767 characters (non-Unicode edition) or
16,383 characters (Unicode edition). The entire field length, up to the
maximum, is imported into Analytics, but only the first 256 characters are
displayed in the table view. The remainder of the data is present, and can
be analyzed, but it is not visible in the view. To see all the data, open the
Table Layout dialog box.
Use first row as Values in the first line in the file are used as field names in the resulting table layout.
field names
Note
If you use this setting, the row used as field names is whatever line
number is specified in Start on Line. If the field names are not correct,
you can update them in a subsequent page in the Data Definition
Wizard.
Property Description
o TAB
o Semicolon
o Other – allows you to specify the character that is used as the field separator
Text Qualifier The text symbol that identifies values contained in fields:
o Double Quote
o Single Quote
o None – indicates that no text qualifier is used
o Other – allows you to specify the character that is used as the text qualifier
Clear CR and Cleanses the imported data of misplaced carriage return (CR) and/or line feed (LF)
Clear LF characters.
Misplaced CR/LF characters can cause incorrect line breaks within records. When
enabled, the option replaces any CR/LF characters with a space. Only CR/LF characters
that occur inside a pair of text qualifiers are replaced.
For Windows files, select both Clear CR and Clear LF.
The two options are disabled if Text Qualifier is None.
All Character Assigns the Character data type to all the imported fields.
Tip
Assigning the Character data type to all the imported fields simplifies the
process of importing delimited text files.
Once the data is in Analytics, you can assign different data types, such
as Numeric or Datetime, to the fields, and specify format details.
The All Character option is useful if you are importing a table with
identifier fields automatically assigned the Numeric data type by
Analytics when in fact they should use the Character data type.
Note
Select a column heading in the preview table to see the properties associated with
the column.
Property Description
Ignore this field Excludes the field from the resulting table layout.
The data in the field is still imported, but it is undefined, and does not appear in the new
Analytics table. It can be defined later, if necessary, and added to the table.
Column Title The column title for the field in the default Analytics view.
If you do not specify a column title, the Name value is used.
Note
If you selected All Character in the Delimited File Properties page, the options below do not apply
and are disabled.
Type The data type assigned to the field in the resulting Analytics table.
You can keep the data type assigned by Analytics, or select an appropriate data type from the
drop-down list.
For information about the supported data types in Analytics, see "Data types in Analytics" on
page 812.
Value A read-only property that displays the first value in the field.
The value dynamically updates based on any edits you make.
Decimal Numeric fields only. The number of decimal places in the source data.
Note
The Decimal text box appears automatically when you select a Numeric data
type.
Input Format Datetime fields only. The format of datetime values in the source data.
The format you specify must exactly match the format in the source data.
For more information about date and time formats, see "Formats of date and time source data"
on page 360.
2. Enter a name for the table layout that you are adding to the project, or keep the default name,
and click OK.
The new Analytics table is created with data from the imported file.
Note
Analytics table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
number.
Note
All first rows in the files that you import should use a consistent approach. First rows
should be either field names, or data, across all files. Avoid mixing the two
approaches in a single import operation.
If the files have an inconsistent approach to first rows, use two separate import
operations.
Note
The table name applies to both the new table layout and the new source
Table Name data file created when importing the data.
Existing tables with identical names in the Analytics project are overwritten.
Overwrite existing
tables For detailed information, see "How overwriting works" on page 264.
Specifies the folder where the new Analytics data files (.fil) are saved.
If you leave Output Path blank, the Analytics data files are saved in the folder containing
Output Path the Analytics project.
3. If the error message "Existing file or table names detected" appears, click OK and do one or
both of the following:
l Select Overwrite existing tables if any existing table layouts or associated data files with
1. In the Delimited File Properties page, review the settings assigned by Analytics to the
properties listed below, make any required updates, and click Next.
Property Description
Start on Line The line number on which to start reading the files.
This setting allows you to skip lines at the beginning of files that contain information you
do not want to import. For example, if the first three lines of each file contain header
information, enter 4 to start reading data on the fourth line.
Field Width For the selected column heading in the preview table, specifies the length of the field in
the resulting table layout. Specify the length in characters.
Analytics automatically assigns a length that matches the longest value in the field. You
can keep the assigned length, or specify a different length. Field values that exceed the
specified field length are truncated in the resulting Analytics table.
Tip
If you intended to periodically refresh a resulting Analytics table from
updated source data, or re-use the import command, enter a longer field
length than the one assigned by Analytics.
A longer field length provides extra space if updated values in the source
data are longer than any of the current values.
Note
Maximum field length is 32,767 characters (non-Unicode edition) or
16,383 characters (Unicode edition). The entire field length, up to the
maximum, is imported into Analytics, but only the first 256 characters are
displayed in the table view. The remainder of the data is present, and can
be analyzed, but it is not visible in the view. To see all the data, open the
Table Layout dialog box.
Use first row as Values in the first line in each file are used as field names in the resulting table layouts.
field names
Note
If you use this setting, the row used as field names is whatever line
number is specified in Start on Line.
This setting applies globally to all files that you import.
Text Qualifier The text symbol that identifies values contained in fields:
o Double Quote
o Single Quote
o None – indicates that no text qualifier is used
o Other – allows you to specify the character that is used as the text qualifier
Property Description
Clear CR and Cleanses the imported data of misplaced carriage return (CR) and/or line feed (LF)
Clear LF characters.
Misplaced CR/LF characters can cause incorrect line breaks within records. When
enabled, the option replaces any CR/LF characters with a space. Only CR/LF characters
that occur inside a pair of text qualifiers are replaced.
For Windows files, select both Clear CR and Clear LF.
The two options are disabled if Text Qualifier is None.
All Character Assigns the Character data type to all the imported fields.
Tip
Assigning the Character data type to all the imported fields simplifies the
process of importing delimited text files.
Once the data is in Analytics, you can assign different data types, such
as Numeric or Datetime, to the fields, and specify format details.
The All Character option is useful if you are importing a table with
identifier fields automatically assigned the Numeric data type by
Analytics when in fact they should use the Character data type.
Caution
Use control totals to verify that the Analytics table created from an imported print
image or PDF file contains all the data from the source file. Unintentionally excluding
records is a possibility when defining print image or PDF files. You should always
verify that you have a complete data set in Analytics before beginning any analysis.
Capturing records
l "Specify a unique value to capture a set of records" on page 282
l "Tips for choosing a unique value" on page 283
l "Precisely capture a set of records" on page 284
l "Use multiple criteria to capture a set of records" on page 287
l "Check record definitions and field definitions throughout the entire file" on page 288
l "You can define multiline records and fields" on page 288
Additional considerations
l "Define and import only data you need" on page 288
l "Control the order of fields in the resulting Analytics table" on page 288
l "Analytics may auto-define a file" on page 289
l "Use control totals to verify the resulting Analytics table" on page 289
General points
The file definition process is iterative
Successfully defining a print image or PDF file is typically an iterative process and may require a
certain amount of trial and error. You will need to perform some or all of the following individual
tasks:
l define one or more fields
l define a set of detail records based on a unique value
l define one or more header or footer records
l modify or further build criteria to fine tune a captured set of records
l review each field and record definition for accuracy
l edit inaccurate field or record definitions
l make multiple passes through a file as one way of dealing with misaligned data
Misaligned data
Workarounds for misaligned data
In the Data Definition Wizard, misaligned data columns in a parsed PDF or print image file (see
"Aligned and misaligned data in a parsed PDF file" below) can make it difficult or labor-intensive to
create an Analytics table that is usable. If misaligned data is a significant problem, consider any of
the following approaches.
Note
The most suitable approach for your situation depends on the nature of the data you
are trying to define, and your experience with Analytics. New users of Analytics
should consider asking for the data in a different format.
l Go back to the source of the file and ask for the data in a different format.
l Try converting the file using conversion software — for example, software that converts a PDF
file to an Excel file or a text file. Import the converted file to Analytics.
l Try copying and pasting PDF data into a text editor. Then import the text file to Analytics.
l Use one or more of the following techniques to define misaligned fields:
l Create a field definition that is long enough to capture the leftmost and the rightmost
l Create a single, long field definition that encompasses multiple misaligned fields.
For more information, see "Defining misaligned fields in a print image or PDF file" on
page 321.
l Import the source file more than once. With each import, define a different subset of records.
Append the resulting Analytics tables to assemble a complete data set.
For more information, see "Defining and importing subsets of print image or PDF data" on
page 325.
Note
Only aqua-blue highlighted fields become part of the resulting Analytics table.
Gray highlighted data in a defined record is ignored unless it is also defined as a
field. The gray portions of a record between defined fields are omitted in the resulting
Analytics table.
Completely undefined data is ignored. If you want to include any of this data in the
resulting Analytics table, you must define additional fields and records.
Location in
"The different kinds of data in a
Kind of data Description Example PDF file" on the facing page
The basic content of a file, o credit card transactions #2, outlined in blue
arranged in records. o inventory records
Defining detail data is
mandatory. You cannot define a
print image or PDF file without
Detail data defining detail data.
Location in
"The different kinds of data in a
Kind of data Description Example PDF file" on the facing page
The identifying information that o store number and #1, outlined in red
appears above blocks or subsets location where the
of detail records. credit card transactions
took place
Defining header data is optional. o “Product Class”
If you do not need the header
information
information, you do not need to
Header data define it.
The information that appears o subtotaled credit card #3, outlined in aqua-blue
below blocks or subsets of detail transactions by store
records. o “Class Totals”
Defining footer data is optional. If
you do not need the footer
information, you do not need to
Footer data define it.
Additional guidelines
l You can define detail, header, or footer data in any order you want. A sequence is not
enforced.
l You can also specify field names (outlined in green in "The different kinds of data in a PDF
file" below). The method for specifying field names differs from the process for defining detail,
header, or footer data.
Note
Do not use Header data to attempt to define field names that may appear in a
print image or PDF file.
l In the initial data value you select to begin defining the initial data field
l In the same row as the initial data value
If required, you can change the exact match to a generic match, such as Numeric, or Non-Blank,
which can provide greater flexibility when specifying a unique value. For more information, see
"Working with record definitions" on page 317.
When you select or specify a value, in a specific position, to capture a set of records, Analytics
considers any character or characters in that position, from the top of the file to the bottom, as it
searches for the value. Characters are considered even if they are outside those rows that you
consider record data. If the value you specified is not sufficiently precise, additional, non-record data
can be captured and included in the set of records.
Note
You can use criteria to either include or exclude rows in the source file.
Tip
If you use an initial detail field to capture detail records, but you do not want the field
to appear first in the resulting Analytics table, you can use the field to capture
records, and then delete it and re-add it.
Header and footer fields appear in the resulting Analytics table in the order in which you define them.
They appear before detail fields if you have not defined an initial detail field, and they appear after
detail fields once you have defined an initial detail field.
You also have the option of reordering fields once you have finished importing the print image or
PDF file into Analytics. You can drag columns to reorder them in a view. You can also extract by
view if you want to create a new table in which the fields in the table layout are physically reordered.
For more information, see "Extracting data" on page 199. You may find reordering fields in Analytics
is easier than trying to maintain a precise field order in the Data Definition Wizard.
Note
Only detail records are auto-defined. Header or footer data, if you require it, must be
manually defined.
on page 304.
1. Proceed through the Data Definition Wizard until the source file appears.
For detailed instructions, see "Define and import a print image file" on page 296, or "Define
and import a PDF file" on page 304.
2. Select a value in the initial field you want to define.
In the example below, the first value in the “Product No” field is selected.
3. Type a name for the field, update the data type if required, and click OK.
The value you selected is outlined with a box.
4. In the value you selected, or in the same row in the file, select one or more characters that are
unique to the set of records you want to capture.
For more information, see "Defining and importing print image (report) files and PDF files" on
page 275.
In the example below, the decimal point in the “Unit Cost” field is selected.
The Record Definition dialog box opens, and the initial field and the associated set of records
are defined.
The field is aqua-blue, and the records are gray. Undefined data continues to have a white
background.
5. If required, change the Record Type, or modify or further build the criteria used to capture the
set of records, and click OK.
For detailed information, see "Working with record definitions" on page 317.
6. Define additional fields in the record by selecting a value in each field.
Additional fields automatically conform to the set of records.
If field values vary in length, select the longest value, or select extra blank spaces to allow for
longer values elsewhere in the field.
In the example below, three fields are defined: “Product No”, “Loc”, and “Product Description”.
7. When you have finished defining the fields you require, click Next.
The remainder of the defining and importing process is similar to the process for defining and
importing other data formats such as Excel and delimited text files.
For complete instructions, see "Define and import a print image file" on the facing page, or
"Define and import a PDF file" on page 304.
You can create an Analytics table by defining and importing a print image file.
When you use the Data Definition Wizard to process a print image file, Analytics may fully or
partially auto-define the file, or you may need to manually define the file.
Note
Defining print image files can be challenging. If you encounter problems, review
"Defining and importing print image (report) files and PDF files" on page 275.
Highlighting Meaning
Highlighting Meaning
Analytics was not able to detect a pattern in the data and could not auto-
define it.
If Analytics auto-defined the entire file perfectly, and you do not want to:
o update the generic field names
If Analytics auto-defined the file o add any header or footer data to the detail data
and you do not want to make any
updates go to "Finalize the print image file definition" on page 301
If Analytics auto-defined the entire file perfectly, and you want to:
o update the generic field names (“Field_1”, “Field_2”, and so on), go
Tip
You can also update the generic field names in a subseq-
If Analytics auto-defined the file uent page in the Data Definition Wizard, which you may f-
and you want to make updates ind more convenient.
If the auto-definition:
o contains errors
o excludes data that you need
o includes data that you do not need
Tip
If the auto-definition contains significant errors, deleting t-
If the auto-definition contains he entire auto-definition and manually defining the file ca-
errors n be easier.
Right-click an aqua-blue field and select Edit Field, or double-click the field.
You can make a number of changes, including:
o updating the field name
o updating the data type
o under Advanced Options:
l changing the field length (Field Width)
l changing the starting position of the field
Edit a field definition For detailed information, see "Working with field definitions" on page 312.
Right-click a gray record and select Edit Record, or double-click the record.
You can make two main changes:
o update the categorization of the record – detail, header, and footer are the options
o modify the criteria that Analytics used to capture the set of records
Edit a record definition For detailed information, see "Working with record definitions" on page 317.
Note
You are deleting the field definition or the record definition only, not the
actual data. If necessary, you can redefine the same field or record data.
Tip
If you want to selectively delete records, select Edit Record and fine-tune
the criteria that Analytics used to capture the set of records.
Delete a field definition or For detailed information, see "Working with record definitions" on
a record definition page 317.
Note
You can also define a print image file using saved field and record definitions, if they
exist.
For more information, see "Define the print image file using a set of saved field and
record definitions" on page 300.
1. In the Print Image File Definition page, select a data value to start defining one of the fields in
the table.
For example, you could select a social security number in an SSN field. When you select the
data value, the Field Definition dialog box opens.
Guidelines:
l You can select a value anywhere in the data. You do not have to use the first field in the
table, or select the first value in a field.
l The value you select can be detail data, header data, or footer data.
l Do not select field names. Leave all field names in the source file unselected. If you select
field names in the source file, Analytics treats them as data contained in fields.
l If field values vary in length, select the longest value, or select extra blank spaces to allow
for longer values that may be lower in the field and not currently displayed.
If you intend to use the initial data value you selected to uniquely identify a set of records, see
"Working with field definitions" on page 312.
2. Enter a name for the field, if necessary update the data type, and click OK.
3. In the data value you just selected, or in the same row in the file, select the character, or string
of characters, that uniquely identifies the set of records in the source file.
For example, select:
l a slash in a date value
l a decimal point in a numeric value
l a unique identifying value anywhere in the row containing the data value you selected
When you select the unique character or characters, the Record Definition dialog box opens,
and all records containing the character or characters are highlighted gray.
For detailed information, see "Defining and importing print image (report) files and PDF files"
on page 275.
If you need to define a record that extends beyond one row in the source file, see "Working
with multiline records and fields" on page 327.
4. If required, update the Record Type to match the type of data you are defining: detail, header,
or footer.
5. If required, modify the criteria used to capture the set of records.
For example, you could add additional criteria to omit some of the records that were initially
captured.
For detailed information, see "Working with record definitions" on page 317.
6. Click OK.
The field you defined is highlighted aqua-blue, and the associated set of captured records is
highlighted gray.
7. Scroll vertically to examine the defined field, and the associated set of captured records.
8. If the field is not defined correctly, or if the set of captured records needs adjustment, double-
click the field or the record, and make the necessary edits in the Field Definition dialog box,
or the Record Definition dialog box.
For more information, see "Working with field definitions" on page 312, or "Working with
record definitions" on page 317.
9. Define the remaining fields in the record by selecting a representative data value for each
field.
Additional fields automatically conform to the set of records.
Guidelines:
l Define only those fields you want in the resulting Analytics table.
l With each field definition, scroll vertically to examine the defined field. Edit the definitions as
required.
For example, if data values are not fully contained by a field, you need to adjust the length
or starting position of the field, or both.
For more information, see "Edit the auto-definition" on page 297.
l If you need to define field values that extend beyond one row in the source file, see
"Working with multiline records and fields" on page 327.
Tip
The order in which you define detail fields is the order in which they appear in
the resulting Analytics table.
If you delete a detail field during the definition process, and then re-add it, it
loses its original position and is placed last among detail fields.
Define the print image file using a set of saved field and
record definitions
You can define a print image file using field and record definitions from a previous file definition
session that have been saved in a print image query file. The print image query file must already
exist, and the saved definitions must match the current data.
Note
Loading a print image query file deletes any current field and record definitions.
Note
Only load a file with definitions that you know match, or closely match, the
current data.
Note
Field and record definitions often represent a lot of work, and it is
recommended that you save them.
If you subsequently discover that the imported data needs an adjustment, and
must be redefined and reimported, saved definitions do not have to be
recreated from scratch.
2. When you are satisfied with all field and record definitions, click Next.
Note
If required, you can return to this point in the process and make updates to the
field and record definitions.
Note
Select a column heading in the preview table to see the properties associated with
the column.
Property Description
Ignore this field Excludes the field from the resulting table layout.
The data in the field is still imported, but it is undefined, and does not appear in the new
Analytics table. It can be defined later, if necessary, and added to the table.
Column Title The column title for the field in the default Analytics view.
If you do not specify a column title, the Name value is used.
Value A read-only property that displays the first value in the field.
The value dynamically updates based on any edits you make.
Decimal Numeric fields only. The number of decimal places in the source data.
Note
The Decimal text box appears automatically when you select a Numeric data
type.
Input Format Datetime fields only. The format of datetime values in the source data.
The format you specify must exactly match the format in the source data.
For more information about date and time formats, see "Formats of date and time source data"
on page 360.
Note
Analytics table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
number.
You can create an Analytics table by defining and importing an Adobe PDF file.
When you use the Data Definition Wizard to process a PDF file, Analytics may fully or partially
auto-define the file, or you may need to manually define the file.
Note
Defining PDF files can be challenging. If you encounter problems, review "Defining
and importing print image (report) files and PDF files" on page 275.
Tip
In some circumstances, parsing a PDF file on a page-by-page basis can help
with data misalignment.
If you take this approach, you need to import the file more than once, create
more than one Analytics table, and then append the resulting tables in
Analytics.
For more information, see "Defining and importing subsets of print image or
PDF data" on page 325.
3. Leave the PDF Parser at the default setting of Xpdf, or select VeryPDF.
If you are importing the file for the first time, and you have no reason to do otherwise, leave
the setting at Xpdf.
If you have already encountered data alignment issues when using Xpdf with the file, select
VeryPDF to see if the parsing results are better.
4. Click Next.
The PDF file is parsed and the PDF File Definition page updates to display the parsed file.
5. Scroll vertically and horizontally to examine the parsed file.
Highlighting indicates whether Analytics has auto-defined data in the file:
Highlighting Meaning
Undefined data.
Analytics was not able to detect a pattern in the data and could not auto-
White background define it.
6. Optional. If the data in the parsed file is misaligned, click Back, switch the parser selection in
PDF Parser, and click Next.
The PDF file is re-parsed using the parser you selected, which may produce better data
alignment.
Any existing field and record definitions are deleted when you re-parse the file.
7. Do one of the following:
Result of auto-definition Action to take
If Analytics auto-defined the entire file perfectly, and you do not want to:
o update the generic field names
If Analytics auto-defined the file o add any header or footer data to the detail data
and you do not want to make any
updates go to "Finalize the PDF file definition" on page 310
If Analytics auto-defined the entire file perfectly, and you want to:
o update the generic field names (“Field_1”, “Field_2”, and so on), go
Tip
You can also update the generic field names in a
If Analytics auto-defined the file subsequent page in the Data Definition Wizard, which
and you want to make updates you may find more convenient.
If the auto-definition:
o contains errors
o excludes data that you need
o includes data that you do not need
Tip
If the auto-definition contains significant errors, deleting
If the auto-definition contains the entire auto-definition and manually defining the file
errors can be easier.
If the parsed file is entirely If the parsed file is entirely undefined, indicated by a completely white
undefined background, you must "Manually define the PDF file" on the next page
Right-click an aqua-blue field and select Edit Field, or double-click the field.
You can make a number of changes, including:
o updating the field name
o updating the data type
o under Advanced Options:
l changing the field length (Field Width)
l changing the starting position of the field
Edit a field definition For detailed information, see "Working with field definitions" on page 312.
Right-click a gray record and select Edit Record, or double-click the record.
Edit a record definition You can make two main changes:
o update the categorization of the record – detail, header, and footer are the options
o modify the criteria that Analytics used to capture the set of records
For detailed information, see "Working with record definitions" on page 317.
Note
You are deleting the field definition or the record definition only, not the
actual data. If necessary, you can redefine the same field or record data.
Tip
If you want to selectively delete records, select Edit Record and fine-tune
the criteria that Analytics used to capture the set of records.
Delete a field definition or For detailed information, see "Working with record definitions" on
a record definition page 317.
Note
You can also define a PDF file using saved field and record definitions, if they exist.
For more information, see "Define the PDF file using a set of saved field and record
definitions" on page 309.
1. In the PDF File Definition page, select a data value to start defining one of the fields in the
table.
For example, you could select a social security number in an SSN field. When you select the
data value, the Field Definition dialog box opens.
Guidelines:
l You can select a value anywhere in the data. You do not have to use the first field in the
table, or select the first value in a field.
l The value you select can be detail data, header data, or footer data.
l Do not select field names. Leave all field names in the source file unselected. If you select
field names in the source file, Analytics treats them as data contained in fields.
l If field values vary in length, select the longest value, or select extra blank spaces to allow
for longer values that may be lower in the field and not currently displayed.
If you intend to use the initial data value you selected to uniquely identify a set of records, see
"Working with field definitions" on page 312.
2. Enter a name for the field, if necessary update the data type, and click OK.
3. In the data value you just selected, or in the same row in the file, select the character, or string
of characters, that uniquely identifies the set of records in the source file.
For example, select:
l a slash in a date value
l a decimal point in a numeric value
l a unique identifying value anywhere in the row containing the data value you selected
When you select the unique character or characters, the Record Definition dialog box opens,
and all records containing the character or characters are highlighted gray.
For detailed information, see "Defining and importing print image (report) files and PDF files"
on page 275.
If you need to define a record that extends beyond one row in the source file, see "Working
with multiline records and fields" on page 327.
4. If required, update the Record Type to match the type of data you are defining: detail, header,
or footer.
5. If required, modify the criteria used to capture the set of records.
For example, you could add additional criteria to omit some of the records that were initially
captured.
For detailed information, see "Working with record definitions" on page 317.
6. Click OK.
The field you defined is highlighted aqua-blue, and the associated set of captured records is
highlighted gray.
7. Scroll vertically to examine the defined field, and the associated set of captured records.
8. If the field is not defined correctly, or if the set of captured records needs adjustment, double-
click the field or the record, and make the necessary edits in the Field Definition dialog box,
or the Record Definition dialog box.
For more information, see "Working with field definitions" on page 312, or "Working with
record definitions" on page 317.
9. Define the remaining fields in the record by selecting a representative data value for each
field.
Additional fields automatically conform to the set of records.
Guidelines:
l Define only those fields you want in the resulting Analytics table.
l With each field definition, scroll vertically to examine the defined field. Edit the definitions as
required.
For example, if data values are not fully contained by a field, you need to adjust the length
or starting position of the field, or both.
For more information, see "Edit the auto-definition" on page 306.
l If you need to define field values that extend beyond one row in the source file, see
"Working with multiline records and fields" on page 327.
Tip
The order in which you define detail fields is the order in which they appear in
the resulting Analytics table.
If you delete a detail field during the definition process, and then re-add it, it
loses its original position and is placed last among detail fields.
Define the PDF file using a set of saved field and record
definitions
You can define a PDF file using field and record definitions from a previous file definition session
that have been saved in a print image query file. The print image query file must already exist, and
the saved definitions must match the current data.
Note
Loading a print image query file deletes any current field and record definitions.
Note
Only load a file with definitions that you know match, or closely match, the
current data.
Note
Field and record definitions often represent a lot of work, and it is
recommended that you save them.
If you subsequently discover that the imported data needs an adjustment, and
must be redefined and reimported, saved definitions do not have to be
recreated from scratch.
2. When you are satisfied with all field and record definitions, click Next.
Note
If required, you can return to this point in the process and make updates to the
field and record definitions.
Note
Select a column heading in the preview table to see the properties associated with
the column.
Property Description
Ignore this field Excludes the field from the resulting table layout.
The data in the field is still imported, but it is undefined, and does not appear in the new
Analytics table. It can be defined later, if necessary, and added to the table.
Column Title The column title for the field in the default Analytics view.
If you do not specify a column title, the Name value is used.
Value A read-only property that displays the first value in the field.
The value dynamically updates based on any edits you make.
Decimal Numeric fields only. The number of decimal places in the source data.
Note
The Decimal text box appears automatically when you select a Numeric data
type.
Input Format Datetime fields only. The format of datetime values in the source data.
The format you specify must exactly match the format in the source data.
For more information about date and time formats, see "Formats of date and time source data"
on page 360.
Note
Analytics table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
number.
l an SSN field
You will have greater success using a consistently structured field than you will using a field
with varying contents.
l One or more consistently positioned characters in the field must be unique, or uniquely
positioned, when compared to data above or below the field.
l Avoid a field with missing values. It is possible to use a field with missing values, but it
complicates the process of defining the file.
Note
The value you use to uniquely identify a set of records does not have to be contained
in the initial data value or the initial data field. It can occur anywhere in the row
containing the initial data value. For more information, see "Defining and importing
print image (report) files and PDF files" on page 275.
The table below explains the purpose of each item in the Field Definition dialog box:
Name Specifies a field name other than the generic field name assigned by Analytics.
The name you specify becomes the physical field name in the resulting Analytics table – that is,
the field name in the table layout.
Starts on Line Specifies which line in a record contains the start of the field.
For example:
o If each record containing the field appears on a single line, then the value must be ‘1’
o If each record containing the field spans two lines, and the field starts on the second line,
then the value must be ‘2’
Note
The starting position of a field is critical to the success of the defining and
importing process. Once a field is defined, scroll through the source file to
ensure the starting position accommodates all values in the field. Adjust the
starting position if necessary.
For Unicode data, typically you should specify an odd-numbered starting byte
position. Specifying an even-numbered starting position can cause characters
to display incorrectly.
Note
Field length is critical to the success of the defining and importing process.
Once a field is defined, scroll through the source file to ensure that the field is
long enough to accommodate all values in the field. Adjust the length if
necessary.
For Unicode data, specify an even number of bytes only. Specifying an odd
number of bytes can cause characters to display incorrectly.
Field Height Specifies the number of lines that constitute a single value in the field.
For example:
o If each value appears on a single line, then the field height must be ‘1’
o If each value spans two lines, then the field height must be ‘2’
o If each value spans a varying number of lines, such as the content of a Note field, set the
field height to accommodate the value that spans the greatest number of lines (see Ends on
blank line below)
DD/MM/YYYY. Use MMM in the format to match months that use abbreviations or that are
spelled out.
Tip
If numeric or datetime data in the source file is inconsistently formatted, you
can import it as character data and try to clean up the inconsistencies using
Analytics functions in the resulting Analytics table.
Convert to single Specifies that multiline fields defined in the source file are imported to Analytics as a single field
field containing the data from all lines.
(character fields For example, if you define address data that spans several lines, selecting Convert to single
only) field creates a single field with all the address data on one line.
(multiline fields only) If you leave Convert to single field unselected (the default setting), multiline fields are
imported to Analytics as multiple fields each containing the data from a single line.
Fill if Blank Specifies that a field value is copied to subsequent blank values until a new field value occurs.
For example, if the value “01” in the Product Class field appears in only the first record of a
block of Product Class 01 records, selecting Fill if Blank causes the value “01” to appear with
every record.
Ends on blank line Specifies that values in a multiline field terminate when they encounter a blank line.
(multiline fields only) This option addresses a situation that occurs when values in a multiline field span a varying
number of lines. You must set the Field Height to accommodate the value that spans the
greatest number of lines. However, doing so can cause a mismatch between values with fewer
lines and field or record boundaries. Selecting Ends on blank line causes the field height, and
the field or record boundaries, to dynamically resize to fit the number of lines occupied by each
value.
Note
This feature only works if one or more blank lines separate each value in the
multiline field.
behavior if the field contains data, such as unit prices, for which totals are not meaningful.
o Control Total – Specifies that the field is a control total field.
A control total is the sum of values in a numeric field, which can be used to check data
integrity. When you extract or sort data to a new table, Analytics includes the input and
output totals of a control total field in the table history. Input refers to the original table.
Output refers to the new table. If the two totals match, no data was lost in the extract or sort
operation.
If you specify control totals for more than one field, the table history reports on only the
numeric field with the leftmost starting position.
Note
The Control Total setting in the Field Definition dialog box does not create
control totals when you import a print image or PDF file to Analytics. For
information about creating control totals for this purpose, see "Defining and
importing print image (report) files and PDF files" on page 275.
Record Type: Specifies the type of data represented by the records: detail, header, or footer.
o Detail o Detail records – the main information in a file
o Header For example, in a file listing overdue invoices, the invoice entries are the detail records. You
can define only one set of detail records in a file.
o Footer
o Header records – the identifying information that appears above blocks or subsets of detail
records
For example, a file might list account information for each customer (header record),
followed by a list of each customer’s unpaid invoices (detail record). If necessary, you can
define more than one set of header records.
o Footer records – information that appears below blocks or subsets of detail records
For example, a file might list subtotals for each customer’s unpaid invoices (footer record). If
necessary, you can define more than one set of footer records.
Note
Although header and footer data is initially treated like a separate record in the
Data Definition Wizard, in the resulting Analytics table this data becomes one
or more additional fields, with repeated values, added to the detail record.
Transparent Specifies that header records do not split multiline detail records.
(applies to header If a header record splits a multiline detail record in the source file, which can happen at a page
records only) break, selecting Transparent unifies the detail record in the resulting Analytics table.
Record Name Allows you to customize the default record names that appear in the leftmost column in the
Data Definition Wizard.
You may find customizing a default name useful if you are creating multiple header or footer
records. The value appears in the Data Definition Wizard only and does not appear in the
resulting Analytics table.
Lines in Record Specifies the number of lines that constitute a single record in the source file.
For example, if each detail record in the source file appears on a single line, then the value
must be ‘1’. If each detail record spans three lines, then the value must be ‘3’.
Include or Exclude Specifies whether records that match the criteria should be included in, or excluded from, the
set of records.
(part of the criteria
builder) This menu contains the following options:
o Include – include records that match the criteria
o Exclude – exclude records that match the criteria
Match On Specifies the method to use, or the type of characters to use, to uniquely identify the set of
records in the file.
(part of the criteria
builder) This menu contains the following options:
o Exact Match – matching records must contain the character, or string of characters, in the
Text field, in the specified Line of the record, starting at the specified Start position
o Alpha – matching records must contain one or more alpha characters, in the specified Line
of the record, at the specified Start position, or in all positions of the specified Range
o Numeric – matching records must contain one or more numeric characters, in the specified
Line of the record, at the specified Start position, or in all positions of the specified Range
o Blank – matching records must contain one or more blank spaces, in the specified Line of
the record, at the specified Start position, or in all positions of the specified Range
o Non-Blank – matching records must contain one or more non-blank characters (includes
special characters), in the specified Line of the record, at the specified Start position, or in
all positions of the specified Range
o Find in Line – matching records must contain the character, or string of characters, in the
Text field anywhere in the specified Line of the record
o Find in Range – matching records must contain the character, or string of characters, in the
Text field, in the specified Line of the record, anywhere in the specified Range
o Custom Map – matching records must contain characters that match the character pattern
in the Text field, in the specified Line of the record, starting at the specified Start position
The Custom Map option uses the same syntax as the MAP( ) function.
Text For Exact Match, Find in Line, or Find in Range, specifies the character, or string of
characters, that uniquely identifies the set of records in the file.
(part of the criteria
builder) For Custom Map, specifies the character pattern that uniquely identifies the set of records in
the file.
The field is disabled for the other Match On options.
Line Specifies which line of the record the criteria applies to.
(part of the criteria For example, if you create a custom map to match zip codes, and the zip codes appear on the
builder) third line of a three-line record, you must specify ‘3’ in Line.
For single-line records, the value is always ‘1’.
Logic Allows you to add or delete criteria, and specify the logical relations between criteria. You can
add a maximum of 8 criteria.
(part of the criteria
builder) This menu contains the following options:
o And – adds an additional criterion with a logical AND
o Or – adds an additional criterion with a logical OR
o Insert Criteria – inserts an empty criterion below the criterion to which it is applied
The criterion is initially inserted with a logical AND. You can change to a logical OR, but only
after you have specified values for the inserted criterion.
o Delete Criteria – deletes the criterion to which it is applied
o New Group – creates a separate criteria group
The New Group option allows you to build multiple criteria groups, which operate as
separate blocks of logic. The groups are related to one another with either a logical OR or a
logical AND.
o End – designates a criterion as the final criterion
Selecting End for a criterion deletes any subsequent criteria, including criteria in other
groups.
Tip
The Logic buttons may become unresponsive if you are missing values in a
criterion. Supply any missing values to reactivate the Logic buttons.
Note
If the values in a field vary in the number of words they contain, try to create
a separate field definition for these values, or ensure that these values
represent the last field at the end of a long field definition encompassing
multiple misaligned fields. The “Product Description” field in the sample
“Inventory.pdf” is an example of a field in which values vary in number of
words.
In Analytics, you will use the ALLTRIM( ), the REGEXREPLACE( ), and the SPLIT( )
functions to break up the single field into separate, aligned data elements.
3. Check the entire file to ensure that none of the values in the misaligned fields are outside the
aqua-blue highlighting of their field definition. Adjust the length of the field definition, if
required.
4. Make sure that a data type of Character is specified for each field definition in the Field
Definition dialog box.
5. Complete the import process in the usual manner.
In the Edit Field Properties page, make sure that a data type of ASCII or UNICODE is
specified for every field.
For more information, see "Define and import a print image file" on page 296, or "Define and
import a PDF file" on page 304.
6. For a misaligned field with no data from an overlapping field, create a computed field in
Analytics that uses the following expression:
ALLTRIM(misaligned_field_name)
Leading and trailing spaces are removed from the field, which aligns all values in the field.
7. For a misaligned field that contains data from an overlapping field, do the following in
Analytics:
a. Create an initial computed field that uses the following expression to replace one or more
spaces between the field value and the unwanted characters with a single space:
The expression also removes leading and trailing spaces from the misaligned field.
b. Create a second computed field that uses one of the following expressions to extract the
field value and discard the unwanted characters.
l If the unwanted characters are at the end of the field, use this expression:
SPLIT(initial_computed_field_name," ", 1)
l If the unwanted characters are at the beginning of the field, use this expression:
SPLIT(initial_computed_field_name," ", 2)
Tip
If unwanted characters are sometimes at the end of a field, and sometimes
at the beginning, or if they are present in only some of the records, you need
to create a conditional computed field that applies different versions of the
SPLIT( ) expression to different parts of the misaligned field. For example,
the condition RECNO( ) > 100 allows you to apply a version of the
expression to only those records beyond the first 100 records.
For more information, see "Define a conditional computed field" on
page 807.
8. For a long field definition that encompasses multiple misaligned fields, do the following in
Analytics:
a. Create an initial computed field that uses the following expression to replace one or more
spaces between data elements with a single space:
The expression also removes leading and trailing spaces from the long field.
Tip
You may find including the OMIT( ) function in the expression is useful for
removing pieces of data that appear inconsistently and complicate
subsequent processing. For example, OMIT(ALLTRIM(REGEXREPLACE
(long_field_name, "\s+", " ")), "-") does the same as the expression above,
and also removes hyphens.
b. Create a second computed field that uses this expression to extract the first data element:
SPLIT(initial_computed_field_name," ", 1)
c. Create as many additional computed fields as required, using variations of the same
expression, to extract all the data elements.
For example:
SPLIT(initial_computed_field_name," ", 2)
SPLIT(initial_computed_field_name," ", 3)
To specify successive data elements, keep increasing the number in the segment
parameter of the SPLIT( ) function.
Note
For field values that contain more than one word, such as the values in the
“Product Description” field in the sample “Inventory.pdf”, this technique
isolates each word in a separate field. If required, you can reunite the values
by concatenating the separate fields. For more information, see "Concaten-
ating fields" on page 231.
9. Once you have finished extracting all the data elements to separate fields, do the following to
convert numeric and datetime data to the appropriate data type:
a. For numeric fields, create a computed field that uses this expression:
VALUE(field_name, number_of_decimal_places)
CTOD(field_name, "date_format")
Tip
You can save labor, and create fewer computed fields, by converting the data
type at the same time you apply functions to correct misaligned data. For
example:
VALUE(ALLTRIM(misaligned_field_name), 2)
10. Once you have created all the required computed fields, add them to the table view.
You do not need to add the initial computed field to the view, and you can remove any
misaligned fields, or long field or fields, from the view.
For more information, see "Add columns to a view" on page 850, or "Remove columns from a
view" on page 851.
Tip:
For PDF definition, you have the option of parsing the PDF file on a page-by-page
basis. In some cases, data misalignment occurs across page breaks. You may be
able to solve an alignment issue by using page-sized subsets of data.
Tip:
After importing the first subset, open the resulting table in Analytics, and
enter DISPLAY in the command line to display the data structure of the table
layout. Use the displayed table layout information as a guide for creating the
subsequent subsets of records and fields.
To save labor, use the generic Analytics field names (“Field_1”, “Field_2”,
and so on) when defining and importing subsets of records. Once you have
reassembled the data set in Analytics, you can rename all the fields in the
reassembled table.
2. When you save each Analytics data file, and each Analytics table layout, use an incrementing
numeric suffix to prevent overwriting tables you have already created. For example, “Table_
1.fil”, “Table_2.fil”, and so on.
3. Once you have defined and imported all the records in the source file, append the multiple
Analytics tables.
For more information, see "Extracting and appending data" on page 943.
terminate when they encounter a blank line. This feature only works if one or more blank lines
separate each value in the multiline field.
o Column Title – Enter the column title to display in the default Analytics view. If a column
title is not specified the Name value is used.
o Type – Select the appropriate data type from the drop-down list. For information about the
supported data types in Analytics, see "Data types in Analytics" on page 812.
The Decimal and Input Format text boxes appear automatically when you select the
corresponding data type.
o Value – A read-only property that displays the first value in the field. The value is updated
based on any edits you make.
o Decimal (numeric fields only) – Specify the appropriate number of decimal places.
o Input Format (datetime fields only) – Specify the format that matches the data. For more
information about date and time formats, see "Formats of date and time source data" on
page 360.
9. Click Next after you have finished editing the field properties you want to change.
10. In the Final page, verify the settings for the new Analytics table and click Finish.
11. Enter a name for the Analytics table you are adding to the project, or keep the default name,
and click OK.
Column names can have a maximum length of ten characters. The first ten characters of each
Column names field must be unique or the duplicate fields cannot be exported.
Field names Field names must be specified in the first row, and data must start in the second row.
Each column should contain values of only one data type. For example, if the first value in a
Data type field contains character data, the field will be exported as character data.
Fields that contain only numbers will be exported as numeric data. In some cases, this will
result in a field with the wrong data type in Analytics. For example, invoice numbers are
Fields with num- numeric values, but they are often stored in character fields. When this occurs, you need to
bers change the field data type in the Table Layout dialog box.
Steps
1. Select File > New > Table.
The first page displayed in the Data Definition Wizard depends on your configuration. If
integration with Analytics Server is enabled the Select Platform for Data Source page is
displayed, otherwise the Select Local Data Source page is displayed.
2. Complete one of the following steps to select the location of the file:
o If the Select Platform for Data Source page is displayed and you want to use Analytics to
define the file, select Local and click Next. In the Select Local Data Source page select
File and click Next.
o If the Select Platform for Data Source page is displayed and you want to use an Analytics
Server to define the file, select ACL Server and select the Windows server profile from the
drop-down list, and then click Next. In the Select ACL Server Data Source page select
Flat Files and click Next.
o If the Select Local Data Source page is displayed select File and click Next.
3. In the Select File to Define page, locate and select the file you want to create the Analytics
table from and click Open.
dBASE-compatible files have a .dbf file extension.
4. In the File Format page, verify that the dBASE compatible file option has been selected and
click Next.
5. In the Final page, verify the settings for the new Analytics table and click Finish.
6. Enter a name for the Analytics table you are adding to your project and click OK.
Note
Diligent offers two utilities for directly accessing an SAP system and importing data
to Analytics:
l SAP connector – one of the Analytics connectors, available with an additional
subscription
l Direct Link – an optional add-on that can be purchased from Diligent
Steps
1. Select File > New >Table .
The first page displayed in the Data Definition Wizard depends on your configuration. If
integration with Analytics Server is enabled the Select Platform for Data Source page is
displayed, otherwise the Select Local Data Source page is displayed.
2. Complete one of the following steps to select the location of the file:
o If the Select Platform for Data Source page is displayed and you want to use Analytics to
define the file, select Local and click Next. In the Select Local Data Source page select
File and click Next.
o If the Select Platform for Data Source page is displayed and you want to use an Analytics
Server to define the file, select ACL Server and select the server profile from the drop-
down list, and then click Next. In the Select ACL Server Data Source page select Flat
Files and click Next.
o If the Select Local Data Source page is displayed select File and click Next.
3. In Select File to Define, locate and select the file you want to create the Analytics table from
and click Open.
4. In the Character Set page, verify that the correct character set option has been selected and
click Next.
5. In the File Format page, verify that the SAP private file format / DART option has been
selected and click Next.
6. In the SAP Private File Format page, select the appropriate option for field naming:
l Use local language field descriptions as ACL field names – Select this option to use the
localized field descriptions configured for the SAP system, instead of the standard German
language field names. This option is recommended if the Analytics table will be used in only
one language.
l Use standard-delivered SAP German abbreviations as ACL field names – Select this
option if you prefer to use the German field names, or if the Analytics table will be used in
multiple languages.
7. Click Next.
8. In the Save Converted SAP File As dialog box, enter the file name and modify the folder
location for the Analytics data file, as necessary, and click Save.
9. In the Final page, verify the settings for the new Analytics table and click Finish.
10. Enter a name for the Analytics table you are adding to your project and click OK.
Note
Analytics table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
number.
You can create an Analytics table by defining and importing an XML file. The Data Definition
Wizard allows you to select the XML elements to import, configure the structure of the resulting
Analytics table, and customize column headings and data types for the elements you are importing.
Note
In some cases, you may need to adjust one or more field definitions in the resulting
Analytics table so that the data displayed in the view accurately reflects the data in
the source XML file. You adjust field definitions in the Analytics table layout.
Analytics imports the exact raw data contained in an XML file, and you can see this
source data in the table layout. On occasion, a field definition created during the
table definition and import process misinterprets the source data, and the definition
requires subsequent adjustment. For example, a numeric field could be misinter-
preted as a date field, and dates rather than numbers may initially appear in the
view.
Note
Generating a preview of the data in a large XML file can be slow, so the Auto
Preview option is automatically deselected for XML files larger than 2 GB.
c. Select and add all the data structures you want to include in the Analytics table.
d. If necessary, select a data structure in the Preview pane and click Remove to remove it.
e. Click Next.
An XML data structure is a collection of XML elements and attributes. For more information,
see "Selecting XML data structures" on page 341.
7. In the Select XML Elements page, fine-tune the selection of XML elements and attributes
and click Next.
For more information, see "Selecting and configuring XML elements" on page 342.
8. In the Preview Data page, modify the name or properties for any field, if necessary.
To modify field properties, select the appropriate column heading in the preview table, in the
bottom half of the page, and update any of the following properties:
o Name – Keep the name assigned by Analytics for the field in the table layout, or enter a
different name.
o Column Title – Enter the column title to display in the default Analytics view. If a column
title is not specified the Name value is used.
o Type – Select the appropriate data type from the drop-down list. For information about the
supported data types in Analytics, see "Data types in Analytics" on page 812.
The Decimal and Input text boxes appear automatically when you select the
corresponding data type.
o Value – A read-only property that displays the first value in the field. The value is updated
based on any edits you make.
o Decimal (numeric fields only) – Specify the appropriate number of decimal places.
o Input (datetime fields only) – Specify the format that matches the data. For more
information about date and time formats, see "Formats of date and time source data" on
page 360.
9. Click Next.
10. In the Save Data File As dialog box, enter a name for the Analytics data file, and if necessary
modify the location where the file will be saved, and click Save.
11. In the Final page, verify the settings for the new Analytics table and click Finish.
12. Enter a name for the Analytics table you are adding to the project, or keep the default name,
and click OK.
Note
Analytics table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
number.
13. Review the data in the new Analytics table and update any field definitions, if required.
If a field has the wrong data type specified, the data may not appear in the view, or the data
may be misinterpreted. For example, a numeric value may be interpreted as a date.
14. To update a field definition, do the following:
a. Select Edit > Table Layout.
b. In the Edit Fields/Expressions tab, double-click the field you want to modify.
c. Make the necessary changes to the field definition and click Accept Entry .
For example, you may need to change the Type from Datetime to Numeric.
Note
If more than one instance of a nested element exists within the data structure,
the repeated element may not be listed in the data structure in the treeview.
You can select the specific instances of the repeated element in a subsequent
page of the wizard.
Note
Generating a preview of the data in a large XML file can be slow, so the Auto
Preview option is automatically deselected for XML files larger than 2 GB.
3. Repeat steps 1 to 2 to add any additional data structures that you want to include in the
Analytics table.
4. Click Next.
Note
Generating a preview of the data in a large XML file can be slow, so the Auto
Preview option is automatically deselected for XML files larger than 2 GB.
Note
If adding an element violates your intended Analytics table structure and
causes gaps to appear in the table, data of the same kind probably needs to be
merged in a single column (step 4 below).
If adding an element creates duplicate or multiple identical records (identical
except for the added element), more than one instance of the element
probably exists within a parent element and the instances need to be split into
separate columns.
3. If you want to move a column, select the column and click the left or right arrow button, or drag
the column to a new position.
4. If you want to merge data of the same type in a column, select the column in the Preview
table, select the element or attribute to add in the XML Elements treeview, and click Add to
Column.
5. If you want to modify column properties, select the column in the Preview table and click
Column Properties.
Make any of the following changes in the XML Column Properties dialog box and click OK:
l Change the name of the column.
l Change the data type of a column.
l If the column is assigned the Text data type, repeat the name of the column in each row of
the column.
l If an element is repeated in the data structure, assign specific instances of the repeated
element to the column. For example, if there are multiple <description> elements in a data
structure, you could assign only the first instance to a Description column.
l Remove a specific column from a merged column.
6. Click Next.
<catalog>
<cd>
<title></title>
</cd>
</catalog>
<organization>
<company/>
<description/>
<department/>
<description/>
</organization>
You can enter a single number, multiple numbers separated by commas, a numeric range, or
a combination of these. For example, if you want to include the first instance, and the fifth to
tenth instances, in a single column, enter the following: 1, 5-10. By default, all instances are
initially displayed in the column.
Tip:
If you want to add different instances of a repeated element to different
columns in an Analytics table, you need to create a column for each instance
and set the Instance field to the appropriate value.
6. Click OK.
File extensions
XML files typically use a standard file extension (.xml). In some cases, other file extensions are
used, and the first line of the document identifies it as an XML file. If a non-standard file extension is
used, you need to manually select the XML file format in the Data Definition Wizard.
<name>John Smith</name>
An attribute provides additional information about an element. In the following example, the type
attribute specifies that the account element represents a checking account:
<account type="checking">991110101</account>
In the Data Definition Wizard, attribute names are automatically preceded by the @ symbol to
distinguish them from element names. For example, an attribute named “type” is displayed as
“@type”.
XML sample
XML files usually include a mixture of elements and attributes, and at least one data structure. The
following example shows the contents of a simple XML file that contains two client records:
<?xml version="1.0"?>
<accounts>
<client>
<name>John Smith</name>
<ID>JS004</ID>
<account type="checking">991110101</account>
<account type="savings">991110808</account>
</client>
<client>
<name>Jane Smith</name>
<ID>JS005</ID>
<account type="checking">771110103</account>
<account type="savings">771110303</account>
</client>
</accounts>
You can create an Analytics table by defining and importing an XBRL file. The Data Definition
Wizard allows you to select the elements to import, and customize column headings and data types
for the elements you are importing.
1. Select File > New > Table.
2. If the Select Platform for Data Source page is displayed, select Local and click Next.
3. In the Select Local Data Source page, select File and click Next.
4. In the Select File to Define dialog box, locate and select the file you want to create the
Analytics table from and click Open.
XBRL 2.1 files have a .xbrl or .xml file extension. The difference between an XBRL file and
other XML files is that in the XBRL file the top-level, or root, element tag is <xbrl>.
5. In the File Format page, verify that the XBRL 2.1 file option has been selected and click
Next.
6. In the Select XBRL Contexts to Import page, select the XBRL contexts to include in the
Analytics table and click Next. For details on this process, see "Selecting XBRL contexts" on
page 351.
7. In the Select Elements to Import page, select the elements to include in the Analytics table
and click Next. For details on this process, see "Selecting XBRL elements" on page 350.
8. In the Preview Data page, you can modify the name and properties for each field by selecting
the appropriate column heading in the preview table, in the bottom half of the page, and
updating any of the following properties:
o Ignore this field – If you do not want the field to be included in the Analytics table layout,
select this checkbox.
o Name – Keep the name assigned by Analytics for the field in the table layout, or enter a
different name.
o Column Title – Enter the column title to display in the default Analytics view. If a column
title is not specified the Name value is used.
o Type – Select the appropriate data type from the drop-down list. For information about the
supported data types in Analytics, see "Data types in Analytics" on page 812.
The Decimal and Input text boxes appear automatically when you select the
corresponding data type.
o Value – A read-only property that displays the first value in the field. The value is updated
based on any edits you make.
o Decimal (numeric fields only) – Specify the appropriate number of decimal places.
o Input (datetime fields only) – Specify the format that matches the data. For more
information about date and time formats, see "Formats of date and time source data" on
page 360.
9. Click Next after you have finished editing the field properties you want to change.
10. In the Save Data File As dialog box, enter a name for the Analytics data file, and if necessary
modify the location where the file will be saved, and click Save.
11. In the Final page, verify the settings for the new Analytics table and click Finish.
12. Enter a name for the Analytics table you are adding to the project, or keep the default name,
and click OK.
Note
Analytics table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
number.
Note
If you are working with a complex XBRL file you may need to, or may find it easier to,
define more than one Analytics table for the various contexts in the file, and then
define relations between the tables using the Relate Tables command.
Steps
1. Select File > New > Table.
2. In the Select Platform for Data Source page, select ACL Server and select the Windows
server profile to use from the drop-down list, and click Next.
3. In the Select ACL Server Data Source page, select Database Profile and select the
database profile to use from the drop-down list, and click Next.
4. In the Select Database/Schema page, select the schema (Oracle) or database (SQL Server
and IBM DB2) to access from the Schema drop-down list and click Next.
5. In the Select Tables page, select the database tables, views, and synonyms/aliases to add to
your query by selecting the item in the Available Tables list and clicking the right-arrow
button. You can select up to five tables, but if you select more than one table, each additional
table you select must be related to a previously selected table. Selecting multiple tables,
particularly tables with large numbers of records, will typically result in longer wait times
before data is displayed in Analytics.
When you select more than one table, Analytics displays the Identify Relationship dialog box
which you must use to identify the field in the table you are adding that relates to a table that
l Click Browse, locate the definition file or data set in the Select File to Convert dialog
the Available Definitions list and clicking the right-arrow button, or by double-clicking the
definition in the Available Definitions list.
l Add multiple definitions by selecting the Do you want to concatenate multiple selected
file definitions? checkbox, and then select each definition to add and click the right-
arrow button, or click Add all to add all of the definitions listed in the Available
Definitions list.
c. Click Next.
6. In the Select Conversion Properties page, select either or both of the following properties, as
necessary, and click Next.
o Remove leading file indicator from field names – If a prefix is specified before each field
name, it will be removed from the field name added to the Analytics table layout. For
example, Test-Field1 would have the prefix Test- removed.
If this checkbox is not selected, any prefix values identified will be included in the field
name with the hyphen converted to an underscore (i.e. Test-Field1 will be added as
Test_Field1).
o IBM Variable Length – If the data file being processed is an IBM variable length file, the
record length is not specified in the Analytics table layout.
7. In the Final page, verify the settings for the new Analytics table and click Finish.
8. Enter a name for the Analytics table you are adding to your project and click OK.
9. If the associated data file is not found, you will be prompted for the file location. Complete the
following steps to locate the file:
a. If the Select file location dialog box is displayed select Client to select a file that is
accessible from your computer, or select Server and select the server profile to use to
access a server file, and click OK.
b. In the Select file dialog box, locate and select the data file and click Open.
if you want to define the table layout manually in the Table Layout dialog box, or if you
are unable to define a file using the Data Definition Wizard.
b. Enter a value greater than 0 in the Bytes to Skip text box to skip the specified number of
bytes from the beginning of the file. For example, if the first 300 bytes only contains header
information, you can enter 300 to omit this section of the file from the table definition.
c. Modify the value in the Record Length text box to increase or decrease the record length
identified by the Data Definition Wizard. The record length refers to the length of each
record in fixed length files, or the length of the longest record in variable length files. If the
values in a field are misaligned to the right, the record length value likely needs to be
increased. If the values in a field are misaligned to the left, the record length value likely
needs to be decreased.
d. Select the Hex checkbox to view the data in hexadecimal format. This option is useful if you
are working with unprintable characters or compressed data, such as packed numeric data
originating from an IBM mainframe computer.
e. Click Next.
7. If you selected Fixed Length or Variable Length in the previous step, select one of the
following options in the File Type page and click Next.
o Data File (Single Record Type) – Select this option if each field in the record has a fixed
start and end point, and each record in the file is the same length.
o Print Image File (Report File) – Select this option if the data file is an electronic version of
a printed report that includes consistent formatting. This type of data file has detail records
that contain the information being reported on, and often include header and/or footer
records that include additional information, such as customer details and totals.
Note
Before you attempt to define a print image file using this option, you should
try selecting the Print Image (Report) File option in the File Format page of
the Data Definition Wizard (step 5 above), which uses a more straight-
forward process for defining print image files.
o Multiple Record Type File – Select this option if the data file includes more than one type
of record, but is not formatted as a report.
o Skip Field Identification – Select this option to move to the Final page of the Data
Definition Wizard without defining fields in the Analytics table layout.
8. If you selected Data File (Single Record Type) in the previous step, complete the following
steps:
a. In the Identify Fields page, complete any of the following actions to modify the fields
identified in the record, and click Next.
l Delete an existing field separator by clicking on the field separator line you want to
remove.
l Move an existing field separator by clicking and dragging the field separator line to the
new location.
l Create a new field separator by clicking the grid in the position where you want to add the
field separator.
Follow the guidelines below when specifying separator characters in datetime formats. Omitting or
incorrectly specifying separator characters can prevent datetime data from displaying, or from
displaying correctly.
Note
Specifying particular separator characters in the datetime format can be required,
optional, or disallowed, depending on the function of the character.
Specify in
Function of separator character format? For this source data: Specify this format:
Separates the date and time portions of Optional 31/12/2014 23:59:59 DD/MM/YYYY hh:mm:ss
datetime values
DD/MM/YYYYhh:mm:ss
(single space)
DD/MM/YYYY hhmmss
DD/MM/YYYYhhmmss
Separates the date and time portions of Disallowed 31/12/2014T235959 DD/MM/YYYY hhmmss
datetime values
DD/MM/YYYYhhmmss
(‘T’ or ‘t’)
l 2014/12/31 23:59:59
l 20141231.235959
For datetime values that use a Datetime data type, or a Character data type, Analytics recognizes
the following separators:
l <date> <time> (single space)
l <date>T<time> (uppercase ‘T’)
l <date>t<time> (lowercase ‘t’)
For datetime values that use a Numeric data type, Analytics recognizes only the following separator:
l <date>.<time> (decimal point)
Note
Analytics can read datetime values that use a Datetime or Character data type and
have a period as a separator – <date>.<time>. However, the period separator is not
officially supported because in some situations results can be unreliable.
Note
Analytics can read time values that use a Datetime or Character data type and have
a period as a separator – .<time>. However, the period separator is not officially
supported because in some situations results can be unreliable.
Date formats
There are many date formatting conventions in use. In the Data Definition Wizard, and the Table
Layout dialog box, you can select from among several common date formats. If necessary, you can
Note
These characters are the default, and they can be changed in the Options dialog
box.
If separators such as the slash symbol (/) exist in the source data, you need to insert the same
symbol in the same relative position in the date format. Otherwise, Analytics will not interpret the
date correctly.
DD Day (1 – 31)
MM Month (1 – 12)
YYYY-MM-DD 2014-12-31
YYYYMMDD 20141231
MM/DD/YYYY 12/31/2014
MM/DD/YY 12/31/14
DD/MM/YYYY 31/12/2014
YYDDD 14365
Time formats
Analytics supports the most common time formatting convention – hh:mm:ss – and some minor
variations of this format. In the Data Definition Wizard, and the Table Layout dialog box, you can
select from among several common time formats. If necessary, you can modify or create a time
format to match the source data.
Time formats apply to time data, or to the time portion of datetime data.
Note
The hour, minute, and second characters shown below are the default, and they can
be changed in the Options dialog box.
hh:mm 23:59
hh:mm A 11:59 P
hhmm PM 1159 PM
hh:mm:ss 23:59:59
hh:mm:ss P 11:59:59 P
hhmmss AM 115959 PM
hh:mm:ss+hh:mm 23:59:59-05:00
The Data Access window is a component of Analytics that contains data connectors, which you can
use to import data to Analytics from a wide range of sources. The Data Access window also contains
features for precisely shaping the set of data you are importing.
For a complete list of the data sources you can connect to using the Data Access window, see "Data
sources you can access with Analytics" on page 240.
Note
You can also import data using the Data Definition Wizard. For more information,
see "Defining and importing data using the Data Definition Wizard" on page 245.
When connecting to any data source, or importing from any data source, Analytics is
strictly read-only. For more information, see "Data access by Analytics is read-only"
on page 241.
Note
The Data Access window is an import-only tool. You can edit the SQL import
statement used to access data in an external database or file. Editing the SQL to
write to the data source is not supported.
2 Search tables A search box for progressively filtering the list of available tables in the source
data.
As you enter characters in the search box, the Available Tables list is filtered
so that it contains only tables names with a matching string of characters.
3 Available Tables The tables in the source data that are available for import.
The first 200 tables in the source data are displayed. If additional tables exist,
you can click a link to display them in blocks of up to 500 tables at a time.
4 Staging Area The area in the Data Access window that contains the table or tables you have
selected for import.
The Staging Area is also the location where you perform joins between tables,
and select which fields in a table are imported.
5 Filter panel A panel for building simple or compound filters that precisely specify which
records from a data set are imported.
6 Import Preview A preview of the data exactly as it will be imported into Analytics.
As you work with the data by joining tables, omitting fields, and creating filters,
you can refresh the preview to see the effect of your changes.
The Estimate Size option displays an estimate of the number of records in the
import, and the size of the Analytics data file (.fil) that will be created.
8 SQL Mode A text editor that allows you to directly edit the SQL import statement.
Users with knowledge of SQL can control aspects of the data import not
available through the user interface.
1. From the Analytics main menu, select Import > Database and application.
2. In the Existing Connections tab, under ACL Connectors or ACL DSN Connectors
(Bundled), hover over the connection that you want to maintain, and click the ellipsis icon
.
l Rename connection
l Delete connection
Note
The "Server" in ServerDataAccess.log refers to the data access component
of Analytics running locally on the computer where Analytics is installed.
l DataAccess.log – records information about the import operation and the Analytics project
that you are importing data to
Location: ..\<Analytics project folder>\DataAccess.log
You can import data and create an Analytics table by using the Data Access window to connect to
source data in either a database or a file.
Note
In the event of a failed connection, two log files can assist with troubleshooting. For
more information, see "Data Access log files" on the previous page.
Note
Configuration of connection prerequisites within a cloud data service is
typically performed by the person in your company responsible for adminis-
tering the service – for example, your company's Salesforce administrator, or
Concur administrator.
For connection issues that originate with the cloud data service you need to
contact your company's administrator for that service rather than Support.
Note
In the Data Definition Wizard, you can also select Local > Database and
Application.
Tip
You can filter the list of available connections by entering a search string in the
Filter connections box. Connections are listed alphabetically.
For some types of connections, you are immediately connected to the source data.
The existing connections are organized under ACL Connectors, ACL DSN Connectors
(Bundled), Windows DSN Connectors, and Other Connectors.
If you do not have any existing connections, the section or sections do not appear.
2. If you are not connected immediately, do one of the following:
l If the Data Connection Settings panel opens, click Connect at the bottom of the panel (you
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
The available connectors are organized under ACL Connectors, ACL DSN Connectors
(Bundled), Windows DSN Connectors, and Other Connectors.
3. Do one of the following:
l If the Data Connection Settings panel opens, enter the connection settings, and click Save
and Connect at the bottom of the panel (you may need to scroll).
You can accept the default Connection Name, or enter a new one.
l For connectors in the ACL DSN Connectors (Bundled) section, the DSN Configuration
dialog box opens.
Note
Successful connections made with an Analytics connector are automatically
saved to the Existing Connections tab.
Connections made with Windows connectors are preserved for the current
data import session only.
Note
Some data sources may not have a schema, or may have only one schema.
2. Optional. In the Connection panel, filter the list of available tables by entering a search string
in the Search tables box.
Matches for a literal search string (no wildcards) can appear anywhere in a table name. The
search is not case-sensitive.
You can also use one or more wildcard characters in the search string.
Show me more
Wildcard Scope Example Matches
%june o Invoice-June
o PO-June
%invoice% o Invoice-June
o June-Invoice
j_n o Jan
o Jun
Note
If you use a wildcard character in the search string, the length of matching strings, and the
first and last characters, are evaluated more strictly:
l j_n matches only three-character strings that begin with j and end with n
l j*n matches strings of any length, but the strings must begin with j and end with n
l by contrast, jan matches strings of any length, and jan can appear anywhere in the string
This matching behavior is the result of Analytics interpreting literal search strings (no
wildcards) in the following manner: jan = *jan*
3. Optional. Scroll to the bottom of the list of tables and click Show remaining # tables.
Analytics displays the first 200 tables in the data source. If additional tables exist, you can
click the Show remaining link to display them in blocks of up to 500 tables at a time.
Note
The Search tables box must be empty for the link to appear.
4. Under Available Tables, click a table name to add the table to the Staging Area.
Tables are listed alphabetically. You can add up to ten tables to the staging area if you intend
to join the tables. The SAP connector is currently limited to two tables.
Note
You cannot import multiple tables individually with one import operation. The
tables must be joined to be imported together.
5. Optional. Select Include System Tables if you want to add any system tables to the list of
available tables.
Note
This option does not apply to some data sources.
Join tables
If you added more than one table to the Staging Area, you need to join the tables.
For detailed information about joining tables, see "Joining tables in the Data Access window" on
page 381. For information about joining Apache Drill tables, see "Joining tables from Apache Drill
data sources" on page 384.
1. In the Staging Area, click the join icon to access the Join Settings.
l Outer
l Left
l Right
Note
Some data connectors, including the Microsoft Excel and Microsoft Access
connectors, do not support the Outer join type.
Tip
You can filter the list of available fields by entering a search string in the Left
Column or Right Column boxes. Fields are listed alphabetically.
4. Optional. Click + Add key if you need to add an additional key field.
5. Click Apply to save the join settings.
6. Create join settings for each additional table you are joining.
7. Optional. In the Import Preview panel, click Refresh to see a preview of the joined tables.
Tip
If you want to deselect most of the fields, click the Select all toggle to deselect
all fields, and then re-select the fields you want.
3. In the Import Preview panel, click Refresh to review the fields included in the import.
Note
Even though you cannot read the raw values of hashed data, it is still useful
when combining or analyzing data. If you want to compare values that are
hashed by ACCESSDATA during import with values that are hashed using
ACLScript's HASH( ) function, you must convert any numeric or datetime
Analytics fields to character values and trim any spaces before hashing the
data.
Datetime fields must use the following formats:
l Datetime – "YYYY-MM-DD hh:mm:ss"
l Date – "YYYY-MM-DD"
l Time – "hh:mm:ss"
Filter data
By default, all records in a table are imported unless you create one or more filters to omit specific
records.
Note
If you use both of the filtering options explained below, conditional filtering is applied
first, and then the specified number of records is applied to the results of the
conditional filtering.
Tip
To reset the import to all records in the table, enter n in Select first n records.
Tip
You can filter the list of available fields by entering a search string in the Field
box. Fields are listed alphabetically.
Note
If you have joined tables, you can select a field from any of the joined tables.
3. From the Condition list, select a conditional operator such as is, equals, or greater than.
The in operator allows you to specify multiple test values. For more information, see "Using
the "in" conditional operator" on the next page.
4. In the third field, enter the value to test against.
Note
If you are filtering using a Logical field, the test value may need to be one of the
following, depending on the data source:
l 'true' or 'false' (including the single quotation marks)
l 1 or 0 (1= true, 0 = false)
If filtering using one of the actual values in the field returns an error, try one of
the values above.
Note
You cannot mix Boolean operators when you combine multiple filters in a
filter group. All filters in a group must be combined using either AND or OR.
Note
The filters in each filter group are evaluated first, and then the filter groups
are evaluated in relation to one another.
You cannot mix Boolean operators when you combine multiple filter groups.
All filter groups must be combined using either AND or OR.
7. Optional. In the Import Preview panel, click Refresh to see the records included in the import.
Note
Field lengths cannot be specified individually. A single setting applies to all character
fields or all memo fields in all tables in an import.
Tip
Be careful about making fields shorter based on the first few values in the Import
Preview. Longer values may occur lower down in a table.
1. At the bottom of the Data Access window, increase or decrease the number of characters in
one or both of these fields:
l Max Character Field Length
2. In the Import Preview panel, click Refresh to update the field lengths in the preview.
Note
You may need to drag a preview column wider to see all the text in the column.
Caution
Any changes you make in SQL Mode are lost if you return to the visual editor in the
Data Access window.
Note
You cannot use ACLScript syntax (commands or functions) in the body of the
SQL import statement. You must use valid SQL syntax only.
3. In the Import Preview area, click Refresh to see the effect of the updated SQL on the data
that will be imported.
Caution
Use the Estimate Size option with caution. For large data sets and certain data
sources, generating the estimate is processor-intensive and can be slow.
2. In the Import Preview area, click Refresh to see the data that will be imported.
Note
Analytics table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
number.
Guidelines
l Only the content is refreshed –Refreshing an Analytics table updates only the content of
existing fields. It does not update the table layout.
You cannot refresh a table if the structure of the source data has changed – for example, if
fields have been added or removed. You must re-import the data.
l The table is open – If the table is open when you refresh it, you temporarily need disk space
equal to twice the size of the table. If you have limited disk space, close the table first before
refreshing it.
l Tables imported with Analytics 12 – Tables that were imported using the Data Access
window in version 12 of Analytics are not refreshable, even if you are using a more recent
version of Analytics.
If you want to be able to refresh these tables, re-import them using Analytics 12.5 or later.
Steps
1. In the Navigator, right-click the Analytics table that you want to update and select Refresh
from Source.
2. Click Yes in the confirmation dialog box.
3. If the Password Prompt appears, enter the password for the data source and click OK.
Note
You can also change the user name if you want to use a different account to
access the data source.
4. If one or more prompts appear asking if you want to save changes, click Yes, unless you do
not want to save the changes.
The table is refreshed.
Note
For information about joining Analytics tables once they are in Analytics, see
"Joining tables" on page 963.
This topic is about joining tables in the Data Access window as part of the data
import process.
Example
You are working with accounts receivable data and you want a list of customers, the orders
for each customer, and the details of the products on each order.
To assemble this data and import it into Analytics, you need to join three tables from the
source data system:
l Join #1 – you join the Customer and Orders tables using the key field of CustID, which
appears in both tables
l Join #2 – you join the Orders and Product tables using the key field of ProdID, which
appears in both tables
In the figure below, only join #1 has been completed, so the second join icon is still red.
Tip
You can try this example join yourself in the Data Access window. Use the
Microsoft Access connector and connect to this sample Microsoft Access file
that comes with Analytics:
..\ACL Data\Sample Data Files\Sample.mdb.
Join types
When you join tables you can choose from among four different join types. The join type you choose
controls which records from the two original tables are included in the joined table.
Matched
Matched left Unmatched left right table Unmatched right
Join type table records table records records table records
Inner
Outer
Left
Right
Example
You want to join two tables by vendor ID but some of the vendors have more than one
location and you want to keep the records for each location separate. To achieve this result
you use both Vendor ID and Location fields as key fields.
If you use only Vendor ID as a key field, records for individual vendor locations are
intermixed.
If you use only Location as a key field, records for different vendors are intermixed.
Vendor ID Location
A-4538 Vancouver
A-4538 Burnaby
A-4538 Richmond
B-2204 Vancouver
B-2204 Burnaby
Active Directory is Microsoft's Directory Server that provides a LDAP-compliant database containing
objects such as users, groups, and computers. Use the Active Directory data connector to import
your organization's Active Directory data.
Note
You cannot use this connector independently of Analytics. You can configure a
DSN for the connector driver using the Windows ODBC Data Source Administrator,
however you must test the DSN connection from within Analytics and not from the
connector's Windows DSN configuration dialog.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for Active Directory is saved to the Existing Connections tab. In the future, you can
reconnect to Active Directory from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from Active Directory, see "Working with the Data
Access window" on page 370.
Connection settings
Basic settings
Setting Description Example
Note
You may connect without
providing a password if
your Active Directory
server permits
anonymous connections.
Based on your server's
security configuration,
anonymous connections
may be able to list
available tables.
However, such
connections may not be
able to select data from
some or all of the tables
listed. For more
information about your
Active Directory security
configuration, contact
your company's adminis-
trator.
Tip
Limiting scope can
greatly improve the
search performance.
Advanced settings
Setting Description Example
Note
This setting must be false
to support filtering using
the where clause syntax.
Execution of predicates
Execution of Joins
The connector uses various
techniques to join in memory. The
driver trades off memory utilization
against the requirement of reading
the same table more than once.
Execution of Aggregates
The connector retrieves all rows
necessary to process the aggregation
in memory.
Scenario
You are working with the User table and you want to import records where the ObjectClass
has the following attributes:
l person
l user
You also want to limit the records to those where the ObjectCategory has the Computer
attribute, and not Person.
You then use SQL Mode to verify the WHERE clause that the filter constructs:
WHERE
(
"User"."ObjectClass" = N'person' AND
"User"."ObjectClass" = N'user' AND
"User"."ObjectCategory" = N'Computer'
)
Filter results
Once the filter is applied, the table includes records that match the WHERE clause and you
import the table.
Connecting to ADP
ADP is an online payroll and HR solution. You can use the ADP data connector to import your
organization's ADP data.
The ADP data connector is available in version 16.1 or later of Analytics.
Note
The ADP data connector is provided by our data access and connectivity partner,
CData Software. Detailed information about individual connection fields is available
in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to Airtable
Note
The Airtable data connector is provided by our data access and connectivity partner,
CData Software. Detailed information about individual connection fields is available
in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Amazon Athena is an interactive query service that enables users to query data in Amazon S3,
using standard SQL. You can use the Amazon Athena data connector to import your organization's
Amazon Athena data.
Note
The Amazon Athena data connector is provided by our data partner, CData. For
information about any of the connection fields, refer to the documentation available
at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Amazon DynamoDB is a cloud data service. You can use the Amazon DynamoDB data connector to
import your organization's DynamoDB data.
Note
Analytics provides DynamoDB as an optional connector and if it is not available in
your Data Access window, it is likely that the connector was not selected during
installation. For more information, see "Install optional Analytics data connectors
and Python engine" on page 2689.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for DynamoDB is saved to the Existing Connections tab. In the future, you can
reconnect to DynamoDB from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from DynamoDB, see "Working with the Data
Access window" on page 370.
Connection settings
Basic settings
Setting Description Example
Credentials File The full path and name of the credentials file,
where MFA credentials are saved.
The default location is
%APPDATA%\\CData\\AmazonDynamoDB
Data Provider\\CredentialsFile.txt
Profile Name The name of the profile to use from the AWS
credentials file.
Temporary Session Token The session token to use when connecting to 3600
DynamoDB using temporary security
credentials, which are valid only for a limited
period of time.
Advanced settings
Setting Description Example
Note
Before connecting to a data source and re-running the import, clear the
connector cache to flush the existing set of table names.
In the Existing Connections tab in the Data Access window, beside the
connector name, select > Clear cache.
l Update field specifications – You may also need to update field specifications in the script
body to align with table schema changes in the data source or ODBC driver. Possible
changes include field names, field data types, and field and record lengths.
l Check the results of any filtering – You should also check the results of any filtering that you
apply as part of the data import. Confirm that the import filtering is including and excluding
records correctly.
Amazon Redshift is a cloud data warehouse service used for business intelligence. Use the Amazon
Redshift data connector to import your organization's Amazon Redshift data.
Note
Analytics provides Amazon Redshift as an optional connector and if it is not
available in your Data Access window, it is likely that the connector was not selected
during installation. For more information, see "Install optional Analytics data
connectors and Python engine" on page 2689.
Note
When gathering the required connection information:
l you can obtain the ODBC URL from the AWS Management Console by
looking at the database properties for your cluster
l verify that the connecting account has database permissions, not just Amazon
Redshift permissions
For more information about configuring an ODBC connection, see the online
Amazon AWS documentation.
For help gathering the connection prerequisites, contact the Amazon Redshift administrator in your
organization. If your administrator cannot help you, you or your administrator should contact
Amazon Redshift Support.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for Amazon Redshift is saved to the Existing Connections tab. In the future, you
can reconnect to Amazon Redshift from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from Amazon Redshift, see "Working with the
Data Access window" on page 370.
Connection settings
Basic settings
Setting Description Example
Enable HTTP Proxy Connection Specifies whether the driver can pass
the IAM authentication processes
through a proxy server.
Advanced settings
Setting Description Example
Show Boolean Column As String Specifies the SQL data type that the
driver uses to return Boolean data.
If enabled, the driver returns Boolean
columns as SQL_VARCHAR data
with a length of 5, else as SQL_BIT
data.
Connecting to Amazon S3
Amazon Simple Storage Service (S3) is an object storage service that can be accessed through a
web service interface. You can use the Amazon S3 data connector to import your organization's
Amazon S3 data.
Note
The Amazon S3 data connector is provided by our data partner, CData. For
information about any of the connection fields, refer to the documentation available
at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Apache Cassandra is a NoSQL database management system. Use the Apache Cassandra data
connector to import your organization's Cassandra data.
Note
Analytics provides Cassandra as an optional connector and if it is not available in
your Data Access window, it is likely that the connector was not selected during
installation. For more information, see "Install optional Analytics data connectors
and Python engine" on page 2689.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for Cassandra is saved to the Existing Connections tab. In the future, you can
reconnect to Cassandra from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from Cassandra, see "Working with the Data
Access window" on page 370.
Connection settings
Basic settings
Setting Description Example
Advanced settings
Setting Description Example
Query mode Specifies the query mode to use SQL with CQL Fallback
when sending queries to Cassandra.
The options available are:
o SQL - Uses SQL_QUERY_MODE
and executes all queries in SQL.
o CQL - Uses CQL_QUERY_MODE
and executes all queries in CQL.
o SQL with CQL Fallback - Uses
SQL_WITH_CQL_FALLBACK_
QUERY_MODE and executes all
queries in SQL by default. If a
Virtual table name separator The separator for naming a virtual _vt_
table built from a collection.
The name of a virtual table consists of
the name of the original table, then
the separator, and then the name of
the collection.
Client-side Private Key The full path to the file containing the
private key used to verify the client.
Key File Password The password for the private key file
that is specified in the Client-side
Private Key field.
Querying Cassandra
One advantage of the Apache Cassandra design is the ability to store data that is denormalized into
fewer tables. By taking advantage of nested data structures such as sets, lists, and maps, transac-
tions can be simplified. However, Analytics does not support accessing this type of data. By re-
normalizing the data contained within collections (sets, lists, and maps) into virtual tables, the
connector allows users to directly interact with the data but leave the storage of the data in its
denormalized form in Cassandra.
If a table contains any collection columns, when the table is queried for the first time, the connector
creates the following virtual tables:
l A "base" table, which contains the same data as the real table except for the collection
columns.
l A virtual table for each collection column, which expands the nested data.
Virtual tables refer to the data in the real table, enabling the connector to access the denormalized
data. By querying the virtual tables, you can access the contents of Cassandra collections via
ODBC.
The base table and virtual tables appear as additional tables in the list of tables that exist in the
database. The base table uses the same name as the real table that it represents. The virtual tables
that represent collections are named using the name of the real table, a separator (_vt_ by default),
and the name of the column.
Example
ExampleTable is a Cassandra database table that contains an integer primary key column
named pk_int, a list column, a map column, and a set column (named StringSet).
The connector generates multiple virtual tables to represent this single table. The first virtual
table is the base table:
Base table
pk_int
The base table contains the same data as the original database table except for the
collections, which are omitted from this table and expanded in other virtual tables.
The following tables show the virtual tables that re-normalize the data from the List, Map, and
StringSet columns:
List
pk_int List#index List#value
1 0 1
1 1 2
1 2 3
3 0 100
3 1 101
3 2 102
3 3 105
Map
pk_int Map#key Map#value
1 S1 a
1 S2 b
3 S1 t
StringSet
pk_int StringSet#value
1 a
1 b
1 c
3 a
3 e
The foreign key columns in the virtual tables reference the primary key columns in the real
table, and indicate which real table row the virtual table row corresponds to. The columns with
names that end with #index or #key indicate the position of the data within the original list or
map. The columns with names that end with #value contain the expanded data from the
collection.
Note
Before connecting to a data source and re-running the import, clear the
connector cache to flush the existing set of table names.
In the Existing Connections tab in the Data Access window, beside the
connector name, select > Clear cache.
l Update field specifications – You may also need to update field specifications in the script
body to align with table schema changes in the data source or ODBC driver. Possible
changes include field names, field data types, and field and record lengths.
l Check the results of any filtering – You should also check the results of any filtering that you
apply as part of the data import. Confirm that the import filtering is including and excluding
records correctly.
Drill is an Apache open-source SQL query engine for high-performance analysis on the semi-
structured data coming from Big Data applications. Use the Apache Drill data connector to import
your organization's Drill data.
Note
Analytics provides Drill as an optional connector and if it is not available in your Data
Access window, it is likely that the connector was not selected during installation.
For more information, see "Install optional Analytics data connectors and Python
engine" on page 2689.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for Apache Drill is saved to the Existing Connections tab. In the future, you can
reconnect to Apache Drill from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from Apache Drill, see "Working with the Data
Access window" on page 370.
Connection settings
Basic settings
Setting Description Example
Advanced settings
Setting Description Example
Apache HBase is the Hadoop database that is a distributed, scalable, big data store. You can use
the Apache HBase data connector to import your organization's HBase data.
Note
Analytics provides HBase as an optional connector and if it is not available in your
Data Access window, it is likely that the connector was not selected during install-
ation. For more information, see "Install optional Analytics data connectors and
Python engine" on page 2689.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for HBase is saved to the Existing Connections tab. In the future, you can
reconnect to HBase from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from HBase, see "Working with the Data Access
window" on page 370.
Connection settings
Basic settings
Setting Description Example
Advanced settings
Setting Description Example
Schema definition row limit Number of rows that the driver 1024
samples when generating a schema.
Apache Hive is a cloud data service. You can use the Apache Hive data connector to import your
organization's Hive data.
Note
Analytics provides Hive as an optional connector and if it is not available in your Data
Access window, it is likely that the connector was not selected during installation.
For more information, see "Install optional Analytics data connectors and Python
engine" on page 2689.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for Hive is saved to the Existing Connections tab. In the future, you can reconnect
to Hive from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from Hive, see "Working with the Data Access
window" on page 370.
Connection settings
Basic settings
Setting Description Example
Hive Server Type Specifies the Hive Server instance to Hive Server 2
connect to.
Service Discovery Mode Specifies how the Hive Server No Service Discovery
services are discovered. The options
available are:
o No Service Discovery - The
driver connects to Hive without
using a discovery service.
o ZooKeeper - The driver discovers
Hive Server services through the
ZooKeeper service.
Advanced settings
Setting Description Example
Client Private Key File The full path to the .pem file
containing the SSL private key of the
client.
Client Private Key Password The password of the private key file
specified in the Client Private Key
File field.
Get Tables with Query Specifies whether the driver uses the
SHOW TABLES query to retrieve
table names from the database. If
disabled, the driver uses GetTables
Thrift API call.
Note
Scripts that use DSN connections established in versions of ACL older than 13.1
continue to work after upgrading to version 13.1.
Apache Phoenix is a relational database engine supporting online transaction processing with
Apache HBase. You can use the Apache Phoenix data connector to import your organization's
Apache Phoenix data.
Note
The Apache Phoenix data connector is provided by our data access and connectivity
partner, CData Software. Detailed information about individual connection fields is
available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Apache Spark is a cloud data service. You can use the Apache Spark data connector to import your
organization's Spark data.
Note
Analytics provides Spark as an optional connector and if it is not available in your
Data Access window, it is likely that the connector was not selected during install-
ation. For more information, see "Install optional Analytics data connectors and
Python engine" on page 2689.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for Spark is saved to the Existing Connections tab. In the future, you can reconnect
to Spark from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from Spark, see "Working with the Data Access
window" on page 370.
Connection settings
Basic settings
Setting Description Example
Advanced settings
Setting Description Example
Client Private Key File The full path to the .pem file
containing the SSL private key of the
client.
Client Private Key Password The password of the private key file
specified in the Client Private Key
File field.
Get Tables with Query Specifies whether the driver uses the 1
SHOW TABLES query to retrieve
table names from the database. If
disabled, the driver uses GetTables
Thrift API call.
Note
Scripts that use DSN connections established in versions of ACL older than 13.1
continue to work after upgrading to version 13.1.
AWS Data Management is an web-based interface for managing Amazon Web Services. You can
use the AWS Data Management data connector to import your organization's AWS Data
Management data.
Note
The AWS Data Management data connector is provided by our data partner, CData.
For information about any of the connection fields, refer to the documentation
available at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Azure Analysis Services is a cloud platform for data modeling, data analysis, and reporting. You can
use the Azure Analysis Services data connector to import your organization's Azure Analysis
Services data.
Note
The Azure Analysis Services data connector is provided by our data access and
connectivity partner, CData Software. Detailed information about individual
connection fields is available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Azure Data Catalog is a cloud service for data discovery and collaborative data annotation. You can
use the Azure Data Catalog data connector to import your organization's Azure Data Catalog data.
Note
The Azure Data Catalog data connector is provided by our data access and
connectivity partner, CData Software. Detailed information about individual
connection fields is available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Azure Data Lake Storage is a cloud-based file storage and management facility designed for big
data. You can use the Azure Data Lake Storage data connector to import your organization's Azure
data.
Note
The Azure Data Lake Storage data connector is provided by our data access and
connectivity partner, CData Software. Detailed information about individual
connection fields is available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Azure Data Management provides options to manage Azure data. You can use the Azure Data
Management data connector to import your organization's Azure data.
Note
The Azure Data Management data connector is provided by our data partner,
CData. For information about any of the connection fields, refer to the document-
ation available at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Azure Table Storage is a cloud-based NoSQL datastore that allows you to store massive amounts of
structured and non-relational data. You can use the Azure Table Storage data connector to import
your organization's Azure Table Storage data.
Note
The Azure Table Storage data connector is provided by our data partner, CData. For
information about any of the connection fields, refer to the documentation available
at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to Basecamp
Basecamp is an online project management platform. You can use the Basecamp data connector to
import your organization's Basecamp data.
Note
The Basecamp data connector is provided by our data access and connectivity
partner, CData Software. Detailed information about individual connection fields is
available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to Box
Box is a cloud-based content management service, which enables file sharing and collaboration for
business. You can use the Box data connector to import your organization's Box data .
Note
The Box data connector is provided by our data partner, CData. For information
about any of the connection fields, refer to the documentation available at the CData
website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
5. Click Authorize.
If you are using SSO, provide the credentials and log in.
6. On the page that appears, click Grant access to Box.
The page is authorized successfully.
Note
When connected to Box through multi-factor authentication (MFA), the authentic-
ation token expires roughly after one hour and causes any existing connections and
imports happening to fail. Once the authentication failure happens, the existing
connection will not work. You must create a new connection to Box for your further
operations.
Cloudera Impala is a cloud data service. You can use the Cloudera Impala data connector to import
your organization's Impala data.
Note
Analytics provides Impala as an optional connector and if it is not available in your
Data Access window, it is likely that the connector was not selected during install-
ation. For more information, see "Install optional Analytics data connectors and
Python engine" on page 2689.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for Impala is saved to the Existing Connections tab. In the future, you can
reconnect to Impala from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from Impala, see "Working with the Data Access
window" on page 370.
Connection settings
Basic settings
Setting Description Example
Advanced settings
Setting Description Example
Note
Before connecting to a data source and re-running the import, clear the
connector cache to flush the existing set of table names.
In the Existing Connections tab in the Data Access window, beside the
connector name, select > Clear cache.
l Update field specifications – You may also need to update field specifications in the script
body to align with table schema changes in the data source or ODBC driver. Possible
changes include field names, field data types, and field and record lengths.
l Check the results of any filtering – You should also check the results of any filtering that you
apply as part of the data import. Confirm that the import filtering is including and excluding
records correctly.
Connecting to CockroachDB
CockroachDB is a distributed SQL database. You can use the CockroachDB data connector to
import your organization's CockroachDB data.
Note
The CockroachDB data connector is provided by our data access and connectivity
partner, CData Software. Detailed information about individual connection fields is
available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to Concur
Concur is a cloud-based travel and expense management service. Use the Concur data connector
to import your organization's Concur data.
Note
Analytics provides Concur as an optional connector and if it is not available in your
Data Access window, it is likely that the connector was not selected during install-
ation. For more information, see "Install optional Analytics data connectors and
Python engine" on page 2689.
Note
Make note of your token's expiry date when you obtain it. Concur authentication
tokens expire after one year.
For help gathering the connection prerequisites, contact the Concur administrator in your organiz-
ation. If your administrator cannot help you, you or your administrator should contact Concur
Support.
You acquire a Client ID in the Administration area of Concur Web Services through the Register
Partner Application option.
In Concur Web Services, the Client ID is called either:
l Application Authorization Key
l Consumer Key
Note
If the Register Partner Application option does not appear in Concur Web Services,
you or your Concur administrator needs to contact Concur Support. Your company
may not have the appropriate Concur license.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for Concur is saved to the Existing Connections tab. In the future, you can
reconnect to Concur from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from Concur, see "Working with the Data Access
window" on page 370.
Connection settings
Basic settings
Setting Description Example
Advanced settings
Setting Description Example
User Param The value to use for the user query all
parameter, when querying tables with
endpoints that are under the
/api/v3.0/expense endpoint
group.
proxy.
Note
If an API is not listed below, you cannot access it using the Data Access window. For
information about the data available from each endpoint, see the Concur API
documentation.
Concur stores data in structures which do not follow the rules of data typing and
structure that apply to traditional relational tables and columns. Therefore, the data
needs to be mapped to a relational form. To achieve this, the connector maps the
Concur data to an ODBC-compatible format.
Common Lists
List Items
Locations
Expense Entries
Expense Form
Itemizations
Quick Expense
Reports
Insights Opportunities
Travel Trips
You can access data from the Expense module for multiple Concur accounts by setting the optional
User Param field in the Advanced Options to All.
You can also enter the user name of a specific Concur user in this field to view expense data for an
individual.
SAP Concur is a cloud-based travel and expense management service. You can use the SAP
Concur data connector to import your organization's SAP Concur data.
Note
The SAP Concur data connector is provided by our data access and connectivity
partner, CData Software. Detailed information about individual connection fields is
available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to Couchbase
Couchbase is a NoSQL document-oriented database. Use the Couchbase data connector to import
your organization's Couchbase data.
Note
Analytics provides Couchbase as an optional connector and if it is not available in
your Data Access window, it is likely that the connector was not selected during
installation. For more information, see "Install optional Analytics data connectors
and Python engine" on page 2689.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
Connection settings
Setting Description Example
[{"user": "[UserName1]",
"pass":"[Password1]"},
{"user": "[UserName2]", "pass":"
[Password2]"}]
Advanced settings
Setting Description Example
Note
The names of data structures are case-sensitive, therefore you must ensure the
casing of structures such as tables, columns, or buckets in your queries match the
structures in the database.
Schema definition
Couchbase is able to store data that follows different rules of data typing and structure compared to
traditional relational tables and columns. Couchbase data is organized into buckets and documents,
which can contain nested arrays or arrays of differently typed elements. This data needs to be
mapped to a relational form. To achieve this, the connector generates a schema definition that maps
the Couchbase data to an ODBC-compatible format.
When you connect to a database that does not already have the necessary schema definition, the
connector automatically generates one by doing the following:
1. For each document type identified in the database, the connector samples data from multiple
documents to detect the structure of the data.
2. The connector organizes all the documents into collections based on their type, and saves
these collections as part of the schema definition. Using the schema definition, the driver
exposes collections as tables.
3. For each array detected in the database, the connector generates a virtual table to expand the
data, and saves these virtual tables as part of the schema. Using the schema, the driver
exposes virtual tables as normal tables.
4. The connector defines a Couchbase data type for each column and maps each Couchbase
data type to the SQL data type that is best able to represent the greatest number of values.
Base tables
Base tables represent data from collections of Couchbase documents. Documents appear as rows,
and all attributes that are not arrays appear as columns. In each base table, the connector creates a
primary key column named PK that identifies which Couchbase document each row comes from.
In the connector, the name of the base table is the document type that it represents. In Couchbase,
the name of the base table is the bucket that the data comes from.
Virtual tables
Virtual tables provide support for arrays. Each virtual table contains the data from one array, and
each row in the table represents an element from the array. If an element contains an array, then the
connector creates additional virtual tables as needed to expand the nested data.
In each virtual table, the connector creates a primary key column name that identifies the document
that the array comes from and references the column from the related base table. The connector
also creates an index column (with the suffix _IDX in its name) to indicate the position of the element
within the array.
Example
The following example shows the base tables and virtual tables that the connector would
generate if it connected to a Couchbase database named ExampleDatabase, which contains
two documents named Customer_123221 and Order_221354.
The Customer_123221 document is of type Customer and contains the following attributes.
The SavedAddresses attribute is an array:
{
"Type": "Customer",
"Name": "John Doe",
"SavedAddresses": ["123 Main St.", "456 1st Ave"]
}
The Order_221354 document is of type Order and contains the following attributes. The
CreditCard attribute is an object, and the Items attribute is an array of objects:
{
"Type": "Order",
"CustomerID":"Customer_123221",
"CreditCard":
{
"Type":"Visa",
"CardNumber":"4111 1111 1111 1111",
"Expiry":"12/12",
"CVN":"123"
},
"Items":
[
{"ItemID":89123, "Quantity":1},
{"ItemID":92312, "Quantity":5}
]
}
When Analytics connects to ExampleDatabase and generates the schema, the connector
creates a collection for each document type and exposes these collections as two base
tables, which are shown below:
The SavedAddresses array from the Customer_123221 document and the Items array from
the Order_221354 document do not appear in these base tables. Instead, the connector
generates a virtual table for each array:
SavedAddresses table
PK SavedAddresses_IDX SavedAddresses
Items table
PK Items_IDX ItemID Quantity
"Order_221354" 0 89123 1
"Order_221354" 1 92312 5
Connecting to DigitalOcean
DigitalOcean is a cloud infrastructure provider. You can use the DigitalOcean data connector to
import your organization's DigitalOcean data.
Note
The DigitalOcean data connector is provided by our data access and connectivity
partner, CData Software. Detailed information about individual connection fields is
available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to DocuSign
DocuSign is an electronic agreements management tool. You can use the DocuSign data connector
to import your organization's DocuSign data.
Note
The DocuSign data connector is provided by our data partner, CData. For
information about any of the connection fields, refer to the documentation available
at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to Dropbox
Dropbox is a cloud-based file hosting service. You can use the Dropbox data connector to import
your organization's Dropbox data.
Note
The Dropbox data connector is provided by our data access and connectivity
partner, CData Software. Detailed information about individual connection fields is
available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Microsoft Dynamics CRM is a customer relationship management (CRM) system. You can use the
Dynamics CRM data connector to import your organization's Dynamics CRM data.
Note
The Dynamics CRM data connector is provided by our data partner, CData. For
information about any of the connection fields, refer to the documentation available
at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to Dynamics GP
Microsoft Dynamics GP is business accounting software for managing finance, inventory, and
operations. You can use the Dynamics GP data connector to import your organization's Dynamics
GP data.
Note
The Dynamics GP data connector is provided by our data partner, CData. For
information about any of the connection fields, refer to the documentation available
at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Microsoft Dynamics NAV is an enterprise resource planning (ERP) system. You can use the
Dynamics NAV data connector to import your organization's Dynamics NAV data.
Note
The Dynamics NAV data connector is provided by our data partner, CData. For
information about any of the connection fields, refer to the documentation available
at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Microsoft Dynamics 365 Business Central is an enterprise resource planning (ERP) system. You
can use the Dynamics 365 Business Central data connector to import your organization's Dynamics
365 Business Central data.
Note
The Dynamics 365 Business Central data connector is provided by our data partner,
CData. For information about any of the connection fields, refer to the document-
ation available at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Microsoft Dynamics 365 Finance and Operations is a cloud-based enterprise resource planning
(ERP) system. You can use the Dynamics 365 Finance and Operations data connector to import
your organization's Dynamics 365 Finance and Operations data.
Note
The Dynamics 365 Finance and Operations data connector is provided by our data
partner, CData. For information about any of the connection fields, refer to the
documentation available at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Microsoft Dynamics 365 Sales is a customer relationship management (CRM) solution specialized
for an organization's sales function. You can use the Dynamics 365 Sales data connector to import
your organization's Dynamics 365 Sales data.
Note
The Dynamics 365 Sales data connector is provided by our data partner, CData. For
information about any of the connection fields, refer to the documentation available
at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Edgar Online is a solution that creates and distributes financial data and public filings for equities,
mutual funds, and other publicly traded assets. You can use the Edgar Online data connector to
import data your organization's Edgar Online data.
Note
The Edgar Online data connector is provided by our data partner, CData. For
information about any of the connection fields, refer to the documentation available
at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to Elasticsearch
Elasticsearch is a search platform with a data store and an analytics engine. You can use the Elastic-
search data connector to import your organization's Elasticsearch data.
Note
The Elasticsearch data connector is provided by our data access and connectivity
partner, CData Software. Detailed information about individual connection fields is
available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to Email
Use the Email data connector to import email messages for a single account using the standard mail
protocols IMAP or POP. When you connect to your email server, each table name represents a
mailbox folder on the server, and each record represents an email message.
Note
You cannot use this connector independently of Analytics. You can configure a
DSN for the connector driver using the Windows ODBC Data Source Administrator,
however you must test the DSN connection from within Analytics and not from the
connector's Windows DSN configuration dialog.
This connector retrieves email messages for a single account stored on mail servers only. It does
not connect to features such as chat, or to-dos that are included with some email clients.
Note
Your email server must use either the IMAP or POP protocol.
For help gathering the connection prerequisites, contact the Email administrator in your organiz-
ation. If your administrator cannot help you, you or your administrator should contact Email Support.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
Connection settings
Basic settings
Setting Description Example
Advanced settings
Setting Description Example
Note
Using the Email
connector, you cannot
retrieve the contents of
the Subject field for the
Task or Calendar
mailboxes from an
Outlook 365 account. If
you are connecting to an
Outlook 365 account,
consider using the
Exchange connector
instead. For more
information, see
"Connecting to
Exchange" on page 509
Caution
This setting affects
performance and may
cause your query to
timeout if you are working
with many records.
Execution of predicates
Execution of Joins
The connector uses various
techniques to join in memory. The
driver trades off memory utilization
against the requirement of reading
the same table more than once.
Execution of Aggregates
The connector retrieves all rows
necessary to process the aggregation
in memory.
Note
The connector will use the
system proxy settings by
default, without further
configuration needed; if
you want to connect to
another proxy, you will
need to set
ProxyAutoDetect to false,
in addition to ProxyServer
and ProxyPort. To
authenticate, set
ProxyAuthScheme and
set ProxyUser and
ProxyPassword, if
needed.
Proxy SSL Type The SSL type to use when connecting AUTO
to the ProxyServer proxy:
o AUTO – If the URL is an HTTPS
URL, the connector will use the
TUNNEL option. If the URL is an
HTTP URL, the connector will use
the NEVER option (default)
o ALWAYS – the connection is
Note
Before connecting to a data source and re-running the import, clear the
connector cache to flush the existing set of table names.
In the Existing Connections tab in the Data Access window, beside the
connector name, select > Clear cache.
l Update field specifications – You may also need to update field specifications in the script
body to align with table schema changes in the data source or ODBC driver. Possible
changes include field names, field data types, and field and record lengths.
l Check the results of any filtering – You should also check the results of any filtering that you
apply as part of the data import. Confirm that the import filtering is including and excluding
records correctly.
14.2 Existing fields To and From now contain email address only.
New fields FullTo and FullFrom contain email address and email alias.
15.0 Default value for the Max Items field in the connector is -1. When this value is
specified, the connector returns all items during import.
After upgrading to 15.0, if value for Max Items is specified as 100 or any other
value, the connector returns items only from the specified number of records.
If you were using the ACCESSDATA command in a previous version of
Analytics, when upgrading to 15.0, to return all items, open the script, update
the value for maxitems to -1, and re-run the script.
Epicor ERP is an enterprise resource planning (ERP) solution. You can use the Epicor ERP data
connector to import your organization's Epicor ERP data.
Note
The Epicor ERP data connector is provided by our data partner, CData. For
information about any of the connection fields, refer to the documentation available
at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Exact Online is a cloud-based accounting and customer relationship management (CRM) solution.
You can use the Exact Online data connector to import your organization's Exact Online data.
Note
The Exact Online data connector is provided by our data partner, CData. For
information about any of the connection fields, refer to the documentation available
at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Excel Online is a web-based version of the Microsoft Excel spreadsheet program. You can use the
Excel Online data connector to import your organization's Excel Online data.
Note
The Excel Online data connector is provided by our data access and connectivity
partner, CData Software. Detailed information about individual connection fields is
available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to Exchange
Use the Exchange data connector to import data from Microsoft's Exchange email and calendar
server. You can import data from a single Exchange account.
Note
You cannot use this connector independently of Analytics. You can configure a
DSN for the connector driver using the Windows ODBC Data Source Administrator,
however you must test the DSN connection from within Analytics and not from the
connector's Windows DSN configuration dialog.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for Exchange is saved to the Existing Connections tab. In the future, you can
reconnect to Exchange from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from Exchange, see "Working with the Data
Access window" on page 370.
Connection settings
Basic settings
Setting Description Example
Advanced settings
Setting Description Example
Note
Microsoft has
announced that is
deprecating
Basic authentication
for Exchange Web
Services in October
2020. Consider using
an alternative
authentication
scheme.
Caution
This setting affects
performance and may
cause your query to
timeout if you are working
with many records.
Execution of predicates
The connector determines which of
the clauses are supported by the data
source and then pushes them to the
source to get the smallest superset of
rows that would satisfy the query. It
then filters the rest of the rows locally.
The filter operation is streamed,
which enables the driver to filter
effectively for even very large
datasets.
Execution of Joins
The connector uses various
techniques to join in memory. The
driver trades off memory utilization
against the requirement of reading
the same table more than once.
Execution of Aggregates
The connector retrieves all rows
necessary to process the aggregation
in memory.
Note
The connector will use the
system proxy settings by
default, without further
configuration needed; if
you want to connect to
another proxy, you will
need to set
ProxyAutoDetect to false,
in addition to ProxyServer
and ProxyPort. To
authenticate, set
ProxyAuthScheme and
set ProxyUser and
ProxyPassword, if
needed.
Proxy SSL Type The SSL type to use when connecting AUTO
to the ProxyServer proxy:
o AUTO – If the URL is an HTTPS
URL, the connector will use the
TUNNEL option. If the URL is an
HTTP URL, the connector will use
the NEVER option (default)
o ALWAYS – the connection is
Note
Using this connector, you can list attachment filenames, however you cannot access
the contents of attachment files. You can only access the contents of the message
body.
Returning the message body is resource-intensive and doing so for a number of records affects
performance. If you need to examine the message body, try using other fields to identify the
messages you want to analyze in detail. Then query this subset of messages individually to examine
the message body for each one.
Filtering limitations
The following filter condition and field combinations are not supported:
SenderName o Is (=)
o Starts with (LIKE "%value")
SenderEmailAddress
o Contains (LIKE "%value%")
FromName
Note
Before connecting to a data source and re-running the import, clear the
connector cache to flush the existing set of table names.
In the Existing Connections tab in the Data Access window, beside the
connector name, select > Clear cache.
l Update field specifications – You may also need to update field specifications in the script
body to align with table schema changes in the data source or ODBC driver. Possible
changes include field names, field data types, and field and record lengths.
l Check the results of any filtering – You should also check the results of any filtering that you
apply as part of the data import. Confirm that the import filtering is including and excluding
records correctly.
Analytics ver-
sion Exchange table Change
Analytics ver-
sion Exchange table Change
Google Analytics is a web analytics platform for tracking, analyzing, and reporting on web site traffic.
You can use the Google Analytics data connector to import your organization's Google Analytics
data.
Note
The Google Analytics data connector is provided by our data access and
connectivity partner, CData Software. Detailed information about individual
connection fields is available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Google BigQuery is a cloud data service. You can use the Google BigQuery data connector to
import your organization's BigQuery data.
Note
Analytics provides Google BigQuery as an optional connector and if it is not
available in your Data Access window, it is likely that the connector was not selected
during installation. For more information, see "Install optional Analytics data
connectors and Python engine" on page 2689.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for Google BigQuery is saved to the Existing Connections tab. In the future, you
can reconnect to Google BigQuery from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from Google BigQuery, see "Working with the
Data Access window" on page 370.
Connection settings
Basic settings
Setting Description Example
Advanced settings
Setting Description Example
Dataset Name for Large Result Sets ID of the BigQuery dataset to use to _odbc_temp_tables
store temporary tables for large result
sets.
Specify a value for this option only if
you want to enable support for large
result sets.
This field is enabled only if you select
the Allow Large Result Sets option.
Temporary Table Expiration Time Time (in seconds) until the temporary 3600000
(ms) table expires. To have the table set to
never expire, specify the value 0.
Note
Before connecting to a data source and re-running the import, clear the
connector cache to flush the existing set of table names.
In the Existing Connections tab in the Data Access window, beside the
connector name, select > Clear cache.
l Update field specifications – You may also need to update field specifications in the script
body to align with table schema changes in the data source or ODBC driver. Possible
changes include field names, field data types, and field and record lengths.
l Check the results of any filtering – You should also check the results of any filtering that you
apply as part of the data import. Confirm that the import filtering is including and excluding
records correctly.
Google Cloud Storage is a web-based file storage service for managing data on Google Cloud
Platform. You can use the Google Cloud Storage data connector to import your organization's
Google Cloud Storage data.
Note
The Google Cloud Storage data connector is provided by our data access and
connectivity partner, CData Software. Detailed information about individual
connection fields is available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Google Contacts is a web-based contact management tool. You can use the Google Contacts data
connector to import your organization's Google Contacts data.
Note
The Google Contacts data connector is provided by our data access and
connectivity partner, CData Software. Detailed information about individual
connection fields is available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Google Drive is a cloud-based file storage service. You can use the Google Drive data connector to
import your organization's Google Drive data.
Note
The Google Drive data connector is provided by our data access and connectivity
partner, CData Software. Detailed information about individual connection fields is
available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Google Sheets is a web-based spreadsheet program. You can use the Google Sheets data
connector to import your organization's Google Sheets data.
Note
The Google Sheets data connector is provided by our data access and connectivity
partner, CData Software. Detailed information about individual connection fields is
available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
IBM Cloudant is a distributed database based on open source Apache CouchDB. You can use the
IBM Cloudant data connector to import your organization's IBM Cloudant data.
Note
The IBM Cloudant data connector is provided by our data access and connectivity
partner, CData Software. Detailed information about individual connection fields is
available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to Jira
Jira is a cloud or server-based platform for software issue tracking and project management. Use
the Jira data connector to access your company's Jira data.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for Jira is saved to the Existing Connections tab. In the future, you can reconnect to
Jira from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from Jira, see "Working with the Data Access
window" on page 370.
Connection settings
Basic settings
Setting Description Example
Advanced settings
Setting Description Example
Note
The connector will use the
system proxy settings by
default, without further
configuration needed; if
you want to connect to
another proxy, you will
need to set
ProxyAutoDetect to false,
in addition to ProxyServer
and ProxyPort. To
authenticate, set
ProxyAuthScheme and
set ProxyUser and
ProxyPassword, if
needed.
ProxyAuthScheme.
If you are using HTTP authentication,
additionally set ProxyUser and
ProxyPassword to HTTP proxy.
If you are using NTLM authentication,
set ProxyUser and ProxyPassword to
your Windows password. You may
also need these to complete
Kerberos authentication.
Proxy SSL Type The SSL type to use when connecting AUTO
to the ProxyServer proxy:
o AUTO – If the URL is an HTTPS
URL, the connector will use the
TUNNEL option. If the URL is an
HTTP URL, the connector will use
the NEVER option (default)
o ALWAYS – the connection is
always SSL enabled
o NEVER – the connection is not
SSL enabled
o TUNNEL – the connection is
through a tunneling proxy: The
proxy server opens a connection
to the remote host and traffic flows
back and forth through the proxy
The possibility exists that changes made by third-party data sources or ODBC driver vendors
required updates to one or more of the data connectors. Scripted data connections may need to be
updated in order to continue working correctly.
l Re-run the import – The easiest way to update a connection is to manually perform an import
using the Data Access window in the upgraded version of Analytics. Copy the ACCESSDATA
command from the log and use it to update your script.
Note
Before connecting to a data source and re-running the import, clear the
connector cache to flush the existing set of table names.
In the Existing Connections tab in the Data Access window, beside the
connector name, select > Clear cache.
l Update field specifications – You may also need to update field specifications in the script
body to align with table schema changes in the data source or ODBC driver. Possible
changes include field names, field data types, and field and record lengths.
l Check the results of any filtering – You should also check the results of any filtering that you
apply as part of the data import. Confirm that the import filtering is including and excluding
records correctly.
Boards FilterId
(Existing scripted Jira
imports that reference
this field continue to
work, but the field no
longer exists.)
AuthorDisplayName
JavaScript Object Notation (JSON) is a standard file format used to transmit data objects consisting
of attribute-value pairs and array data types. JSON is a common format for communication with Web
services.
Note
You cannot use this connector independently of Analytics. You can configure a
DSN for the connector driver using the Windows ODBC Data Source Administrator,
however you must test the DSN connection from within Analytics and not from the
connector's Windows DSN configuration dialog.
Note
You cannot use the JSON connector with the Professional Edition of ACL Robotics if
the connection requires authentication.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for JSON is saved to the Existing Connections tab. In the future, you can reconnect
to JSON from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from JSON, see "Working with the Data Access
window" on page 370.
Connection settings
Basic settings
Setting Description Example
Note
JSONPath and
XPath are
standardized
query formats. For
more information
about the syntax
and keywords,
consult an online
resource.
Advanced settings
Setting Description Example
Note
The connector will use the
system proxy settings by
default, without further
configuration needed; if
you want to connect to
another proxy, you will
need to set
ProxyAutoDetect to false,
in addition to ProxyServer
and ProxyPort. To
authenticate, set
ProxyAuthScheme and
set ProxyUser and
ProxyPassword, if
needed.
Proxy SSL Type The SSL type to use when connecting AUTO
to the ProxyServer proxy:
o AUTO – If the URL is an HTTPS
URL, the connector will use the
TUNNEL option. If the URL is an
HTTP URL, the connector will use
the NEVER option (default)
o ALWAYS – the connection is
Connecting to Kintone
Kintone is a workplace platform that centralizes team data, workflows, and communication. You can
use the Kintone data connector to import your organization's Kintone data.
Note
The Kintone data connector is provided by our data access and connectivity partner,
CData Software. Detailed information about individual connection fields is available
in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to LDAP
The Lightweight Directory Access Protocol (LDAP) is an industry-standard application protocol for
accessing and maintaining distributed directory information services over an Internet Protocol (IP)
network. Use the LDAP connector for real-time access to LDAP data, directly from any applications
that support ODBC connectivity.
Note
You cannot use this connector independently of Analytics. You can configure a
DSN for the connector driver using the Windows ODBC Data Source Administrator,
however you must test the DSN connection from within Analytics and not from the
connector's Windows DSN configuration dialog.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for LDAP is saved to the Existing Connections tab. In the future, you can reconnect
to LDAP from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from LDAP, see "Working with the Data Access
window" on page 370.
Connection settings
Basic settings
Setting Description Example
Note
You may connect without
providing a password if
your LDAP server permits
anonymous connections.
Based on your server's
security configuration,
anonymous connections
may be able to list
available tables.
However, such
connections may not be
able to select data from
some or all of the tables
listed. For more
information about your
LDAP security configur-
ation, contact your
company's administrator.
Tip
Limiting scope can
greatly improve the
search performance.
Advanced settings
Setting Description Example
column names.
Note
This setting must be false
to support filtering using
the where clause syntax.
Execution of predicates
The connector determines which of
the clauses are supported by the data
source and then pushes them to the
source to get the smallest superset of
rows that would satisfy the query. It
Execution of Joins
The connector uses various
techniques to join in memory. The
driver trades off memory utilization
against the requirement of reading
the same table more than once.
Execution of Aggregates
The connector retrieves all rows
necessary to process the aggregation
in memory.
Scenario
You are working with the User table and you want to import records where the ObjectClass
has the following attributes:
l person
l user
You also want to limit the records to those where the ObjectCategory has the Computer
attribute, and not Person.
You then use SQL Mode to verify the WHERE clause that the filter constructs:
WHERE
(
"User"."ObjectClass" = N'person' AND
"User"."ObjectClass" = N'user' AND
"User"."ObjectCategory" = N'Computer'
)
Filter results
Once the filter is applied, the table includes records that match the WHERE clause and you
import the table.
Connecting to LinkedIn
LinkedIn is a professional networking website for business professionals. You can use the LinkedIn
data connector to import your organization's LinkedIn data.
Note
The LinkedIn data connector is provided by our data partner, CData. For information
about any of the connection fields, refer to the documentation available at the CData
website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to Marketo
Marketo is a marketing automation platform. Specify a Marketo REST API endpoint to import data
from your Marketo system using the connector.
Note
You cannot use this connector independently of Analytics. You can configure a
DSN for the connector driver using the Windows ODBC Data Source Administrator,
however you must test the DSN connection from within Analytics and not from the
connector's Windows DSN configuration dialog.
Note
Marketo's API services are subject to limitations for the number of requests per day
as well as the number of simultaneous requests. If you are experiencing issues with
these limitations, contact your Marketo administrator or Marketo Support.
For help gathering the connection prerequisites, contact the Marketo administrator in your organiz-
ation. If your administrator cannot help you, you or your administrator should contact Marketo
Support.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for Marketo is saved to the Existing Connections tab. In the future, you can
reconnect to Marketo from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from Marketo, see "Working with the Data Access
window" on page 370.
Connection settings
Basic settings
Setting Description Example
Advanced settings
Setting Description Example
Note
The connector will use the
system proxy settings by
default, without further
configuration needed; if
you want to connect to
another proxy, you will
need to set
ProxyAutoDetect to false,
in addition to ProxyServer
and ProxyPort. To
authenticate, set
ProxyAuthScheme and
set ProxyUser and
ProxyPassword, if
needed.
Proxy SSL Type The SSL type to use when connecting AUTO
to the ProxyServer proxy:
o AUTO – If the URL is an HTTPS
URL, the connector will use the
TUNNEL option. If the URL is an
HTTP URL, the connector will use
the NEVER option (default)
o ALWAYS – the connection is
always SSL enabled
o NEVER – the connection is not
SSL enabled
o TUNNEL – the connection is
through a tunneling proxy: The
proxy server opens a connection
to the remote host and traffic flows
back and forth through the proxy
Connecting to MarkLogic
MarkLogic is a cloud platform for data integration. You can use the MarkLogic data connector to
import your organization's MarkLogic data.
Note
The MarkLogic data connector is provided by our data access and connectivity
partner, CData Software. Detailed information about individual connection fields is
available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Microsoft Access is a database management system. You can use the Microsoft Access data
connector to import your organization's Microsoft Access data.
Note
The Microsoft Access data connector is provided by our data access and
connectivity partner, CData Software. Detailed information about individual
connection fields is available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Microsoft OneDrive is web-based file hosting service. You can use the Microsoft OneDrive data
connector to import your organization's Microsoft OneDrive data.
Note
The Microsoft OneDrive data connector is provided by our data access and
connectivity partner, CData Software. Detailed information about individual
connection fields is available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Microsoft SQL Server is a widely-used relational database management system. You can use the
SQL Server data connector to import your organization's SQL Server data.
Note
Analytics provides SQL Server as an optional connector and if it is not available in
your Data Access window, it is likely that the connector was not selected during
installation. For more information, see "Install optional Analytics data connectors
and Python engine" on page 2689.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for SQL Server is saved to the Existing Connections tab. In the future, you can
reconnect to SQL Server from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from SQL Server, see "Working with the Data
Access window" on page 370.
Connection settings
Setting Description Example
Microsoft Teams is a business communications platform. You can use the Microsoft Teams data
connector to import your organization's Microsoft Teams data.
Note
The Microsoft Teams data connector is provided by our data access and
connectivity partner, CData Software. Detailed information about individual
connection fields is available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to MongoDB
MongoDB is a cloud data service. You can use the MongoDB data connector to import your organiz-
ation's MongoDB data.
Note
Analytics provides MongoDB as an optional connector and if it is not available in
your Data Access window, it is likely that the connector was not selected during
installation. For more information, see "Install optional Analytics data connectors
and Python engine" on page 2689.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for MongoDB is saved to the Existing Connections tab. In the future, you can
reconnect to MongoDB from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from MongoDB, see "Working with the Data
Access window" on page 370.
Connection settings
Basic settings
Setting Description Example
Replica Set Name The name of the replica set for the
driver to access.
connection.
o MongoDB User Name and
Password - The driver
authenticates using the SCRAM-
SHA-1 protocol, which is the
default authentication protocol
used by MongoDB.
o Kerberos - The driver
authenticates using the Kerberos
protocol.
o LDAP - The driver authenticates
using the LDAP protocol.
Advanced settings
Setting Description Example
Certificate Authority File The full path of the .pem file that you
use to verify the server.
Certificate Revocation List File The full path of the .pem file
containing the list of revoked
certificates.
Expose strings as SQL_ Specifies whether the string data type Enabled
WVARCHAR is mapped to SQL_WVARCHAR or
SQL_VARCHAR.
Binary Column Size The maximum data length for binary 32767
columns.
The default value is 32767.
Documents to sample (0 for all Maximum number of records that the 100
documents) driver can sample to generate a
temporary schema definition.
When this option is set to 0, the driver
samples every document in the
database.
The default value is 100.
Write Concern Journaled Writes Specifies whether the driver requires Disabled
the data from a write operation to be
committed to the journal before the
write operation can be
acknowledged.
Note
Before connecting to a data source and re-running the import, clear the
connector cache to flush the existing set of table names.
In the Existing Connections tab in the Data Access window, beside the
connector name, select > Clear cache.
l Update field specifications – You may also need to update field specifications in the script
body to align with table schema changes in the data source or ODBC driver. Possible
changes include field names, field data types, and field and record lengths.
l Check the results of any filtering – You should also check the results of any filtering that you
apply as part of the data import. Confirm that the import filtering is including and excluding
records correctly.
14.2 The connector no longer supports connecting to MongoDB 3.0 and 3.2.
Connections can be made to MongoDB 3.4, 3.6, and 4.0.
Connecting to MySQL
MySQL is a popular open source relational database management system. Use the MySQL data
connector to import your organization's MySQL data.
Note
You cannot use this connector independently of Analytics. You can configure a
DSN for the connector driver using the Windows ODBC Data Source Administrator,
however you must test the DSN connection from within Analytics and not from the
connector's Windows DSN configuration dialog.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for MySQL is saved to the Existing Connections tab. In the future, you can
reconnect to MySQL from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from MySQL, see "Working with the Data Access
window" on page 370.
Connection settings
Basic settings
Setting Description Example
Advanced settings
Setting Description Example
Connecting to NetSuite
NetSuite is a cloud-based enterprise resource planning (ERP) service from Oracle. You can use the
NetSuite data connector to import your organization's NetSuite data.
Note
The NetSuite data connector is provided by our data partner, CData. For information
about any of the connection fields, refer to the documentation available at the CData
website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to OData
OData is an open REST-based protocol for querying and updating data. You can use the OData
data connector to import data your organization's OData data.
Note
The OData data connector is provided by our data partner, CData. For information
about any of the connection fields, refer to the documentation available at the CData
website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to Odoo
Odoo is a business management software suite. You can use the Odoo data connector to import
your organization's Odoo data.
Note
The Odoo data connector is provided by our data access and connectivity partner,
CData Software. Detailed information about individual connection fields is available
in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Open Exchange Rates is a live and historical foreign exchange (forex) rate service that provides
data for over 200 worldwide and digital currencies. Data is tracked and blended algorithmically from
multiple reliable sources, ensuring consistency.
Note
You cannot use this connector independently of Analytics. You can configure a
DSN for the connector driver using the Windows ODBC Data Source Administrator,
however you must test the DSN connection from within Analytics and not from the
connector's Windows DSN configuration dialog.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for Open Exchange Rates is saved to the Existing Connections tab. In the future,
you can reconnect to Open Exchange Rates from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from Open Exchange Rates, see "Working with
the Data Access window" on page 370.
Connection settings
Basic settings
Setting Description Example
Advanced settings
Setting Description Example
Note
The connector will use the
system proxy settings by
default, without further
configuration needed; if
you want to connect to
another proxy, you will
need to set
ProxyAutoDetect to false,
in addition to ProxyServer
and ProxyPort. To
authenticate, set
ProxyAuthScheme and
set ProxyUser and
ProxyPassword, if
needed.
Proxy SSL Type The SSL type to use when connecting AUTO
to the ProxyServer proxy:
o AUTO – If the URL is an HTTPS
URL, the connector will use the
TUNNEL option. If the URL is an
HTTP URL, the connector will use
the NEVER option (default)
o ALWAYS – the connection is
Connecting to Oracle
Oracle is a widely used relational database management system (RDBMS). You can use the Oracle
data connector to import data from your company's on-premise Oracle database.
Note
The Oracle data connector does not support importing data from Oracle Cloud or
Oracle Fusion data sources.
ACL for Windows provides Oracle as an optional connector and if it is not available
in your Data Access window, it is likely that the connector was not selected during
installation. For more information, see "Install optional Analytics data connectors
and Python engine" on page 2689.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for Oracle is saved to the Existing Connections tab. In the future, you can
reconnect to Oracle from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from Oracle, see "Working with the Data Access
window" on page 370.
Connection settings
Basic settings
Setting Description Example
Advanced settings
Setting Description Example
Oracle Eloqua is a marketing automation software as a service (SaaS) platform. You can use the
Oracle Eloqua data connector to import data your organization's Eloqua data.
Note
The Oracle Eloqua data connector is provided by our data partner, CData. For
information about any of the connection fields, refer to the documentation available
at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Oracle HCM Cloud is a cloud-based Human Capital Management (HCM) solution. You can use the
Oracle HCM Cloud data connector to import your organization's Oracle HCM Cloud data.
The Oracle HCM Cloud data connector is available in version 16.1 or later of Analytics.
Note
The Oracle HCM Cloud data connector is provided by our data access and
connectivity partner, CData Software. Detailed information about individual
connection fields is available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Oracle Sales Cloud is a customer relationship management (CRM) solution. You can use the Oracle
Sales Cloud data connector to import data your organization's Oracle Sales Cloud data.
Note
The Oracle Sales Cloud data connector is provided by our data partner, CData. For
information about any of the connection fields, refer to the documentation available
at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to Parquet
Apache Parquet is an open-source, column-based data storage format designed for large volumes
of complex data. You can use the Parquet data connector to import your organization's Parquet
data.
Note
The Parquet data connector is provided by our data access and connectivity partner,
CData Software. Detailed information about individual connection fields is available
in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to Presto
Presto is an open source SQL query engine to run interactive analytic queries against different data
sources. You can use the Presto data connector to import your organization's Presto data.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for Presto is saved to the Existing Connections tab. In the future, you can reconnect
to Presto from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from Presto, see "Working with the Data Access
window" on page 370.
Connection settings
Basic settings
Setting Description Example
Advanced settings
Setting Description Example
Proxy SSL Type The SSL type to use when connecting AUTO
to the ProxyServer proxy. The options
Connecting to Qualys
Qualys is a cloud-based suite of security and compliance solutions. Use the Qualys data connector
to import your organization's Qualys data.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for Qualys is saved to the Existing Connections tab. In the future, you can
reconnect to Qualys from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from Qualys, see "Working with the Data Access
window" on page 370.
Connection settings
Basic settings
Setting Description Example
Advanced settings
Setting Description Example
Connecting to QuickBooks
QuickBooks is online accounting software that enables you to create invoices, manage expenses,
and analyze your transaction details. You can use the QuickBooks data connector to import data
your organization's QuickBooks data.
Note
The QuickBooks data connector is provided by our data partner, CData. For
information about any of the connection fields, refer to the documentation available
at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
QuickBooks Online is a cloud-based accounting software solution for small and mid-sized
businesses. You can use the QuickBooks Online data connector to import data your organization's
QuickBooks Online data.
Note
The QuickBooks Online data connector is provided by our data partner, CData. For
information about any of the connection fields, refer to the documentation available
at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
QuickBooks Point of Sale (POS) is a point of sale system for small to mid-sized businesses that
enables users to track sales, customers and manage inventory. You can use the QuickBooks POS
data connector to import data your organization's QuickBooks POS data.
Note
The QuickBooks POS data connector is provided by our data partner, CData. For
information about any of the connection fields, refer to the documentation available
at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Caution
In Analytics 15, the REST connector is enhanced to support more authentication
methods and corresponding connection fields are also updated. However, scripts
from previous versions will not work in this version after upgrade. If you upgrade to
the Analytics 15 version, you must re-configure the connector to connect to a
RESTful system. If you have previous versions of REST connector scripts running in
Robots or Analytics Exchange, you must upload the re-configured scripts after
upgrading to Analytics 15.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for REST is saved to the Existing Connections tab. In the future, you can reconnect
to REST from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from REST, see "Working with the Data Access
window" on page 370.
Connection settings
Basic settings
Setting Description Example
Advanced settings
Setting Description Example
Custom Headers This property can be set to a string Content-Type: text/html; charset=utf-8
of HTTP headers to be appended to
Connection: keep-alive
the HTTP request headers created
from other properties, like Content-
Type, From, and so on.
The headers must be of the format
"header: value" as described in the
HTTP specifications. Each header
should go on its own line.
Use this option with caution. If it
contains invalid headers, HTTP
requests might fail. This property is
useful for fine-tuning to integrate
with specialized or nonstandard
APIs.
proxy.
Connecting to Rsam
In Rsam, you can create saved searches that allow you to store results and retrieve them when you
need them. You can import those saved searches into Analytics. Once you bring this data into
Analytics, you can prepare it, analyze it, and move it into Results to create and share storyboards
and visualizations about your data.
Permissions
Whether you authenticate with a user name and password or an API key, the saved searches
available to you in Analytics are the same as the saved searches available to you in Rsam. Your
access is based on your permissions and roles in Rsam. If you do not have access to the data you
need to import, contact your company's Rsam administrator, as only he or she can adjust what you
can access.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for Rsam is saved to the Existing Connections tab. In the future, you can reconnect
to Rsam from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from Rsam, see "Working with the Data Access
window" on page 370.
Connection settings
Basic settings
Setting Description Example
API App Name Your Rsam API app name. By default, this is "rsam_ rsam_api
api", but it is possible to change this in Rsam.
Authentication Method Whether you are connecting to Rsam with a user Password
name and password, or an API key.
API Key If you are authenticating to Rsam with an API key, 99141fae-4c41-4abd-ade2-
enter it here. Your API key is specific to you, but if 469f7d0151a4
you do not already have one, your Rsam adminis-
trator must generate it for you in Rsam.
Advanced settings
Setting Description Example
l Prepare – Use the tools in Analytics to clean and standardize your data, combine it with data
from other sources, and prepare it for analysis. Think about the ways your data can tell a more
comprehensive story.
l Can you learn more about your company's IT risk posture?
l Are there vendors in your ERP system that are not in your Rsam vendor management
program?
l Are there employees in your HR database that are not in Rsam's policy management
campaigns?
l Collecting and preparing all your data can help you answer questions like these. For more
information, see "Preparing data for analysis" on page 867.
l Analyze –Use Analytics commands and functions to analyze your data. For more information,
see "Analyzing data" on page 1163.
l Export –You can export your data to other formats, including to HighBond's Results app. For
more information, see "Exporting data" on page 208 and "Exporting exceptions to the Results
app in HighBond" on page 214.
l Automate –You can write scripts and use HighBond's Robots app to automate repetitive
tasks like importing, aggregating, and exporting data to Results. As your Rsam (and other)
data changes over time, your storyboards in HighBond can reflect this automatically.
l Visualize –Once you bring your data into Results, use Results to build meaningful visualiz-
ations. You can turn these into and storyboards that you can easily share with others in your
company.
Connecting to RSS/ATOM
Really Simple Syndication (RSS) and Atom are XML-based format/feed languages used for
publishing news or articles on websites. You can use the RSS/ATOM data connector to import your
organization's RSS/ATOM data.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for RSS/ATOM is saved to the Existing Connections tab. In the future, you can
reconnect to RSS/ATOM from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from RSS/ATOM, see "Working with the Data
Access window" on page 370.
Connection settings
Basic settings
Setting Description Example
Advanced settings
Setting Description Example
Proxy SSL Type The SSL type to use when connecting AUTO
to the ProxyServer proxy. The options
available are as follows:
o AUTO - If the URL is an HTTPS
URL, the driver will use the
TUNNEL option. If the URL is an
HTTP URL, the component will
use the NEVER option.
o ALWAYS - The connection is
always SSL enabled.
o NEVER - The connection is not
SSL enabled.
o TUNNEL - The connection is
through a tunneling proxy.
This option is enabled only when you
provide the value for the Proxy
Server.
Connecting to Sage 50 UK
Sage 50 UK is account management software used to process financial data, trade in foreign
currencies, and manage invoices and customers. You can use the Sage 50 UK data connector to
import data your organization's Sage 50 UK data.
Note
The Sage 50 UK data connector is provided by our data partner, CData. For
information about any of the connection fields, refer to the documentation available
at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Sage Cloud Accounting is cloud-based accounting software for managing payments, invoices,
payroll, and taxes. You can use the Sage Cloud Accounting data connector to import data your
organization's Sage Cloud Accounting data.
Note
The Sage Cloud Accounting data connector is provided by our data partner, CData.
For information about any of the connection fields, refer to the documentation
available at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Sage Intacct is cloud-based financial management and accounting software for small to mid-sized
businesses. You can use the Sage Intacct data connector to import data your organization's Sage
Intacct data.
Note
The Sage Intacct data connector is provided by our data partner, CData. For
information about any of the connection fields, refer to the documentation available
at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to Salesforce
Salesforce.com is a cloud Customer Relationship Management (CRM) platform. You can use the
Salesforce data connector to import your organization's Salesforce data.
Note
Analytics provides Salesforce as an optional connector and if it is not available in
your Data Access window, it is likely that the connector was not selected during
installation. For more information, see "Install optional Analytics data connectors
and Python engine" on page 2689.
Note
Some connections require a security token, while others do not. You only
require a security token if your connection fails without it.
For help gathering the connection prerequisites, contact the Salesforce administrator in your
organization. If your administrator cannot help you, you or your administrator should contact
Salesforce Support.
Note
If you are an existing Salesforce customer and want to upgrade your account to one
of these editions, contact your Salesforce account representative.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for Salesforce is saved to the Existing Connections tab. In the future, you can
reconnect to Salesforce from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from Salesforce, see "Working with the Data
Access window" on page 370.
Connection settings
Basic settings
Setting Description Example
Advanced settings
Setting Description Example
Sandbox URL
Connecting to SAP
SAP is an enterprise-wide business suite for managing a broad range of business processes. Use
the ACL Connector for SAP to import your organization's SAP data.
Note
Setting up the SAP connector, and if applicable SNC (Secure Network Communic-
ations) and SSO (Single Sign-on), requires personnel with the appropriate level of
technical expertise. For more information, see "Setting up the ACL Connector for
SAP" on page 671.
The SAP connector requires an additional subscription entitlement beyond the basic
Analytics subscription. If you do not have the required subscription entitlement, you
are not able to connect to SAP.
Contact your account representative for information about an SAP connector
subscription.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
Connection settings
Note
Consult your organization's SAP Basis Administrator for the required settings for the
SAP connector.
Basic settings
Setting Description Example
Preloaded SAP Systems The name of an SAP system with PHR - Production Human Resources
connection settings specified in one of
optional
the following SAP GUI configuration
files:
o SAPUILandscape.xml
o saplogon.ini
If you select a preloaded SAP system,
values from the SAP GUI configuration
file automatically populate a number of
the other SAP connection settings for
you.
Default location of the
Note
Enclose the SNC name in
quotation marks if it
contains any spaces.
Mechanism = Individual
Note
Enclose the network path in
quotation marks if it
contains any spaces.
Advanced settings
Setting Description Example
performance of the
SAP connector by increasing
the number of records per
request, which reduces the
number of times the
connector must reconnect.
used)
Any table name in the SAP system that matches the search string is added to the Available
Tables list. The table name or names are also added to the table name cache so that they are
more immediately available in the future.
Note
Searches in the SAP database are on the short SAP table name only (ANAT,
BNKA, and so on). Table descriptions are not searched.
Tip
You cannot selectively remove table names from the Available Tables list or
the table name cache. To clean up the list of tables, delete and recreate the
SAP connection. The list reverts to containing only the common SAP tables.
Note
Once you import SAP data into Analytics, the key field designation is lost, and key
fields are not treated any differently from non-key fields.
Note
The short SAP table name (ANAT, BNKA, and so on) is standard across all
languages.
Field 'DMBTR' in table 'BSEG' needs a join to table 'T001' with field
'WAERS' for currency decimal adjustment
4. Add the second table and create the join according to the instructions in the message.
Important
Select a Left join when you create the join.
For detailed information about joining tables in the Staging Area, see "Joining tables in the
Data Access window" on page 381.
5. In the Import Preview panel, click Refresh again.
If the SAP table contains an additional field with currency data the requires conversion,
another message appears with join instructions.
6. Create the new join according to the instructions.
7. Repeat this process until clicking Refresh no longer generates messages and instead
displays the joined data.
8. Perform any other necessary configuration of the SAP import and then save the data to
Analytics.
For more information, see "Working with the Data Access window" on page 370.
Note
Setting up the SAP connector, and if applicable SNC (Secure Network Communic-
ations) and SSO (Single Sign-on), requires personnel with the appropriate level of
technical expertise.
The SAP connector requires an additional subscription entitlement beyond the basic
Analytics subscription. If you do not have the required subscription entitlement, you
are not able to connect to SAP.
Contact your account representative for information about an SAP connector
subscription.
SAP authorizations
Note
SAP authorizations must be assigned by your SAP Security Administrator.
Users of the SAP connector require the following SAP access and authorizations in order to connect
to an SAP system and extract data:
l An SAP user ID and password that allows them to connect to the SAP system
l Specific SAP authorization objects and authorizations, including SAP table authorizations
Note
Consult your SAP security documentation for detailed information about assigning
SAP authorizations to users.
Authorization Authorization
class object Field Values Details
ACTVT 16 (authorizes
Execute)
RFC_NAME /SDF/CMO_GET_
INSTNO
CMO_GET_INSTNO
RFC_GET_
FUNCTION_
INTERFACE
RFC_GET_
NAMETAB
RFCPING
/DABEXP/RFC_
SAPCONNECTOR
Authorization Authorization
class object Field Values Details
Note
Users of the SAP connector should be assigned authorizations for those SAP
tables they need to access in order to perform their analysis.
For example, a user performing a General Ledger audit needs authorizations for
the general ledger tables.
Your company's own business processes dictate which users require table
authorizations, and what authorizations they require. Work with your SAP
Security Administrator to determine the appropriate level of access that your
users require.
Note
<NN> is the instance number of your SAP system. So, if the SAP system number is 10, then ports
3210, 3310 and 3610 need to be open.
Analytics users The SAP GUI must be installed on the same computer as Analytics.
Robots users The SAP GUI must be installed on the server that houses the on-premise Robots
Agent.
0 Unknown Connecting to
SAP, or importing
Error
number Error code Description
data, cannot be
completed. An
unknown error
occurred.
Error
number Error code Description
Error
number Error code Description
properties are
missing (internal
driver error).
Error
number Error code Description
Error
number Error code Description
46 SapDriverSqlParsingHasNoSelectStatementError A SELECT
statement must be
specified.
Error
number Error code Description
Error
number Error code Description
in the SELECT
statement does
not exist in the
SAP data.
Error
number Error code Description
Error
number Error code Description
in the SELECT
statement must
specify a table.
SAP Business ByDesign is a cloud-based enterprise resource planning (ERP) system. You can use
the SAP ByDesign data connector to import your organization's SAP ByDesign data.
Note
The SAP ByDesign data connector is provided by our data partner, CData. For
information about any of the connection fields, refer to the documentation available
at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
SAP Hybris Cloud for Customer (C4C) is a cloud-based customer relationship management (CRM)
system. You can use the SAP Hybris C4C data connector to import your organization's SAP Hybris
C4C data.
Note
The SAP Hybris C4C data connector is provided by our data partner, CData. For
information about any of the connection fields, refer to the documentation available
at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
SAP SuccessFactors is a cloud-based human resources system. You can use the SAP
SuccessFactors data connector to import your organization's SAP SuccessFactors data.
Note
The SAP SuccessFactors data connector is provided by our data partner, CData.
For information about any of the connection fields, refer to the documentation
available at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to ServiceNow
ServiceNow is a cloud provider of IT management solutions. Use the ServiceNow data connector to
import your organization's ServiceNow data.
Note
You cannot use this connector independently of Analytics. You can configure a
DSN for the connector driver using the Windows ODBC Data Source Administrator,
however you must test the DSN connection from within Analytics and not from the
connector's Windows DSN configuration dialog.
Tip
For more information about registering an application and obtaining OAuth
credentials, search "Set up OAuth" in the ServiceNow documentation.
For help gathering the connection prerequisites, contact the ServiceNow administrator in your
organization. If your administrator cannot help you, you or your administrator should contact
ServiceNow Support.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
Connection settings
Basic settings
Setting Description Example
Advanced settings
Setting Description Example
Note
If you select this option,
any filters you apply
against datetime fields
using the ON (=) operator
require that you use the
'Z' format specifier when
entering the datetime
value for the filter
condition: 2017-01-01
12:38:54Z.
Note
The connector will use the
system proxy settings by
default, without further
configuration needed; if
you want to connect to
another proxy, you will
need to set
ProxyAutoDetect to false,
in addition to ProxyServer
and ProxyPort. To
authenticate, set
ProxyAuthScheme and
set ProxyUser and
ProxyPassword, if
needed.
Proxy SSL Type The SSL type to use when connecting AUTO
to the ProxyServer proxy:
o AUTO – If the URL is an HTTPS
URL, the connector will use the
TUNNEL option. If the URL is an
HTTP URL, the connector will use
the NEVER option (default)
o ALWAYS – the connection is
Note
Before connecting to a data source and re-running the import, clear the
connector cache to flush the existing set of table names.
In the Existing Connections tab in the Data Access window, beside the
connector name, select > Clear cache.
l Update field specifications – You may also need to update field specifications in the script
body to align with table schema changes in the data source or ODBC driver. Possible
changes include field names, field data types, and field and record lengths.
l Check the results of any filtering – You should also check the results of any filtering that you
apply as part of the data import. Confirm that the import filtering is including and excluding
records correctly.
Analytics
version Change
14.2 ServiceNow date fields are now mapped to a date data type in the ServiceNow data connector, with a
Analytics
version Change
Connecting to SFTP
SFTP is a secure file transfer protocol that uses Secure Shell Protocol (SSH). You can use the
SFTP data connector to import your organization's SFTP data.
Note
The SFTP data connector can be used to import file types with extensions .xlsx and
csv only. Script support for this connector may also be limited.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for SFTP is saved to the Existing Connections tab. In the future, you can reconnect
to SFTP from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from SFTP, see "Working with the Data Access
window" on page 370.
Connection settings
Basic settings
Setting Description Example
Advanced settings
Setting Description Example
Connecting to SharePoint
Microsoft SharePoint is a web-based collaborative platform for sharing and managing organizational
content and applications. Use the SharePoint data connector to import your organization's
SharePoint data.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for Sharepoint is saved to the Existing Connections tab. In the future, you can
reconnect to Sharepoint from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from Sharepoint, see "Working with the Data
Access window" on page 370.
Connection settings
Basic settings
Setting Description Example
Connection Name The name you want to give this connection in Sharepoint
Analytics.
Note
If your company accesses SharePoint
through SSO tools like AD FS,
OneLogin, or OKTA, you can enter your
SSO credentials to connect
through Analytics rather than your
SharePoint credentials.
Note
If your company accesses SharePoint
through SSO tools like AD FS,
OneLogin, or OKTA, you can enter your
SSO credentials to connect
through Analytics rather than your
SharePoint credentials.
Share Point Edition The edition of SharePoint being used. It is either Sharepoint Online
Use SSO When set to true, single sign-on (SSO) will be used false
to authenticate to SharePoint Online using the
account specified via User and Password. Active
Directory Federation Services (AD FS), OneLogin,
and OKTA SSO are supported.
SSO Domain may be required if the domain
configured on the SSO domain is different than the
domain for User.
SSO is only applicable when using SharePoint
Online. SSO is not supported for On-Premise
versions of SharePoint.
Auth Scheme Together with Password and User, this field is used NTLM
to authenticate against the server. NTLM is the
default option. Use the following options to select
your authentication scheme:
o NTLM – Set this to use your Windows credentials
for authentication.
o NEGOTIATE – If Auth Scheme is set to
NEGOTIATE, the driver will negotiate an
authentication mechanism with the server. Set
Auth Scheme to NEGOTIATE if you want to use
Kerberos authentication.
o KERBEROSDELEGATION – Set this to use
delegation through the Kerberos protocol. Set the
User and Password of the account you want to
impersonate.
o NONE – Set this to use anonymous authentic-
ation; for example, to access a public site.
o FORMS – Set this if your SharePoint instance
uses a custom authentication method through a
Web form.
o DIGEST – Set this to use HTTP Digest authentic-
ation.
o BASIC – Set this to use HTTP Basic authentic-
ation.
Advanced settings
Setting Description Example
Limit Key Size In some ODBC tools, (Microsoft Access, for 255
example) the length of the primary key column
cannot be larger than a specific value. This
property makes the ODBC Driver override the
reported length of all the primary key columns.
It is especially useful when using the ODBC
Driver as a Microsoft Access Linked Data
Source.
Setting Limit Key Size to zero will make the
key length revert to the original length.
Proxy Port The port the HTTP proxy is running on that you 80
want to redirect HTTP traffic through. Specify
the HTTP proxy in Proxy Server.
Proxy SSL Type This property determines when to use SSL for Auto
the connection to an HTTP proxy specified by
ProxyServer. This value can be AUTO,
ALWAYS, NEVER, or TUNNEL.
Auto –Default setting. If the URL is an HTTPS
URL, the driver will use the TUNNEL option. If
the URL is an HTTP URL, the component will
use the NEVER option.
Proxy Exception A semicolon separated list of hosts or IPs that 127.168.189.10; 127.168.188.11
will be exempt from connecting through the
ProxyServer.
The ProxyServer will be used for all
addresses, except for addresses defined in
this property.
Connecting to ShipStation
ShipStation is an ecommerce shipping solution. You can use the ShipStation data connector to
import your organization's ShipStation data.
Note
The ShipStation data connector is provided by our data access and connectivity
partner, CData Software. Detailed information about individual connection fields is
available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to Slack
Slack is a messaging app for teams and workplaces that can be used across multiple devices and
platforms. You can use the Slack data connector to import your organization's Slack data .
Note
The Slack data connector is provided by our data partner, CData. For information
about any of the connection fields, refer to the documentation available at the CData
website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
l If your organization uses SSO, click the button to sign in with SSO.
5. Click Continue.
If you are using SSO, provide the credentials and log in.
6. Click OK in the connection successful dialog box that appears.
The connection to Slack is established successfully.
Connecting to Snowflake
Snowflake is a cloud-based data warehouse platform. You can use the Snowflake data connector to
import your organization's Snowflake data.
Note
The Snowflake data connector is provided by our data partner, CData. For
information about any of the connection fields, refer to the documentation available
at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to Splunk
Splunk is a security information and event management solution (SIEM). You can use the Splunk
data connector to import your organization's Splunk data.
Note
The Splunk data connector is provided by our data partner, CData. For information
about any of the connection fields, refer to the documentation available at the CData
website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to Square
Square is a financial and merchant services aggregator. You can use the Square data connector to
import your organization's Square data.
Note
The Square data connector is provided by our data partner, CData. For information
about any of the connection fields, refer to the documentation available at the CData
website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to Stripe
Stripe provides online payment infrastructure services for e-commerce websites and mobile applica-
tions. You can use the Stripe data connector to import your organization's Stripe data.
Note
The Stripe data connector is provided by our data partner, CData. For information
about any of the connection fields, refer to the documentation available at the CData
website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
When the connection is successful, a dialog box opens displaying a success message.
7. Click OK in the dialog box that appears.
The connection to Stripe is established successfully.
8. In the DSN Configuration dialog box, click OK.
The connection for Stripe is saved to the Existing Connections tab. In the future, you can reconnect
to Stripe from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from Stripe, see "Working with the Data Access
window" on page 370.
Connecting to SugarCRM
SugarCRM is open source Customer Relationship Management (CRM) software. You can use the
SugarCRM data connector to import your organization's SugarCRM data.
Note
The SugarCRM data connector is provided by our data partner, CData. For
information about any of the connection fields, refer to the documentation available
at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to SuiteCRM
SuiteCRM is an open source Customer Relationship Management (CRM) solution. You can use the
SuiteCRM data connector to import your organization's SuiteCRM data.
Note
The SuiteCRM data connector is provided by our data access and connectivity
partner, CData Software. Detailed information about individual connection fields is
available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to SurveyMonkey
SurveyMonkey is a cloud-based online survey tool. You can use the SurveyMonkey data connector
to import data your organization's SurveyMonkey data.
Note
The SurveyMonkey data connector is provided by our data partner, CData. For
information about any of the connection fields, refer to the documentation available
at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to Sybase
Sybase is a database management system (DBMS). You can use the Sybase data connector to
import your organization's Sybase data.
Note
The Sybase data connector is provided by our data partner, CData. For information
about any of the connection fields, refer to the documentation available at the CData
website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to Sybase IQ
Sybase IQ is a relational database server designed for data warehousing and big data
management. You can use the Sybase IQ data connector to import your organization's Sybase IQ
data.
Note
The Sybase IQ data connector is provided by our data partner, CData. For
information about any of the connection fields, refer to the documentation available
at the CData website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to Tenable.sc
Tenable.sc is a security and vulnerability management solution for network and IT infrastructure.
You can use the Tenable.sc data connector to import your organization's Tenable.sc data.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for Tenable.sc is saved to the Existing Connections tab. In the future, you can
reconnect to Tenable.sc from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from Tenable.sc, see "Working with the Data
Access window" on page 370.
Connection settings
Basic settings
Setting Description Example
Note
To use API key
authorization,
your organization
must have
Tenable.sc
5.13.x or later
vesion.
Advanced settings
Setting Description Example
Proxy SSL Type The SSL type to use when connecting AUTO
to the ProxyServer proxy. The options
available are as follows:
o AUTO - If the URL is an HTTPS
URL, the driver will use the
TUNNEL option. If the URL is an
HTTP URL, the component will
use the NEVER option.
o ALWAYS - The connection is
always SSL enabled.
o NEVER - The connection is not
SSL enabled.
o TUNNEL - The connection is
through a tunneling proxy.
This option is enabled only when you
provide the value for the Proxy
Server.
Connecting to Teradata
Teradata is a cloud data service. You can use the Teradata data connector to import your organiz-
ation's Teradata data.
Note
Analytics provides Teradata as an optional connector and if it is not available in your
Data Access window, it is likely that the connector was not selected during install-
ation. For more information, see "Install optional Analytics data connectors and
Python engine" on page 2689.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for Teradata is saved to the Existing Connections tab. In the future, you can
reconnect to Teradata from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from Teradata, see "Working with the Data
Access window" on page 370.
Connection settings
Basic settings
Setting Description Example
Advanced settings
Setting Description Example
Use Regional Settings for Decimal Specifies whether the driver uses the Enabled
Translation DLL Name The full path to the .dll file that
contains functions for translating all
data that is transferred between the
Teradata server and the driver.
Use Null for Catalog Name Specifies whether the driver sets any
Catalog Name parameters to NULL.
Use DATE Data for TIMESTAMP Specifies whether the driver sends
Parameters DATE data for parameters that are
bound as SQL_TIMESTAMP and
SQL_C_TIMESTAMP.
Use Custom Catalog Mode for 2.x If this option is enabled, provides
Applications backwards compatibility for ODBC
2.x applications that use
noncompliant search patterns.
Note
Before connecting to a data source and re-running the import, clear the
connector cache to flush the existing set of table names.
In the Existing Connections tab in the Data Access window, beside the
connector name, select > Clear cache.
l Update field specifications – You may also need to update field specifications in the script
body to align with table schema changes in the data source or ODBC driver. Possible
changes include field names, field data types, and field and record lengths.
l Check the results of any filtering – You should also check the results of any filtering that you
apply as part of the data import. Confirm that the import filtering is including and excluding
records correctly.
Connecting to Twitter
Connect to live data in Twitter and access Tweets, Followers, Messages, Searches, and more. The
connector uses Application-only authentication, therefore you must register an application with
Twitter and obtain the necessary credentials.
Note
You cannot use this connector independently of Analytics. You can configure a
DSN for the connector driver using the Windows ODBC Data Source Administrator,
however you must test the DSN connection from within Analytics and not from the
connector's Windows DSN configuration dialog.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
3. In the Data Connection Settings panel, enter the connection settings and at the bottom of the
panel, click Save and Connect.
You can accept the default Connection Name, or enter a new one.
The connection for Twitter is saved to the Existing Connections tab. In the future, you can
reconnect to Twitter from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from Twitter, see "Working with the Data Access
window" on page 370.
Connection settings
Basic settings
Setting Description Example
the authentication
process. It has a server-
dependent timeout and
can be reused between
requests.
The access token is used
in place of your
username and password.
The access token
protects your credentials
by keeping them on the
server.
Advanced settings
Setting Description Example
Execution of predicates
The connector determines which of
the clauses are supported by the data
source and then pushes them to the
source to get the smallest superset of
rows that would satisfy the query. It
then filters the rest of the rows locally.
The filter operation is streamed,
which enables the driver to filter
effectively for even very large
datasets.
Execution of Joins
The connector uses various
techniques to join in memory. The
driver trades off memory utilization
against the requirement of reading
the same table more than once.
Execution of Aggregates
The connector retrieves all rows
necessary to process the aggregation
in memory.
Note
The connector will use the
system proxy settings by
default, without further
configuration needed; if
you want to connect to
another proxy, you will
need to set
ProxyAutoDetect to false,
in addition to ProxyServer
and ProxyPort. To
authenticate, set
ProxyAuthScheme and
set ProxyUser and
ProxyPassword, if
needed.
Proxy SSL Type The SSL type to use when connecting AUTO
to the ProxyServer proxy:
o AUTO – If the URL is an HTTPS
Streaming tables
Avoid querying tables that capture continuously updated data, such as the TweetStream table.
Streaming tables are not archives of historical data, and only return live activity. These tables create
a connection that remains open and can cause you to exceed your account's API rate limit.
Note
Before connecting to a data source and re-running the import, clear the
connector cache to flush the existing set of table names.
In the Existing Connections tab in the Data Access window, beside the
connector name, select > Clear cache.
l Update field specifications – You may also need to update field specifications in the script
body to align with table schema changes in the data source or ODBC driver. Possible
changes include field names, field data types, and field and record lengths.
l Check the results of any filtering – You should also check the results of any filtering that you
apply as part of the data import. Confirm that the import filtering is including and excluding
records correctly.
Analytics
version Change
14.2 The DirectMessagesSent and the DirectMessagesReceived tables have been removed, and they are
replaced by the new DirectMessages table.
The data type of the IdLong field in the Tweets table has been changed from long to string.
Connecting to UPS
UPS is a global shipping and logistics firm that provides live tracking data from reporting tools,
databases, and custom applications. You can use the UPS data connector to import your organiz-
ation's UPS data.
Note
The UPS data connector is provided by our data partner, CData. For information
about any of the connection fields, refer to the documentation available at the CData
website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to USPS
United States Postal Service (USPS) is a shipping and mailing service that provides live tracking
data from reporting tools, databases, and custom applications. You can use the USPS data
connector to import your organization's USPS data.
Note
The USPS data connector is provided by our data partner, CData. For information
about any of the connection fields, refer to the documentation available at the CData
website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to Workday
Workday is a cloud-based enterprise management system. You can use the Workday data
connector to import your organization's Workday data.
Note
The Workday data connector is provided by our data access and connectivity
partner, CData Software. Detailed information about individual connection fields is
available in the CData documentation, linked below.
Connection properties
Beyond basic connectivity and authentication, you can configure additional properties of the
connection to the data source. For more information, see Connection Properties in the CData
documentation.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
Connecting to xBase
xBase is a complex of data and note files for storing large amounts of formatted data in a structured
form. You can use the xBase data connector to import your organization's xBase data.
Note
The xBase data connector is provided by our data partner, CData. For information
about any of the connection fields, refer to the documentation available at the CData
website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
When the connection is successful, a dialog box opens displaying a success message.
7. Click OK in the dialog box that appears.
The connection to xBase is established successfully.
8. In the DSN Configuration dialog box, click OK.
The connection for xBase is saved to the Existing Connections tab. In the future, you can reconnect
to xBase from the saved connection.
Once the connection is established, the Data Access window opens to the Staging Area and you
can begin importing data. For help importing data from xBase, see "Working with the Data Access
window" on page 370.
Connecting to ZenDesk
Zendesk is a multi-channel customer support platform. You can use the Zendesk data connector to
import your organization's Zendesk data.
Note
The Zendesk data connector is provided by our data partner, CData. For information
about any of the connection fields, refer to the documentation available at the CData
website.
Tip
You can filter the list of available connectors by entering a search string in the
Filter connections box. Connectors are listed alphabetically.
Note
When you click the Test Connection button, it validates whether the
connection and authentication details provided are correct. If you click OK
without clicking Test Connection, the connection details are saved without any
validation and may not work later if the values provided are incorrect.
You can create an Analytics table by importing data from the projects that you have permission to
work with in HighBond Projects.
You can import a variety of different types of tables from Projects that collectively contain all the text-
based information in all the active projects for a HighBond instance.
Steps
Note
You may be required to specify a password when you connect to HighBond. For
more information, see "Password requirement" on page 762.
Note
You can import only one table at a time to Analytics. You can subsequently join
tables imported from Projects if they have a common key field.
4. Select the fields you want to import, or select Select All to import the entire table, and click
OK.
The data is imported from Projects. To improve usability of the imported table, any rich-text
fields with HTML markup are positioned last.
5. In the Save Data File As dialog box, enter a name for the Analytics data file, and if necessary
modify the location where the file will be saved, and click Save.
6. Enter a name for the Analytics table you are adding to the Analytics project, or keep the
default name, and click OK.
Note
Analytics table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
number.
Tip
When you construct the join in Analytics, make id the primary key, and <table>_id
the secondary key.
Use the join type that includes all secondary records, or a many-to-many join. For
more information, see "Joining tables" on page 963.
Password requirement
Password not required
You do not need to specify a password to import from HighBond if you used online activation to
activate your copy of Analytics. The password is automatically created and sent to HighBond based
on activation information stored on your computer.
Password required
You do need to specify a password to import from HighBond in either of these situations:
l you used offline activation to activate your copy of Analytics
l you use a script to import from HighBond, and you run the script in Robots
The required password value is a HighBond access token.
l In the Script Editor, right-click and select Insert > HighBond Token.
The Manage API tokens page opens in your browser. You may be required to first sign in to
HighBond.
Tip
Access to the Manage API tokens page through Analytics is a convenience
feature. You can also sign in to HighBond and access the page through your
user profile without using Analytics.
to use and enter your HighBond account password. The unmasked token is displayed.
Tip
Use an existing token unless you have a reason for creating a new one. If the
existing token does not work, create a new one.
Using an existing token cuts down on the number of tokens you need to
manage.
l Create a new token – Click Create token > Analytics and enter your HighBond account
password.
A new Analytics token is created.
3. Click Copy to copy the token.
Tip
Do not close the dialog box containing the token until you have successfully
pasted the token.
4. Depending on which data access and password definition method you are using, do one of
the following:
Analytics user interface
Paste the copied token into a password prompt that appears when accessing HighBond
manually.
Analytics script
l PASSWORD command – Paste the copied token into a password prompt that appears
during script execution.
l SET PASSWORD command – Paste the copied token at the appropriate point in the SET
PASSWORD command syntax in a script.
5. In Launchpad, close the dialog box containing the token.
If you created a new token, a partially masked version of the token is added to the top of your
list of tokens.
For more information, see Creating and managing access tokens.
You can create an Analytics table by importing data from the collections that you have permission to
work with in HighBond Results. You can import data tables and interpretations from individual
control tests.
Note
In Results, a control test is called a "data analytic".
Another approach is to perform the import using the IMPORT GRCRESULTS command in the Analytics
command line. When you use the command, you can include the CHARMAX parameter, which allows
you to specify a maximum number of characters in each imported field. For more information, see
"IMPORT GRCRESULTS command" on page 1920.
Steps
Note
You may be required to specify a password when you connect to HighBond. For
more information, see "Password requirement" on the next page.
Note
You do not have the necessary permissions to access the data if:
l the collection containing the control test does not appear
l the message Error retrieving list of interpretations appears when you try to
access the control test
For more information, see Assigning privileges and roles in Results.
For help with permissions, contact your company’s HighBond account adminis-
trator, or Results administrator.
l audit trail
l comments
Note
You can import only one table at a time to Analytics.
Tip
You can join the results table, audit trail, and comments in Analytics using
Record ID as the key field. Use the results table as the primary table in the join.
5. If you are importing the results table, select the individual fields you want to import from the
following categories:
l Metadata – fields containing user-generated and system-generated workflow information
Make sure to select Record ID if you intend to join the results table in Analytics.
Data – fields containing data that was imported to Results, or answers to a Results question-
l
naire
l Select All – imports the entire table
6. Click OK.
The data is imported from Results.
7. In the Save Data File As dialog box, enter a name for the Analytics data file, and if necessary
modify the location where the file will be saved, and click Save.
8. Enter a name for the Analytics table you are adding to the Analytics project, or keep the
default name, and click OK.
Note
Analytics table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
number.
Password requirement
Password not required
You do not need to specify a password to import from HighBond if you used online activation to
activate your copy of Analytics. The password is automatically created and sent to HighBond based
on activation information stored on your computer.
Password required
You do need to specify a password to import from HighBond in either of these situations:
l you used offline activation to activate your copy of Analytics
l you use a script to import from HighBond, and you run the script in Robots
The required password value is a HighBond access token.
l In the Script Editor, right-click and select Insert > HighBond Token.
The Manage API tokens page opens in your browser. You may be required to first sign in to
HighBond.
Tip
Access to the Manage API tokens page through Analytics is a convenience
feature. You can also sign in to HighBond and access the page through your
user profile without using Analytics.
to use and enter your HighBond account password. The unmasked token is displayed.
Tip
Use an existing token unless you have a reason for creating a new one. If the
existing token does not work, create a new one.
Using an existing token cuts down on the number of tokens you need to
manage.
l Create a new token – Click Create token > Analytics and enter your HighBond account
password.
A new Analytics token is created.
3. Click Copy to copy the token.
Tip
Do not close the dialog box containing the token until you have successfully
pasted the token.
4. Depending on which data access and password definition method you are using, do one of
the following:
Analytics user interface
Paste the copied token into a password prompt that appears when accessing HighBond
manually.
Analytics script
l PASSWORD command – Paste the copied token into a password prompt that appears
during script execution.
l SET PASSWORD command – Paste the copied token at the appropriate point in the SET
PASSWORD command syntax in a script.
5. In Launchpad, close the dialog box containing the token.
If you created a new token, a partially masked version of the token is added to the top of your
list of tokens.
For more information, see Creating and managing access tokens.
Table layout
Tab Description
Use this tab to configure general properties for the table layout, such as the record length,
Table Layout Options the data source associated with the table layout, and to add notes about the table layout.
Edit Field- Use this tab to create, modify, or delete fields from the table layout. You can work with both
s/Expressions physical data fields and computed fields.
Use this tab to define data filters, which are rules that specify which data from the data
source to include or exclude from the record you are defining.
Data filters in a table layout are different than filters in Analytics views, and are typically only
necessary when you are unsuccessful in defining a data source using the options available
Add a New Data Filter in the Data Definition Wizard.
Note
If you rename a table layout that is referenced in an Analytics script you must also
update all references to the table in the script or the script will fail when it is run.
Show me how
1. If the table you want to rename is open, close it.
2. In the Overview tab, right-click the table layout and select Rename.
3. Type a new name for the table layout and press Enter.
Note
Table layout names are limited to 64 alphanumeric characters. The name can
include the underscore character ( _ ), but no other special characters, or any
spaces. The name cannot start with a number.
Caution
Be careful when you have more than one table layout associated with the same
Analytics data file. If you have Delete Data File with Table selected in the Options
dialog box, deleting any of the table layouts also deletes the data file, which means
the data is no longer available for the remaining table layouts.
Data files are deleted outright. They are not sent to the Windows Recycle Bin.
Show me how
1. In the Overview tab, right-click the table layout you want to copy and select Copy.
2. Right-click a project folder and select Paste.
3. If a message appears asking whether you want to copy or share field definitions, click Copy
unless you have a specific reason for clicking Share.
Note
The message appears if Don’t Share Table Layouts is deselected in the
Options dialog box. For more information, see "Share a table layout" on the
next page.
The table layout is copied and given an incrementing numeric suffix – for example, “Table2”.
You can rename the table layout if necessary.
Note
Sharing a table layout is not the same as copying a table layout and sharing a data
file.
l When you share a table layout, a single table layout is associated with two or
more data files.
l When you share a data file, two or more table layouts are associated with a
single data file.
Show me how
1. Ensure that Don’t Share Table Layouts is deselected in the Table tab in the Options dialog
box (Tools > Options > Table).
2. Do one of the following:
l Perform an Analytics operation such as extract or sort that outputs results to a new data file
Note
The copied table layout and the data file it is associated with must match – that is, the
structure of the data in the data file must match the field definitions specified by the
table layout.
Data structure refers to the data elements (fields) contained in a data file, the
number and order of the fields, and the data type and length of the fields. If the table
layout and the data file do not match, jumbled or missing data results.
Show me how
1. Open the project that will contain the copied table layout or table layouts.
2. In the Overview tab of the Navigator, right-click the Analytics project entry, or a project folder,
and select Copy from another Project > Table.
The Analytics project is the top-level folder in the treeview.
3. In the Locate Project File dialog box, locate and select the Analytics project that you want to
copy the table layout or layouts from and click Open.
4. In the Import dialog box, complete any of the following tasks to add one or more table layouts
to the To project_name list:
l Double-click a table layout.
l Ctrl+click multiple table layouts and then click the right-arrow button.
You can remove table layouts from the To project_name list by double-clicking an individual
table layout, by using Ctrl+click to select multiple table layouts and then clicking the left-arrow
button, or by clicking Clear All.
5. Click OK to copy the table layout or layouts into the destination project.
If a table layout with the same name already exists in the project, the copied table layout is
given an incrementing numeric suffix.
6. If you need to link the copied table layout to a new data source, see "Modifying data sources
for Analytics tables" on page 784.
Note
The imported table layout and the data file it is associated with must match – that is,
the structure of the data in the data file must match the field definitions specified by
the table layout.
Data structure refers to the data elements (fields) contained in a data file, the
number and order of the fields, and the data type and length of the fields. If the table
layout and the data file do not match, jumbled or missing data results.
Show me how
1. In the Overview tab of the Navigator, right-click the Analytics project entry, or a project folder,
and select Import Project Item > Table.
The Analytics project is the top-level folder in the treeview.
2. In the Project dialog box, locate and select a table layout file (.layout) and click Open.
3. Click OK in the confirmation dialog box.
The table layout is imported into the project. If a table layout with the same name already
exists in the project, the imported table layout is given an incrementing numeric suffix.
4. If you need to link the imported table layout to a new data source, see "Modifying data sources
for Analytics tables" on page 784.
Note
Limit the table layout name to 64 alphanumeric characters, not including the
.layout extension, to ensure that the name is not truncated when the table
layout is imported back into Analytics.
The name can include the underscore character ( _ ), but do not use any other
special characters, or any spaces, or start the name with a number. Special
characters, spaces, and a leading number are all replaced by the underscore
character when the table layout is imported.
Caution
Be careful when deleting table layouts. If you have Delete Data File with Table
selected in the Options dialog box, deleting a table layout also deletes the data file,
which means the data is no longer available.
The Delete confirmation dialog box warns you if the associated data file will be
deleted along with the table layout.
Data files are deleted outright. They are not sent to the Windows Recycle Bin.
Show me how
1. In the Overview tab, right-click the table layout you want to delete and select Delete.
2. Click Delete in the confirmation dialog box.
7. If you want to add a note about the table layout, click Edit Table Layout Note , enter the
note text, and click Close .
8. If data is incorrectly displayed in the data preview area, you can have Analytics attempt to
identify the properties of the data file automatically by clicking Analyze File .
9. If the data source is a delimited text file, and the data is incorrectly displayed in the data
preview area (or no data is displayed), you may need to specify the field separator and
delimiter characters manually:
Note
The table must be open in order to make any changes to views or indexes.
4. Click OK to close the dialog box and save any changes you have made.
Depending on the data source, you can update an Analytics table with the current contents of the
table’s data source without needing to redefine the table layout. You can update the Analytics table
whenever necessary, as long as there are no changes to the structure of the data in the data source.
l Microsoft Excel
l XML
l XBRL
ODBC command
Note
An Analytics table cannot be updated from a file-based data source if a password is
required to access the file. The one exception is updating from a PDF file.
Updating from a database does support the use of a password.
You must have 32-bit Microsoft Access Database Engine installed for the Refresh
from Source option to work with older Excel files (*.xls) and Microsoft Access files
(*.mdb). For more information, see "Exclude optional Microsoft Access Database
Engine" on page 2689.
If any of the new field values in the data source are longer than the specified field lengths in the
Analytics table layout, the values are truncated in the Analytics table. To acquire the full values, you
need to define the Analytics table again instead of using Refresh from Source.
How it works
Say you define an Analytics table from a source data file that contains January invoice data. The
next month, the source file containing February data is identically structured, and the same is true
for subsequent months. Instead of recreating a table layout for each month, you can continue to
reuse the same table layout.
When you get the data for February, you can either relink the January table layout with the new data
file, or you can copy the January table and then modify the link so that you retain tables for both
months.
You can select Client for a local or network location, or Server and a server profile for a
location on an Analytics server.
3. In the Select File dialog box, locate and select the new data source and click Open.
In an Analytics table layout, a field is a single unit of data, such as employee ID, that together with
other units of data form a record.
You can define two types of fields in Analytics table layouts:
l Physical fields
l Computed fields
All fields in Analytics must be assigned a data type (Character, Numeric, Datetime, or Logical) that
determines how the values in the physical or computed fields are displayed and processed.
Physical fields
A physical field corresponds to actual data physically present in a data source, such as a file or a
database. For example, a physical field named Amount could contain sales amounts, such as
$88.50, $123.00, and so on.
In a table layout, a record specifies where data is located in the data source, and a physical field
specifies the location of field data in the record.
Before you can open an Analytics table, the table layout must have at least one physical field
defined. Typically, the physical fields in a table layout are automatically defined by Analytics when
you define and import data using the Data Definition Wizard or the Data Access window. You can
also manually define physical fields, if necessary, in the Table Layout dialog box.
For more information, see "Defining physical fields" on page 788.
Computed fields
A computed field is a "virtual field", created using an Analytics expression, that allows you to
compute or calculate values that are not physically present in the data source. For example, you
could create a computed field named Total Amount that uses the expression Amount * 1.05 to
calculate total amounts including a 5% sales tax.
Although computed fields do not correspond directly to physical data, they often reference one or
more physical fields, such as the Amount field in the example above. Computed field expressions
may also reference other computed fields, or they may contain functions that do not require fields as
input parameters.
You define computed fields in the Table Layout dialog box.
For more information, see "Defining computed fields" on page 795.
In an Analytics table layout, a field that corresponds to actual physical data in a data source is called
a physical field. The process of creating a physical field is called defining.
A physical field, also called a field definition, structures raw field data by specifying metadata
information, including:
l the name of the field
l the start position of the field in the record
l the length of the field
l the data type of the field, which determines how Analytics reads and processes the data
stored in the field
Additional information may also need to be specified based on the data type, and the settings you
want to provide to override default values. For example, the formatting to apply to numeric fields, or
the column title used in views and reports, can either be left blank and a default value is assigned, or
you can specify the value to use.
reports
Alternate Column Title field display name in views and Invoice Amount (two lines)
reports
Note
For Unicode data:
l Start – typically you should specify an odd-numbered starting byte
position. Specifying an even-numbered starting position can cause
characters to display incorrectly.
l Len – specify an even number of bytes only. Specifying an odd number of
bytes can cause characters to display incorrectly.
Note
Field names are limited to 256 upper and lowercase alphanumeric characters.
The name can include the underscore character ( _ ), but no other special
characters, or any spaces. The name cannot start with a number.
Analytics has a number of reserved keywords that cannot be used as field
names. For a complete list, see "Reserved keywords" on page 1435.
2. Select or confirm the appropriate data type in the Type drop-down list.
The type you specify must match the data type in the source data, or must be appropriate for
how you are using the data. For example, a field may be numeric data in the data source but
you might want to define the field in Analytics as character data.
Under Valid Data Types, a clickable list displays the data types that match the physical data
you have specified. The most likely matches are listed first, with common types being listed
before system or application-specific types.
3. (Optional) Specify the display width for the field in characters in the Width text box.
The Width value is used as the column size when displaying the field in Analytics views and
reports.
4. (Optional) Specify the display name in the Alternate Column Title text box.
The display name is used as the column heading, instead of the field name, when displaying
the field in Analytics views and reports. If a value is not specified, the field name is used.
5. (Optional) If you want to limit the records evaluated by the computed field, enter a condition in
the If text box, or click If to create an IF statement using the Expression Builder.
Records excluded by the IF statement are not evaluated by the computed field. For example,
the IF statement Invoice_Amount >= 1000 prevents records with invoice amounts less than
$1000 from being evaluated.
For excluded records, the computed field values are blank, 0.00, or False (F), depending on
the data category of the computed field.
6. Depending on the data type you select, you may need to specify values for the following
settings:
Setting Description
Dec Specifies the number of decimal places. This option is enabled only for numeric fields.
Format Controls the display format of numeric fields in views and reports. It also specifies the input
format of datetime fields in source data.
The drop-down list is disabled when data types other than numeric or datetime are selected.
You can select the format from the drop-down list, type in the format manually, or edit a format
from the list after you have selected it.
If the Format drop-down list is blank, the default display format specified in the Options dialog
box applies to the data in this field. The format you specify here overrides the default format.
Static Alters the default behavior Analytics uses when evaluating an IF statement associated with the
field. (For more information about the optional IF statement, see "Finalize the field definition"
on the next page.)
Static deselected (default) – if the IF statement evaluates to False, the field is assigned an
empty value – blank, zero (0), or False (F), depending on the data category of the field.
Static selected – if the IF statement evaluates to False, Analytics repeats the last valid value in
the field rather than using an empty value. The last valid value is repeated in each row until the
IF statement evaluates to True and a new valid value is used.
Default Filter Filters the records in the default view based on the value of this field each time the Analytics
table is opened.
Only records that evaluate to true are displayed, and the filter is applied automatically. This
option is enabled only for the Logical data type, and only one default filter can be specified for
each table layout.
l excluded from the field – values that do not satisfy the IF statement
For example, the IF statement Invoice_Amount >= 1000 includes invoice amounts of $1000 or
greater, and excludes invoice amounts less than $1000.
Excluded values are not displayed in the field, or included in command processing.
Depending on the data category of the field, excluded values appear as blank, zero (0), or
False (F). You can undo the exclusion at any point by deleting the IF statement.
2. (Optional) Deselect Add created field to current view if you do not want the newly defined
field to be automatically added to the open table view.
If you leave the option selected, the new field is added to the table view. The field is positioned
as the last column in view, or to the left of any selected column in the view.
You can manually add a field to a view at any time. For more information, see "Add columns to
a view" on page 850.
3. (Optional) If you want to add a note to accompany the field definition, click Edit Field Note
In an Analytics table, a computed field is a field that displays the results of an expression, rather
than actual physical data. Computed fields typically perform some kind of calculation, operation, or
data conversion. The process of creating a computed field is called defining.
For more information about expressions, see "Using expressions" on page 868.
Display the result of a calculation In an inventory file, you create a computed field called Value that
multiples the Quantity field by the Unit_cost field to calculate the total
value of each inventory item.
Convert the data type of a physical In order to work with a numeric field as if it were character data, you
field create a computed field that uses the STRING( ) function to convert the
numeric values to character values.
Using conditions, substitute text You create a conditional computed field that displays the actual names of
values for numeric codes countries by mapping them to the numeric country codes in a physical
field. For example: “Canada” instead of 01, and “USA” instead of 02.
Evaluate one or more conditions You create a conditional computed field that calculates the tax on an item
and determine the value of the based on the region where it is sold. If the item is sold in one region the
field based on the result tax is calculated at 7%. If it is sold in another region the tax is calculated
at 6%.
STRING(Employee_number, 10)
0.00 Numeric
Quantity * Unit_cost
VALUE(Salary, 0)
`20180331` Datetime
CTOD(Invoice_date, "DD/MM/YYYY")
T Logical
Expression
Multiply an expression by 1 followed by the number of decimal places of precision that you want.
Make sure to position the 1 at the start of the expression. The example below increases the
precision to four decimal places:
Literal value
Add trailing zeros to the decimal portion of a literal value. The example below increases the
precision to three decimal places:
0.000
In the table view, you can position the computed field (Inventory Value check) beside the
physical, source data field (Inventory Value at Cost), and compare values.
You can also create a filter that returns any non-matching values:
Note
Field names are limited to 256 upper and lowercase alphanumeric characters.
The name can include the underscore character ( _ ), but no other special
characters, or any spaces. The name cannot start with a number.
Analytics has a number of reserved keywords that cannot be used as field
names. For a complete list, see "Reserved keywords" on page 1435.
Note
For numeric computed fields, the decimal precision of all numeric computed
values is controlled by the precision of the expression or the literal value
specified in Default Value.
For more information, see "Controlling decimal precision in numeric computed
fields" on page 796.
Data
Setting category Description
Format Numeric only Controls the display format of numeric fields in views and reports.
You can select the format from the drop-down list, type in the format
manually, or edit a format from the list after you have selected it.
If the Format drop-down list is blank, the default display format specified in
the Options dialog box applies to the data in the field. The format you specify
here overrides the default format.
Suppress Numeric only Prevents the values in the field from being totaled.
Totals
Analytics automatically totals numeric fields in reports. Some numeric fields
contain information that should not be totaled, such as unit prices or account
numbers.
Static Alters the default behavior Analytics uses when evaluating an IF statement
associated with the field. (For more information about the optional IF
statement, see "Finalize the field definition" on the next page.)
Data
Setting category Description
Control Total Numeric only Specifies that the field is a control total field.
A control total is the sum of values in a numeric field, which can be used to
check data integrity. When you extract or sort data to a new table, Analytics
includes the input and output totals of a control total field in the table history.
Input refers to the original table. Output refers to the new table. If the two
totals match, no data was lost in the extract or sort operation.
You can also compare the control totals computed by Analytics with those
supplied by a data provider to determine whether you received all the data.
If you specify control totals for more than one field, the table history reports
on only the numeric field with the leftmost starting position.
Default Filter Logical only Filters the records in the default view based on the value of the field (True or
False). Only records that evaluate to True are displayed.
The filter is applied automatically each time the Analytics table containing the
field is opened.
l not evaluated by the computed field – records that do not satisfy the IF statement
For example, the IF statement Invoice_Amount >= 1000 prevents records with invoice
amounts less than $1000 from being evaluated.
For excluded records, the computed field values are blank, zero (0), or False (F), depending
on the data category of the computed field. You can undo the exclusion at any point by
deleting the IF statement.
2. (Optional) Deselect Add created field to current view if you do not want the new computed
field to be automatically added to the open table view.
If you leave the option selected, the new field is added to the table view. The field is positioned
as the last column in view, or to the left of any selected column in the view.
You can manually add a field to a view at any time. For more information, see "Add columns to
a view" on page 850.
3. (Optional) If you want to add a note to accompany the field definition, click Edit Field Note
Note
The order in which conditions are listed is important. For more information, see
"List conditions from most restrictive to least restrictive" on page 806.
Invoice_size = "Large"
Note
The order in which conditions are listed is important. For more information, see
"List conditions from most restrictive to least restrictive" on page 806.
To ensure that records that meet more than one condition are processed in the way that you intend,
list conditions from most restrictive to least restrictive, with the most restrictive condition at the top.
Show me more
Amount >= 5000 is a less restrictive condition and it is capturing amounts that you do not want
it to capture.
Note
Field names are limited to 256 upper and lowercase alphanumeric characters.
The name can include the underscore character ( _ ), but no other special
characters, or any spaces. The name cannot start with a number.
Analytics has a number of reserved keywords that cannot be used as field
names. For a complete list, see "Reserved keywords" on page 1435.
Note
For numeric computed fields, the decimal precision of all numeric computed
values is controlled by the precision of the expression or the literal value
specified in Default Value.
For more information, see "Controlling decimal precision in numeric computed
fields" on page 796.
Literal text values must be enclosed in quotation marks (" "). Literal date values
must be enclosed in backquotes (` `).
3. If required, specify values for one or more of the settings listed below.
The data category of the expression or the literal value that you specified in the Default Value
text box dictates which settings are enabled.
Data
Setting category Description
Format Numeric only Controls the display format of numeric fields in views and reports.
You can select the format from the drop-down list, type in the format
manually, or edit a format from the list after you have selected it.
If the Format drop-down list is blank, the default display format specified in
the Options dialog box applies to the data in the field. The format you specify
here overrides the default format.
Suppress Numeric only Prevents the values in the field from being totaled.
Totals
Analytics automatically totals numeric fields in reports. Some numeric fields
contain information that should not be totaled, such as unit prices or account
numbers.
Static Alters the default behavior Analytics uses when evaluating an IF statement
associated with the field. (For more information about the optional IF
statement, see "Finalize the field definition" on page 811.)
Static deselected (default) – if the IF statement evaluates to False, the field
is assigned an empty value – blank, zero (0), or False (F), depending on the
data category of the field.
Static selected – if the IF statement evaluates to False, Analytics repeats the
last valid value in the field rather than using an empty value. The last valid
value is repeated in each row until the IF statement evaluates to True and a
new valid value is used.
Control Total Numeric only Specifies that the field is a control total field.
A control total is the sum of values in a numeric field, which can be used to
check data integrity. When you extract or sort data to a new table, Analytics
includes the input and output totals of a control total field in the table history.
Input refers to the original table. Output refers to the new table. If the two
totals match, no data was lost in the extract or sort operation.
You can also compare the control totals computed by Analytics with those
supplied by a data provider to determine whether you received all the data.
If you specify control totals for more than one field, the table history reports
on only the numeric field with the leftmost starting position.
Default Filter Logical only Filters the records in the default view based on the value of the field (True or
False). Only records that evaluate to True are displayed.
The filter is applied automatically each time the Analytics table containing the
field is opened.
Note
The values you specify, and the Default Value, must all be the same data type.
4. (Optional) Select a condition and click Move Condition Up or Move Condition Down
to change the order in which it is evaluated.
Note
The order in which conditions are listed is important. For more information, see
"List conditions from most restrictive to least restrictive" on page 806.
l not evaluated by the computed field – records that do not satisfy the IF statement
For example, the IF statement Invoice_Amount >= 1000 prevents records with invoice
amounts less than $1000 from being evaluated.
For excluded records, the computed field values are blank, zero (0), or False (F), depending
on the data category of the computed field. You can undo the exclusion at any point by
deleting the IF statement.
2. (Optional) Deselect Add created field to current view if you do not want the new computed
field to be automatically added to the open table view.
If you leave the option selected, the new field is added to the table view. The field is positioned
as the last column in view, or to the left of any selected column in the view.
You can manually add a field to a view at any time. For more information, see "Add columns to
a view" on page 850.
3. (Optional) If you want to add a note to accompany the field definition, click Edit Field Note
ASCII text ASCII Character Windows-based applica- Used for data stored in the
tions ASCII character encoding
(American Standard Code for
Information Interchange).
Analytics uses extended
ASCII which defines 256
printable and non-printable
characters. The actual
characters available in
Analytics are specified by the
operating system's default 8-
bit code page.
The maximum length of an
ASCII field is 32767 bytes.
Basic Floating BASIC Numeric Windows-based BASIC Used for floating point data
Point applications types formatted for the
BASIC programming
language. The field length of
this data type can be either 4
or 8 bytes.
Custom Text CUSTOM Character None. This is an Analytics Used to enable user-defined
Format data type that can be character substitutions when
assigned by the user as data is read from the data
needed. source. This data type reads
data as ASCII text unless
there is a substitution
character defined in a file
named custom.dat.
For more information, see
"Custom data type" on
page 820.
Datetime DATETIME Datetime This is an Analytics data Used for date, datetime, and
type automatically or time data stored using a
manually assigned to fields variety of different formats,
that store dates, datetimes, such as YYMMDD, or
and times. YYMMDD hh:mm:ss. The
Format setting in the field
definition specifies how to
read datetime data from the
data source.
EBCDIC text EBCDIC Character IBM z/OS and OS/400 Used for Extended Binary
applications Coded Decimal Interchange
Code (EBCDIC) data, which
is an 8-bit character
encoding, on IBM server
operating systems. The
length of this data type is a
maximum of 32767 bytes.
Floating Point FLOAT Numeric Windows-based applica- Used for double precision
tions floating-point numbers. The
field length of this data type
can be either 4 or 8 bytes.
IBM Floating IBMFLOAT Numeric IBM z/OS and OS/400 Used for IBM floating-point
Point applications data, which is mainly found in
mainframe scientific applica-
tions. The field length of this
data type can be either 4 or 8
bytes long.
Logical LOGICAL Logical This is an Analytics data Used for single character
type automatically or fields that represent Boolean
manually assigned to fields data (usually true or false).
that store logical values. Analytics can interpret the
following sets of values,
where the first value
evaluates to true and the
second evaluates to false:
1/0, T/F, t/f, Y/N, y/n, non-
blank/ASCII blank (Hex 20)
Numeric NUMERIC Numeric Windows ASCII or Unicode Used for printable numeric
(Unformatted) printable numeric data, or data that corresponds to the
z/OS or OS/400 EBCDIC COBOL display type. This
data that uses the COBOL field type can include any
display data type punctuation, but most
commonly includes leading
or trailing blanks, an optional
leading or trailing sign,
embedded commas, and an
explicit decimal point.
This data type can contain a
maximum of 22 digits plus 18
characters of punctuation, for
a total length of 40 bytes, and
leading zeros are treated as
blanks.
This data type should be
used with caution because
the number of decimal points
specified for the field are
applied whether appropriate
or not. For example, if you
specify 2 decimal places and
the values $500.50 and $399
are read, the first value will
be interpreted correctly as
500.50, but the second value
Packed Numeric PACKED Numeric PL/1 fixed decimal data Used for packed numeric
type or the COBOL data from mainframe
computational-3 data type operating systems that stores
two numeric digits per byte.
The rightmost byte contains a
sign indication in the lower
half of the byte, usually
hexadecimal C for positive
and hexadecimal D for
negative. (Using
hexadecimal B to indicate
negative numbers is not
supported.) The upper half of
the rightmost byte and each
half of all other bytes contain
one hexadecimal digit that
represents the numeric digit
of that position in the number.
The length of this data type is
a maximum of 12 bytes (23
digits); however, Analytics
generates an error message
if it encounters a number
larger than 22 digits.
Consequently, when you
define a packed numeric field
in the Table Layout dialog
box, the number of decimals
that you specify in the Dec
text box must not result in
numbers longer than 22
digits. For example, if your
Note
Do not use the
PCASCII data
type when the
ASCII data type
is required. The
extended
character sets of
the two data
types are
different.
Numeric PRINT Numeric Windows ASCII or Unicode Used for printable numeric
(Formatted) printable numeric data, or data that corresponds to the
z/OS or OS/400 EBCDIC COBOL display type. This
data that uses the COBOL field type can include any
display data type punctuation, but most
commonly includes leading
or trailing blanks, an optional
leading or trailing sign,
embedded commas, and an
explicit decimal point.
This data type can contain a
maximum of 22 digits plus 18
characters of punctuation, for
a total length of 40 bytes, and
leading zeros are treated as
blanks.
Unsigned UNSIGNED Numeric IBM z/OS and OS/400 Used for unsigned packed
Packed applications data, which is a data type that
stores two decimal digits per
byte. The length of this data
type is a maximum of 11
bytes or 22 decimal digits.
The number of decimal
places cannot exceed the
maximum number of digits
possible for this field.
VAX Floating VAXFLOAT Numeric DEC VAX applications Used for type-D floating-point
Point data from Digital Equipment
Corporation’s VAX systems.
The length of this data type is
either 4 or 8 bytes.
Zoned Numeric ZONED Numeric IBM, DEC, or Honeywell Used for zoned numeric
mainframe applications fields that store one digit per
byte, and can be encoded
using ASCII, EBCDIC, or
Unicode (if you are using the
Unicode edition of Analytics).
Leading zeros are retained,
and the upper half of the
rightmost byte of the field
includes the minus sign. The
maximum length of a zoned
field is 22 bytes.
Analytics automatically
detects and adjusts for zoned
fields conforming to the IBM,
Honeywell, and DEC formats.
Custom.dat file
Custom.dat is a standard text file with two values on each line. The first value is the non-standard or
unsupported character to be replaced, and the second value is the ASCII character to replace it with.
The values can be specified using any of the following methods, or combination of methods:
l Character codes are specified using numeric values, such as 65 for the character ‘A’.
l Hexadecimal values are specified using the two-character hexadecimal value preceded by an
X, such as X41 for the character ‘A’.
l Literal character values are specified using the character preceded by a C, such as CA for the
character ‘A’.
The custom.dat file is read when you open Analytics, so you cannot edit the file while Analytics is
running. None of the values specified in the custom.dat file should exceed 255, which is the largest
value that can be stored in a byte. You can use any text editor to create or edit the custom.dat file.
Example
The data source field uses the hexadecimal values A4 for a dollar sign and A5 for a comma,
and the character code 5 for a decimal point. You create a custom.dat file to substitute the
required values. The file includes the following lines:
XA4 C$
XA5 C,
5 C.
l first line – substitutes the dollar sign ($) wherever the hexadecimal value A4 is
encountered.
l second line – substitutes a comma wherever the hexadecimal value A5 is encountered.
l third line – substitutes a decimal point wherever the character code 5 is encountered.
Note
If the renamed field is in any other views, it is removed from those views and
must be manually re-added.
Shifting fields allows you to correct field definitions that are displaced by a fixed number of bytes.
This is only required if the table layout was incorrectly defined, or if changes have been made to the
data source and you do not want to redefine your Analytics table.
If a data source has minor changes, such as an increased field length for one of the fields you have
defined, you can shift the position of the subsequent fields and keep using the updated table layout.
By shifting a field’s start position in a table layout, you automatically shift the start positions of all of
the fields defined to the right of that field. Shifting fields only affects physical data fields.
Tip
If the error message is appearing because you are exceeding the end of the record,
try removing the final field definition to make room for the field definitions being
shifted.
Note
For Unicode data, typically you should specify an odd-numbered starting byte
position. Specifying an even-numbered starting position can cause characters
to display incorrectly.
7. In the Shift fields by the following number of bytes text box, enter the number of bytes to
shift the field definition.
Enter a positive number to shift a field definition to the right. Enter a negative number to shift a
field definition to the left.
Note
For Unicode data, specify an even number of bytes only. Specifying an odd
number of bytes can cause characters to display incorrectly.
8. Click OK, and then click Yes in the confirmation dialog box.
Dumping data
The Dump feature allows you to view all the printable and non-printable characters in a record or a
file in one or more of the following encodings:
l Hex
l ASCII
l EBCDIC
l Unicode (Unicode Analytics only)
You can use the Dump feature to troubleshoot problems with viewing or processing data, or to
identify the data fields in a file.
1. If you want to dump data for a particular record in an Analytics table, open the view and select
the record.
2. Select Tools > Hex Dump.
3. If you want to dump data from a file, select File and then select the file in the Open dialog box
and click Open.
You can select an Analytics source data file (.fil), or another file type.
4. Optional. In Skip Bytes, enter a value greater than zero to skip the specified number of bytes
from the start of the file before dumping data.
5. Optional. In Columns, specify the width of the output columns in bytes.
Note
The value you specify refers to the bytes contained by the Analytics record or
table.
The encoded characters in the output may not have a one-to-one relation with
the characters in the record or table. For example, the hexadecimal encoding
for the number 1 is 31.
The default is 16 bytes for each column in a vertical display, and 64 bytes for the single
column in a horizontal display. The maximum number of bytes you can specify is 255.
6. Optional. Select Horizontal to display the character encodings in horizontal rows rather than
in side-by-side vertical blocks (the default).
7. Deselect any of the character encodings you do not want display: HEX, ASCII, EBCDIC, or
Unicode (Unicode Analytics only).
8. If you want to locate a particular value, do the following:
a. Click Find.
b. Enter the search string in the Find text box.
c. Select the character encoding to search: ASCII, EBCDIC, or HEX.
d. Select Ignore case if you want the search to be case-insensitive.
e. In the Search from panel, select Top to search from the top of the file, or Cursor to start the
search at the current cursor position. The currently selected position is displayed in the
Position field in the Dump dialog box.
f. Click Find.
If a match is found, the location of the match is highlighted in each character encoding.
An Analytics workspace is an Analytics project item that contains one or more field definitions that
have been saved for reuse with other tables. When a workspace is activated, the fields within it are
available to the current table. Workspaces let you maintain and reuse definitions of physical fields,
computed fields, or filters (which can be selected from the Filters list in the Expression Builder).
Reusing or sharing field definitions and filters ensures consistency, and reduces the repetitive work
of defining fields and filters that are used in more than one table.
Workspaces can be shared between tables that contain fields of the same type, with the same
names. For example, you might want to associate a workspace with successive tables of a given
type, such as accounts receivable tables from different periods, or from different divisions of the
same company.
If you are working with multiple-record-type files, you can store the definition for each record type in
a separate workspace. You can select the appropriate workspace to process records of a specific
type.
Create a workspace
1. If you want to add field definitions from a particular Analytics table to the workspace, you need
to open the table before you create the new workspace.
2. Select File > New > Workspace.
3. In the Add Fields to Workspace dialog box, complete any of the following tasks:
o Click Add All to add all fields to the workspace.
o Click an individual field in the Available Fields list and then click the right-arrow button to
add it to the workspace.
o Ctrl+click multiple fields in the Available Fields list and then click the right-arrow button to
add them to the workspace.
o Click Expr to open the Expression Builder and create an expression to add to the
workspace.
Note
If you are adding computed fields that reference other computed fields, you
need to add the computed fields that do not have dependencies (do not
reference computed fields) before you add the computed fields that have
dependencies.
4. Click OK.
5. In the Overview tab, right-click the workspace file and select Rename.
6. Type a new name for the workspace and press Enter.
Note
Workspace names are limited to 64 alphanumeric characters. The name can
include the underscore character ( _ ), but no other special characters, or any
spaces. The name cannot start with a number.
Edit a workspace
You can edit a workspace by adding additional field definitions, or by modifying or deleting existing
field definitions.
1. If you want to add field definitions from a particular Analytics table to the workspace, you need
to open the table before you start editing the workspace.
2. Right-click the workspace file in the Overview tab in the Navigator and select Edit.
3. Edit the entries in the Workspace Editor. You can modify or delete entries by editing the field
definition text.
4. Complete the following steps to add fields to the workspace:
l Click an individual field in the Available Fields list and then click the right-arrow button to
Activate a workspace
A workspace can be activated for use with any Analytics table, but you must ensure that any fields
referenced in the workspace field definitions are available in the Analytics table. For example, if a
workspace includes a computed field named Value that is defined using the expression sale_
price * quantity, you must ensure that any table you use the workspace with includes both the
sale_price and quantity fields.
If you activate a workspace that includes a field with the same name as one of the fields in the table,
Analytics asks if you want to replace the field in the table. Click Yes to temporarily replace the field in
the table with the workspace field until you close the table.
If you edit the table layout after you activate a workspace, or make a change that causes the
application to automatically save the table layout, Analytics permanently adds the workspace fields
to the table layout. Once the workspace fields are saved in the table layout, you can add the fields to
the view.
1. Open the table you want to use the workspace with.
2. In the Overview tab of the Navigator, right-click the workspace and select Activate.
1. Open the project that will contain the copied workspace or workspaces.
2. In the Overview tab of the Navigator, right-click the Analytics project entry, or a project folder,
and select Copy from another Project > Workspace.
The Analytics project is the top-level folder in the treeview.
3. In the Locate Project File dialog box, locate and select the Analytics project you want to copy
the workspace or workspaces from and click Open.
4. In the Import dialog box, complete any of the following tasks to add one or more workspaces
to the To project_name list:
o Double-click a workspace.
o Ctrl+click multiple workspaces and then click the right-arrow button.
o Click Add All to add all the workspaces.
You can remove workspaces from the To project_name list by double-clicking an individual
workspace, by using Ctrl+click to select multiple workspaces and then clicking the left-arrow
button, or by clicking Clear All.
5. Click OK to copy the workspace or workspaces into the destination project.
If a workspace with the same name already exists in the project, the copied workspace is
given an incrementing numeric suffix.
Import a workspace
You can import a workspace that exists as a separate .wsp file outside an Analytics project, which
allows you to reuse the physical or computed field definitions, or the filters, the workspace contains
rather than creating them from scratch. In addition to saving labor, reusing any of these items, or
sharing them with other Analytics users, ensures consistency. You can import only one workspace
at a time.
If you want to import a workspace from another Analytics project, see "Copy a workspace from
another Analytics project" on the previous page.
1. In the Overview tab of the Navigator, right-click the Analytics project entry, or a project folder,
and select Import Project Item > Workspace.
The Analytics project is the top-level folder in the treeview.
2. In the Project dialog box, locate and select a workspace file (.wsp) and click Open.
3. Click OK in the confirmation dialog box.
The workspace is imported into the project. If a workspace with the same name already exists
in the project, the imported workspace is given an incrementing numeric suffix.
Export a workspace
You can export a workspace as a separate .wsp file saved outside the Analytics project. A
workspace exported as a separate file can later be imported into any Analytics project, which allows
you to reuse the physical or computed field definitions, or the filters, the workspace contains rather
than creating them from scratch. You can export only one workspace at a time.
1. Right-click the workspace in the Overview tab of the Navigator and select Export Project
Item.
2. In the Save As dialog box, choose a location to save the workspace, rename the workspace if
required, click Save, and click OK in the confirmation dialog box.
The workspace is exported to the location you specified.
Note
Limit the workspace name to 64 alphanumeric characters, not including the
.wsp extension, to ensure that the name is not truncated when the workspace
is imported back into Analytics.
The name can include the underscore character ( _ ), but do not use any other
special characters, or any spaces, or start the name with a number. Special
characters, spaces, and a leading number are all replaced by the underscore
character when the workspace is imported.
Steps
1. Select Edit > Table Layout.
2. Click the Add a New Data Filter tab.
The contents of the data file are displayed in the data preview area in the bottom half of the
screen. By default all data displayed is initially excluded. This is indicated by the “Exclude All”
condition listed in the data filter list, which cannot be modified or deleted.
3. Select a unique character or sequence of characters in the record to define the filter condition.
Click an individual character to highlight it, or click and drag to select more than one
character, and click Include to select all of the records that match the specified condition.
For example, a data file might have the decimal point in byte position 71 of each row that
should be included in your Analytics table. You need to include this decimal point in your filter.
If the decimal point is in the same position in any rows you do not want to include, you will
need to create a rule to omit the incorrectly selected rows.
4. If you want to exclude part of a selected record, select a unique character or sequence of
characters in the record to define the filter condition and click Exclude.
5. Click Accept Entry to create the data filter with the specified conditions.
6. In the Save Filter As dialog box, enter a name for the filter and click OK.
7. Click Yes in the Keep this filter active? dialog box to start defining the fields in the record. If
you want to define the fields later click No, and select the filter from the drop-down list in the
Edit Fields/Expressions tab when you want to define the fields.
When the filter is active the areas of the data file that are excluded from the record are
highlighted in black in the Edit Fields/Expressions preview table. Select the individual fields
from the white areas of the preview table to add them to the record.
Steps
1. Select Edit > Table Layout.
2. In the Edit Fields/Expressions tab, select the data filter to activate from the drop-down list
above the fields list.
The fields list is updated to only show the fields that belong to the selected data filter. To
deactivate the data filter select “All fields” from the drop-down list.
You can also use views to format the data for Analytics reports.
Create a view
The first time you open an Analytics table a view named Default_View is automatically created that
includes all the fields defined in the table layout with their default properties.
You can modify this default view and save it with a different name to create a new view, or you can
create a new empty view and add columns and define settings.
The procedure below outlines the steps for creating a new empty view and adding columns.
Show me how
1. Open the table that you want to create the view for.
2. Right-click a view button at the bottom of the View tab and select New.
3. In the Add View dialog box, enter a name for the view and click OK.
Note
View names are limited to 64 alphanumeric characters. The name can include
the underscore character ( _ ), but no other special characters, or any spaces.
The name cannot start with a number.
4. In the Add Columns dialog box, complete any of the following tasks:
l Click Add All to add all the table layout fields to the view.
l Click an individual field in the Available Fields list and then click the right-arrow button to
select the field and click Edit to open the Expression Builder.
5. (Optional) In the Selected Fields list, select one or more fields, and use the Up arrow or
6. You can add fields from any related tables by selecting the related table in the From Table
drop-down list, and adding the fields you want to include to the Selected Fields list.
7. Click OK.
Open a view
The first time you open an Analytics table, a view named Default_View, containing all the fields
defined in the table layout, is automatically created and opened.
When you open a table that has multiple views associated with it, the view that was last active is
opened automatically.
You can also manually open any view associated with a table.
Show me how
1. In the Navigator, double-click the table with the view that you want to open.
Analytics displays the view that was last active.
2. To open a different view, click the appropriate view button at the bottom of the View tab.
The view is opened and the button for the active view is highlighted.
Rename a view
You can rename a view to make it easier to understand the purpose of the view or the information
displayed in the view.
You can use either the View tab, or the Overview tab in the Navigator, to rename views. If you need
to rename a large number of views, the Overview tab is more convenient.
Note
View names are limited to 64 alphanumeric characters. The name can include the
underscore character ( _ ), but no other special characters, or any spaces. The name
cannot start with a number.
Copy a view
You can copy a view to associate an identical view with the same Analytics table, and then
subsequently modify the copied view. You can also copy views between tables in an Analytics
project.
Tip
Copying and modifying a view may be easier than creating a new view from scratch.
You can use either the View tab, or the Overview tab in the Navigator, to copy views. If you need to
make multiple copies, the Overview tab is more convenient.
Show me how
1. Open the table that will contain the copied view.
2. In the Overview tab of the Navigator, right-click the Analytics project and select Properties.
The Analytics project is the top-level folder in the treeview.
3. Click the Views tab.
4. Select the view that you want to copy, click Apply, and click OK.
If a table is open in the destination project, the copied view is automatically associated with the open
table. If no table is open, the copied view is added to the project and can be associated with a table
at a later point.
If a copied view has the same name as an existing view in the project, the copied view is given an
incrementing numeric suffix.
Note
If you copy views between tables and the destination table does not include all the
fields specified in the view, you get an error message listing one or more fields as
“undefined”. You may still be able to use the view, but view columns associated with
undefined fields do not appear.
Show me how
l If you want to associate a copied view or views with a table at a later point, make sure all
You can remove views from the To project_name list by double-clicking an individual view, by
using Ctrl+click to select multiple views and then clicking the left-arrow button, or by clicking
Clear All.
6. Click OK to copy the view or views into the destination project.
If a table is open, the view or views are associated with the table.
Import a view
You can import a view that exists as a separate .rpt file outside an Analytics project, which allows
you to reuse the view rather than create a new view from scratch. You can import only one view at a
time.
If a table is open in the project when you import the view, the imported view is automatically
associated with the open table. If no table is open, the imported view is added to the project and can
be associated with a table at a later point.
If an imported view has the same name as an existing view in the project, the imported view is given
an incrementing numeric suffix.
Note
If the table you are associating an imported view with does not include all the fields
specified in the view, you get an error message listing one or more fields as
“undefined”. You may still be able to use the view, but view columns associated with
undefined fields do not appear.
Show me how
Export a view
You can export a view as a separate .rpt file saved outside the Analytics project. A view exported
as a separate file can later be imported into any Analytics project, which allows you to reuse the view
rather than create a new view from scratch. You can export only one view at a time.
Show me how
1. Open the table associated with the view.
2. In the Overview tab of the Navigator, right-click the table and select Properties > Views.
3. Select the view that you want to export and click Export.
4. In the Save View As dialog box, choose a location to save the view, rename the view if
required, click Save, and click OK in the confirmation dialog box.
The view is exported to the location you specified.
Note
Limit the view name to 64 alphanumeric characters, not including the .rpt
extension, to ensure that the name is not truncated when the view is imported
back into Analytics.
The name can include the underscore character ( _ ), but do not use any other
special characters, or any spaces, or start the name with a number. Special
characters, spaces, and a leading number are all replaced by the underscore
character when the view is imported.
Delete a view
You can delete individual views associated with a table whenever necessary, but there must always
be one view associated with a table. Analytics prevents you from deleting the last view associated
with a table.
Deleting a view has no effect on the table layout or an associated data file. You can use either the
View tab, or the Overview tab in the Navigator, to delete views.
selected column
l Right-click in the display area without a column selected to add one or more columns after
l Click an individual column in the Available Fields list and then click the right-arrow button
l If you want to use an expression to modify a column after you add it to the Selected Fields
list, select the column and click Edit to open the Expression Builder.
4. If the table has one or more related tables associated with it, you can add fields from any of
the related tables to the view by selecting a related table in the From Table drop-down list,
and adding the fields you want to include to the Selected Fields list.
5. Click OK.
Tip
Do not right-click in the column header row if you have selected multiple
columns, or only the column you right-click will be selected.
To automatically resize all columns in a Right-click in the data area of the view and select Resize All
view to the width of the column contents Columns.
Show me how
1. Click the header of the column you want to move and drag it to a new location.
You need to drag the column near the line separator between the two columns where you
want to move the selected column.
2. Reposition any other columns you want to move, and then select File > Save Project to save
your changes to the view.
Note
Column names specified within individual views override default column names.
3. Switch back and forth between views, or close and reopen the table, to refresh the column
name.
4. Click Yes when you are prompted to save the changes to the table.
Note
These formatting options apply to numeric values in fields that use the numeric data
type. They do not apply to numbers in fields that use the character data type.
Application n/a a. Select Tools > Options Specifies the formatting for all numeric fields and
level > Numeric. columns in Analytics that do not have field-level or
b. Select or specify a column-level formatting specified
format in Default
Numeric Format.
Field level Application a. Open a table. Specifies the formatting for an individual numeric
level b. Select Edit > Table field in a table layout, and the associated column in
Layout. all views that use the table layout, unless column-
c. Double-click a field level formatting is specified
name.
d. In the Edit Fields/Ex- For a change in field-level formatting to take effect
pressions tab, select or in a view, you must remove the associated column
specify a format in and re-add it to the view, or create a new view
Format. containing the column
Column level Application a. Open a table. Specifies the formatting for an individual numeric
level b. In the view, right-click a column in an individual view
column header and
Field level If you have more than one view of a table, you can
select Properties.
format the same column differently in the different
c. In the Modify Column
views. For example, you could display a column
dialog box, select or
with dollar signs in a view you use for printed
specify a format in
reports, and omit the dollar signs in a view you use
Format.
for analysis.
display any value less than $100, because each 9 indicates that any digit between 0 and 9 can be
displayed, with the dollar sign displayed next to the value.
-999999.99 -100234.56
-9,999,999.99 -100,234.56
(9,999,999.99) (100,234.56)
-$9,999,999.99 -$100,234.56
($9,999,999.99) ($100,234.56)
9,999,999.99- 100,234.56-
Component Description
The number 9 is used to specify each place where a single digit between 0 and 9 can be
displayed.
If you specify more placeholders for digits than required, the extra digits and anything
between them, such as commas, are not displayed. For example, if the format mask was
specified as $9,999, a value of 310 would be displayed as $310.
You should specify formatting for the maximum number of digits that may appear in the
column if you are using special formatting because any extra digits in your data are
added immediately to the left of the leftmost 9, with no additional punctuation. For
example, if your format mask is -9,999.00 a value of 1000000.00 will be incorrectly
Digit placeholder formatted as 1000,000.00 (with no thousands separator after the 1).
Component Description
Large numbers often have formatting applied between groups of digits to make them
easier to read. The most common separators are commas (100,000.00) or spaces (100
000.00).
Some regional settings use a period as the separator and a comma to indicate decimal
Thousands separator (if values. The default value used in Analytics is specified in the Thousands Separator text
any) box in the Numeric tab in the Options dialog box (Tools > Options).
A period is most often used to indicate decimal values, but a comma is used in some
regional settings.
The default value used in Analytics is specified in the Decimal Place Symbol text box in
Decimal point indicator the Numeric tab in the Options dialog box (Tools > Options).
Value indicator sign (if A dollar sign, percentage sign, and so on, can be added to the format to identify the type
any) of value being displayed.
Column
type Option Description
Any Column Allows you to modify the values displayed in the column.
Contents
Click Column Contents and use the Expression Builder to create or edit an expression.
Only the display of the values is modified, not the physical data.
The expression in Column Contents must return the correct data type for the column. For
example, an expression for a numeric column must return a numeric value.
Any fields referenced in the expression must exist in the table layout.
Alternate The text for the display name of the column in the view.
Column
Title
Column
type Option Description
Note
You are changing the column title in the current view only, which
overrides the default column title specified in the Table Layout dialog
box. For more information, see "Rename columns in a view" on page 852.
Width The display width of the column on screen or in a report. Enter the width in characters.
For numeric columns, ensure that the column is wide enough to display the values with
the largest number of digits. If a full numeric value cannot be displayed on screen, a string
of number signs (######) is displayed to indicate an error.
Note
You must also select Presort in the Report dialog box.
Note
You must also select Presort in the Report dialog box.
Column
type Option Description
A heavy, dashed separator appears to the right of the break column or columns in the
view.
Note
Do not right-click a column header if you have selected multiple columns or a
group of values, because only the column you right-click will be selected.
If the menu item is disabled it means that the selected data area or columns cannot be
graphed.
The graph is displayed in a new graph window. You can modify any of the graph properties in
the graph window, but the Drill-down command is disabled because the subset of data used
to create the graph is already highlighted in the view.
Steps
You can open multiple tables simultaneously in Analytics. Each table appears in a separate View
tab, allowing you to switch back and forth between different tables. The tables must all be contained
in the same Analytics project.
1. In the Navigator, double-click the first table to open it.
2. Click the pin icon to pin the View tab.
3. Open one or more additional tables and click the pin icon for each table before opening the
next table.
To move back and forth between tables, click the individual View tabs, or click the table name
in the Navigator, where open tables are indicated with a green dot . The name of the
active table (currently displayed table) appears in bold in the Navigator.
of preliminary work to manually harmonize the two key fields before performing the join. Or you
could open both tables, and using the banned vendor list as a reference, create filters in the transac-
tions table that isolate any occurrences of the banned vendors. If appropriate, you could build a
fuzzy search component into the filtering of the T&E transactions. The filters below provide two
examples:
l ISFUZZYDUP(vendor_name,"Diamond Casino", 5, 99) isolates exact occurrences and fuzzy
duplicates of Diamond Casino.
l MATCH(mc_code, "7298", "7995", "9222") isolates exact occurrences of merchant category
codes 7298 (Health and Beauty Spas), 7995 (Betting), and 9222 (Fines).
For more information, see "ISFUZZYDUP( ) function" on page 2342 and "MATCH( ) function" on
page 2375.
General table behavior Tables behave the same way whether only one table is open, or multiple tables are open.
Table state preserved The state of each table is preserved as you switch between tables. Table state includes
the following elements:
o filtering
o quick sorting
o record selection
o column, record, or field highlighting
o scroll bar position
o active view selection
o active index selection
Analytics operations Analytics operations are performed on the active table only.
Closing the View tab and o Closing the View tab containing a table also closes the table. You cannot perform any
closing tables operations on a closed table.
Prior to version 10.0 of Analytics, closing the View tab removed the table data from
view, however the table remained in an open state and you could continue to perform
operations on the data.
Primary and secondary o One or more open tables can be primary tables with associated secondary tables.
tables Each primary-secondary association is unique and has no effect on any other primary-
secondary association.
(Applies to the Analytics o Different primary tables can have the same secondary table.
interface only, including o A table that is open in the View tab cannot be opened as a secondary table. It must first
the command line. Does
be closed before being opened as a secondary table.
not apply to Analytics o A table open as a secondary table cannot be opened in the View tab. It must first be
scripting.) closed before being opened in the View tab.
Note
Opening a secondary table means associating it with a primary table
and making it available for processing. Secondary tables are not
opened in the View tab.
Analytics projects Multiple open tables must all be contained in the same Analytics project.
If an Analytics project has multiple tables open when you close the project, only the active
table is automatically opened when you reopen the project. The open state of the other
tables, and any primary-secondary associations, are not preserved.
Server tables Multiple-table mode is supported for local tables only. You cannot open more than one
server table at a time. If you have one or more local tables open when you open a server
table, all the local tables are automatically closed.
Analytics command log In multiple-table mode, every time you switch to a different table and perform an action or
an operation on the table that causes an entry to be written to the Analytics command log,
the log entry is preceded by an OPEN <table name> log entry. When multiple tables are
open, this preceding log entry identifies which table is the target of an operation.
Pinning a table, or switching between tables without performing any subsequent
operation, does not create a log entry.
Data Definition Wizard When you use the Data Definition Wizard to import data and define a table all open tables,
whether pinned or not, are automatically closed. Closing all open tables ensures that a
table can be overwritten, if necessary.
Running the IMPORT command from the command line does not close any open tables. If
you attempt to overwrite a table using this method, and the table is open and active, the
command fails and an error message appears.
Scripting o You cannot open multiple tables using an Analytics script. Multiple-table mode is an
interface-only feature and does not have an equivalent in ACLScript.
o Pinning a table to keep it open in the Analytics interface does not prevent the table from
being closed with the CLOSE command.
o When you run an Analytics script, all open tables, whether pinned or not, are automat-
ically closed. The active table, and an associated secondary table, if one exists, are
then automatically reopened, unless the script specifies opening a different table.
Automatically reopening the active table and any associated secondary table supports
the use of scripts that assume manually opening a table prior to running a script.
Verifying data
In addition to preparing data, you should also verify the completeness and validity of any data that
you are going to analyze. Even a small amount of invalid data can invalidate all your subsequent
analysis, and waste valuable time and resources.
Using expressions
Analytics expressions are combinations of values and operators that perform a calculation and
return a result.
Expressions are a valuable and flexible tool. You can use them to:
l perform a wide range of calculations
l create filters
l prepare data for analysis
l create computed fields
Quantity * Cost
A more complex expression could reference a number of fields and functions and use operators to
combine the parts of the expression.
For example:
converts all the names in the first_name and last_name fields to proper case (initial capital letter
followed by lowercase), and joins the first and last names with a single space between them.
Types of expressions
Analytics supports four types of expressions, which correspond with the four supported data
categories, or data types:
l character
l numeric
l datetime
l logical
For example:
l Amount + 1 is a numeric expression because it performs an operation on numbers and returns
a numeric result.
l Amount > 1 is a logical expression because it makes a comparison and returns a logical result
of True or False.
The content of any expression you create must correspond with the expression type:
Expression
type Required content Example
Contains any of the following: Extract the digits from a product code
o character fields and discard the three-character prefix:
o variables that contain character data o SUBSTR(Product_code, 4, 10)
o functions that return character values
Character o quoted character strings (character literals)
Contains any of the following: Find all records with a payment date
o an operation that produces a logical result of True or past the due date:
False (T or F) o Payment_date > Due_date
Logical o functions that return logical values
Expression
type Required content Example
If T or F are part of the expression, they must be entered Filter records in a table on three cities:
without quotation marks. o MATCH(Vendor_City, "Phoenix",
"Austin", "Los Angeles")
Note
A logical expression can reference fields,
variables, or literals of any data type.
Arithmetic and logical precedence dictates the order in which operators are evaluated.
See "Operators in Analytics expressions" below.
Operator precedence Use parentheses ( ) to modify the order in which the operators are evaluated.
Operand data type Each operator works only if its operands are of a compatible data type.
By default, when character strings of different lengths are compared, the shorter of the
two lengths is used.
If the Exact Character Comparisons option is selected in the Tables tab in the Options
dialog box, the longer of the two lengths is used.
Comparing character
strings For more information, see "Table options" on page 125.
If numbers with different decimal precision are mixed in a numeric expression, the result
retains the number of decimal places of the operand with the largest number of decimal
places. (This default behavior can be changed with the SET MATH command.)
For example:
o 4 + 5.0 = 9.0
o 6 * 2.000000 = 12.000000
o 1.1 * 1.1 = 1.2
o 1.1 * 1.10 = 1.21
For more information, see "Controlling rounding and decimal precision in numeric
Decimal precision expressions" on page 876.
The operators are listed in decreasing order of precedence. When operators of equal precedence
appear in an expression, they are evaluated from left to right – unless you use parentheses to specify
a particular order of evaluation.
* Multiply
/ Divide
Operators have equal precedence and
are evaluated from left to right
+ Add
- Subtract
Operators have equal precedence and
are evaluated from left to right
Note
Operators with two
symbols must not contain a
space. For example, type
>= not > = .
OR (or |) Logical OR
What is an expression?
An expression is a statement that combines elements such as data fields, operators, functions,
filters, and variables that Analytics evaluates and returns a value for.
Automatically verify the syntax of the expression in the Expression text box
Clicking Verify saves time by allowing you to quickly check the validity of an expression
2 Verify button without leaving the Expression Builder.
Save As text Field for entering a name for a permanently saved expression
3 box
Lists all data fields and computed fields in the selected table
Available
4 Fields list Double-click a field entry to add it to the Expression text box.
Operator but- Buttons for adding operators, or dates, datetimes, or times, to the Expression text box
tons, and Date
& Time
6 Selector
Functions Lists function categories that can be used to filter the functions displayed in the Functions
9 drop-down list list
Lists the functions available in Analytics and their required syntax. Optional parameters
are enclosed in angle brackets (< >). Double-click a function to add it to the Expression
text box. Depending on the type of function, the parameters can be constants, literals, field
names, or expressions, which may include other functions.
Tip
For information about how to use the individual functions in the Functions
10 Functions list list, click the Help button below the list.
o Selected – the function and the parameter placeholders are copied to the Expression
Paste Para- text box
meters check- o Not selected – only the function, including opening and closing parentheses, is copied
11 box to the Expression text box
Tip
For information about how to use the individual functions in the Functions
list, click the Help button below the list.
2. Click Verify to validate the expression you have built. The expression is checked to ensure
that the syntax is correct and that the expression returns the correct value type, if a particular
type is required.
3. Complete one of the following steps to create the expression:
a. If you want to save the expression permanently, enter a name in the Save As text box and
click OK. The name of the expression is copied into the text box or the location from which
you accessed the Expression Builder. If you are creating a variable you must provide a
name.
b. Click OK to create the expression without saving it permanently. The expression is copied
into the text box or the location from which you accessed the Expression Builder.
Note
Not being aware how rounding works in Analytics is one of the most common causes
of computational errors.
Fixed-point arithmetic
The rounding behavior in Analytics is associated with the fixed-point arithmetic that Analytics uses
for numeric operations (with the exception of financial functions). Analytics uses fixed-point
arithmetic for two reasons:
l It improves processing speed
l It allows user control over decimal places and rounding
Rounding in multiplication
Consider the expression 1.1 * 1 .1. The correct answer is 1.21. However, Analytics rounds the result
to one decimal place because that is the larger number of decimal places in the operands.
If one of the operands has two decimal places, Analytics rounds the decimal portion of the result to
the larger number of decimal places in the operands. In this particular example, no rounding is
required:
Rounding in division
Consider the expression 7/3. The correct answer is 2.333... However, Analytics rounds the result to
zero decimal places because neither operand has any decimal values.
7/3 = 2
If one or both operands have decimal places, Analytics rounds the decimal portion of the result to
the larger number of decimal places in the operands:
7/3.00 = 2.33
7.000/3.00 = 2.333
Example
Problem
In the following expressions, Analytics rounds the result to two decimal places, which is not
precise enough for your requirements:
Solution
To increase the precision of the result, you multiply by 1 followed by the number of decimal
places of precision that you want:
Caution
Position 1 at the beginning of an expression. If you position 1 anywhere else,
the precision adjustment may not work because the precision of the first two
operands to be evaluated has already caused rounding to occur:
Another characteristic of cumulative rounding is that the loss of decimal precision increases at each
stage of a multi-operand expression.
The larger number of decimal places in the first evaluated stage of the expression is two ( 1.1
* 1.12 ). This two-decimal-place precision persists throughout the remainder of the multi-
operand expression (indicated by the digits in red).
The Result difference column shows how the cumulative loss of precision increases at each
successive stage of evaluation.
The table below illustrates how Analytics applies rounding after the addition of 1.00000 to
specify five decimal places of precision:
The larger number of decimal places in the first evaluated stage of the expression is five (
1.00000 * 1.1 ). This five-decimal-place precision persists throughout the remainder of the
multi-operand expression (indicated by the digits in red).
The scenario
You need to calculate one day’s interest on $100,000 at 12% per annum.
One approach
You could first calculate the interest rate per day, and then multiply the daily rate by 100,000.
However, problems with rounding arise with this approach.
Analytics first divides 0.12 by 365, which based on the rules of rounding in Analytics results in
0.00. The true result is 0.00032876712..., but because the result is rounded to two decimal
places all the subsequent digits are lost.
The rounded result is then multiplied by 100000, yielding 0.00, even though the correct
answer is 32.876712...
An alternate approach
You could first calculate the total amount of interest for the year, and then divided the amount
by 365. This alternate approach avoids problems with rounding.
With the parentheses removed, the results at each stage of the calculation remain greater
than 1, avoiding any decimal rounding issues, and the answer is correct to the penny (two
decimal places).
Result of 1.275 *
Command Description 1.3
SET MATH FIRST use the number of decimal places of the first operand in a pair of 1.658
operands
SET MATH LAST use the number of decimal places of the last operand in a pair of 1.7
operands
SET MATH MIN use the minimum number of decimal places in a pair of operands 1.7
SET MATH MAX use the maximum number of decimal places in a pair of operands 1.658
Default
Result of 1.275 *
Command Description 1.3
For detailed information about SET MATH, see "SET command" on page 2102.
Identifies the day of the week, or the month of the year, for CDOW( ), CMOY( )
a date
Extracts the date or the time from a datetime value DATE( ), TIME( )
Extracts the day, month, year, hour, minutes, or seconds DAY( ), MONTH( ), YEAR( ), HOUR( ), MINUTE( ),
from a datetime value SECOND( )
Converts serial datetime values, or character or numeric STOD( ), STODT( ), STOT( ), CTOD( ), CTODT( ), CTOT
datetime values, to regular datetime values with a ()
Datetime data type
Returns the current operating system date, datetime, or TODAY( ), DATETIME( ), NOW( )
time
Times
The time value 08:30:00 could refer to an amount of time – 8 hours and 30 minutes – or a point in
time – 08:30:00 AM in the morning.
Note
The Time Display Format (Tools > Options > Date and Time) in the first example is
hh:mm:ss and in the second example is hh:mm:ss PM. Both examples involve
serial datetime calculations, which are explained in subsequent sections.
Amount of time
If you subtract one time from another time the result is an elapsed time, which is an amount of
time.
Returns 01:15:00 (1 hour, 15 minutes, 0 seconds):
STOT(`T083000` - `T071500`)
Point in time
If you add a number to a time, or subtract a number from a time, the result is a positive or
negative adjustment that creates another point in time – either later or earlier than the initial
time.
Returns 07:00:00 AM :
`T083000` - (1.00000000/24*1.5)
Dates
Amount of time
If you subtract one date from another date the result is the number of elapsed days, which is
an amount of time.
Returns 31 , the number of days between the two dates:
`20141231` - `20141130`
Point in time
If you add a number to a date, or subtract a number from a date, the result is another point in
time – either more recent or earlier than the initial date.
Returns 30 Nov 2014 , the date 31 days earlier:
`20141231` - 31
l Add or subtract numbers and datetimes – Whole numbers, mixed numbers, and fractional
numbers can be subtracted from or added to date, datetime, or time values.
l Add datetimes – Date, datetime, or time values cannot be added to one another.
If you need to add amounts of time, such as the hours worked in a week, you can use
Analytics functions to extract the hour, minutes, and seconds portions of times as numeric
values. You can then perform calculations on those numeric values. For more information,
see "Using functions to add amounts of time" on page 892.
l Compare datetimes and numbers – Date, datetime, or time values cannot be compared to
numbers.
The table below summarizes the combinations that are possible with datetime expressions and
indicates whether each combination is valid or invalid – that is, whether it can be processed by
Analytics.
Note
Even if an expression is valid, it may not always serve a useful analytical purpose.
For example, Analytics will process the expression Finish_Date > Start_Time, but
the result is always True (T) and comparing a date to a time serves no logical
purpose.
YYYYMMDD `20141231`
YYMMDD `141231`
YYMMDDthhmm `141231t2359`
YYYYMMDDThh `20141231T23`
thhmmss `t235959`
Thhmm `T2359`
Note
Do not use hh alone in the main time
format with data that has a UTC offset.
For example, avoid: hh+hhmm. Results
can be unreliable.
Computed field
name Expression Description
Elapsed STOT(End_Time - A subtraction operation that calculates the hours worked for the day.
Start_Time) The STOT( ) function converts the results from serial time values to
Computed field
name Expression Description
Hours HOUR(Elapsed) The hour portion extracted as a numeric value from the Elapsed value.
Minutes MINUTE(Elapsed) The minutes portion extracted as a numeric value from the Elapsed
value.
(For display purposes. Not required for the calculation.)
Part Hours MINUTE The minutes portion extracted as a numeric value from the Elapsed
(Elapsed)/60.000 value, and calculated as a decimal fractional portion of 60 minutes.
Hours+Part Hours Hours + Part_Hours The numeric hours and part hours added together.
As a final step, you can total the Hours+Part Hours field to calculate the total hours for the week:
`20141231` + 15
`20141231` - 15
`t120000` + `t030000`
`t120000` + 0.125
`t120000` - `t030000`
Returns 09:00:00 :
STOT(`t120000` - `t030000`)
(1.00000000/24*2.5)
You need to specify ‘1’ with the multiple zeros in the decimal places to ensure Analytics
does not round the result.
You can change the number you multiple by to get an appropriate number of hours:
(1.00000000/24*1) , (1.00000000/24*8) , (1.00000000/24*10.25) , and so on.
2. In the same computed field, add or subtract the calculated serial time to or from the
source time or datetime value.
Returns values in the field + 2-1/2 hours:
3. If you want to add or subtract both days and time to or from a datetime value, include
an appropriate number of days in the calculation.
Returns values in the field + 2 days and 2-1/2 hours:
Note
In a number of the examples, the results are returned as serial datetimes – that is, a
date, datetime, or time value represented as an integer, or a decimal fractional
portion of 24 hours.
You can use the STOD( ), STODT( ), and STOT( ) functions to convert serial
datetime results into regular datetime values. For more information, see "Serial
datetimes" on page 900.
`20141231` - `20141130` 31
The elapsed days between the two dates
Expression Result
hh:mm:ss
Finish_Datetime - Start_Datetime The elapsed days and time between Finish_Datetime and
Start_Datetime values, with the time expressed as a serial
time
STRING(INT(Finish_DateTime - Start_DateTime), 5) + " " The elapsed days and time between Finish_Datetime and
+ TIME(STOT(MOD(Finish_DateTime - Start_DateTime, Start_Datetime values, expressed as days, hours,
1))) minutes, and seconds
STOT(0.51005787037037) 12:14:29
The serial time in the example above converted to a time
value, using the current Analytics time display format
Expression Result
Due_date <= `20141231` All values in the Due_date field on or before 31 Dec 2014
Payment_date > Due_date All values in the Payment_date field past their due date
CTOD(DATE(Payment_timestamp, "YYYYMMDD"), All values in the Payment_timestamp field past their due
"YYYYMMDD") > Due_date date
To compare datetime and date values, the date is first
extracted as a character value from the datetime values in
the Payment_timestamp field, and then converted back to
a date value to compare it with the due date.
To ensure date formats match, identical formats are
specified for the DATE( ) format parameter (the output
format) and the CTOD( ) format parameter (the input
format).
Expression Result
Login_time > `t100000` All values in the Login_time field later than 10:00:00
Serial datetimes
Analytics uses serial datetime values to store dates, datetimes, and times, and to perform datetime
calculations.
You may encounter a serial datetime value when working with datetime expressions. For example,
subtraction operations that involve time values return results in the form of serial times.
0.7500000 18:00:00
Tip
Another way of thinking of a serial time value is that it represents a percentage of a
24-hour day.
01:00:00 0.04166666666667
(1 hour, 1/24th of a 24-hour day)
08:00:00 0.3333333
(one third of a 24-hour day)
12:00:00 0.5000000
(half of a 24-hour day)
17:54:30 0.74618055555556
(17 hours, 54 minutes, 30 seconds)
18:00:00 0.7500000
(three quarters of a 24-hour day)
Expression Results
STOT(0.7500000) 18:00:00
MONTH(`20141231T235959`) n/a 12
MONTH(`20141231T235959-0500`) MONTH(`20150101T045959`) 1
Operation Description
Verify Tests the validity of values in character, numeric, and datetime fields
Verifying data
Verifying data checks for data validity errors in the active table. Verification ensures that data in a
table conforms to the table layout and is consistent with the specified data types.
Steps
You can verify that data conforms to the table layout, including the specified data types, and output
any validity errors.
Show me how
1. Select Data > Verify.
2. On the Main tab, do one of the following:
o Select the field(s) to verify from the Verify Fields list.
Note
The If condition is evaluated against only the records remaining in a table after
any scope options have been applied (First, Next, While).
Tip
You can click any linked result value in the display area to drill down to the
associated record or records in the source table.
If the output table contains a large number of records, it is faster and more useful to save
the results to a file than to display the results on the screen.
l Print – Select this option to send the results to the default printer.
l Graph – Select this option to create a graph of the results and display it in the Analytics
display area.
l File – Select this option to save or append the results to a text file. The file is saved outside
Analytics.
Note
Output options that do not apply to a particular analytical operation are
disabled.
6. If you selected File as the output type, specify the following information in the As panel:
l File Type – ASCII Text File or Unicode Text file (depending on which edition of Analytics
you are using) is the only option. Saves the results to a new text file, or appends the results
to an existing text file.
l Name – Enter a file name in the Name text box. Or click Name and enter the file name, or
select an existing file in the Save or Save File As dialog box to overwrite or append to the
file. If Analytics prefills a file name, you can accept the prefilled name, or change it.
You can also specify an absolute or relative file path, or navigate to a different folder, to
save or append the file in a location other than the project location. For example:
C:\Results\Output.txt or Results\Output.txt.
l Local – Disabled and selected. Saving the file locally is the only option.
7. Click the More tab.
8. Select the appropriate option in the Scope panel:
l All
l First
l Next
l While
Show me more
All This option is selected by default. Leave it selected to specify that all records in the view are
processed.
First Select this option and enter a number in the text box to start processing at the first record in the
view and include only the specified number of records.
Next Select this option and enter a number in the text box to start processing at the currently selected
record in the view and include only the specified number of records. The actual record number in
While Select this option to use a WHILE statement to limit the processing of records in the view based on
a particular criterion or set of criteria. You can enter a condition in the While text box, or click While
to create a WHILE statement using the Expression Builder.
A WHILE statement allows records in the view to be processed only while the specified condition
evaluates to true. As soon as the condition evaluates to false, the processing terminates, and no
further records are considered. You can use the While option in conjunction with the All, First, or
Next options. Record processing stops as soon as one limit is reached.
Note
The number of records specified in the First or Next options references either the physical or
the indexed order of records in a table, and disregards any filtering or quick sorting applied to
the view. However, results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
9. In the Error Limit text box, specify the maximum number of invalid records to list, or keep the
default of 10.
If the limit is reached, Analytics stops processing and outputs the invalid records found to that
point.
Note
You can change the default error limit by selecting Tools > Options,
Command tab and updating the Error Limit value.
10. If you selected File as the output type, and want to append the output results to the end of an
existing text file, select Append To Existing File.
11. Click OK.
12. If the overwrite prompt appears, select the appropriate option.
Counting records
You can count all records in a table, or only those that meet a specified condition. The results are
displayed in the Analytics display area.
If no condition is specified, the total number of records in the table is displayed in the status bar. If a
global filter has been applied to a view, the number of records remaining in the table after the filter
has been applied is displayed in the status bar.
Steps
1. Select Analyze > Count.
2. On the Main tab, you can optionally do one of the following:
o Enter a condition in the If text box.
o Click If to create an IF statement using the Expression Builder.
The IF statement considers all records in the view and filters out those that do not meet the
specified condition.
3. Click the More tab.
4. Select the appropriate option in the Scope panel:
l All
l First
l Next
l While
Show me more
All This option is selected by default. Leave it selected to specify that all records in the view are
processed.
First Select this option and enter a number in the text box to start processing at the first record in the
view and include only the specified number of records.
Next Select this option and enter a number in the text box to start processing at the currently selected
record in the view and include only the specified number of records. The actual record number in
the leftmost column must be selected, not data in the row.
While Select this option to use a WHILE statement to limit the processing of records in the view based on
a particular criterion or set of criteria. You can enter a condition in the While text box, or click While
to create a WHILE statement using the Expression Builder.
A WHILE statement allows records in the view to be processed only while the specified condition
evaluates to true. As soon as the condition evaluates to false, the processing terminates, and no
further records are considered. You can use the While option in conjunction with the All, First, or
Next options. Record processing stops as soon as one limit is reached.
Note
The number of records specified in the First or Next options references either the physical or t-
he indexed order of records in a table, and disregards any filtering or quick sorting applied to t-
he view. However, results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
5. Click OK.
Totaling fields
You can total numeric fields or expressions in the active table. Totaling finds the arithmetic sum of
one or more numeric fields, and is typically used to prove the completeness and accuracy of the
data, and to produce control totals. The results are displayed in the Analytics display area.
Tip
Some character fields, such as invoice numbers, may contain numbers. To total this
type of data, create a computed field that uses the VALUE( ) function to convert
character data to numeric data, and then total the computed field.
Steps
1. Select Analyze > Total.
2. On the Main tab, do one of the following:
o Select the field(s) to total from the Total Fields list.
o Click Total Fields to select the field(s), or to create an expression.
The order in which you select the fields is the order in which the columns appear in the
results.
3. If there are records in the current view that you want to exclude from processing, enter a
condition in the If text box, or click If to create an IF statement using the Expression Builder.
Note
The If condition is evaluated against only the records remaining in a table after
any scope options have been applied (First, Next, While).
Show me more
All This option is selected by default. Leave it selected to specify that all records in the view are
processed.
First Select this option and enter a number in the text box to start processing at the first record in the
view and include only the specified number of records.
Next Select this option and enter a number in the text box to start processing at the currently selected
record in the view and include only the specified number of records. The actual record number in
the leftmost column must be selected, not data in the row.
While Select this option to use a WHILE statement to limit the processing of records in the view based on
a particular criterion or set of criteria. You can enter a condition in the While text box, or click While
to create a WHILE statement using the Expression Builder.
A WHILE statement allows records in the view to be processed only while the specified condition
evaluates to true. As soon as the condition evaluates to false, the processing terminates, and no
further records are considered. You can use the While option in conjunction with the All, First, or
Next options. Record processing stops as soon as one limit is reached.
Note
The number of records specified in the First or Next options references either the physical or t-
he indexed order of records in a table, and disregards any filtering or quick sorting applied to t-
he view. However, results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
6. Click OK.
Combining data
Analytics allows you to analyze data in only one table at a time. For this reason, you may have to
combine data from two or more tables into one table before performing your analysis.
Analytics provides the following methods for combining data:
o Append o Join
o Extract/Append o Relate
o Merge
The nature of the source data, or your analysis goal, dictates which method of combining data you
should use. The five methods are described briefly below.
Append
When you append tables, you combine records from two or more tables into a new table that
contains all the records from the appended tables. You have the option of including all the fields
from the appended tables, or only the common fields.
Example
Scenario
You want to perform analysis on an entire year's worth of data but the data is spread among
twelve monthly transaction tables.
Approach
You append the data from the twelve monthly tables into a single annual table containing all
the data, and then perform the analysis.
Detailed information
For detailed information, see "Appending tables" on page 931.
Extract/Append
When you extract and append data, you extract records from one table and append them to the end
of another table. Extracting is the same as copying, and appending is the same as adding.
You also have the option of extracting a subset of the fields in a record rather than the entire record.
The table you append to (the target table) is increased in size. A new table is not created.
Example
Scenario
You want to perform analysis on an entire set of employee records but records for new
employees are not yet contained in the Employee master table.
Approach
You extract the records for new employees and append them to the end of the Employee
master table, and then perform the analysis.
Detailed information
For detailed information, see "Extracting and appending data" on page 943.
Merge
When you merge tables, you interfile records from two sorted tables into a new, third table, which is
also sorted. Interfiling means to combine records in accordance with their existing sort order.
Example
Scenario
You want to perform analysis on an entire set of employee records but the records are split
between two divisional Employee tables.
Both tables are sorted by last name and you want to avoid the overhead of resorting the
records once they are combined.
Approach
You merge the records from the two tables into a new third table. Merging preserves the
sorting by last name.
Detailed information
For detailed information, see "Merging tables" on page 954.
Join
When you join tables, you use a common key field to incorporate records, or a selection of fields,
from two tables into a new, third table. A common key field is an identifying field, such as Employee
ID, that appears in both of the tables being joined.
Example
Scenario
You want to identify any vendors who are also employees as one way of analyzing data for
possible improper payments.
Approach
You join the Vendor master table with the Employee table, using the common key field of
Address.
The joined output table contains any vendors and employees with the same address.
Detailed information
For detailed information, see "Joining tables" on page 963.
Relate
When you relate tables, you virtually join up to 18 tables. You use a common key field to relate each
table pair.
Relating, or virtually joining, means to create a temporary programmatic association between tables
that allows you to access the data in the tables as if it existed in a single physical table. However, no
physical table is created, and you can unrelate the source tables at any point.
A common key field is an identifying field, such as Employee ID, that appears in each table pair
being related. Typically, you use a different common key field for each table pair.
Example
Scenario
You want to create a sales report that contains details about the customers, and the products
sold, for the month of March, but the data is spread across three tables.
Approach
You relate the Customer master table with the Orders table, and the Orders table with the
Product master table, to create a temporary association of tables that contains all the
information you need for the report:
l customer name and location – from the Customer master table
l order details – from the Orders table
l product details – from the Product master table
Detailed information
For detailed information, see "Relating tables" on page 1001.
Use... If...
o You want to combine multiple tables using the least amount of labor.
Append o The records in the source tables are similar or exactly identical in structure.
Extract/Append o The records or fields in the two source tables are exactly identical in structure.
o The records in the two source tables are exactly identical in structure.
o Both source tables are sorted, using an identical sort order.
Tip
Merging can be tricky to perform correctly. You can get the same result by
appending, or by extracting and appending, and then sorting.
If the two source tables are already sorted, merging is more efficient and can
Merge execute more quickly.
o The records in the two source tables have different record structures.
o You want to include or exclude records based on matched or unmatched values in a
common key field.
Join o You are doing investigative analysis that requires a physical, joined table.
o You want to relate, or virtually join, up to 18 tables with different record structures.
o You want to include or exclude records based on matched or unmatched values in common
key fields.
o You do not need to output the combined data to a new table.
o You are doing informational work, like reporting, that requires only a temporary association
Relate between tables.
Use... If...
Tip
If required, after relating tables you can perform a separate operation and
extract any combination of fields from the related tables to a new physical
table.
Data structure
When you combine data, the method you choose is often dependent on how the source data is
structured. Data structure, or record structure, refers to the data elements contained in a record,
their data type, the length of fields, and the number and order of columns.
For detailed information about data structure, see "Data structure and data format requirements" on
page 921.
Example
1. You first compile an annual transaction table by combining monthly transaction tables.
2. You then use a common key field such as Customer ID to join the annual transaction
table with a master table containing data such as Customer Name.
Note
The suitability of an alternative method depends on your particular data analysis
workflow and the nature of your source data. A method may be appropriate in some
cases and not others.
Join up to ten tables when you import data into Analytics using the
Data Access window.
For more information, see "Joining tables in the Data Access window"
Join tables using the Data Access window on page 381.
Combine data using a third-party applic- Use the native features of source applications such as Excel and
ation Access to combine data, then import the combined data into Analytics.
Tip
For information about using the DISPLAY command to compare the data structures
of two tables, see "Comparing data structures" on page 207.
Tip
If the data structure or the data format of fields differ, you may be able to use
Analytics functions to harmonize the fields. For more information, see "Harmonizing
fields" on page 924.
Entire records, all fields in a view, or all Datetime format must be identical
selected fields in tables being extracted
and appended must be exactly identical in
Extract/Append structure.
The common key fields in tables being Values in common key fields must be
Join
joined or related must be exactly identical identically formatted in order for Analytics
Relate in structure. to correctly match values.
must be the must be the same must be the must be the must be the
Fields (data same data data elements same data same data same data
elements) elements elements elements elements
Field name must be identical can differ can differ can differ can differ
Extract/Append
Merge Join Relate
Requirement for (entire record,
Append
tables being fields in view, or (entire (common key (common key
combined (common fields) selected fields) record) field) field)
recommended to
be identical,
depending on
data type
automatic
harmonization of
the length of
character key
fields fields
Format of field can differ can differ can differ must be must be
value identical identical
differences
(Standardized affect sort
hyphenation, order of key
street type field
abbreviation,
etc.)
Harmonizing fields
In order to successfully combine tables in Analytics, you may need to first harmonize one or more
fields in the two tables being combined.
What is harmonizing?
Harmonizing is the process of making the data structure of corresponding fields in separate tables
identical – for example, standardizing the data type of the fields.
Harmonizing can also mean making the format of the values in two corresponding fields identical –
for example, standardizing the use of hyphenation in ID numbers.
If the structure of corresponding fields, or the format of values in the fields, is not identical, jumbled
data can result, the combining operation may not execute, or joins or relations may not match values
correctly.
Analytics
function Category Purpose
CTOD( ) Data type conversion Converts character or numeric dates to date data.
(C or N to D)
CTODT( ) Converts character or numeric datetimes to datetime data.
SUBSTRING( ) Length adjustment Extracts the specified portion of a string (which can be equivalent to
the entire existing string). Can be used for shortening or
lengthening field length. If the specified length is longer than the
existing string, trailing spaces are added.
Analytics
function Category Purpose
RJUSTIFY( ) Right justifies character data, with any trailing spaces converted to
leading spaces.
PROPER( ) Converts the first character of each word to uppercase, and the rest
of the word to lowercase.
REMOVE( ) Extracts the specified characters from a string, and retains the
original string length by adding trailing spaces.
CLEAN( ) Removes invalid characters such as tabs and carriage returns, and
any specified characters, from a string, and all subsequent
characters, and replaces removed characters with spaces.
REPLACE( ) Replaces every instance of an existing string with a new string. For
example, you could replace “Rd.” with “Road”.
Note
Appending, extracting and appending, and merging are compared because these
methods combine tables with identical or similar record structures.
Joining is compared with relating because these two methods combine tables with
different record structures.
For more information, see "Data structure and data format requirements" on
page 921.
Access and analyze data Yes Not supported by a single Not supported by a single
from more than two tables extract and append merge operation.
operation. Requires Requires multiple
multiple operations. operations.
Extracting and
Requirement/Capability Appending Appending Merging
Number of key fields Not applicable Not applicable One or more key fields
can be selected from each
Appending does not use Extracting and appending
table.
key fields. does not use key fields.
Comparison of capabilities
Capability Joining Relating
Use case Good for as a preliminary step for Good for informational work because
investigative work because it outputs it creates a virtual table without any
a permanently joined new third table. requirement that it be made
permanent.
Number of key fields One or more key fields can be Limited to one key field per table pair
selected from each table.
If more than one key field is required
to establish an accurate relation
Comparison of requirements
Requirement Joining Relating
Key field lengths must be identical for Recommended (not enforced) Recommended (not enforced)
each table pair
Lengths of two character key fields
automatically harmonized by
Analytics.
Tables must be sorted or indexed Sort, Presort, or Index required for Index required for child tables
secondary table, optional for primary (created automatically when relating
table. tables), Sort or Index optional for
primary table.
Appending tables
Appending tables combines records from two or more Analytics tables into a new table. You may
need to append multiple tables into a single table before you can perform analysis.
For example, you want to perform analysis on an entire year's worth of data but the data is spread
among twelve monthly Excel worksheets. After importing the individual worksheets into Analytics,
you can then append them to create a single annual table for analysis.
Tip
If you want to directly append inconsistently named fields, standardize the physical
names of the fields in the table layouts before appending. (Assumes that the fields
belong to the same data category, or that you harmonize the data category of the
fields.) For more information, see "Define a physical field" on page 790.
When to append
Use appending when you want to combine data from multiple tables with an identical or similar
structure. For example, appending is a good choice for combining monthly or quarterly tables into an
annual table.
Tip
A single execution of the append operation can replace multiple executions of the
extract and append operation.
Example
Scenario
You want to perform analysis on an entire year's worth of data but the data is spread among
twelve monthly transaction tables.
Approach
You append the data from the twelve monthly tables into a single annual table containing all
the data, and then perform the analysis.
l Employee_number
l First_name
l Last_name
and two non-common fields, which appear in one or more tables, but not in every table:
l Middle_name
l Email
Input
The three tables being appended appear below:
Employees_
central
Employees_
east
Employees_
west
Employees_
master
Employees_
master
Automatic harmonization
In some situations Analytics automatically harmonizes fields in order to append them:
Data category of
fields Harmonization performed
Numeric o Different field lengths are harmonized. The fields are converted to the ACL data type.
o A different number of defined decimal places are harmonized. Decimal places are
standardized on the greatest number of places, with trailing zeros added to numeric values
where necessary. The fields are converted to the ACL data type.
o Different numeric data types such as Print, Float, EBCDIC, and Micro are harmonized by
Data category of
fields Harmonization performed
Datetime o Different date, datetime, or time formats in the source data are harmonized by converting
the fields to the Analytics default formats:
l YYYYMMDD
l YYYYMMDD hh:mm:ss
l hh:mm:ss
User-specified harmonization
Two options in the Append dialog box allow you to harmonize identically named fields belonging to
different data categories so that the fields can be appended without error. The options work by
standardizing identically named fields on the character data category:
l Use Character data type to harmonize common fields – converts non-character fields to the
character data category only when required for harmonization
l Convert all fields to Character data type – converts all non-character fields in all tables being
appended to the character data category whether required for harmonization or not
Example
Scenario
You want to append two tables in which the Employee_ID field is character data in one table,
and numeric data in the other.
Approach
In the Append dialog box, you select Use Character data type to harmonize common fields.
The numeric Employee_ID field is converted to character data and the two fields are
appended without an error.
Tip
If harmonizing on the character data category does not meet your needs, you may
be able to manually harmonize the fields using a different approach, or redefine one
or more fields. For more information, see "Harmonizing fields" on page 924 and
"Define a physical field" on page 790.
Tip
You can append a computed field by first extracting it to convert the field to a
physical field. (For more information, see "Extract and append data" on page 948.)
You then use the extracted table in the append operation.
Another approach is to recreate the computed field in the appended output table.
If you include all fields from all source tables when appending, the record length in the output
Record length table can be longer than the longest record in the source tables.
An error message appears if the output record length exceeds the Analytics maximum of 32
KB.
For two or more datetime fields to be appended, the following conditions must be met:
o identical physical names
o identical data category (Datetime)
o identical data subtypes (date, datetime, or time)
o identical use of time zone indicator – either used, or not used, by all fields being appended
Note
You can harmonize dissimilar datetime fields by converting them to the
character data category, and then append them. This approach allows you to
combine the data in a single table. However, depending on the nature of the
source data, you may not be able to convert the combined data back to
Datetime fields datetime data.
Specific behavior governs the appending of numeric fields that include decimal places.
The Decimal setting
The append operation uses the number of decimal places defined in the Dec setting in the field
definition in the table layout.
Note
The Dec setting may not be the same as the actual number of decimal places
in the source data. Decimal places that exceed the Dec setting are undefined,
and are rounded in calculations.
Any existing sort orders in the source tables are separately maintained in the respective record
sets in the output table.
Even if the records in all source tables are sorted, the output table is considered unsorted
because the source records are appended as groups, without consideration of any existing sort
order in other source tables.
For example, if you append monthly or quarterly tables to create an annual table, any internal
sorting of the monthly or quarterly data is retained. If required, you can sort the output table
Sorting after performing the append operation.
Common fields in source tables do not have to be in the same order to be appended.
For example, these fields are correctly appended even though they are in a different order:
Table Fields
The first table selected in the Append dialog box dictates the order of the fields in the output
table. So in the example above, the order in the output table is:
o Last_name | First_name | Middle_name
Non-common fields
Non-common fields in source tables appear in the output table in the order that they appear in
the selected group of source tables.
For example, when appending these two tables:
Table Fields
Alternate column titles in source tables appear in the output table. If more than one source
Alternate Column table has an alternate column title for the same field, the title from the first selected table takes
Title precedence.
Append tables
You can append two or more Analytics tables to create a new table that contains all the data from
the source tables, or only the common fields from the source tables.
Based on the order in which you select tables in the Append dialog box, records from the tables are
appended in vertical blocks in the new table.
Steps
1. From the Analytics main menu, select Data > Append.
2. In the Append dialog box, in the Available Tables list, double-click tables in the order that you
want to append them in the new table.
The tables are added to the Selected Tables area. A number before the table name indicates
the order of the table in the Selected Tables area, which is also the order in which the tables
are appended in the output table.
3. (Optional) Drag any of the selected tables to reorder them, and to change the order in which
the tables are appended in the output table.
Note
Drag a table by its header, and drop it on top of another table.
4. (Optional) Click Hide table fields to collapse a table field list, or Delete selected table
Note
To be considered "common", fields must have identical physical names and
belong to the same data category, or be harmonized to belong to the same
data category.
You cannot append computed fields. For more information, see "Computed
fields are not supported" on page 938.
6. (Optional) Select Add Table Name if you want the output table to include the Source Table
field.
For each record in the output table, the Source Table field identifies the table from which the
record originated.
Tip
Including the names of the source tables you are appending may provide
useful information when you analyze data in the output table.
7. (Optional) If you need to harmonize the data categories of identically named fields, select one
of the following:
l Use Character data type to harmonize common fields – converts non-character fields to
Note
Analytics table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
number.
Extracting and appending data allows you to extract records or fields from one Analytics table and
append them as a group to the end of another Analytics table. Extracting is the same as copying,
and appending is the same as adding. The two tables can be sorted or unsorted.
The table you append to (the target table) is increased in size. A new table is not created.
You can use multiple iterations of the extract and append operation to perform useful tasks such as
combining monthly or quarterly tables into an annual table.
Example
Scenario
You want to perform analysis on an entire set of employee records but records for new
employees are not yet contained in the Employee master table.
Approach
You extract the records for new employees and append them to the end of the Employee
master table, and then perform the analysis.
Tip
A single execution of the append operation can replace multiple executions of the
extract and append operation.
For more information, see "Appending tables" on page 931.
Option Description
As shown in the two tables on the left side of the figure, with fields A, B, C:
Extracting and appending
by record The number and the order of the fields must be identical in the source and target tables.
when you extract, to match the number and the order of fields in the target table.
In the example below, you position fields in the view, or select fields, in the order: D, B, E.
You omit fields A and C.
Tip
In some instances it may be easier or more practical to combine data outside
Analytics. If you have difficulty appending data in Analytics because of inconsist-
encies between fields, see "Alternative methods for combining data" on page 920.
The table below summarizes the requirements for the different extract and append options.
Field name No No No
The names of the
corresponding fields in the
source and target tables Target table field names are used in the resulting combined table.
must be the same.
You can extract records or fields from one Analytics table and append them as a group to the end of
another Analytics table. The records or fields must have an identical structure in the two tables. The
two tables can be sorted or unsorted. The resulting combined table is considered unsorted.
Steps
Note
Detailed information appears after the steps. See "Extract dialog box options" on the
next page.
1. In the Navigator, open the table from which you want to extract records or fields.
2. Select Data > Extract.
3. On the Main tab, select one of the following:
l Record – extracts entire records.
Note
The number, selection, and order of the fields in the view must exactly match
the number, selection, and order of fields in the target table’s table layout.
Tip
You can Ctrl+click to select multiple non-adjacent fields, and Shift+click to
select multiple adjacent fields.
Note
The number, selection, and order of the fields you select must exactly match
the number, selection, and order of fields in the target table’s table layout.
Main tab
Options – Extract
dialog box Description
Note
You cannot append computed and physical fields to each other.
For more information, see "Extracting and appending computed fields" on
page 952.
Record If you want to extract data from a child table in a table relation:
View o select Fields, or select View if the child table fields have previously been added to the view.
Fields You cannot extract child table data using the Record option.
Options – Extract
dialog box Description
You can also specify an absolute or relative file path, or navigate to a different folder, to append
data to a target table in a location other than the project location. For example:
C:\Results\GL_2011.fil or Results\GL_2011.fil.
Regardless of where you append data, the target table is added to the open project if it is not
already in the project.
If you are connected to a server table, specifies where to save the output table.
o Local selected – saves the output table to the same location as the Analytics project, or to a
specified path, or location you navigate to.
Local o Local deselected – saves the output table to the Prefix folder on AX Server.
Specifies whether the Analytics table containing the output results opens automatically upon
Use Output Table completion of the operation.
More tab
Options – Extract
dialog box Description
Note
The number of records specified in the First or Next options references either
the physical or the indexed order of records in a table, and disregards any
filtering or quick sorting applied to the view. However, results of analytical
operations respect any filtering.
Scope panel If a view is quick sorted, Next behaves like First.
(Optional) Forces the extract operation to execute one more time when the end of a table is
reached.
EOF (End of file pro- The EOF parameter is usually used if you are extracting records as part of a larger analytic
cessing) process and the Extract command occurs inside a group in a script. If you are extracting
Options – Extract
dialog box Description
records based on a comparison between sequential records, you may need to use EOF to
ensure the final record in a table is extracted.
Specifies that the output results are appended (added) to the end of an existing Analytics table.
o You can select Append To Existing File if you are certain the records or fields and the
target table are identical in structure.
o You can leave Append To Existing File deselected if you want Analytics to compare the
record lengths of the output results and the existing table. If the record lengths are not
identical, the data structure is not identical, and the append will not work correctly.
Note
Leaving Append To Existing File deselected is recommended if you are
uncertain whether the output results and the existing table have an identical
data structure.
Append To Existing For more information about appending and data structure, see "Appending
File output results to an existing table" on page 205.
Merging tables
Merging tables allows you to combine two sorted Analytics tables with identical record structures
into a new third table that preserves the sort order of the original tables. Merging works by interfiling
records, which means to combine records in accordance with their existing sort order.
You can use the merge operation to perform useful tasks such as combining sorted employee tables
into a unified table that preserves the sort order.
Example
Scenario
You want to perform analysis on an entire set of employee records but the records are split
between two divisional Employee tables.
Both tables are sorted by last name and you want to avoid the overhead of resorting the
records once they are combined.
Approach
You merge the records from the two tables into a new third table. Merging preserves the
sorting by last name.
Note
Only character fields, and character computed fields, are displayed in the Merge
dialog box. Fields not displayed must also have an identical data structure between
the two tables.
Tip
In some instances it may be easier or more practical to combine data outside
Analytics. If you have difficulty merging data in Analytics because of inconsistencies
between fields, see "Alternative methods for combining data" on page 920.
Data element Must be the same. For example, both key fields are last name fields.
Note
You can use the Presort Primary Table option for sorting the primary key
field during the merge operation. If the secondary key field is unsorted,
you must first sort it in a separate sort operation before performing the
merge.
The number of records in the resulting combined table is the sum of the records in the two
Size of output table tables being merged.
Tip
Data type of key You can use an Analytics function to convert a numeric or datetime field to a
fields character field. For more information, see "Harmonizing fields" on page 924.
Identical key field When key field values are identical in primary and secondary table records, primary table
values records are sorted above secondary table records.
Names of cor- Corresponding fields in the primary and secondary tables do not need identical names. In the
responding fields resulting combined table, the primary table field names take precedence.
Corresponding com- It there are corresponding computed fields, the expression in the computed field in the primary
puted fields table takes precedence over the expression in the secondary table.
When merging two tables of different sizes, using the larger table as the primary table requires
Performance tip less processing.
The primary and secondary key fields can be indexed in ascending order instead of sorted.
Indexing can provide performance benefits over sorting.
Indexing instead of Applying an index to the secondary table can only be performed from the command line or in a
sorting script.
The If, While, First, and Next parameters that limit which records are processed apply only to
Scope parameters the primary table.
In order to be merged, tables must be in the same Analytics project. Server tables must be on
the same server, and must be accessed using the same server profile. You cannot merge a
Location of tables local table with a server table.
Merge tables
Using a common key field from each table, you can merge two sorted Analytics tables with identical
record structures into a new third table that uses the same sort order as the original tables.
Note
To successfully merge tables, the data in both tables must be exactly identical in
structure. For more information, see "Merging tables" on page 954.
Steps
Note
Detailed information appears after the steps. See "Merge dialog box options" below.
1. In the Navigator, open the primary table, and right-click the secondary table and select
Open as Secondary.
The primary and secondary table icons update with the numbers 1 and 2 to indicate their
relation to each other .
2. Select Data > Merge.
3. On the Main tab:
a. Select the primary key field from the Primary Keys list.
b. Select the secondary key field from the Secondary Keys list.
4. In the To text box, specify the name of the new, merged table.
5. On the More tab:
a. (Optional) To specify that only a subset of records are processed, select one of the options
in the Scope panel.
b. Click OK.
Main tab
Options – Merge dia-
log box Description
Specifies the common key field to use to merge the two tables.
o You can select the common key field directly in the Primary Keys and Secondary Keys
lists.
o You can also click Primary Keys or Secondary Keys to open the Selected Fields dialog
box where you can select the common key field, or create an expression on the primary key.
Key field guidelines:
o Data type – Both key fields must be character fields.
o Data structure – The following elements must be exactly identical for both key fields:
l start position
l field length
o Sorting – Both key fields must be sorted in ascending order.
Primary Keys o Multiple key fields – If required, the common key can include more than one key field per
Secondary Keys table. For more information, see "Merging tables using multiple key fields" on page 956.
If you are connected to a server table, specifies where to save the merged table.
o Local selected – saves the output table to the same location as the Analytics project, or to a
specified path, or location you navigate to.
Local o Local deselected – saves the output table to the Prefix folder on AX Server.
Specifies whether the Analytics table containing the output results opens automatically upon
Use Output Table completion of the operation.
Note
Analytics table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
number.
More tab
Options – Merge dia-
log box Description
Note
The number of records specified in the First or Next options references either
the physical or the indexed order of records in a table, and disregards any
filtering or quick sorting applied to the view. However, results of analytical
operations respect any filtering.
Scope panel If a view is quick sorted, Next behaves like First.
Specifies that the output results are appended (added) to the end of an existing Analytics table.
Note
Leaving Append To Existing File deselected is recommended if you are
uncertain whether the output results and the existing table have an identical
data structure.
Append To Existing For more information about appending and data structure, see "Appending
File output results to an existing table" on page 205.
If you are expecting the Append option to appear and it does not, click No to cancel the
operation and see "Appending output results to an existing table" on page 205.
Example
l Compare employee T&E claims to employee T&E limits to identify any employees who
have exceeded their reimbursement limit.
l Compare transaction authorizations against a segregation of duties list to identify any
employees who are circumventing internal controls.
l Compare customer account balances to customer credit limits to identify any
customers who have exceeded their credit limit.
Another common use of joining or relating is to compare the contents of two files.
Example
l Compare employee records to a vendor listing to check for employees who are
doubling as vendors.
l Compare physician billing records to insurance claims to ensure that claim amounts
are accurate.
Joining tables
Joining tables allows you to combine two Analytics tables with different record structures into a new
third table. You can select any combination of fields from the two original tables to be included in the
new table.
Record structures are different if they have one or more fields (data elements) that differ. Joining is a
good choice for investigative work that requires a permanently joined set of data as a starting point
for analysis.
Example
Scenario
You want to identify any vendors who are also employees as one way of analyzing data for
possible improper payments.
Approach
You join the Vendor master table with the Employee table, using the common key field of
Address.
The joined output table contains any vendors and employees with the same address.
Note
For information about joining tables in the Data Access window as part of the data
import process, see "Joining tables in the Data Access window" on page 381.
This topic is about joining Analytics tables once they are in Analytics.
Data element Must be the same. For example, both key fields are employee number fields.
Can be any data type, but key fields must be the same data type as each other. For
example, two character fields.
The exception is character-numeric and numeric-character data type joins, which
Analytics automatically harmonizes. For more information, see "Automatic harmonization
when joining tables" on page 999.
Data type Datetime subtypes (date, datetime, and time) can only be joined to the same subtype.
l Matched records – primary and secondary records are matched if they have identical values
in the primary and secondary key fields.
Note
Depending on the join type you select, duplicate occurrences of matching
secondary key values may be left unjoined. For more information, see "Why
are some secondary table records missing from the joined output table?" on
the next page
l Unmatched records – primary and secondary records are unmatched if they do not have
identical values in the primary and secondary key fields.
Types of joins
Analytics supports six different types of joins, summarized below. For specific examples, see
"Examples of join types" on page 978.
Unmatched primary
l Use many-to-many joining – Use the Matched primary and secondary (all secondary
matches) join type.
Many-to-one join
In the example below, both occurrences of the primary key value 'C' are joined in the
output table, but only the first occurrence of the secondary key value 'C' is joined.
Tip
If the key field values are unique in one of the tables you are joining, make that
table the secondary table. For example, if you are joining a transactional table
with a master table, make the master table the secondary table.
Structuring the join in this manner ensures that all the matching records are
joined and included in the output table.
Many-to-many join
In the example below, both occurrences of the primary key value 'C' are joined in the
output table, and both occurrences of the secondary key value 'C' are also joined.
Tip
If you are uncertain whether duplicate matches exist in the secondary key,
choose the many-to-many join type. It ensures that you do not exclude any
records that should be joined.
If you intentionally want to exclude duplicate secondary key matches, then do
not choose the many-to-many join type.
Note
Analytics uses the term "many-to-many join" in a manner unique to Analytics. It is not
the same as a SQL many-to-many join.
Unmatched records If you include unmatched primary or unmatched secondary records in a join, for the missing
and missing field field values, Analytics displays a blank in character and datetime fields, a zero in numeric
values fields, and “F” in logical fields.
Duplicates or If duplicates or missing values in a secondary table key field render subsequent analysis
blanks in invalid, pre-processing the secondary table to remove the duplicates and/or blanks may be a
secondary table solution in some circumstances.
key field
Partial matching of key field values is not supported. To be matched, values must be 100%
identical.
For example:
o matched – AB-123, AB-123
o not matched – AB-123, 123
Note
Partial matching Partial matching is supported by the Analytics "Fuzzy join" on page 987.
With the exception of character key fields, Analytics does not enforce identical lengths for the
primary and secondary key fields when joining tables.
It is recommended that you always use identical lengths for numeric key fields, manually
harmonizing the lengths prior to performing the join, if necessary. Results derived from joining
using numeric key fields of different lengths are not reliable.
Identical key field Datetime key fields can be different lengths because Analytics, when performing operations
length not enforced involving dates, datetimes, or times, uses an internal Analytics datetime format.
When you join tables using character key fields, justification and case must be the same:
o Both key fields must have the same justification. Use the LTRIM( ) function to remove
leading blanks from the key fields.
Harmonizing justific- o Both key fields must be in the same case – UPPER, lower, or Proper. To harmonize the
ation and case case, use the UPPER( ), LOWER( ), or PROPER( ) function.
Count of records Depending on the type of join you perform, records in the primary and/or secondary tables may
not included in a not be included in the joined table. The command log displays the number of primary records
join not included (<n> records bypassed), but not the number of bypassed secondary records.
Conditional In many-to-one joins, the If, While, First, and Next parameters that limit which records are
expressions and processed apply only to the primary table. In many-to-many joins, If and While expressions can
scope options used also reference the secondary table.
in join operation
Identical field If the primary and secondary key fields, or any other included fields, have identical names,
Analytics adds ‘2’ to the end of the secondary field name in the layout for the output table. For
example, ‘vendor_ID’ becomes ‘vendor_ID2’ (or ‘vendor_ID3’, and so on, until Analytics finds a
name that does not conflict with any other field names in the output table).
names in tables The alternate column titles in the view for the output table continue to display the identical
being joined names unaltered.
A table is unavailable to select as the secondary table in a join if it is currently related to the
primary/parent table as a child table. To avoid this restriction, you can create a copy of the
Table unavailable primary/parent table layout, or the child table layout, and join using the copied layout, or you
as secondary table can delete the relation.
Restrictions on To be joined, tables must be in the same Analytics project. Server tables must be on the same
location of tables server, and must be accessed using the same server profile. You cannot join a local table with
being joined a server table.
Depending on the type of join performed, the number of records in the resulting combined table
Size of joined table can be greater than, equal to, or less than the sum of the records in the two tables being joined.
A UTC-based and a non-UTC datetime key field can be used to join two tables. (UTC is
Coordinated Universal Time, the time at zero degrees longitude.) When performing operations
involving datetimes or times, Analytics uses an internal Analytics datetime format, so the
following two datetimes are interpreted as identical, and constitute a match:
o UTC-based – 31/12/2014 10:30:15-05:00
o non-UTC – 31/12/2014 15:30:15
You should exercise caution if you mix UTC-based and non-UTC time data in an Analytics
operation. Although Analytics will match the two time values above, it may not make logical
Joining UTC-based sense to do so, because one value references a time zone, and the other value does not. For
and non-UTC data more information about UTC, see "Date and Time options" on page 136.
Join tables
Using a common key field from each table, you can join two Analytics tables with different record
structures into a new third table. The fields contained in the third table can be any combination of
fields from the two original tables.
Note
Carefully identify the primary and secondary tables in a join because results can
differ if you reverse the order. For more information, see "Common uses of joining or
relating" on page 962.
Steps
Note
Detailed information appears after the steps. See "Join dialog box options" on the
facing page.
1. In the Navigator, open the primary table, and right-click the secondary table and select
Open as Secondary.
The primary and secondary table icons update with the numbers 1 and 2 to indicate their
relation to each other .
2. Select Data > Join.
3. On the Main tab:
a. Select the join type.
Join types are explained below.
b. Select the primary key field from the Primary Keys list.
c. Select the secondary key field from the Secondary Keys list.
d. Select the fields to include in the joined table from the Primary Fields and Secondary
Fields lists.
Note
You must explicitly select the primary and secondary key fields if you want to
include them in the joined table.
Tip
You can Ctrl+click to select multiple non-adjacent fields, and Shift+click to
select multiple adjacent fields.
4. In the To text box, specify the name of the new, joined table.
5. (Optional) On the More tab:
a. If you want to process only a subset of records, select one of the options in the Scope
panel.
b. If you want to append (add) the output results to the end of an existing Analytics table,
select Append To Existing File.
6. Click OK.
The new, joined table is output.
Main tab
Options – Join dialog box Description
secondary o all primary records (matched and unmatched) and the first matched secondary record
Primary Keys Specifies the common key field to use to join the two tables.
Secondary Keys o You can select the common key field directly in the Primary Keys and Secondary
Keys lists.
o You can also click Primary Keys or Secondary Keys to open the Selected Fields
dialog box where you can select the common key field, or create an expression on the
primary key.
Key field guidelines:
o Data type – The key fields can be any data type, but they must be the same data type
as each other.
The one exception is that character and numeric key fields can be joined to each
other.
o Datetime subtypes – Datetime subtypes (date, datetime, and time) can only be joined
to the same subtype.
o Length
l It is recommended that numeric key fields be the same length.
l If character key fields are not the same length, they are automatically harmonized.
l Datetime key fields do not need to be the same length.
o Names and start positions – Key field names and start positions can be different, but
they must describe the same data element.
o Multiple key fields – If required, the common key can include more than one key field
per table. For more information, see "Using multiple key fields" on page 1015.
primary fields.
o The order in which you select primary and secondary fields dictates the field order in
the resulting joined table.
As a group, the primary fields appear before the secondary fields in the joined table.
Presort Primary Table Sorts the primary or secondary tables by their key field, or fields.
Presort Secondary Table o If one or both key fields are already appropriately sorted or indexed, you can deselect
Presort.
o Presorting increases the length of time it takes to join tables, so you should use this
feature only if you need to.
o The secondary key field must be sorted or indexed in ascending order.
Local If you are connected to a server table, specifies where to save the joined table.
o Local selected – saves the output table to the same location as the Analytics project,
or to a specified path, or location you navigate to.
o Local deselected – saves the output table to the Prefix folder on AX Server.
Use Output Table Specifies whether the Analytics table containing the output results opens automatically
upon completion of the operation.
Note
To access the secondary table fields in the Expression Builder, select
the secondary table in the From Table drop-down list.
The If condition is evaluated against only the records remaining in a
table after any scope options have been applied (First, Next, While).
Note
Analytics table names are limited to 64 alphanumeric characters, not
including the .FIL extension. The name can include the underscore
character ( _ ), but no other special characters, or any spaces. The name
cannot start with a number.
More tab
Options – Join dialog box Description
Scope panel Specifies which records in the primary table are processed:
o All – (default) all records in the primary table are processed.
o First – select this option and enter a number in the text box to start processing at the
first record in the primary table and include only the specified number of records.
o Next – select this option and enter a number in the text box to start processing at the
currently selected record in the primary table view and include only the specified
number of records.
The actual record number in the leftmost column must be selected, not data in the
row.
o While – select this option to use a WHILE statement to limit the processing of records
in the primary table based on criteria.
l You can enter a condition in the While text box, or click While to create a WHILE
statement using the Expression Builder.
l A WHILE statement allows records to be processed only while the specified
condition evaluates to true.
l You can use the While option in conjunction with the All, First, or Next options.
Record processing stops as soon as one limit is reached.
Note
The number of records specified in the First or Next options references
either the physical or the indexed order of records in a table, and
disregards any filtering or quick sorting applied to the view. However,
results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
Append To Existing File Specifies that the output results are appended (added) to the end of an existing Analytics
table.
Note
Leaving Append To Existing File deselected is recommended if you are
uncertain whether the output results and the existing table have an
identical data structure.
For more information about appending and data structure, see
"Appending output results to an existing table" on page 205.
Sample data
The first five examples use the sample data shown below.
Primary table
Secondary table
(primary)
Employee Records Maintained by the human resources department. Employee records consist of a complete list of
table valid employees and the amount that they are paid each period. One employee, 002, does not
appear in the table.
(secondary)
In the examples that follow, the Payroll Ledger table is joined with the Employee Records table
using the common key field of Employee number.
Join All five examples are many-to-one joins.
Example
Test – You want to verify that employees were paid correctly.
Approach – You use a join type that creates one output record for every record in the Payroll
Ledger table (P) that has a match in the Employee Records table (S).
Output table – Contains all employees who have been paid and who are also listed in the
Employee Records table.
Note that the two employee 003 records in the primary table are joined to the same employee
003 record in the secondary table.
Analysis – In the output table, you can compare Cheque amount to Pay per period to verify
that an employee was paid correctly. Even though employee 003 received two cheques, the
total amount of $2000 is correct.
Example
Test – You want to find out if someone who is not listed as an employee was paid.
Approach – You use a join type that creates one output record for every record in the Payroll
Ledger table (P) that does not have a match in the Employee Records table (S).
Output table – Contains people who have been paid but who are not listed in the Employee
Records table.
Example
Test – You want to verify amounts for all checks that were issued.
Approach – You use a join type that creates one output record for every record in the Payroll
Ledger table (P) whether or not it has a match in the Employee Records table (S).
Output table – Contains a complete list of people who have been paid.
Analysis – In the output table, you can compare Cheque amount to Pay per period to verify
that an employee was paid correctly. You can see that employee 002 was paid $2200 but
according to the Pay per period field was not supposed to be paid anything.
Note
Analytics fills missing secondary fields for unmatched primary records with
blanks or zeros.
Example
Test – You want to verify that all employees listed in the Employee Records table were paid.
Approach – You use a join type that creates one output record for every record in the
Employee Records table (S) whether or not it has a match in the Payroll Ledger table (P).
Output table – Contains a complete list of all employees and what they were paid.
Analysis – In the output table, you can compare Cheque amount to Pay per period to verify
that an employee was paid, and paid correctly. You can see that employees 004 and 005
were not paid at all.
Note
Analytics fills missing primary fields for unmatched secondary records with
blanks or zeros.
Example
Test – You want to examine all payroll and employee data.
Approach – You use a join type that creates:
l one output record for every record in the Payroll Ledger table (P) that has a match in
the Employee Records table (S)
l one output record for every unmatched record in either table
Output table – Contains all payroll and employee data, whether it is matched or unmatched.
Analysis – In the output table, you can compare Cheque amount to Pay per period:
l to verify that an employee was paid, and paid correctly
l to identify people who were paid but who are not listed in the Employee Records table
l to identify employees who were not paid
Note
Analytics fills missing fields for unmatched records with blanks or zeros.
Secondary table
Sample data and example
details
Payroll Ledger The complete Payroll Ledger table has all pay periods and all payroll disbursements for 2018.
table The example uses January and February disbursements.
(primary)
Maintained by the human resources department. The Employee Records table contains:
o a complete list of valid employees
o each employee's pay per period
o each employee's start date
o any employee's start date in a new position
Employee Records Two records exist for employee 006:
table o start date
(secondary) o data of a promotion and a pay raise
In the example that follows, the Payroll Ledger table is joined with the Employee Records table
using the common key field of Employee number.
Join The example is a many-to-many join.
Example
Test – You want to verify that employees were paid correctly.
Approach – You use a join type that creates one output record for every match between
records in the Payroll Ledger table (P) and the Employee Records table (S).
Note
Because both source tables in the join contain multiple occurrences of
matching key values, you need to use the join type that includes all secondary
matches to ensure that you capture all relevant data and derive accurate
results.
Output table – For each pay date, contains all employees who have been paid and who are
also listed in the Employee Records table.
Analysis – In the output table, you can compare Cheque amount to Pay per period to verify
that an employee was paid correctly for each Pay date.
Because you used the join type that includes all secondary matches (the Analytics many-to-
many join), the $200 increase in Cheque amount received by employee 006 starting on 15
February is explained by the matching employee record that shows a $200 raise beginning
01 February.
Remove redundant joined records – Depending on the nature of the data being joined, a
many-to-many join can create redundant joined records. In the example above, some of the
employee 006 joined records contained invalid Pay date-Start date combinations. You can
use a filter to remove the invalid combinations and make the output table easier to read:
Fuzzy join
An Analytics fuzzy join use fuzzy matching of key field values to combine two Analytics tables into a
new third table. In most respects, a fuzzy join is like a regular Analytics join (see "Joining tables" on
page 963). The main difference is that in addition to joining records based on exact matching of key
field values, a fuzzy join can join records based on approximate matching.
Fuzzy joining is useful when primary and secondary keys contain the same kind of data, but in
slightly different form. Or the data in the keys has slight irregularities, such as typos, that might
prevent an exact match.
Example
Scenario
You want to identify any vendors who are also employees as one way of analyzing data for
possible improper payments.
Approach
You join the Vendor master table with the Employee table, using the address field in each
table as a common key (Vendor_Street, and Emp_Address). However, the form of the
address data in the key fields varies slightly, so you use a fuzzy join instead of a regular join.
Even with data cleansing and harmonization, key values with minor differences in spelling,
such as "Rowan" and "Rowen", would probably not be matched.
The key values could be joined by a fuzzy join, depending on the fuzzy join settings.
Output results
In the example of the joined table below, exact key field matches are highlighted purple, and
fuzzy key field matches are highlighted green.
For more information about computed fields, see "Defining computed fields" on page 795.
Note
The Fuzzy Join dialog box does not allow the creation of an expression on a
secondary key field. However, you can manually create a secondary key field
expression in the Analytics command line or in a script. Another option is to create a
computed field for use as the secondary key field.
Note
Sorting elements in key field values is best suited for fuzzy joining using the
Levenshtein distance algorithm.
Sorting elements when fuzzy joining using the Dice coefficient algorithm may or may
not be beneficial. Test a set of sample data before deciding whether to use
SORTWORDS( ) in conjunction with the Dice coefficient algorithm in a production
setting.
Caution
If you use SORTWORDS( ) in conjunction with fuzzy joining you must apply
SORTWORDS( ) to both strings or both fields being compared.
Command performance
The fuzzy matching algorithms ensure that only key values within a specified degree of fuzziness, or
exactly matching values, are actually joined. However, every possible primary-secondary match
must be tested, which means that the fuzzy joining process can be time-consuming. The number of
individual tests that must be performed is equal to the number of records in the primary table times
the number of records in the secondary table.
Enabling the option is not appropriate if you need output results that contain all possible joins
between primary and secondary key values.
Note
If you select Join only the first occurrence of secondary key matches and the first
occurrence of a match happens to be an exact match, any subsequent fuzzy
matches for the primary key value are not included in the joined output table.
Best practices
Keep output table size and command performance in mind when you prepare primary and
secondary input tables, and specify the degree of fuzziness.
l Tailor the data – Ensure that only relevant records are included in the primary and secondary
tables. If some records have no chance of being matched, filter them out before performing
fuzzy matching.
l Test runs – For large data sets, do test runs on a small portion of the data as a more efficient
way of arriving at suitable settings for the fuzzy matching algorithms. Start with more
conservative fuzzy settings, and if required, progressively loosen them.
Degree of fuzziness
You specify the degree of fuzziness for each algorithm, which can dramatically change the size and
makeup of the result set. "Degree of fuzziness" refers to how closely two values match.
Depending on the algorithm you select, you use the following settings to control the degree of
fuzziness:
Algorithm Setting
Try experimenting with different degrees of fuzziness. Begin conservatively and produce smaller
result sets, and then progressively loosen the settings until you start getting too many joined values
that are obviously not matches (false positives).
Dice coefficient
The Dice coefficient algorithm works by measuring the degree of similarity between a primary and a
secondary key value, on a scale from 0.0000 to 1.0000. The greater the Dice's coefficient of the two
values, the more similar they are.
Show me more
Dice's coefficient Meaning
1.0000 Each value is composed of an identical set of characters, although the characters may be
in a different order, and may use different case.
The n-grams in the two values are 100% identical.
N-grams are explained below.
0.0000 The two values have no identical n-grams, or the length specified in the N-gram setting is
longer than the shorter of the two values being compared.
N-grams
Dice's coefficient is calculated by first dividing the values being compared into n-grams. N-grams
are overlapping blocks of characters, with a length of n, which is whatever length you specify in the
N-gram setting.
Here are two of the values from the example above, divided into n-grams with a length of 2
characters (n = 2).
2203 Rowen St 22 | 20 | 03 | 3_ | _R | Ro | ow | we | en | n_ | _S | St
The Dice's coefficient is the percentage of n-grams in the two values that are identical. In this case,
20 of 28 n-grams are identical, which is 71.43%, or 0.7143 expressed as a decimal fraction.
Note
Increasing the length in the N-gram setting makes the criterion for similarity between
two values stricter.
Percent
When you specify a Percent setting, you are specifying the minimum allowable Dice's coefficient of
two values for them to qualify as a fuzzy match. For example, if you specify 0.7500 , at least 75% of
the n-grams in two values must be identical to create a match.
0.7500 To qualify as a fuzzy match, at least 75% Not matched, not included in the joined
of the n-grams in two values must be table
identical.
(Dice's coefficient = 0.7143)
0.7000 To qualify as a fuzzy match, at least 70% Matched, included in the joined table
of the n-grams in two values must be
(Dice's coefficient = 0.7143)
identical.
For detailed information about how Dice's coefficient works, see "DICECOEFFICIENT( ) function"
on page 2263.
Levenshtein distance
The Levenshtein distance algorithm works by measuring the degree of difference between a primary
and a secondary key value, on a whole number scale starting at 0. The scale represents the number
of single-character edits required to make one value identical to the other value. The greater the
Levenshtein distance between the two values, the more different they are.
Show me more
Levenshtein distance Meaning
0 Each value is composed of an identical set of characters, in an identical order. Case may
differ.
2 Two single-character edits are required to make the two values identical.
For example: "Smith" and "Smythe"
o edit 1 – substitute 'y' for 'i'
o edit 2 – insert 'e'
3 Three single-character edits are required to make the two values identical.
For example: "Hanssen" and "Jansn"
o edit 1 – substitute 'J' for 'H'
o edit 2 – delete 's'
o edit 3 – delete 'e'
Distance
When you specify a Distance setting, you are specifying the maximum allowable Levenshtein
distance between two values for them to qualify as a fuzzy match. For example, if you specify 2 , no
more than two edits can be required to make two values identical.
2 To qualify as a fuzzy match, no more than Not matched, not included in the joined
2 character edits can be required to make table
two values identical.
(Levenshtein distance = 3)
3 To qualify as a fuzzy match, no more than Matched, included in the joined table
3 character edits can be required to make
(Levenshtein distance = 3)
two values identical.
For detailed information about how Levenshtein distance works, see "LEVDIST( ) function" on
page 2358. Unlike the function, the Levenshtein distance algorithm used in the fuzzy join automat-
ically trims leading and trailing blanks, and is not case-sensitive.
Steps
You can use fuzzy matching of key field values to combine two Analytics tables into a new third
table.
Show me how
Note
Detailed information appears after the steps. See "Fuzzy Join dialog box options" on
the next page.
1. In the Navigator, open the primary table, and right-click the secondary table and select
Open as Secondary.
The primary and secondary table icons update with the numbers 1 and 2 to indicate their
relation to each other .
2. Select Data > Fuzzy Join.
3. On the Main tab select the fuzzy matching algorithm you want to use:
l Dice coefficient
l Levenshtein
4. Depending on the algorithm you selected, provide settings to control the degree of fuzziness.
Dice coefficient
l N-gram
l Percent
Levenshtein
l Distance
The settings are explained below.
5. (Optional) Select Join only the first occurrence of secondary key matches to specify that
each primary key value is joined to only the first occurrence of any matching secondary key
values.
6. Select the primary key field from the Primary Keys list.
You can select only one primary key field, and it must be a character field.
7. Select the secondary key field from the Secondary Keys list.
You can select only one secondary key field, and it must be a character field.
8. Select the fields to include in the joined table from the Primary Fields and Secondary Fields
lists.
Note
You must explicitly select the primary and secondary key fields if you want to
include them in the joined table.
Tip
You can Ctrl+click to select multiple non-adjacent fields, and Shift+click to
select multiple adjacent fields.
9. In the To text box, specify the name of the new, joined table.
10. (Optional) On the More tab:
a. If you want to process only a subset of records, select one of the options in the Scope
panel.
b. If you want to append (add) the output results to the end of an existing Analytics table,
select Append To Existing File.
11. Click OK.
The new, joined table is output.
Main tab
Use Dice's coefficient for fuzzy matching between primary and secondary key values.
o N-gram – the n-gram length to use
Specify a whole number, 1 or greater. Increasing the n-gram length makes the
Dice coefficient criterion for similarity between two values stricter.
o Percent – the minimum allowable Dice's coefficient of two values for them to qualify as
a fuzzy match
Specify a decimal fraction, from 0.0000 to 1.0000 (for example, 0.7500). Use a
maximum of four decimal places.
Decreasing the value increases the number of matches by including matches with a
greater degree of fuzziness – that is, values that are more different from each other.
Use Levenshtein distance for fuzzy matching between primary and secondary key
values.
o Distance – the maximum allowable Levenshtein distance between two values for
them to qualify as a fuzzy match
Specify a whole number, 1 or greater.
Increasing the value increases the number of matches by including matches with a
Levenshtein greater degree of fuzziness – that is, values that are more different from each other.
Specifies that each primary key value is joined to only the first occurrence of any
secondary key matches.
Join only the first occur-
rence of secondary key If you leave the option unchecked, the default behavior is to join each primary key value
matches to all occurrences of any secondary key matches.
Specifies the common key field to use to join the two tables.
o You can select the common key field directly in the Primary Keys and Secondary
Keys lists.
o You can also click Primary Keys or Secondary Keys to open the Selected Fields
dialog box where you can select the common key field, or create an expression on the
primary key.
Key field guidelines:
o Data type – The key fields must be the character data type.
o Length – If key fields are not the same length, they are automatically harmonized.
o Names and start positions – Key field names and start positions can be different, but
Primary Keys
they must describe the same data element.
Secondary Keys o Multiple key fields – Only one key field per table is supported.
Specifies whether the Analytics table containing the output results opens automatically
Use Output Table upon completion of the operation.
Note
To access the secondary table fields in the Expression Builder, select
the secondary table in the From Table drop-down list.
The If condition is evaluated against only the records remaining in a
If table after any scope options have been applied (First, Next, While).
Note
Analytics table names are limited to 64 alphanumeric characters, not
including the .FIL extension. The name can include the underscore
character ( _ ), but no other special characters, or any spaces. The name
To cannot start with a number.
More tab
Note
The number of records specified in the First or Next options references
either the physical or the indexed order of records in a table, and
disregards any filtering or quick sorting applied to the view. However,
results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
Specifies that the output results are appended (added) to the end of an existing Analytics
table.
Note
Leaving Append To Existing File deselected is recommended if you are
uncertain whether the output results and the existing table have an
identical data structure.
For more information about appending and data structure, see
Append To Existing File "Appending output results to an existing table" on page 205.
Example
You want to join two tables using social security number as the common key field.
l One key field contains numbers and punctuation formatted as character data: 555-44-
3322
l The other key field contains only numbers formatted as numeric data: 555443322
Because Analytics automatically harmonizes character-numeric joins, you can perform a
standard join without needing to first manually harmonize the fields using functions.
Additional details
l Any alpha characters or punctuation marks such as hyphens and parentheses in the
character field are ignored, and only the numbers are considered when matching values in the
numeric field.
l The position of alpha characters has no effect on the numeric matching.
l The character field retains its original data type and all its characters, including alpha and
punctuation, in the resulting joined table.
l Either the character or the numeric field can be the primary key field.
l Neither the character field, nor the numeric characters in the character field, need to be the
same length as the numeric field. Regardless of field length, only numeric values that are
identical are matched.
Relating tables
Relating tables allows you to combine up to 18 Analytics tables with different record structures and
access and analyze data from any combination of fields in the related tables as if they existed in a
single table.
Record structures are different if they have one or more fields (data elements) that differ. Relating is
a good choice for informational work that requires a quick picture of data associations across
several physical tables, or for linking codes with corresponding full names prior to generating
reports.
Example
Scenario
You want to create a sales report that contains details about the customers, and the products
sold, for the month of March, but the data is spread across three tables.
Approach
You relate the Customer master table with the Orders table, and the Orders table with the
Product master table, to create a temporary association of tables that contains all the
information you need for the report:
l customer name and location – from the Customer master table
l order details – from the Orders table
l product details – from the Product master table
Data element Must be the same. For example, both key fields are employee number fields.
Can be any data type, but key fields must be the same data type as each other. For
example, two character fields.
Data type Datetime subtypes (date, datetime, and time) can only be related to the same subtype.
l parent key field – the key field you choose from the parent table
l child table – the second table you add, and any subsequent tables you add
l child key field – the key field you choose from the child table, or tables
You are free to choose whatever parent and child tables and key fields you want. However, the
relation will succeed only if the key fields meet the requirements for relating.
For more information, see "About key fields" on page 229.
Relating a table pair is the logical equivalent of joining them using the All Primary Records
option – that is, using the type of many-to-one join that includes matching primary and
secondary records (parent and child records), and unmatched primary records.
As with the corresponding many-to-one join, the relating operation matches parent key values
to the first occurrence only of a matching child key value. If additional occurrences of a
matching child key value exist, they are ignored. You need to take this behavior into account
when planning your table relations, especially if a child table contains legitimate multiple
occurrences of a matching key value. One approach is to try reversing the relation of the two
Record matching tables, making the child the parent, and vice versa.
Unmatched records If a parent key value has no match in a related child table, for the missing field values, Analytics
and missing field displays a blank in character and datetime fields, a zero in numeric fields, and “F” in logical
values fields.
Duplicates or If duplicates or missing values in a child table key field render subsequent analysis invalid, pre-
blanks in child table processing the child table to remove the duplicates and/or blanks may be a solution in some
key field circumstances.
You have two options when extracting data from related tables:
o Using either the View or Fields option in the Extract dialog box, you can extract some or all
of the data from the parent and child tables into a new Analytics table. The new table is no
longer related to any other tables.
If you use the View option, you must first add the pertinent child table data to the parent
view.
o Using the Record option in the Extract dialog box, you can extract the data from the parent
Extracting data table into a new Analytics table. The new table retains the relations of the original parent
from related tables table. The Record option does not support extracting child table data.
Analytics does not enforce identical lengths for the common key fields in parent and child
tables.
It is recommended that you always use fields of identical length, manually harmonizing the
lengths prior to performing the relation, if necessary. Results derived from relating using key
fields of different lengths are not reliable.
Identical key field Datetime key fields can be different lengths because Analytics, when performing operations
length not enforced involving dates, datetimes, or times, uses an internal Analytics datetime format.
You cannot change the data type of a parent or child key field while it is being used to relate
tables. If you need to change the data type of either field, you must first delete the relation. If the
Changing key field change results in the data types being different from each other, you are no longer able to use
data type the two fields to relate tables.
Do not use a conditional index for child table key fields. Instead, apply conditions when you
perform operations against a parent table and its related table(s).
Avoiding Using conditional indexes when building relations can cause unintended data gaps at different
conditional points in a relational hierarchy. The safer approach is to build relations that present as full a
indexing data set as the relations warrant, and subsequently apply conditions, if required.
Restrictions on To be related, tables must be in the same Analytics project. Server tables must be on the same
location of tables server, and must be accessed using the same server profile. You cannot relate a local table
being related and a server table.
When you relate table pairs using character key fields, justification and case must be the same:
o Both key fields must have the same justification. Use the LTRIM( ) function to remove
leading blanks from the key fields.
Harmonizing justific- o Both key fields must be in the same case – UPPER, lower, or Proper. To harmonize the
ation and case case, use the UPPER( ), LOWER( ), or PROPER( ) function.
Relating UTC- A UTC-based and a non-UTC datetime key field can be used to relate two tables. (UTC is
Coordinated Universal Time, the time at zero degrees longitude.) When performing operations
involving datetimes or times, Analytics uses an internal Analytics datetime format, so the
following two datetimes are interpreted as identical, and constitute a match:
o UTC-based – 31/12/2014 10:30:15-05:00
o non-UTC – 31/12/2014 15:30:15
You should exercise caution if you mix UTC-based and non-UTC time data in an Analytics
operation. Although Analytics will match the two time values above, it may not make logical
based and non- sense to do so, because one value references a time zone, and the other value does not. For
UTC data more information about UTC, see "Date and Time options" on page 136.
Relate tables
Using a common key field from each table pair, you can relate two or more Analytics tables with
different record structures. Once tables are related, you can use the parent table to access and
analyze data from any combination of fields in the related tables.
Note
Carefully identify the parent and child tables in a relation because results can differ if
you reverse the order. For more information, see "Common uses of joining or
relating" on page 962.
Steps
Note
Detailed information appears after the steps. See "Relations dialog box options" on
the next page.
Tip
You can Ctrl+click to select multiple non-adjacent tables, and Shift+click to
select multiple adjacent tables.
You can double-click a child table to add it singly.
Tip
You can resize the Relations dialog box, or tables in the dialog box, and move
tables, to create more room in which to work, or to make field information more
visible.
5. Drag the key field from the parent table to the corresponding key field in the child table.
An arrow appears between the two key fields, indicating the relation between the tables.
Parent and child tables are related using an index on the child table key field. For more
information, see "Child table index" on page 1008.
6. Relate any additional tables in the same manner as the first table pair, by dragging key field to
key field.
Each additional relation must create a direct or indirect link to the parent table.
Note
Individual instances of two tables can have only one relation. If you try to relate
the same table pair a second time, the operation is prohibited and an error
message appears. Add another instance of the required table by clicking the
Add Table button and selecting the appropriate table.
For more information, see "Using multiple key fields in isolation" on page 1017.
7. (Optional) To remove an individual relation, or a table, from the Relations dialog box, do the
following:
l To remove a relation – right-click the key field arrow and select Delete
l To remove a table – right-click the body of the table and select Remove Table
Note
If the table has an existing relation, you must delete the relation first.
Options – Relations
dialog box Description
Specifies the common key field to use to relate each table pair.
o You select the common key field by dragging key field to key field.
o Once the key field arrow is in place, you can right click it and select Edit Relation to change
the common key field.
Key field guidelines:
o Data type – The key fields can be any data type. For each table pair, key fields must be the
same data type.
o Datetime subtypes – Datetime subtypes (date, datetime, and time) can only be related to
the same subtype.
o Length – It is recommended that key field lengths be identical for each table pair.
Key field arrow o Names and start positions – Key field names and start positions can be different, but they
Options – Relations
dialog box Description
(Optional) You can right-click the working area of the Relations dialog box and select Arrange
Arrange Tables Tables to neaten the arrangement of tables and key field arrows.
If no index exists on the child table key field, Analytics automatically creates one when you
If no index exists relate the parent and child tables.
If you want to specifically name the child table index auto-created by Analytics:
a. Right-click when you drag the key field from the parent table to the child table.
b. Select Relate using Named Index.
Relate using Named Index is disabled if an index already exists.
If you want to spe- c. Specify a name for the index, and if desired a location other than the default (the folder
cifically name the containing the Analytics project)
index d. Click OK.
If multiple indexes If the child table has two or more existing indexes on its key field, you are presented with a list
exist of these eligible indexes. Select the appropriate index and click OK
3. Select one or more child table fields to add to the parent view.
Child table fields appear in the parent view in the order in which you select them.
4. If applicable, select additional child tables from the From Table drop-down list, and select
additional child table fields to add to the parent view.
5. Click OK.
The child table fields are added to the parent view. Analytics fills missing values in child table
fields for unmatched parent table records with blanks or zeros.
Modify relations
You can modify table relations, including adding or removing related tables, changing key fields, and
creating expressions. You can also delete a relation entirely.
1. Open the parent table and select Data > Relate.
2. In the Relations dialog box, do one or more of the following:
Right-click the arrow connecting the two tables and select Delete.
You cannot delete the relation if any child table fields are referenced in either the current
parent view, or in an active computed field. You must first remove the fields from the
view, or delete the computed field, or make it inactive. You can make a computed field
inactive by switching to a different view, or by closing and reopening the parent table.
Delete a relation You also cannot delete the relation if it indirectly links another child table to the parent
entirely table. You must first delete the relation to the other child table.
Add a table to the Click Add Table, select one or more tables, click Add, and click Close. Create the
relation relation to the new table(s) in the usual manner.
Right-click the arrow connecting the two tables and select Edit Relation, or double-click
the arrow.
You can change the parent and/or child key fields, and select a different index for the
child table, if one or more additional indexes already exist. Click OK to save your
changes.
Right-click the parent table and select New Expression to open the Expression Builder.
Create an You can create an expression using fields from the parent and any related child tables.
expression You can only create an expression through the parent table.
Example
In the figure below, the tables and key fields are related in the following manner:
Parent table Common key field Child tables Common key field Grandchild tables
Customer_number Customer
If legitimate duplicate child key values exist, making the child table the parent may yield more
complete results, assuming the current parent table does not also contain legitimate duplicates.
If both tables contain legitimate duplicates, joining the tables using a many-to-many join may be a
better approach.
If you try to relate the same table pair a second time, the operation is prohibited and the
following message appears:
"One of these files is already part of a relation. To create another relation, add another
instance of the file."
You can add another instance of the required table by clicking the Add Table button in
the Relations dialog box and selecting the appropriate table. An additional table instance
is added with an incrementing numeric suffix, or a name of your choosing.
Individual instances of
two tables can have only Alternatively, you can make a copy of the appropriate table layout in the Navigator, and
one relational association add the copy to the Relations dialog box.
o Tables can be related using two or more key fields in combination if the key fields are
concatenated.
For more information, see "Using multiple key fields in combination" on page 1015.
Relating tables using mul-
tiple key fields o A parent table can be related to two (or more) separate instances of the same child
The values in a single common key field You need to use both the vendor ID field
Multiple key fields in com- are insufficiently unique to accurately join and the Location field to accurate join or
bination or relate two tables. relate two tables.
The values required to join or relate two You are joining or relating tables on Name.
tables are split between two (or more) key The primary or parent table contains a
fields in one of the tables being joined or single Name field. However, names can
Multiple key fields in isol- related. occur in either of two fields in the
ation secondary or child table.
Example
You want to join or relate two tables using Vendor_ID as a common key field. However, some
vendors have multiple locations for the same vendor ID.
In this example, Vendor A4538 has locations in Vancouver, Richmond, and Coquitlam.
Select more than one key field in the Join dialog box
When you select more than one key field for each table in the Join dialog box, the following
conditions apply:
The data structure and data format requirements that apply when using one key field still apply to the
Data struc- corresponding key fields in each table when using multiple key fields. For more information, see
ture "Data structure and data format requirements" on page 921.
Within a table, the multiple key fields can be of different data types – for example, first name, last
Data type name, and date of birth.
Selecting more than one key field creates a nested sort order in the output table, assuming you
Presort the primary table while performing the join. The order in which you select the key fields
Sort order dictates the priority of the nested sort order.
l In each table, create a computed field that concatenates (adds together) two or more key
fields, and relate the tables using the computed fields. For more information, see
"Concatenate key fields" on page 1022.
l In each table, define a new field long enough to encompass the data in the multiple key fields,
and relate the tables using the new field. For more information, see "Define a physical field"
on page 790.
Note
Unlike joining, when you relate tables you can select only one key field per table pair,
so you need to employ one of the methods above to use multiple key fields in
combination.
The data structure and data format requirements that apply when using one key field still apply to
Data struc- newly created fields that encompass multiple key fields. For more information, see "Data structure
ture and data format requirements" on page 921.
This method works only if the multiple key fields are adjacent in each table. Fields can be made
Field adja- adjacent by extracting by field to a new table and selecting the fields for extraction in the required
cency order.
New fields that encompass multiple key fields can be any data type supported by the source data.
If the multiple key fields are of different data types, you can create the new field encompassing them
Data type as a character field because you are using it only for the purposes of relating tables.
You want to use names to join or relate two tables. The primary or parent table contains the
Name field. However, the secondary or child table contains two different name fields – Name_
1 and Name_2. Matching names in the secondary or child table could appear in either of the
two name fields.
Joining tables
To capture all possible matches between names you need to perform two successive joins,
with each join using only one of the key fields in the secondary table. You use the output table
from the first join as the primary table in the second join.
With each join you must select the join type that includes matched and unmatched primary
records (that is, all primary records) so you do not lose the unmatched primary records at any
point in the process.
Note
The figures below illustrate only the key fields in the tables being joined.
Typically, tables also include other data in non-key fields.
Relating tables
To capture all possible matches between names you need to add an additional instance of
the child table for the additional relation between the parent key field and the second child key
field.
You add additional instances of the child table by clicking the Add Table button in the
Relations dialog box and selecting the appropriate table.
Joining tables
To associate social security numbers to both main and secondary tax filers you need to
perform two successive joins, with each join using only one of the key fields in the primary
table. You use the output table from the first join as the primary table in the second join.
With each join you must select the join type that includes matched and unmatched primary
records (that is, all primary records) so you do not lose the unmatched primary records at any
point in the process.
Note
The figures below illustrate only the key fields in the tables being joined.
Typically, tables also include other data in non-key fields.
Relating tables
To associate social security numbers to both main and secondary tax filers you need to add
an additional instance of the child table for the relation between the second parent key field
and the child key field.
You add additional instances of the child table by clicking the Add Table button in the
Relations dialog box and selecting the appropriate table.
Note
You can concatenate only character key fields, so you may have to use Analytics
functions to convert non-character data prior to concatenating. For more information,
see "Harmonizing fields" on page 924.
1. Open the parent table and select Edit > Table Layout.
2. Click Add a New Expression .
3. Enter a Name for the concatenated key field.
4. Click f(x) to open the Expression Builder.
5. Build an expression using two or more key fields and the Add operator (+).
For example: vendor_ID + location_code
6. Click OK.
If you get an “Expression type mismatch” error, one or more of the key fields are probably not
character key fields.
7. Click Accept Entry and click Close to exit the Table Layout dialog box.
8. Open the child table and repeat the same steps to add an identical concatenated key field to
the child table.
9. Relate the two tables using the concatenated key field.
Sampling data
You want to discover the rate of deviation from a prescribed control, or the total amount of monetary
misstatement, in an account or class of transactions. However, you may not have the time or the
budget to examine every record in the data set.
You can use Analytics to draw a statistically valid subset of the data, called a sample, and analyze
this much smaller set of data instead.
You can then project the results you get from analyzing the smaller set of data to the entire
population of data. The projection creates an estimate of the overall deviation rate, or the overall
amount of misstatement.
The sample selection and the projection use statistical formulas, which ensure a reasonable and
measurable degree of confidence that the estimate is close to what you would have got if you had
actually examined every record.
Note
The information about sampling in this guide is intended to help users already
familiar with audit sampling perform sampling tasks in Analytics. The information is
not intended to explain audit sampling theory, which is a complex subject.
For in-depth coverage of audit sampling, consult a resource such as AICPA's Audit
Guide: Audit Sampling.
Sampling types
Analytics has three types of sampling:
l record sampling (attributes sampling)
l monetary unit sampling
l classical variables sampling
The type of sampling you choose depends on the nature of the analysis you are doing, and the
nature of the data.
Note
If all you require is a non-representative random selection of records, see "Generate
a random selection of records" on page 234. Projecting results based on a non-
representative selection has no statistical validity.
Note
If you are not familiar with the professional judgments required to perform audit
sampling in a reliable manner, we recommend that you consult audit sampling
resources, or an audit sampling specialist, before using Analytics for sampling in a
production environment.
Materiality deciding upon the acceptable level of misstatement in an account or class of transactions
Monetary precision
Tolerable deviation rate deciding upon the acceptable rate of deviation from a prescribed control
Evaluation method for classical variables sampling, choosing an appropriate evaluation method
Note
These are layperson definitions that intentionally simplify the more precise
definitions used in the audit and assurance profession.
The entire set of records in a file, or the entire monetary amount in an account or class of
population transactions, from which a sample is drawn.
A statistically valid process that selects less than 100% of a population. This subset is
sampling, sample known as "the sample".
A number that you specify, or that Analytics randomly selects, to initialize the
seed Analytics random number generator.
In a misstated amount, the percentage of the book value (recorded value) that the
misstatement represents.
For example: a $200 book value that should actually be $180 is misstated by $20 and
tainting therefore has a 10% tainting.
Monetary unit sampling o fixed interval The records contained in the sample
o cell are those that correspond to the
o random selected monetary units
Note
If you want Analytics to randomly select a start number, you can enter a start number
of ‘0’, or leave the start number blank.
Example
If 62 is the interval generated by Analytics, and you choose 17 as the start number, the
following monetary units, or record numbers, are selected:
l 17
l 79 (17+62)
l 141 (79+62)
l 203 (141+62)
l and so on
Each selection is the same distance, or fixed interval, apart.
For monetary unit sampling, the actual record numbers selected are the ones that correspond
to the selected monetary units. For more information, see "How monetary unit sampling
selects records" on page 1068.
Considerations
When you use the fixed interval selection method, you need to be alert to any patterns in the data.
Because a fixed interval is used for sample selection, a non-representative sample can result if the
data has a pattern that coincides with the interval you specify.
For example, you sample expenses using an interval of $10,000, and the same expense category
appears at ten-thousand-dollar intervals in the file, which results in all the selected records coming
from a single expense category. This type of scenario is uncommon, but you should be aware that it
could occur.
l The interval value that Analytics generates when you calculate the sample size
l A seed value used to initialize the random number generator in Analytics
The interval value dictates the size of each cell. The random number generator specifies which
monetary unit or which record number is selected from each cell.
Note
If you want Analytics to randomly select a seed value, you can enter a seed value of
‘0’, or leave the seed value blank.
Example
If 62 is the interval generated by Analytics, one monetary unit, or one record number, is
randomly selected from each of the following cells:
l cell 1 (1 to 62)
l cell 2 (63 to 124)
l cell 3 (125 to 186)
l and so on
Each selection is a random distance apart, but constrained within its cell.
For monetary unit sampling, the actual record numbers selected are the ones that correspond
to the selected monetary units. For more information, see "How monetary unit sampling
selects records" on page 1068.
Considerations
The main advantage of the cell selection method over the fixed interval selection method is that it
avoids problems related to patterns in the data.
For monetary unit sampling, two disadvantages exist:
l Amounts can span the dividing point between two cells, which means they could be selected
twice, yielding a less consistent sample than the sample generated by the fixed interval
method.
l Larger amounts that are less than the top stratum cutoff have a slightly reduced chance of
being selected.
Note
Do not use the random selection method with monetary unit sampling if you intend to
use Analytics to evaluate any misstatement detected in the resulting sample.
Evaluating monetary unit samples requires that you use the fixed interval or the cell
selection methods.
Note
If you want Analytics to randomly select a seed value, you can enter a seed value of
‘0’, or leave the seed value blank.
Considerations
Large amounts may be excluded from a monetary unit sample
With the random selection method, each monetary unit has an equal chance of selection, and there
is no guarantee that the resulting sample will be evenly distributed. As a result, the distance or gap
between selected units may be large in some instances. If all the monetary units associated with a
large amount happen to fall into a gap, the amount is not included in the sample. There is also no top
stratum cutoff available when using the random selection method.
With the fixed interval and cell selection methods, there is an assurance that the selected units are
evenly distributed, or relatively evenly distributed. And top stratum cutoff is available.
Note
A record number field is automatically included in the output table when you use
classical variables sampling.
Show me how
1. In the source table, create a computed field that uses the following expression:
RECNO( )
For more information, see "Define a conditional computed field" on page 807.
2. When you sample the data, output by Fields, not by Record.
You must output by Fields in order to convert the computed record number field to a physical
field that preserves the record numbers from the source table.
3. Include the computed record number field in the output fields you specify.
attribute sampling
Record sampling attributes sampling
Confidence confidence
confidence level
reliability
Population population
population size
Materiality tolerable
misstatement
Expected expected
Total Errors misstatement
estimated
misstatement
expected
population
misstatement
Maximum
Tolerable
Taintings (%)
(an Analytics-
specific term)
Errors misstatements
Evaluate results
Confidence confidence
confidence
level
reliability
Population population
population
size
Interval sampling
interval
Number of
Tolerable Errors
(an Analytics-
specific term)
Number of number of
Errors deviations
Evaluate result
Tip
For a hands-on introduction to the end-to-end process of record sampling in
Analytics, see "Record sampling tutorial" on page 1041.
How it works
Record sampling allows you to select and analyze a small subset of a population, and based on the
result estimate the rate of error or deviation from an internal control for the entire population.
You can then compare the estimated rate to the rate that you judge is acceptable, and make a
determination regarding the control.
Record sampling supports making this sort of statement:
l There is a 95% probability that the deviation rate from the prescribed control does not exceed
4.35%, which is below the tolerable deviation rate of 5.0%. Therefore the prescribed control is
operating effectively.
Example
In a table with 100 records, Analytics could select the following record numbers:
l 9
l 13
l 40
l 52
l 78
l 91
l 99
Considerations
Record sampling is appropriate for use with controls testing that results in a yes/no, or pass/fail,
result. In controls testing, you are more concerned with the rate of errors in the total population than
with the cumulative monetary amount of the errors.
Because record sampling does not consider the amounts contained by records, there is a significant
chance that large monetary transactions may be excluded from the sample.
The tutorial leaves out optional aspects of record sampling, and focuses on a single path, so you
can quickly get a basic understanding of how record sampling in Analytics works.
Tip
For simple definitions of sampling terms, see "A word about terminology" on
page 1025.
The scenario
You are examining a vouchers table with over 5000 records. You want to pull hard copies of a
sample of the vouchers to confirm that they match the system entries, and that the voucher
control process is working effectively.
You will check the hard copies to confirm:
Note
Do not include the thousands separator, or the percentage sign, when you specify
values. These characters prevent the command from running, or cause errors.
A maximum of 2% of the vouchers can lack proper approval and you still consider the
Upper Error Limit (%) control effective.
Expected Error Rate (%) You expect that 1% of the vouchers lack proper approval.
If you use one of the interval methods of sample selection, the records selected are
either:
o every 9th record
o a randomly selected record from each block of 9 records
Note
Interval 8.93 is rounded up to 9.
Note
The record sampling tutorial does not use this number, which provides an
alternative method for evaluating control deviations.
Change a value in any of the following fields in the Size dialog box, click Calculate, and
notice how the results change. Change only one value at a time so it is easier to see how the
change affects the results.
l Confidence
l Upper Error Limit (%)
l Expected Error Rate (%)
More stringent requirements increase the sample size. More lenient requirements decrease
the sample size.
Reset the values to match the screen above and click OK. Pin the Size tab with the results of
the sample size calculation.
sample of records.
A seed value of 456654 is used to initialize the random number generator in Analytics.
You can specify any seed value you want.
Seed The random number generator specifies which record number is selected from each cell.
The random number generator uses the Mersenne-Twister algorithm to generate random
Algorithm numbers.
The sample of records drawn from the Vouchers table is output to a new table called
To Vouchers_sample.
Note
Because Analytics rounds up the Interval to 9, the actual number of
records drawn is slightly less than the calculated sample size of 593.
Note
The menu option is disabled if a table is not open.
2. Select Record.
3. Specify the input values exactly as they appear in the screen below and click OK to project the
results.
The actual number of records in the sample you drew – that is, the number of records in
Sample Size the Vouchers_sample table.
When you examined the hard copies, the number of vouchers that lacked proper
Number of Errors approval.
The maximum deviation rate for the entire population of vouchers, projected with a 95%
degree of confidence.
Put another way: There is a 95% probability that the number of vouchers that lack proper
approval in the Vouchers table does not exceed 1.79%, or 95 vouchers.
Because 1.79% is less than the 2.00% you specified for the Upper Error Limit (%) when
you calculated the sample size, you can conclude that the voucher control is operating
effectively.
Upper error limit fre- For a detailed explanation, see "What “Upper error limit frequency” tells you" on
quency page 1065.
Rerun the evaluate command with a different Number of Errors to see how the result
changes.
The table below summarizes some different results.
Vouchers lacking
Number of Upper error limit approval in
Errors frequency Vouchers table
(in the (projected (projected
sample) maximum) maximum) Conclusion
Vouchers lacking
Number of Upper error limit approval in
Errors frequency Vouchers table
(in the (projected (projected
sample) maximum) maximum) Conclusion
limit of 2.00%.
Note
This example demonstrates the
difference between using Upper
error limit frequency and Number
of Tolerable Errors to evaluate
control deviations.
If you use the more lenient Number
of Tolerable Errors method, the
voucher control is operating
effectively.
The number of observed errors in
the "Number of Errors" column to
the left is 6, which does not exceed
the Number of Tolerable Errors of
6 reported when you calculated
sample size.
Before sampling a set of data, you must calculate the statistically appropriate sample size, and other
values required by the subsequent sample and evaluate operations.
The Calculate Sample Size feature in Analytics calculates the required values for you based on
input values you provide.
Caution
In a production environment, do not manipulate input values solely to achieve a
smaller sample size. Input values should be based on your professional judgment
about what is most appropriate for the data being sampled and the audit objective.
Increasing this input value: Decreases sample size Increases sample size
Confidence
Increasing this input value: Decreases sample size Increases sample size
Steps
Note
Do not include the thousands separator, or the percentage sign, when you specify
values. These characters prevent the command from running, or cause errors.
Note
The menu option is disabled if a table is not open.
l Population
Note
The input values are explained in detail below.
Tip
Clicking Calculate instead of OK allows you to experiment with different input
values before outputting the results.
Note
The output results are explained in detail below.
Tip
You can click any linked result value in the display area to drill down to the
associated record or records in the source table.
l Click Name and enter the file name, or select an existing file in the Save or Save File As
Note
ASCII Text File or Unicode Text file (depending on which edition of
Analytics you are using) is the only option for File Type.
6. Click OK.
7. If the overwrite prompt appears, select the appropriate option.
Your desired confidence level that the resulting sample is representative of the entire
population.
For example, entering 95 means that you want to be confident that 95% of the time the sample
will in fact be representative. Confidence is the complement of “sampling risk”. A 95%
Confidence confidence level is the same as a 5% sampling risk.
Population The number of records in the data set you are sampling.
Note
In record sampling, the population size does not affect the resulting sample
size. For example, if the other input values remain the same, the same statist-
ically valid sample size is calculated for populations of 150,000 or 1,000,000
records.
The resulting interval value does increase in direct relation to the population
size.
The maximum rate of deviation from a prescribed control that can occur and you still consider
the control effective.
Upper Error Limit For example, entering 5 means that the deviation rate must be greater than 5% for you to
(%) consider the control not effective.
The rate of deviation from a prescribed control that you expect to find.
For example, entering 1 means that you expect the deviation rate to be 1%.
Note
The Expected Error Rate (%) you specify must be less than the Upper Error
Limit (%). If the difference between them is too small, the error message Error
rate too high for calculation appears.
Expected Error In audit sampling terms, the degree of sampling precision represented by the
Rate (%) difference is too small to be calculated for the confidence level you specified.
Interval The interval value – required for the fixed interval and the cell selection methods.
The maximum number of errors or deviations that can occur in the resulting sample without
exceeding the Upper Error Limit (%).
Number of Tol-
erable Errors For more information, see "Number of Tolerable Errors" on page 1055.
populations, the sample size generated by the Poisson distribution can actually exceed the
population size.
When calculating sample sizes in Analytics, recognize that for record sampling of small data sets,
the sample size may be larger than you need. This larger sample size does not present an obstacle
to analysis because it is common practice to manually oversample small populations.
You can create a new table that contains a representative sample of the data in the active table.
Record sampling is appropriate if you are interested in the rate of deviation from a prescribed
control.
Note
This procedure does not include filtering (IF statements) or scope parameters
because applying these options compromises the validity of a sample.
Steps
Note
Detailed information appears after the steps. See "Sample dialog box options" on
the facing page.
Do not include the thousands separator, or the percentage sign, when you specify
values. These characters prevent the command from running, or cause errors.
1. In the Navigator, open the table you want to draw a sample from.
2. Select Sampling > Record/Monetary Unit Sampling > Sample.
3. On the Main tab, select Record.
4. In the Sample Parameters panel, specify a sample selection method:
l Fixed Interval
l Cell
l Random
5. Enter the sample parameters for the selection method you chose:
Selection method Sample parameters
Cell o Interval
o Seed (optional)
o Algorithm – leave Mersenne Twister selected
Random o Size
o Seed (optional)
o Population (optional) – prefilled with the number of records in the table
o Algorithm – leave Mersenne Twister selected
Note
Sample parameters are explained in detail below.
6. In the To text box, specify the name of the Analytics table that will contain the output results.
7. On the More tab, select one of the following:
o Record –The entire record is included in the output table.
o Fields – Only the selected fields are included in the output table.
8. If you chose Fields, select the field(s) to include in the output table from the Extract Fields list.
9. Optional. Select Report Selection Order if you want to add the ORDER field to the output
results.
Note
Report Selection Order is available only if both the Random selection method
and Fields output are selected.
Main tab
Options – Sample
dialog box Description
Specifies that the fixed interval method is used for sample selection.
Samples are selected based on an interval value and a start number that you specify. For more
information, see "Fixed interval selection method" on page 1027.
If you selected Fixed Interval enter the following values:
Fixed Interval o Interval (required) – the interval value that was generated by calculating the sample size
Options – Sample
dialog box Description
Note
If you have not already calculated the sample size, you can click Size to
open the Size dialog box. For more information, see "Calculating sample
size for a record sample" on page 1050.
o Start (optional) – a start number that is greater than zero and less than the interval value
Tip
Enter a start number of ‘0’, or leave the start number blank, if you want
Analytics to randomly select a start number.
Note
If you have not already calculated the sample size, you can click Size to
open the Size dialog box. For more information, see "Calculating sample
size for a record sample" on page 1050.
Tip
Enter a seed value of ‘0’, or leave the seed blank, if you want Analytics to
randomly select a seed value.
Note
If you have not already calculated the sample size, you can click Size to
open the Size dialog box. For more information, see "Calculating sample
Random size for a record sample" on page 1050.
Options – Sample
dialog box Description
Tip
Enter a seed value of ‘0’, or leave the seed blank, if you want Analytics to
randomly select a seed value.
o Population (optional) –prefilled with the number of records in the table, which is the
population from which the sample will be selected
o Algorithm (required) – leave Mersenne Twister selected
Only select Default if you require backward compatibility with Analytics scripts or sampling
results created prior to Analytics version 12.
Caution
Do not create an IF statement or filter records in the course of sampling. Doing
so compromises the validity of the sample.
If For more information, see "Conditional sampling" on page 1160.
Note
Analytics table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
To number.
If you are connected to a server table, specifies where to save the output table.
o Local selected – saves the output table to the same location as the Analytics project, or to a
specified path, or location you navigate to.
Local o Local deselected – saves the output table to the Prefix folder on AX Server.
Specifies whether the Analytics table containing the output results opens automatically upon
Use output table completion of the operation.
More tab
Options – Sample
dialog box Description
Caution
Do not limit which records are processed in the course of sampling. Doing so
compromises the validity of the sample.
Scope panel For more information, see "Conditional sampling" on page 1160.
Specifies whether the output table includes the entire record, or selected fields.
If you choose Fields, do one of the following:
o Select the field(s) to extract from the Extract Fields list.
o Click Extract Fields to select the field(s), or to create an expression.
The order in which you select the fields is the order in which the columns appear in the results.
Record
If you are appending results to an existing Analytics table, the column selection and order must
Fields be identical to the column selection and order in the existing table.
Note
Report Selection Report Selection Order is available only if both the Random selection method
Order and Fields output are selected.
Specifies that the output results are appended (added) to the end of an existing Analytics table.
Note
Leaving Append To Existing File deselected is recommended if you are
uncertain whether the output results and the existing table have an identical
data structure.
Append To Existing For more information about appending and data structure, see "Appending
File output results to an existing table" on page 205.
After you have performed your audit procedures on the set of sampled data you can use Analytics
to:
l project any errors you found to the entire population
l calculate an upper limit on the deviation rate
Even if you found no errors, you still use the evaluation feature to calculate the basic allowance for
sampling risk.
Note
Evaluating errors requires input of some of the values previously generated by
calculating sample size.
Comparison Conclusion
Upper error limit frequency is less than or equal to Upper The prescribed control is operating effectively
Error Limit (%)
Upper error limit frequency is greater than Upper Error The prescribed control is not operating effectively
Limit (%)
Steps
Note
Do not include the thousands separator, or the percentage sign, when you specify
values. These characters prevent the command from running, or cause errors.
Note
The menu option is disabled if a table is not open.
l Sample Size
Note
Enter the actual sample size as drawn, which might differ from the sample
size initially calculated by Analytics.
l Number of Errors
Note
The input values are explained in detail below.
Tip
You can click any linked result value in the display area to drill down to the
associated record or records in the source table.
l Click Name and enter the file name, or select an existing file in the Save or Save File As
Note
ASCII Text File or Unicode Text file (depending on which edition of
Analytics you are using) is the only option for File Type.
5. Click OK.
6. If the overwrite prompt appears, select the appropriate option.
The same confidence level that you entered when you calculated the sample size.
Confidence For more information, see "Calculating sample size for a record sample" on page 1050.
Note
Sample Size is the actual sample size as drawn, which might differ from the
Sample Size sample size initially calculated by Analytics.
Number of Errors The total number of errors, or deviations, that you found in the sample.
The figure below shows an example of input values for evaluating errors in a record sample.
Result
Evaluating the errors you found in a record sample produces the following result:
Upper error limit An adjusted deviation rate that Analytics calculates is not exceeded in the entire data set, for
frequency the confidence level you specified.
(computed upper
deviation rate)
The figure below shows the result of evaluating errors found in a record sample.
Example
You evaluate the errors you found in a record sample and Analytics returns an Upper error
limit frequency of 4.35%. This percentage is less than the Upper Error Limit (%) (tolerable
deviation rate) of 5% that you specified earlier when you calculated the sample size, and
specified a confidence level of 95%.
Based on this information, you can make the following statement:
There is a 95% probability that the actual deviation rate from the prescribed control in the
entire population does not exceed 4.35%.
If the Upper error limit frequency is greater than 5%, as it is in the figure above, the
prescribed control is probably not operating effectively. You need to decide upon further
appropriate steps to meet your audit objective.
Tip
For a hands-on introduction to the end-to-end process of monetary unit sampling in
Analytics, see "Monetary unit sampling tutorial" on page 1070.
How it works
Monetary unit sampling allows you to select and analyze a small subset of the records in an
account, and based on the result estimate the total amount of monetary misstatement in the
account.
You can then compare the estimated misstatement to the misstatement amount that you judge is
material, and make a determination regarding the account.
Monetary unit sampling supports making this sort of statement:
l There is a 95% probability that the misstatement in the account balance does not exceed
$28,702.70, which is less than the tolerable misstatement of $29,000.00. Therefore the
amounts in the account are fairly stated.
The monetary unit sampling process involves the following general steps:
1. Calculate the required sample size
2. Choose a sample selection method:
l Fixed interval
l Cell
l Random
3. Optionally specify one or more of the following options:
"Top stratum cutoff" on page 1093
l
Example
A table contains an "Amount" field with the values shown below. The field has an absolute
value of $11.75, and therefore contains 1,175 monetary units.
If the sampling process selects monetary units 399 and 1,007, records 2 and 5 are included in
the output table. Records 1, 3, and 4 are not included.
Cumulative bal-
ance
Unit selected by
Record number Amount (absolute) Monetary units Analytics
Considerations
Monetary unit sampling is appropriate for use with substantive or misstatement testing. By biasing
larger amounts, monetary unit sampling provides a high level of assurance that all significant
amounts in a population are subject to testing. When testing for misstatement, it is the larger
amounts that present the greatest risk of containing a material error.
If you choose a sampling method that biases large amounts, you may miss a potential problem
related to small transactions. Problems with small transactions, once aggregated, may be material.
The tutorial leaves out optional aspects of monetary unit sampling, and focuses on a single path, so
you can quickly get a basic understanding of how monetary unit sampling in Analytics works.
Tip
For simple definitions of sampling terms, see "A word about terminology" on
page 1025.
The scenario
You are examining an Invoices table with over 4000 records as part of confirming accounts
receivable. You want to contact a sample of invoiced customers to confirm outstanding
amounts in the account, and detect any misstatement.
You will use the customer contacts to confirm:
Note
Most of the amounts in the Invoices table in ACL_Rockwood.acl have a
status of "Paid". For this scenario, assume they have a status of "Outstanding"
and a payment amount of $0.00.
Note
Do not include the thousands separator, or the percentage sign, when you specify
values. These characters prevent the command from running, or cause errors.
Population The absolute value of the Invoice Amount field in the Invoices table.
The total amount of misstatement in the account must exceed $1,392,005.96 (3%) to be
Materiality considered a material misstatement.
Expected Total Errors You expect the total amount of misstatement in the account is $464,001.99 (1%).
If you use one of the interval methods of sample selection, the records selected
correspond to either:
o the monetary unit that occurs every 21,140,918 units
o the monetary unit that is randomly selected from each block of 21,140,918 units
Note
In Analytics, 1 monetary unit = 1 cent
For a detailed explanation, see "How monetary unit sampling selects records" on
Interval page 1068.
Note
The monetary unit sampling tutorial does not use this number, which
provides an alternative method for evaluating misstatement.
Change a value in any of the following fields in the Size dialog box, click Calculate, and
notice how the results change. Change only one value at a time so it is easier to see how the
change affects the results.
l Confidence
l Materiality
l Expected Total Errors
More stringent requirements increase the sample size. More lenient requirements decrease
the sample size.
Reset the values to match the screen above and click OK. Pin the Size tab with the results of
the sample size calculation.
You are using the fixed interval selection method for drawing the sample of records.
With the fixed interval selection method, you specify the initial monetary unit that is
selected, and all subsequent selections are a fixed interval or distance apart.
Fixed Interval For a detailed explanation, see "Fixed interval selection method" on page 1027.
Interval The interval between selected monetary units is $211,409.18, or 21,140,918 units.
The sample of records drawn from the Invoices table is output to a new table called
To Invoices_sample.
Note
The menu option is disabled if a table is not open.
Note
Use a comma between Item amount and Error, but do not use commas in the
amounts. Enter each amount and error on a separate line.
Interval The interval you used when you drew the sample.
The maximum amount of misstatement for the entire account, projected with a 95%
degree of confidence: $1,188,531.07
Put another way: There is a 95% probability that the total amount of misstatement in the
Invoices table does not exceed $1,188,531.07.
Because $1,188,531.07 is less than the $1,392,005.96 you specified for Materiality
when you calculated the sample size, you can conclude that the accounts receivable are
Upper error limit not materially misstated.
(Total) For a detailed explanation, see "What the “Upper Error Limit” tells you" on page 1100.
Rerun the evaluate command with different values in the Errors field to see how the result
changes.
The table below summarizes different results.
6,002.16, 6,002.16 1,392,005.84 In strict terms, the account is not materially misstated.
31,997.46, 18,000.00 However, $1,392,005.84 is very close to the
materiality threshold of $1,392,005.96.
13,225.50, 8,644.34
Note
This example demonstrates the
difference between using Upper error
limit and Maximum Tolerable Taintings
(%) to evaluate misstatement.
If you use the more stringent Maximum
Tolerable Taintings (%) method, the
account is materially misstated.
The sum of the tainting percentages in
the "Misstatements" column to the left is
221.61% (100% + 56.25% + 65.36%),
which is slightly greater than the
Maximum Tolerable Taintings (%) of
219.48% reported when you calculated
sample size.
Before sampling a set of data, you must calculate the statistically appropriate sample size, and other
values required by the subsequent sample and evaluate operations.
The Calculate Sample Size feature in Analytics calculates the required values for you based on
input values you provide.
Caution
In a production environment, do not manipulate input values solely to achieve a
smaller sample size. Input values should be based on your professional judgment
about what is most appropriate for the data being sampled and the audit objective.
Increasing this input value: Decreases sample size Increases sample size
Confidence
Population
Increasing this input value: Decreases sample size Increases sample size
Materiality
Steps
Note
Do not include the thousands separator, or the percentage sign, when you specify
values. These characters prevent the command from running, or cause errors.
Note
The menu option is disabled if a table is not open.
l Population
l Materiality
Note
The input values are explained in detail below.
Tip
Clicking Calculate instead of OK allows you to experiment with different input
values before outputting the results.
Note
The output results are explained in detail below.
Tip
You can click any linked result value in the display area to drill down to the
associated record or records in the source table.
l Click Name and enter the file name, or select an existing file in the Save or Save File As
Note
ASCII Text File or Unicode Text file (depending on which edition of
Analytics you are using) is the only option for File Type.
6. Click OK.
7. If the overwrite prompt appears, select the appropriate option.
Your desired confidence level that the resulting sample is representative of the entire
population.
For example, entering 95 means that you want to be confident that 95% of the time the sample
will in fact be representative. Confidence is the complement of “sampling risk”. A 95%
Confidence confidence level is the same as a 5% sampling risk.
Note
To get the absolute value, profile or generate statistics on the sample field.
The maximum total amount of misstatement that can occur in the sample field without being
considered a material misstatement.
For example, entering 29000 means that the total amount of misstatement must be greater
Materiality than $29,000 to be considered a material misstatement.
The total amount of misstatement that you expect the sample field to contain.
For example, entering 5800 means that you expect the total amount of misstatement to be
$5,800.
Note
The Expected Total Errors you specify must be less than Materiality. If the
difference between them is too small, the error message Error rate too high
for calculation appears.
Expected Total In audit sampling terms, the degree of sampling precision represented by the
Errors difference is too small to be calculated for the confidence level you specified.
Interval The interval value – required for the fixed interval and the cell selection methods.
The maximum accumulated tainting percentages that can occur in misstated amounts in the
resulting sample without exceeding the Materiality.
Note
The Maximum Tolerable Taintings (%) value reported by Analytics can be
greater than 100%.
Maximum Tolerable
Taintings (%) For more information, see "Maximum Tolerable Taintings (%)" on page 1084.
Maximum Tolerable Taintings (%) provides one way of evaluating misstatement in a population.
If you use this method, you know in advance the threshold value reported by Analytics, before you
begin audit procedures on the sampled data. If cumulative errors you observe in the course of
performing the procedures exceed the threshold value, you know at that point that the sample field
is materially misstated.
Example
In an accounts receivable table you discover that a book value of $1000 should actually be
$930. In a misstated amount, tainting is the percentage of the book value that the
misstatement represents.
After performing your substantive procedures on sampled data you can sum all the individual
tainting percentages from any misstated amounts. If the sum of the tainting percentages is less than
or equal to the Maximum Tolerable Taintings (%) reported by Analytics, you can consider that the
amounts in the sample field as a whole are not materially misstated, for your specified confidence
level.
Example
You discover three misstated amounts in an accounts receivable table, which results in the
following taintings, and total tainting percentage:
Let's assume the Maximum Tolerable Taintings (%) reported by Analytics when you
calculated the sample size for the table was 92.30%. Because the total tainting percentage of
49% is less than 92.30%, you can conclude that the amounts in the sample field as a whole
are not materially misstated, for your specified confidence level.
Note
Evaluation using Maximum Tolerable Taintings (%) is slightly more stringent than
the evaluation feature in Analytics.
If the sum of the tainting percentages marginally exceeds the Maximum Tolerable
Taintings (%) value you should use the evaluation feature to confirm that the sample
field is in fact materially misstated.
For more information, see "Evaluating errors in a monetary unit sample" on
page 1096.
For typical data sets of a thousand or more records, the Poisson and the binomial distributions
generate nearly identical sample sizes. For populations of under a thousand records, sample sizes
determined with the Poisson distribution tend to be slightly larger and therefore more conservative
than sizes determined with the binomial distribution. The binomial distribution adjusts the sample
size downward for small populations but the Poisson distribution does not. With very small
populations, the sample size generated by the Poisson distribution can actually exceed the
population size.
When calculating sample sizes in Analytics, recognize that for record sampling of small data sets,
the sample size may be larger than you need. This larger sample size does not present an obstacle
to analysis because it is common practice to manually oversample small populations.
You can create a new table that contains a representative sample of the monetary data in the active
table.
Monetary unit sampling is appropriate if you are interested in the total amount of monetary
misstatement in a file.
Note
This procedure does not include filtering (IF statements) or scope parameters
because applying these options compromises the validity of a sample.
Steps
Note
Detailed information appears after the steps. See "Sample dialog box options" on
the facing page.
Do not include the thousands separator, or the percentage sign, when you specify
values. These characters prevent the command from running, or cause errors.
1. In the Navigator, open the table you want to draw a sample from.
2. Optional. If you intend to use the Random selection method, profile or generate statistics on
the sample field.
3. Select Sampling > Record/Monetary Unit Sampling > Sample.
4. On the Main tab, select MUS.
5. Select the field to sample from the Sample On drop-down list.
6. In the Sample Parameters panel, specify a sample selection method:
l Fixed Interval
l Cell
l Random
Note
Do not use the random selection method with monetary unit sampling if you
intend to use Analytics to evaluate any misstatement detected in the
resulting sample.
Evaluating monetary unit samples requires that you use the fixed interval or
cell selection methods.
7. Enter the sample parameters for the selection method you chose:
Selection method Sample parameters
Cell o Interval
o Seed (optional)
o Cutoff (optional)
o Algorithm – leave Mersenne Twister selected
Random o Size
o Seed (optional)
o Population
o Algorithm – leave Mersenne Twister selected
Note
Sample parameters are explained in detail below.
8. In the To text box, specify the name of the Analytics table that will contain the output results.
9. On the More tab, select one of the following:
o Record –The entire record is included in the output table.
o Fields – Only the selected fields are included in the output table.
10. If you chose Fields, select the field(s) to include in the output table from the Extract Fields list.
11. Optional. Select one or more of the following options:
l Subsample
l No Repeats
Note
The options are explained below.
Subsample is available only if Fields output is selected.
Report Selection Order is available only if both the Random selection method
and Fields output are selected.
Main tab
Options – Sample
dialog box Description
Specifies that the fixed interval method is used for sample selection.
Samples are selected based on an interval value and a start number that you specify. For more
information, see "Fixed interval selection method" on page 1027.
If you selected Fixed Interval enter the following values:
o Interval (required) – the interval value that was generated by calculating the sample size
Note
If you have not already calculated the sample size, you can click Size to
open the Size dialog box. For more information, see "Calculating sample
size for a monetary unit sample" on page 1079.
o Start (optional) – a start number that is greater than zero and less than the interval value
Tip
Enter a start number of ‘0’, or leave the start number blank, if you want
Analytics to randomly select a start number.
Options – Sample
dialog box Description
Note
If you have not already calculated the sample size, you can click Size to
open the Size dialog box. For more information, see "Calculating sample
size for a monetary unit sample" on page 1079.
Tip
Enter a seed value of ‘0’, or leave the seed blank, if you want Analytics to
randomly select a seed value.
Note
If you have not already calculated the sample size, you can click Size to
open the Size dialog box. For more information, see "Calculating sample
size for a monetary unit sample" on page 1079.
Tip
Enter a seed value of ‘0’, or leave the seed blank, if you want Analytics to
randomly select a seed value.
o Population (required) – the absolute value of the sample field, which is the population from
which the sample will be selected
Tip
This field is prefilled with the correct value if you previously profiled or
Random generated statistics on the sample field.
Options – Sample
dialog box Description
Caution
Do not create an IF statement or filter records in the course of sampling. Doing
so compromises the validity of the sample.
If For more information, see "Conditional sampling" on page 1160.
Note
Analytics table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
To number.
If you are connected to a server table, specifies where to save the output table.
o Local selected – saves the output table to the same location as the Analytics project, or to a
specified path, or location you navigate to.
Local o Local deselected – saves the output table to the Prefix folder on AX Server.
Specifies whether the Analytics table containing the output results opens automatically upon
Use output table completion of the operation.
More tab
Options – Sample
dialog box Description
Caution
Do not limit which records are processed in the course of sampling. Doing so
compromises the validity of the sample.
Scope panel For more information, see "Conditional sampling" on page 1160.
Record Specifies whether the output table includes the entire record, or selected fields.
Fields If you choose Fields, do one of the following:
Options – Sample
dialog box Description
Note
Subsample is available only if Fields output is selected.
Report Selection Order is available only if both the Random selection method
and Fields output are selected.
Subsample
With No Repeats, selected records become ineligible for subsequent
Report Selection selection, which can reduce the size of the sample. You should consider
Order oversampling the data set to compensate.
No Repeats For more information, see "Sample selection without repeats" on page 1094.
Specifies that the output results are appended (added) to the end of an existing Analytics table.
Note
Leaving Append To Existing File deselected is recommended if you are
uncertain whether the output results and the existing table have an identical
data structure.
Append To Existing For more information about appending and data structure, see "Appending
File output results to an existing table" on page 205.
Top stratum cutoff is an additional method that Analytics uses to bias monetary unit sampling toward
larger amounts. By default, sample field amounts greater than or equal to the interval value are
considered top stratum amounts and are automatically included in the sample.
Negative as well as positive amounts are eligible for automatic inclusion because it is the absolute
value of the amount that is considered.
Note that the greater the amount of automatic selection, the larger the sample size becomes.
You can optionally specify a top stratum cutoff value that is higher or lower than the interval value:
Decreases the probability that larger amounts will be automatically included in the sample.
Top stratum cutoff
higher than the If you specify a cutoff value larger than the largest positive or negative amount in the sample
interval value field, no amounts are automatically selected.
Increases the probability that larger amounts will be automatically included in the sample.
If no amounts are automatically selected using the default top stratum cutoff, you can adjust the
cutoff value downward in order to automatically select some of the larger amounts in the
sample field.
Caution
Top stratum cutoff If you specify a cutoff value that is too small in relation to the sample field
lower than the inter- amounts, too many amounts are automatically selected, which defeats the
val value purpose of sampling.
Example
The log displays that 8 of 93 selected records are top stratum, accounting for $33,153.55 of
the absolute value of the numeric sample field.
Subsampling
Note
Subsampling is available only for monetary unit sampling using field output.
In some cases, each amount in a sample field represents a total of several separate transactions. If
you want to perform audit procedures on only one transaction from each sampled total amount, you
can use subsampling to randomly select the individual transactions.
When you select Subsample in the Sample dialog box, the resulting sample includes the
SUBSAMPLE field. This field contains amounts that represent the difference between the total
amount and the actual monetary unit used to select the total amount.
Example
$12,455 (total amount)
To complete the process, you would select the transaction containing the 7,835th dollar in the
cumulative balance of transactions for that particular total amount.
Note
Any top stratum cutoff amounts in the sample display “0.00” in the SUBSAMPLE
field because they are automatically included in the sample and no monetary unit
was involved in their selection.
records may be smaller than the sample size calculated by Analytics. To compensate, you can
oversample by using one of the following methods to increase the sample size:
l Fixed interval or cell selection methods:
l decrease the size of the interval
l adjust the top stratum cutoff value to automatically select a greater number of records
l Random selection method – increase the specified sample size
After you have performed your audit procedures on the set of sampled data you can use Analytics
to:
l project any misstatements you found to the entire account
l calculate an upper limit on misstatement amount
Even if you found no errors, you still use the evaluation feature to calculate the basic allowance for
sampling risk.
Note
Evaluating errors requires input of some of the values previously generated by
calculating sample size.
To use the evaluation feature with the results of a monetary unit sample, you must
have drawn the sample using either the fixed interval or the cell selection methods.
Comparison Conclusion
Upper Error Limit is less than or equal to Materiality The amounts in the sample field as a whole are fairly
stated
Upper Error Limit is greater than Materiality The amounts in the sample field as a whole are materially
misstated
Steps
Note
Do not include the thousands separator, or the percentage sign, when you specify
values. These characters prevent the command from running, or cause errors.
Note
The menu option is disabled if a table is not open.
l Interval
l Errors
Note
The input values are explained in detail below.
Tip
You can click any linked result value in the display area to drill down to the
associated record or records in the source table.
l Click Name and enter the file name, or select an existing file in the Save or Save File As
Note
ASCII Text File or Unicode Text file (depending on which edition of
Analytics you are using) is the only option for File Type.
5. Click OK.
6. If the overwrite prompt appears, select the appropriate option.
The same confidence level that you entered when you calculated the sample size.
Confidence For more information, see "Calculating sample size for a monetary unit sample" on page 1079.
The interval value that you used when you drew the sample.
Note
The interval value that you used might differ from the interval value initially
Interval calculated by Analytics.
Tip
If the list of misstatement errors is long, it may be easier to copy and paste the
list from another application.
Example
If an amount has a book value of $1,000 and an audit value of $930, enter 1000,70.
If an amount has a book value of $1,250 and an audit value of $1,450, enter 1250,-
200.
Enter each error on a separate line:
Errors 1000,70
(Item amount, 1250,-200
Error)
The figure below shows an example of input values for evaluating errors in a monetary unit sample.
Results
Evaluating the errors you found in a monetary unit sample produces the following results:
Item The list that you entered of sample amounts with misstatement error.
Basic Precision The basic allowance for sampling risk (18,850.00 in the figure below).
The misstatement amount for each error projected to the interval containing the sample
amount.
Most Likely Error amounts that are not top stratum are listed in descending order. Top stratum
Most Likely Error misstatement amounts are listed between projected overstatements and projected understate-
ments.
(projected
misstatement) The projection calculation is not performed on top stratum misstatement amounts.
The Most Likely Error amount, and the Upper Error Limit amount, for the entire population or
Totals account balance.
The figure below shows the results of evaluating errors found in a monetary unit sample.
Example
You evaluate the errors you found in a monetary unit sample and Analytics returns an Upper
Error Limit of $28,702.70. This amount is less than the Materiality (tolerable misstatement)
of $29,000 that you specified earlier when you calculated the sample size, and specified a
confidence level of 95%.
Based on this information, you can make the following statement:
There is a 95% probability that the actual misstatement in the account balance does not
exceed $28,702.70.
If the Upper Error Limit is greater than $29,000, the account balance is probably materially
misstated. You need to decide upon further appropriate steps to meet your audit objective.
Amount Explanation
In the absence of any misstatement errors in the sampled amounts, a basic allowance for
sampling risk calculated by Analytics using a statistical formula.
A basic allowance for sampling risk is required because even if you found no errors in the
Basic precision sampled amounts, you cannot be sure no errors exist in the population as a whole.
Tip
For a hands-on introduction to the end-to-end process of classical variables
sampling in Analytics, see "Classical variables sampling tutorial" on page 1111.
Note
In addition to financial data, you can use classical variables sampling with any
numeric data that has a variable characteristic – for example, quantity, units of time,
or other units of measurement.
How it works
Classical variables sampling allows you to select and analyze a small subset of the records in an
account. Based on the results of analyzing the subset, you can estimate the total audited value of
the account, and the total amount of monetary misstatement.
The two estimates are computed as ranges:
l The point estimate is the midpoint of a range.
l The upper limit and the lower limit are the two end points of a range.
You can also choose to compute a one-sided estimate or range, with a point estimate and
only an upper limit, or only a lower limit.
You compare the estimated range to the book value of the account, or to the misstatement amount
that you judge is material, and make a determination regarding the account.
Classical variables sampling supports making this sort of statement:
l There is a 95% probability that the true audited value of the account is between
45,577,123.95 and 46,929,384.17, a range that contains the account book value of
46,400,198.71. Therefore the amounts in the account are fairly stated.
l There is a 95% probability that the misstatement in the account balance is between –
813,074.76 and 539,185.46, which does not exceed the monetary precision of ±928,003.97.
Therefore the amounts in the account are fairly stated.
Caution
Update prefilled values only if you have the statistical knowledge to understand the
effect of the change.
Stratification
Classical variables sampling gives you the option of numerically stratifying the records in a
population before drawing a sample.
The benefit of stratification is that it often dramatically reduces the required sample size while still
maintaining statistical validity. A reduced sample size means less data analysis work is required to
reach your goal.
How it works
Show me more
Stratification works by dividing a population into a number of subgroups, or levels, called strata.
Ideally, the values in each stratum are relatively homogenous.
A statistical algorithm (the Neyman method) sets the boundaries between the strata. The algorithm
positions the boundaries to minimize the dispersion of values within each stratum, which decreases
the effect of population variance. Reducing the variance, or 'spread', reduces the required sample
size. By design, the range of each stratum is not uniform.
The required number of samples is then calculated on a per-stratum basis, and totaled, rather than
on the basis of the entire, unstratified population. For the same set of data, the stratified approach
typically results in a much smaller sample size than the unstratified approach.
Note
Pre-stratification cells and the cells used in the cell method of sample selection are
not the same thing.
The portion of the population not captured by a certainty stratum is sampled using the random
selection method.
Note
Depending on the nature of the data, the overall sample size may increase as you
lower the cutoff value for the top certainty stratum, or raise the cutoff value for the
bottom certainty stratum.
You should avoid setting a cutoff value too generously. Consult a sampling specialist
if you are unsure where to set a cutoff value.
Example
In a table with 300 records, divided into 3 strata, Analytics could select the following record
numbers:
o 9 o 104 o 211
o 13 o 119 o 229
o 40 o 132 o 236
o 52 o 144 o 248
o 78 o 153 o 278
o 91 o 186 o 295
o 99 o 296
In an unstratified table with 300 records Analytics could select the record numbers displayed
below. You can see that the selected record numbers are less evenly distributed.
Note
The record numbers below are grouped in three columns for ease of
comparison, but the columns do not represent strata.
o 25 o 143 o 241
o 64 o 175 o 257
o 79 o 179 o 259
o 104 o 184 o 281
o 122 o 191 o 289
o 127 o 201 o 299
o 138 o 234
The tutorial leaves out some optional aspects of classical variables sampling, and focuses on a
single path, so you can quickly get a basic understanding of how classical variables sampling in
Analytics works.
Tip
For simple definitions of sampling terms, see "A word about terminology" on
page 1025.
The scenario
You are examining an Invoices table with over 4000 records as part of confirming accounts
receivable. You want to contact a sample of invoiced customers to confirm outstanding
amounts in the account, and detect any misstatement.
You will use the customer contacts to confirm:
Note
Most of the amounts in the Invoices table in ACL_Rockwood.acl have a
status of "Paid". For this scenario, assume they have a status of "Outstanding"
and a payment amount of $0.00.
Note
Do not include the thousands separator, or the percentage sign, when you specify
values. These characters prevent the command from running, or cause errors.
You want to divide the population into 5 strata, or subgroups, as a way of significantly
Number of Strata reducing the sample size.
Optional.
Minimum Strata Sample Leaving the default value of zero (0) means that you are not enforcing a minimum
Size number of sampled records in each stratum.
Leaving the default value of zero (0) means that you are not enforcing a minimum total
Size sample size.
You want to sample and test 100% of the book value items greater than or equal to
$35,000.
Top certainty stratum
cutoff Every item in the top certainty stratum will be included in the sample output table.
Optional.
Bottom certainty stratum
cutoff Leaving the field empty means that you are not specifying a bottom certainty stratum.
You want a 95% degree of confidence that the sample you are going to draw is represent-
ative of the entire population.
Put another way: if you drew the sample 100 times, it would be representative 95 times,
Confidence Level (%) and unrepresentative only 5 times.
Number of Expected You expect the count of misstatement errors in the sample to be at least 6.
Errors
o Sample Items – the total required sample size, broken down by stratum. Includes all
items in the top certainty stratum.
Several descriptive statistics provide insight into the statistical properties of the
population strata:
o Standard Error
o Variance
o Standard Deviation
Descriptive Statistics o Mean
The CVS Prepare results provide a prefilled version of the command that is used at the
CVS Sample stage of the classical variables sampling process (the next stage).
The values used to prefill the command are not saved when you close Analytics. You can
manually save the prefilled command to preserve the values and avoid the work of
regenerating them later.
In a production environment, you may run through the CVS Prepare stage multiple times
Associated CVSSAMPLE as you optimize stratification of the population and sample size. With each iteration of
Command CVS Prepare you can manually save the associated CVSSAMPLE command.
Show me more
Save the CVSSAMPLE command in case you need to recover the values it contains.
1. At the bottom of the CVS Prepare display area, click the CVSSAMPLE link to load the
command into the command line.
2. Copy the entire command from the command line and save it in an Analytics script with the
name CVS_Sample.
Note
Most of the values are prefilled from the output results of the CVS Prepare
stage.
If a number of the prefilled values are missing, see "Use the CVSSAMPLE
command (optional)" on the facing page.
Make sure you specify the Seed value exactly as shown below: 12345
The seed value is used to initialize the random selection of records for the
sample. If you use a different seed value, a different group of records is
selected, and none of the sample amounts will match in the examples that
follow.
4. Optional. Pin the tab with the summary results of the sampling process.
If you pin the output results as you proceed through the classical variables sampling process,
you can review the entire process once you have completed it.
Show me more
If a number of the prefilled values are missing from the CVS Sample dialog box, you may have
closed Analytics between the CVS Prepare and CVS Sample stages and lost the values.
Instead of using the CVS Sample dialog box to draw the sample of records, you can use the
CVSSAMPLE command you saved in a script.
1. Open the CVS_Sample script and make these updates to the CVSSAMPLE command:
TO Invoices_sample
Tip
If you didn't save the CVSSAMPLE command, you can perform the CVS Prepare stage
again to regenerate the values required by the CVS Sample stage. You can open the
Invoices table and quickly rerun the CVSPREPARE command from the log.
Optional.
Specifying a seed value is optional, but to ensure that the records included in the sample
Seed match the tutorial sample you need to specify an identical seed value.
The sample of records drawn from the Invoices table is output to a new table called
To Invoices_sample.
Analytics used the Random selection method to draw the specified number of records
from each stratum.
Selection Method All records in the top certainty stratum are automatically selected.
The same breakdown that appears in the output of the CVS Prepare stage.
Now that actual sample records have been drawn, Analytics can calculate the Sample
Value for each stratum in the sample, and for the sample as a whole.
Strata Breakdown Note the difference between the Sample Value and the Population Value.
Associated The CVS Sample results provide a prefilled version of the command that is used at the
CVSEVALUATE Com- CVS Evaluate stage of the classical variables sampling process (the final stage).
The values used to prefill the command are not saved when you close Analytics. You can
manually save the prefilled command to preserve the values and avoid the work of
regenerating them later.
In a production environment, several weeks could elapse between the CVS Sample and
the CVS Evaluate stages during which you are performing audit procedures on the
mand sample data.
Show me more
Save the CVSEVALUATE command in case you need to recover the values it contains.
1. At the bottom of the CVS Sample display area, click the CVSEVALUATE link to load the
command into the command line.
2. Copy the entire command from the command line and save it in an Analytics script with the
name CVS_Evaluate.
If the command line is not visible, select Window > Command Line.
Tip
If you want to confirm that the AUDIT_VALUE field was created, type display
in the command line and press Enter to see a list of the fields in the table.
4. Select each of these fields and use the Up arrow to move them to the top of the Selected
Fields list:
l SAMPLE_RECORD_NUMBER
l STRATUM
l invoice_amount
l AUDIT_VALUE
Note
Do not close Analytics.
Note
To make it easier to update the Excel file, and to demonstrate how the subsequent
evaluation works:
l the updates are all in the first few records in the file
l understatements, and a mix of understatements and overstatements, are
each grouped in a particular stratum
In a production environment, the likelihood is that overstatements and understate-
ments would be scattered across strata, and throughout the file.
Tip
Copy and paste the entire table below to an blank Excel worksheet, and then copy
the audit values to the AUDIT_VALUE column in the Invoices_sample worksheet.
As an alternative, you can download a text file with a column of the audit values.
1 3 9,394.55 9,494.55
2 5 27,033.66 17,033.66
3 4 22,617.90 22,917.90
4 2 4,576.24 4,575.83
5 1 4,039.67 0.00
6 3 13,753.12 31,753.12
7 4 23,633.12 23,433.12
8 5 33,663.50 33,660.00
9 2 7,136.79 6,136.79
10 2 4,495.13 0.00
11 1 1,575.87 1,075.87
12 0 44,379.67 34,379.67
14 5 27,204.08 27,200.00
15 4 20,156.50 20,000.00
17 3 11,879.05 11,889.05
18 1 994.98 964.98
l Start On Line is 1
6. In the Excel Import page, verify that the invoice_amount field and the AUDIT_VALUE field
have a Type of Numeric, and click Next.
Select the field headers to check their assigned Type. If necessary, update the Type to
Numeric, and specify 2 in the Decimal field.
7. In the Save Data File As dialog box, type Invoices_sample_audited in the File name field,
and click Save.
8. In the Final page, click Finish.
9. In the dialog box for specifying a table layout name, click OK.
A new Analytics table is created with the data from the imported Excel file.
Note
The menu option is disabled if a table is not open.
3. Specify the input values exactly as they appear in the screen below and click OK to project the
sample results to the entire population.
Note
Most of the values are prefilled from the output results of the CVS Prepare and
CVS Sample stages.
If a number of the prefilled values are missing, see "Use the CVSEVALUATE
command (optional)" on the facing page.
Show me more
If a number of the prefilled values are missing from the CVS Evaluate dialog box, you may have
closed Analytics between the CVS Sample and the CVS Evaluate stages and lost the values.
Instead of using the CVS Evaluate dialog box to evaluate results, you can use the CVSEVALUATE
command you saved in a script.
1. Open the CVS_Evaluate script and make these updates to the CVSEVALUATE command:
Tip
If you didn't save the CVSEVALUATE command, you can perform the CVS Prepare and
CVS Sample stages again to regenerate the values required by the CVS Evaluate
stage. You can open the Invoices table and quickly rerun the CVSPREPARE and
CVSSAMPLE commands from the log.
Confidence Level (%) The input values are prefilled based on values that you provided, or that
Analytics calculated, during the CVS Prepare stage.
Number of Expected
Errors
Book Value
Precision Limits
Strata Boundaries
Population (Count,
Value)
Top certainty stratum
cutoff (Cutoff, Count,
Value)
Point Estimate (46,253,254.06) – a statistical projection of the most likely audited value
of the entire Invoices table
Precision (676,130.11) – a statistical projection of the amount by which the Point
Estimate could vary
o The statistical projections are based on the audit values in the Invoices_sample_
audited table.
o The Point Estimate is the midpoint of an estimated range.
Point Estimate o The Point Estimate plus or minus the Precision forms the upper and lower limits of
Precision the range.
Before sampling a set of data, you must stratify the table containing the records, and calculate a
statistically valid sample size for each stratum.
The CVS Prepare feature in Analytics calculates the required values for you based on input values
you provide.
You need to choose an option now, during the preparation stage, because the option you choose is
one of the requirements for calculating the sample size.
Both A two-sided range with a point estimate and an upper and lower limit
Show me more
A two-sided range
If you are examining an account that as a whole could be either overstated or understated then
typically you are interested in whether misstatement in either direction exceeds the amount of
misstatement that you judge is tolerable or acceptable.
You need a two-sided range or estimate:
l The lower limit is an estimate of the maximum amount of overstatement that could exist in the
account for the confidence level you specify
l The upper limit is an estimate of the maximum amount of understatement that could exist in
the account for the confidence level you specify
A one-sided range
If you are examining an account that as a whole is likely to be overstated, or likely to be understated,
you may only be interested in whether misstatement in one direction exceeds the amount of
misstatement that you judge is tolerable or acceptable.
You can use a one-sided range or estimate:
l A range with only a lower limit is an estimate of the maximum amount of overstatement that
could exist in the account for the confidence level you specify
l A range with only an upper limit is an estimate of the maximum amount of understatement that
could exist in the account for the confidence level you specify
Caution
In a production environment, do not manipulate input values solely to achieve a
smaller sample size. Input values should be based on your professional judgment
about what is most appropriate for the data being sampled and the audit objective.
threshold applies
Note
For negative cutoff values,
Bottom certainty stratum "higher" means closer to zero
cutoff (0).
Monetary Precision
Precision Limits Both requires a larger sample size than Upper or Lower
Steps
Note
Do not include the thousands separator, or the percentage sign, when you specify
values. These characters prevent the command from running, or cause errors.
1. Open the table containing the book values that you intend to sample.
2. Select Sampling > Classical Variables Sampling (CVS) > Prepare.
Note
The menu option is disabled if a table is not open.
3. On the Main tab, select the book value field from the Book Value drop-down list.
l Upper
l Lower
Note
The options are explained in detail below.
5. Enter the input values to use for preparing the sample design:
l Number of Strata
l Number of Cells
l Monetary Precision
Note
The input values are explained in detail below.
6. Optional. If there are records in the current view that you want to exclude from processing,
enter a condition in the If text box, or click If to create an IF statement using the Expression
Builder.
Caution
If you specify a conditional expression, an identical conditional expression
must be used during both the calculation of the sample size, and the drawing
of the sample.
If you use a condition at one stage and not the other, or if the two conditions
are not identical, the sampling results will probably not be statistically valid.
Tip
You can click any linked result value in the display area to drill down to the
associated record or records in the source table.
l Click Name and enter the file name, or select an existing file in the Save or Save File As
Note
ASCII Text File or Unicode Text file (depending on which edition of
Analytics you are using) is the only option for File Type.
8. Click OK.
The CVS preparation output results are displayed on screen, or saved to a file.
Included in the display is a prefilled version of the CVSSAMPLE command.
Note
The output results are explained in detail below.
Note
If you use the CVSSAMPLE command, you need to add the name of the output
table to the command, and a seed value (optional).
For more information, see "CVSSAMPLE command" on page 1720.
Input values –
CVS Prepare dialog
box Description
Book Value The field that contains the book values you are auditing.
Input values –
CVS Prepare dialog
box Description
Caution
Select Both if you are not sure which option to select. For more information see
"How precision limits work" on page 1132.
The number of strata (subgroups) to use for numerically stratifying the data set.
The minimum number of strata is 1, and the maximum is 256.
If you specify a certainty stratum, it is not included in the Number of Strata.
For more information, see "Stratification" on page 1105.
Note
Number of Strata The Number of Strata cannot exceed 50% of the Number of Cells.
Note
Number of Cells The Number of Cells must be at least twice (2 x) the Number of Strata.
Minimum Strata The minimum number of records to sample from each stratum.
Sample Size
Minimum Total The minimum number of records to sample from the entire data set.
Sample Size
Top certainty greater than (>) the maximum amount in the Book Value field
stratum cutoff
Input values –
CVS Prepare dialog
box Description
less than (<) the minimum amount in the Book Value field
Bottom certainty
stratum cutoff For more information, see "The certainty strata" on page 1107.
Your desired confidence level that the resulting sample is representative of the entire
population.
For example, entering 95 means that you want to be confident that 95% of the time the sample
will in fact be representative.
Confidence is the complement of “sampling risk”. A 95% confidence level is the same as a 5%
sampling risk.
o If the Precision Limit is Upper or Lower, the minimum confidence level is 55%, and the
maximum is 99.5%.
Confidence Level o If the Precision Limit is Both, the minimum confidence level is 10%, and the maximum is
(%) 99.5%.
The monetary amount that is the difference between the tolerable misstatement and the
expected misstatement in the account.
For example, if the tolerable misstatement is $29,000, and the expected misstatement is
$5,800, enter 23200 (a difference of $23,200).
The monetary precision establishes the range of acceptability for an account to be considered
Monetary Precision fairly stated.
Output results
Example screen from classical variables sampling tutorial
Output results –
CVS Prepare Description
The upper boundaries of each stratum, and the bottom and top certainty stratum cutoff values.
Book values are assigned to a stratum if they are:
o less than or equal to the upper boundary
o greater than the boundary immediately below
Book values are assigned to the bottom certainty stratum if they are less than or equal to the
Strata Boundaries cutoff value.
Output results –
CVS Prepare Description
Book values are assigned to the top certainty stratum if they are greater than or equal to the
cutoff value.
Population Items The count of the records in the table, broken down by stratum, including the certainty strata.
Percent of Count The percentage of the record count contained in each stratum, including the certainty strata.
Percent of Amount The percentage of the total book value contained in each stratum, including the certainty strata.
Population Value The total book value of the table, broken down by stratum, including the certainty strata.
The total required sample size, broken down by stratum. Includes all items in the certainty
Sample Items strata.
Associated The command for performing the CVS Sample stage, prefilled with values from the
CVSSAMPLE com- CVS Prepare stage.
mand
You can create a new table that contains a representative sample of the monetary data in the active
table.
Classical variables sampling is appropriate if you are interested in either:
l the total audited value of a file
l the total amount of monetary misstatement in a file
Because Analytics is a read-only application, after you have drawn the sample of records you need
to export the sample table to an application that allows data entry, such as Excel, so that you can
add audit values.
1. Open the table containing the book values that you intend to sample.
2. Select Sampling > Classical Variables Sampling (CVS) > Sample.
Note
The menu option is disabled if a table is not open.
The CVS Sample dialog box opens. If you are using the output results of the CVS Prepare
stage as input for the sampling stage, most of the fields are prefilled with the required values.
If a number of the prefilled values are missing, you can:
l rerun the CVSPREPARE command from the log to regenerate the values
l use the CVSSAMPLE command generated during the CVS Prepare stage, if you saved it
Note
If you use the saved CVSSAMPLE command, you need to add the name of
the output table to the command, and a seed value (optional).
For more information, see "CVSSAMPLE command" on page 1720.
3. If you are not using prefilled values, or you want to adjust one or more values, enter or update
the required values:
l Book Value
l Number of Strata
l Strata Boundaries
l Sample Size
Note
The input values are explained in detail below.
Caution
Normally you should not change any of the prefilled values. Changing prefilled
values can negate the statistical validity of the sampling process.
Note
An If condition specified during the CVS Prepare stage is automatically
propagated to the CVS Sample stage.
If you use a conditional expression, an identical expression must be used
during both stages to ensure that the sampling results are statistically valid.
6. In the To text box, specify the name of the Analytics table that will contain the output results.
Tip
Use the book value table name and add the suffix _sample.
Note
Analytics table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
number.
7. Click OK.
The random sample of records is drawn from the book value table and saved to the output
table you specified.
A summary of the sample process and output results is displayed on screen.
Included in the display is a prefilled version of the CVSEVALUATE command.
Note
The output results are explained in detail below.
Note
If you use the CVSEVALUATE command, you need to update the name of the
audit value field, and possibly the evaluation type.
For more information, see "CVSEVALUATE command" on page 1711.
Input values –
CVS Sample dialog
box Description
Book Value The field that contains the book values you are auditing.
The number of strata (subgroups) to use for numerically stratifying the data set.
Number of Strata If you specify a certainty stratum, it is not included in the Number of Strata.
Input values –
CVS Sample dialog
box Description
Amounts in the Book Value field greater than or equal to the cutoff value are automatically
stratum cutoff selected and included in the sample.
Strata Boundaries The boundary values to use for stratifying the data set.
Population (count, The number of records in each stratum, and the total value for each stratum.
values)
Tip
Seed Leave the seed blank if you want Analytics to randomly select a seed value.
Output results
Example screen from classical variables sampling tutorial
Output results –
CVS Sample Description
The seed value used to initialize the Analytics random number generator.
Seed The seed value was either specified by you, or randomly selected by Analytics.
Book Value Field The book value field that you specified as an input.
The upper boundaries of each stratum, and the bottom and top certainty stratum cutoff values.
Strata Boundaries Book values are assigned to a stratum if they are:
Output results –
CVS Sample Description
The count of the records in the source table, broken down by stratum, and including the
Population Items certainty strata.
The total book value of the source table, broken down by stratum, and including the certainty
Population Value strata.
The total number of records drawn in the sample, broken down by stratum.
Sample Items All records in the certainty strata are automatically drawn and included in the output table.
The total value of the records drawn in the sample, broken down by stratum, and including the
Sample Value value of the certainty strata records.
Associated The command for performing the CVS Evaluate stage, prefilled with values from the
CVSEVALUATE CVS Prepare and CVS Sample stages.
Command
System-generated fields
Analytics automatically generates four fields and adds them to the sample output table. For each
record included in the sample, the fields contain the following descriptive information:
l Stratum – the number of the stratum to which the record is allocated
l Original record number – the original record number in the source data table
l Selection order – on a per-stratum basis, the order in which the record was randomly selected
l Sample record number – the record number in the sample output table
If the command line is not visible, select Window > Command Line.
4. Replace book_value_field with the actual name of the field in your table that contains the
book values.
For example:
Note
Make sure to use the physical name of the field, not the display name, if the
two names are different.
Tip
If you want to confirm that the AUDIT_VALUE field was created, enter display
in the command line and press Enter to see a list of the fields in the table.
After you have performed your audit procedures on a set of sampled data you can use Analytics to:
l project the sample audit value to the entire account
l project any misstatements you found to the entire account
l calculate upper and lower limits on estimated total audit value, and estimated total
misstatement amount
Even if you found no errors, you still use the evaluation feature to calculate the basic allowance for
sampling risk. In this situation, you must use the mean-per-unit estimation type.
Guidelines
The guidelines below help you select an estimation type.
Tip
If you want to compare the results produced by different estimation types, you can
select All in the Estimation Type drop-down list. Selecting All includes all estimation
types in the evaluation output.
Show me more
Presence of mis- Size of mis- Comparison of
Estimation type statements statements Sign of book values strata ratios
book value is
relatively consistent
between strata.
Note
The menu option is disabled if a table is not open.
The CVS Evaluate dialog box opens. If you are using the output results of the CVS Prepare
and the CVS Sample stages as input for the evaluation stage, most of the fields are prefilled
with the required values.
If a number of the prefilled values are missing, you can:
l rerun the CVSSAMPLE command from the log to regenerate the values
l use the CVSEVALUATE command generated during the CVS Sample stage, if you saved it
Note
If you use the saved CVSEVALUATE command, you need to update the
name of the audit value field, and possibly the evaluation type.
For more information, see "CVSEVALUATE command" on page 1711.
3. On the Main tab, select one of the following options from the Estimation Type drop-down list:
l MPU
l Difference
l Ratio Separate
l Ratio Combined
l All
Note
The options are explained in detail above.
4. If you are not using prefilled values, or you want to adjust one or more values, enter or update
the required values:
l Confidence Level (%)
l Book Value
l Audit Value
l Precision Limits
l Strata Boundaries
Note
The input values are explained in detail below.
Caution
Normally you should not change any of the prefilled values. Changing prefilled
values can negate the statistical validity of the evaluation process.
Tip
You can click any linked result value in the display area to drill down to the
associated record or records in the source table.
l Click Name and enter the file name, or select an existing file in the Save or Save File As
You can also specify an absolute or relative file path, or navigate to a different folder, to
save or append the file in a location other than the project location. For example:
C:\Results\Output.txt or Results\Output.txt.
Note
ASCII Text File or Unicode Text file (depending on which edition of
Analytics you are using) is the only option for File Type.
6. Click OK.
The CVS Evaluate output results are displayed, or saved to a file.
Note
The output results are explained in detail below.
For additional information about interpreting output results, see "Judging
whether the invoice records as a whole are fairly stated" on page 1130.
Input values –
CVS Evaluate
dialog box Description
Your desired confidence level that the resulting sample is representative of the entire
population.
For example, entering 95 means that you want to be confident that 95% of the time the sample
will in fact be representative.
Confidence Level Confidence is the complement of “sampling risk”. A 95% confidence level is the same as a 5%
(%) sampling risk.
Input values –
CVS Evaluate
dialog box Description
Book Value The numeric field in the sample table containing the recorded book values.
Audit Value The numeric field in the sample table containing the audit values.
Top certainty The top certainty stratum cutoff value that was used in the CVS process, the number of records
stratum cutoff in the top certainty stratum, and their total value.
(Cutoff, Count,
Value)
Bottom certainty The bottom certainty stratum cutoff value that was used in the CVS process, the number of
stratum cutoff records in the bottom certainty stratum, and their total value.
(Cutoff, Count,
Value)
Strata Boundaries The boundary values that were used for stratifying the data set.
Population (Count, The number of records in each source table stratum, and the total value for each stratum.
Value)
Output results
Example screen from classical variables sampling tutorial
Output results –
CVS Evaluate Description
A statistical projection of the most likely audited value of the entire data set in the source table.
Point Estimate The Point Estimate is the midpoint of an estimated range.
A statistical projection of the amount by which the Point Estimate could vary.
Precision The Point Estimate plus or minus the Precision forms the upper and lower limits of the range.
Conditional sampling
Caution
Applying command filtering or scope parameters when sampling compromises the
validity of the sample. If you do this, a note stating that the sample results may be
invalid is generated in the log.
Although the capability to apply command filters and scope parameters exists in the
Sampling dialog box, the steps have been removed from the sampling procedures in
this guide.
Conditional sampling is used to restrict sample selection to records that meet a specified condition –
for example, transactions originating at a particular location, or products made by a particular
manufacturer.
When you perform conditional sampling, you must ensure that you are working with an accurate
data set. Using a command filter to refine data while sampling can yield unexpected results. A best
practice is to first extract the data that meets the desired condition to a new table, and then perform
the sampling, without using filters, on the new table.
You have a table with 1000 records of which 150 meet the condition “Dept 03”. You want to
draw a sample of 10 records from “Dept 03”.
If you draw the sample of 10 records from the original table with 1000 records, and in the
process apply the command filter IF Dept = "03", you are filtering sampled data.
The problem with this method is that Analytics selects 10 records from the unfiltered data set
and then presents only the records that match “Dept 03”, which results in fewer than the
required 10 records in the sample. The sample is not representative and is invalid.
For similar reasons, filtering an output table containing sampled records invalidates the
sample.
Analyzing data
"Analyzing data" is a broad concept that encompasses a large range of different processes and
techniques. There may be more than one way to achieve the same data analysis objective. The
overall process is often iterative, requiring that you modify your initial approach based upon
information you discover along the way.
Note
Data analysis, beyond the most basic, typically requires using a series of commands
to progressively work toward your analysis objective, rather than using a single
command in isolation.
Reliability/Accuracy computed fields Use computed fields to recalculate and test the accuracy
of calculated amounts in a data set, such as total amounts
including tax
Sequential Order Sequence Test whether data is sequentially ordered, and identify
out-of-sequence items
Inexactness Fuzzy Duplicates Identify nearly identical values that may refer to the same
real-world entity
Frequency Distribution Stratify Group records and determine how many records and how
much value are concentrated by numeric range or cluster,
Concentration of Age
by time period, or by record identifiers such as location
Materiality
Classify codes, vendor/customer numbers, or product identifiers
Summarize Also useful for identifying outliers
Cross-Tabulate
Histogram
Cluster
Profiling data
You can profile data to display the following summary statistics on one or more numeric fields in a
table:
l Total value – The sum of all field values.
l Absolute value – The sum of all field values while disregarding the sign of the numbers. The
absolute value is used as the default population parameter when sampling data using
monetary unit sampling.
l Minimum value – The smallest field value.
l Maximum value – The largest field value.
Note
The minimum and maximum values are often used as default parameters when
stratifying data and generating histograms.
Analytics includes an automatic profiling option which, if enabled, automatically produces a profile of
all the numeric fields in a table each time a table is opened.
Steps
You can profile data to generate summary statistics on one or more numeric fields in a table.
Show me how
1. Select Analyze > Profile.
2. On the Main tab, do one of the following:
o Select the field(s) to profile from the Profile Fields list.
o Click Profile Fields to select the field(s), or to create an expression.
The order in which you select the fields is the order in which the columns appear in the
results.
3. If there are records in the current view that you want to exclude from processing, enter a
condition in the If text box, or click If to create an IF statement using the Expression Builder.
Note
The If condition is evaluated against only the records remaining in a table after
any scope options have been applied (First, Next, While).
The IF statement considers all records in the view and filters out those that do not meet the
specified condition.
4. Click the More tab.
l While
Show me more
All This option is selected by default. Leave it selected to specify that all records in the view are
processed.
First Select this option and enter a number in the text box to start processing at the first record in the
view and include only the specified number of records.
Next Select this option and enter a number in the text box to start processing at the currently selected
record in the view and include only the specified number of records. The actual record number in
the leftmost column must be selected, not data in the row.
While Select this option to use a WHILE statement to limit the processing of records in the view based on
a particular criterion or set of criteria. You can enter a condition in the While text box, or click While
to create a WHILE statement using the Expression Builder.
A WHILE statement allows records in the view to be processed only while the specified condition
evaluates to true. As soon as the condition evaluates to false, the processing terminates, and no
further records are considered. You can use the While option in conjunction with the All, First, or
Next options. Record processing stops as soon as one limit is reached.
Note
The number of records specified in the First or Next options references either the physical or
the indexed order of records in a table, and disregards any filtering or quick sorting applied to
the view. However, results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
6. Click OK.
Generating statistics
You can generate detailed statistics on numeric and datetime fields in a table. Statistics provide an
overview of a table, and can highlight abnormalities in the data, which can guide your subsequent
analysis.
When you generate statistics, in addition to the standard output options, Analytics automatically
creates a number of system variables that contain the output results. For more information, see
"System variables created by Analytics commands" on page 1599.
The results of generating statistics are described in the table below.
Note
All the statistics are generated for numeric fields. Only a subset of the statistics are
generated for datetime fields.
Abs Value The total of all values while disregarding the sign of the numbers
Std Dev (optional) The standard deviation from the mean value
Tip
You can use the # of High/Low setting on the More tab in the Statistics dialog box to specify the
number of high and low values that are included in the results.
Steps
You can generate descriptive statistics on numeric and datetime fields in a table.
Show me how
1. Select Analyze > Statistics.
2. On the Main tab, do one of the following:
o Select the field(s) to generate statistics on from the Statistics On list.
o Click Statistics On to select the field(s), or to create an expression.
The order in which you select the fields is the order in which the columns appear in the
results.
3. If there are records in the current view that you want to exclude from processing, enter a
condition in the If text box, or click If to create an IF statement using the Expression Builder.
Note
The If condition is evaluated against only the records remaining in a table after
any scope options have been applied (First, Next, While).
The IF statement considers all records in the view and filters out those that do not meet the
specified condition.
4. If you want to calculate the standard deviation for the selected field or fields, select Std
Deviation.
5. If you want to calculate the median, mode, and first and third quartile values for the selected
field or fields, select Median, Mode, Q25, Q75.
Note
Calculating these additional statistics requires additional computer memory.
You may exceed your computer's memory and get an error message if you
calculate the additional statistics for very large data sets.
Tip
You can click any linked result value in the display area to drill down to the
associated record or records in the source table.
If the output table contains a large number of records, it is faster and more useful to save
the results to a file than to display the results on the screen.
l Print – Select this option to send the results to the default printer.
l Graph – Select this option to create a graph of the results and display it in the Analytics
display area.
l File – Select this option to save or append the results to a text file. The file is saved outside
Analytics.
Note
Output options that do not apply to a particular analytical operation are
disabled.
8. If you selected File as the output type, specify the following information in the As panel:
l File Type – ASCII Text File or Unicode Text file (depending on which edition of Analytics
you are using) is the only option. Saves the results to a new text file, or appends the results
to an existing text file.
l Name – Enter a file name in the Name text box. Or click Name and enter the file name, or
select an existing file in the Save or Save File As dialog box to overwrite or append to the
file. If Analytics prefills a file name, you can accept the prefilled name, or change it.
You can also specify an absolute or relative file path, or navigate to a different folder, to
save or append the file in a location other than the project location. For example:
C:\Results\Output.txt or Results\Output.txt.
l Local – Disabled and selected. Saving the file locally is the only option.
9. Click the More tab.
10. Select the appropriate option in the Scope panel:
l All
l First
l Next
l While
Show me more
All This option is selected by default. Leave it selected to specify that all records in the view are
processed.
First Select this option and enter a number in the text box to start processing at the first record in the
view and include only the specified number of records.
Next Select this option and enter a number in the text box to start processing at the currently selected
record in the view and include only the specified number of records. The actual record number in
the leftmost column must be selected, not data in the row.
While Select this option to use a WHILE statement to limit the processing of records in the view based on
a particular criterion or set of criteria. You can enter a condition in the While text box, or click While
to create a WHILE statement using the Expression Builder.
A WHILE statement allows records in the view to be processed only while the specified condition
evaluates to true. As soon as the condition evaluates to false, the processing terminates, and no
further records are considered. You can use the While option in conjunction with the All, First, or
Next options. Record processing stops as soon as one limit is reached.
Note
The number of records specified in the First or Next options references either the physical or
the indexed order of records in a table, and disregards any filtering or quick sorting applied to
the view. However, results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
11. If you want to change the number of highest and lowest field values included in the results,
enter the number in # of High/Low.
12. If you selected File as the output type, and want to append the output results to the end of an
existing text file, select Append To Existing File.
13. Click OK.
14. If the overwrite prompt appears, select the appropriate option.
Identifying outliers
Use the outlier feature in Analytics to identify records that are out of the ordinary and could require
closer scrutiny.
Note
A record can be an outlier for a legitimate reason. Typically, you need to perform
additional examination of the outliers identified by Analytics to determine if any
issues actually exist.
Guidelines
When you specify settings in the outliers feature, consider the nature of the data you are analyzing:
Values are clustered, with a small range Use a smaller standard deviation multiple. Try starting
with 1. Use decimal multiples such as 1.25, to make
precise adjustments.
Values are dispersed, with a large range Use a larger standard deviation multiple. Try starting with
3.
The data is skewed, with a small percentage of the values Use Median, instead of Average, as the method for
being large, or small, when compared to the rest of the calculating the center point of the values that you are
data examining.
Steps
Note
Detailed information appears after the steps. See "Outliers dialog box options" on
the facing page.
l Median
4. In Number of times of S.dev, specify a multiple of the standard deviation to use for the outlier
boundaries.
You can specify any positive integer or decimal numeral (0.5, 1, 1.5, 2 . . . ).
5. Do one of the following:
l From the Primary Keys list, select one or more key fields to use for grouping the records in
the table.
Tip
You can Ctrl+click to select multiple non-adjacent fields, and Shift+click to
select multiple adjacent fields.
lSelect No Key to identify outliers across the entire table, rather than within specific groups.
6. From the On Field list, select the numeric field to examine for outliers ("the outlier field").
7. Optional. From the Other Fields list, select one or more additional fields to include in the
output table.
Note
Key fields and the outlier field are automatically included in the output table,
and do not need to be selected.
8. If there are records in the current view that you want to exclude from processing, enter a
condition in the If text box, or click If to create an IF statement using the Expression Builder.
Note
The If condition is evaluated against only the records remaining in a table after
any scope options have been applied (First, Next, While).
The IF statement considers all records in the view and filters out those that do not meet the
specified condition.
9. Do one of the following:
a. In the To text box, specify the name of the output table.
b. Select Screen to output the results to the Analytics display area.
10. Deselect Presort, if appropriate.
Note
Guidance is provided below.
Main tab
Options – Outliers
dialog box Description
The method used for calculating the center point of the values in the outlier field.
o Average – use the average (mean) of the values in the field
o Median – use the median of the values in the field
The center point is used in calculating the standard deviation of the values in the outlier field.
Note
If you select Median, the outlier field must be sorted. Select Presort if the
outlier field is not already sorted.
Tip
Average
If the data you are examining for outliers is significantly skewed, Median might
Median produce results that are more representative of the bulk of the data.
In the outlier field, the number of standard deviations from the mean or the median to the upper
and lower outlier boundaries. You can specify any positive integer or decimal numeral (0.5, 1,
1.5, 2 . . . )
For example, specifying 2 establishes, for each key field group, or for the field as a whole:
o an upper outlier boundary 2 standard deviations greater than the mean or the median
o a lower outlier boundary 2 standard deviations less than the mean or the median
Any value in the outlier field greater than an upper boundary, or less than a lower boundary, is
included as an outlier in the output results.
Note
Number of times of For the same set of data, as you increase the number of standard deviations,
S.dev you potentially decrease the number of outliers in the output results.
The field or fields to use for grouping the data in the table.
For each key field group, a standard deviation is calculated for the group's numeric values in
the outlier field. The group standard deviation is used as the basis for identifying group outliers.
Key fields can be character, numeric, or datetime. Multiple fields can be any combination of
data types.
If you select more than one field, you created nested groups. The nesting follows the order in
which you select the fields.
Note
Primary Keys
The key field or fields must be sorted. Use Presort if one or more fields are not
optional already sorted.
Options – Outliers
dialog box Description
The numeric field to examine for outliers. You can examine only one field at a time.
On Field
If you select a key field, outliers are identified at the group level. If you select No Key, outliers
("the outlier field") are identified at the field level.
Note
Other Fields
Key fields and the outlier field are automatically included in the output table,
optional and do not need to be selected.
Note
Analytics table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _ ), but
To
no other special characters, or any spaces. The name cannot start with a
optional number.
Screen Displays the results in the Analytics display area instead of creating an output table.
optional
Note
Sorting a computed outlier field is
an internal, technical requirement
of Analytics.
Presort o One or more key fields key field or fields, then by the outlier field
o Median
optional
Options – Outliers
dialog box Description
o No Key no sorting
o Average
Tip
If the appropriate field or fields in the input table are already sorted, you can
save processing time by not selecting Presort.
More tab
Options – Outliers
dialog box Description
Note
The number of records specified in the First or Next options references either
the physical or the indexed order of records in a table, and disregards any
filtering or quick sorting applied to the view. However, results of analytical
operations respect any filtering.
Scope panel If a view is quick sorted, Next behaves like First.
Specifies whether the Analytics table containing the output results opens automatically upon
Use Output Table completion of the operation.
Operation Approaches
o Quick sort – sort the values in a column to temporarily reorder the records in a view
o Sort command – sort records and output them to a new, physically reordered Analytics table
o Index command – index records to temporarily sort them in the current table
Sorting o Presort – sort records as an integral part of the execution of an Analytics command
Note
Quick sorting works with a maximum field length of 247 characters. If a field is longer
than 247 characters, the Quick Sort menu options are disabled.
Steps
1. Right-click the header of the column you want to use for sorting.
2. Select Quick Sort Ascending or Quick Sort Descending to sort the column in either
ascending or descending order.
3. If you want to remove the quick sort, right-click the column and select Quick Sort Off.
The quick sort is automatically removed when you close the table.
a block of values spanning two or more records and two o Equal (not shown)
or more columns
Steps
Apply the initial quick filter
1. Select a single value, or two or more adjacent values, as the basis for the quick filter.
Click and drag to select multiple adjacent values.
If you want to quick filter a character field by blank or non-blank values, select any value in the
field.
2. Right-click in the data area of the view, select Quick Filter, and select an appropriate
submenu option.
The records in the table are filtered based on your selection. The auto-generated syntax of the
filter expression appears in the Filter text box at the top of the View tab.
If you selected a block of values spanning two or more records and two or more columns, no
submenu options are available and the quick filter automatically filters the view to include only
those records that match the selected values.
Example
To further limit the filter Customer = '795401' to records in which the transaction type is
"IN", you can select the IN value and then right-click and select Quick Filter > AND >
Equal. The filter expression is modified as follows:
(Customer = '795401') AND (Type = 'IN')
AND further limits the initial filtered set of data. Depending on the specific details of the
extended filter expression, OR typically expands the initial filtered set of data.
Search scope
All the source data in the table is searched, not just the data displayed in the current view. For
information about source data, tables, and views, see "The structure of Analytics tables" on
page 118.
Entire records are searched, including any undefined portion of the record, rather than specific
fields. For example, entering casino finds records that contain “casino” anywhere in the record. You
can subsequently modify the search if you need to search a specific field (character data searches
only).
Computed fields and related fields are not searched unless you subsequently modify the search to
specify the specific field.
The filter auto-populates the Filter text box, from where you can modify it, if required. For example,
you could modify FIND("casino") to limit the search to a specific field: FIND("casino", Merchant).
The filter is also added to the filter history and to the command log, from where you can
subsequently reapply it.
Steps
Note
When searching for numbers or datetime values, you need to match the source data
formatting rather than the formatting in the view. For more information, see "Quick
searching numeric or datetime data" on page 1190.
Note
You must use the physical name of the field, which may not be the same as the
display name of the field in the view.
To check the physical name, right-click the appropriate column header and
select Properties. If necessary, copy the physical name from the text box at
the top of the Modify Column dialog box. Do not use the Alternate Column
Title.
To search in a related field you must specify the fully qualified name of the field
(that is, table.field name). For example: FIND("casino", Vendor.Vendor_
Name)
cas o casino
o cash
o Americas
o Lancashire
o etcetera . . .
casino o casino
o casinos
“cash ” o cash
(the word ‘cash’ followed by one space) (in the data, requires that the string ‘cash’ is followed
by at least one space)
o does not return ‘cashier’ or ‘Lancashire’
When quick searching numeric or datetime data, you need to remember that you are searching the
underlying source data rather than the data displayed in a view.
Numbers, dates, and times are often formatted differently in the source data than they are in the
view. Search terms need to match the source data formatting rather than the formatting in the
view.
You can select Edit > Table Layout to view the source data for a table.
9,999.99 1,234.00
DD/MM/YYYY 31/12/2015
YYYYMMDD 20151231
FIND("2015-12-31") 2015-12-31
Characteristic Description
Leading, trailing, and intervening spaces in search terms are considered only if you
enclose the search term or terms and the spaces inside double quotation marks.
When spaces are enclosed by double quotation marks they are treated like characters
Spaces and must be exactly matched in the data.
Characteristic Description
Only double quotation marks can be used for enclosing phrases. Single quotation marks
Quotation marks are not supported for this purpose and are treated like a regular character.
When modifying the auto-populated filter to limit the search to a specific field you can
specify only character fields.
Limiting search by field Specifying a numeric or datetime field causes an error.
If used in quick search terms, the following characters may give inconsistent results, or
cause an error message, because they are the operators used in Analytics expressions:
^ * ( ) - + = < >
If you want to search for one of these characters, manually enter the FIND( ) function in
the Filter text box. For example:
Unsupported characters FIND("a+b") or FIND("2015-12-31")
Field boundaries in records are ignored, which means it is possible for a search term to
match a string of characters across a field boundary. Trailing spaces in fields are treated
like characters.
Search results found across field boundaries may not be valid results, unless you
specifically intend this type of search. For example, the last digits of an account number
and the first digits of an amount in an adjacent field could match a numeric search term,
but would probably be a false positive.
Note
The field boundaries under discussion are the ones that appear in the
table layout, based on the physical order of fields in the layout.
The order of fields in the layout can differ from the order of columns in the
associated view, creating different adjacencies in the layout and the
view.
Field boundaries
If it is unclear why quick searching is returning a particular record, select
Trailing spaces Edit > Table Layout to view the source data being searched.
Sorting and indexing are two different methods for sequentially ordering data in tables. Some
Analytics commands require that the input is first sorted or indexed. Ordering data can also be a
useful analytical operation in itself, bringing patterns and anomalies into focus.
Operation Description
Sorting a table physically reorders data into a sequential order and outputs the results to a new
Sorting Analytics table.
Indexing does not make any change to the underlying physical order of data. Instead, it creates
a separate index file that references records in a table, allowing access to the records in a
sequential order rather than a physical order. Data in a view is reordered in accordance with an
Indexing index only while the index is active.
Sorting Indexing
A-
n- S-
a- o-
l- r-
y- t
t- O-
i- r-
c- d-
s e-
r
E- d-
d- e-
i- f-
t- a-
i- u-
o- l-
n t Associated sort sequence
A-
n- S-
a- o-
l- r-
y- t
t- O-
i- r-
c- d-
s e-
r
E- d-
d- e-
i- f-
t- a-
i- u-
o- l-
n t Associated sort sequence
e a- o Characters with diacritical marks are intermixed with characters without diacritical marks.
n-
For example: e, E, é, É, f, F
g-
u- Show all characters sorted (Unicode edition)
a-
g-
_ - – — , ; : ! ¡ ? ¿ . … ' ‘ ’ ‚ ‹ › “ ” „ « » ( ) [ ] { } @ * / \ & # % ` ´ ˜ ^ ¨
e-
¸ ˆ © ® + ± < = > | ¦ ~ ¢ $ £ ¥ € 0 1 2 3 4 5 6 7 8 9 a A á Á à À â Â å Å ä Ä ã Ã b
s
B c C ç Ç d D ð e E é É è È ê Ê ë Ë f F ƒ g G h H i I í Í ì Ì î Î ï Ï j J k K l L m
M n N ñ Ñ o O ó Ó ò Ò ô Ô ö Ö õ Õ ø Ø p P q Q r R s S š Š ß t T ™ u U ú Ú ù Ù û Û ü
(- Ü v V w W x X y Y ý Ý ÿ Ÿ z Z ž Ž þ Þ
U-
C-
A-
)
(-
U-
n-
i-
c-
o-
d-
e
c-
o-
l-
l-
a-
t-
i-
o-
n
a-
l-
g-
A-
n- S-
a- o-
l- r-
y- t
t- O-
i- r-
c- d-
s e-
r
E- d-
d- e-
i- f-
t- a-
i- u-
o- l-
n t Associated sort sequence
o-
r-
i-
t-
h-
m-
)
Sorting records
You can sort records into an ascending or descending sequential order and output the results to a
new, physically reordered Analytics table. Outputting to an Analytics table is the only output option.
Sorting records is a prerequisite for several Analytics operations. For more information, see "Should
I do an explicit sort or use Presort?" on page 1202
Sorting can also be a useful analytical operation in itself, bringing patterns and anomalies into focus.
Note
Indexing records is an alternative to sorting them, and in some situations may be a
better choice. For more information, see "Should I sort or index?" on page 1194
Tip
If you want some of the characteristics of outputting by field, but you need the entire
record, output by field and select all fields.
o Only specified fields are included in the sorted output table. Key fields are automatically
included and do not need to be specified.
o Computed fields are converted to physical fields and populated with the actual computed
values.
o Related fields can be included. They become permanent physical fields in the output table.
Fields The new output table is no longer related to the original child table.
Example
You want to sort a transaction table in ascending order on a key date field, and within each
date in descending order on a key amount field.
The result below illustrates nested sorting that mixes data type (datetime and numeric), and
ascending and descending order.
Additional suggestions
If the amount of time required to sort large tables remains an issue for you, consider:
l upgrading your computer hardware
l creating a script to sort data on a scheduled basis overnight
You set a control total for a field in the Table Layout dialog box. Once you have sorted and output
the records, in the new table select Tools > Table History to compare the input and output control
totals. For more information, see "Define a physical field" on page 790.
Steps
You can sort records by one or more key fields in the active table and output the results to a new
Analytics table. You can include the entire record in the sorted output table, or only specified fields.
Show me how
Note
Detailed information appears after the steps. See "Sort dialog box options" on the
facing page.
You need free disk space at least 2.5 times the size of the file being sorted for the
creation of a temporary file used during the sorting process.
Tip
If you click Sort On, you can optionally specify a descending sort order in the
output results for one or more of the key fields by clicking the sort arrow
(the default sort order is ascending).
l Select Fields if you want to include only a subset of fields in the sorted output table.
Note
If you need only a portion of the data contained in a record, select Fields,
especially if the table is large.
For more information, see "How to speed up sorting" on page 1201.
Tip
You can Ctrl+click to select multiple non-adjacent fields, and Shift+click to
select multiple adjacent fields.
Main tab
Note
Sorting on logical fields requires that Include Filters in Field Lists is selected
(Tools > Options > Interface).
Caution
If you sort by a related key field when using the Record option, be aware
that the related key field is not included in the sorted output table, which
Sort On can be confusing.
Record Specifies whether to include the entire record in the sorted output table, or only a subset of
fields.
o Record – includes entire records. The fields in the output table maintain the same order as
the source table.
o Fields – includes a selection of individual fields. The fields in the output table appear in the
order you select them.
If you are including one or more computed fields:
o select Record to preserve the fields as computed expressions
o select Fields to convert the fields to physical fields of the appropriate data type and
populate them with the actual computed values
If you want to include fields from a child table in a table relation:
o select Fields
Fields You cannot include child table fields using the Record option.
If you selected Fields, specifies the non-key fields to include in the sorted output table.
o You can select the appropriate fields from the Other Fields list.
o You can also click Other Fields to select the appropriate fields, or to create an expression,
then click OK.
Note
Key fields are automatically included in the output table. They are ignored
when specified as Other Fields.
As a group, key fields appear before other fields in the output table.
Note
Analytics table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
To number.
If you are connected to a server table, specifies where to save the output table.
o Local selected – saves the output table to the same location as the Analytics project, or to a
specified path, or location you navigate to.
Local o Local deselected – saves the output table to the Prefix folder on AX Server.
Specifies whether the Analytics table containing the output results opens automatically upon
Use Output Table completion of the operation.
More tab
Note
The number of records specified in the First or Next options references either
the physical or the indexed order of records in a table, and disregards any
filtering or quick sorting applied to the view. However, results of analytical
operations respect any filtering.
Scope panel If a view is quick sorted, Next behaves like First.
Specifies that the output results are appended (added) to the end of an existing Analytics table.
The resulting combined table is considered unsorted because the sorted records are appended
to the end of the target table, without consideration of any existing sort order in the target table.
o You can select Append To Existing File if you are certain the records or fields and the
target table are identical in structure.
o You can leave Append To Existing File deselected if you want Analytics to compare the
Append To Existing record lengths of the output results and the existing table. If the record lengths are not
File identical, the data structure is not identical, and the append will not work correctly.
Note
Leaving Append To Existing File deselected is recommended if you are
uncertain whether the output results and the existing table have an identical
data structure.
For more information about appending and data structure, see "Appending
output results to an existing table" on page 205.
Indexing records
Indexing creates a separate index file (.inx file) that allows access to the records in an Analytics
table in a sequential order rather than a physical order (that is, the raw data order).
Indexing does not physically reorder data in tables. However, when a table’s index is active, the data
in the view is reordered in accordance with the order specified by the index, and analytical
operations process the data based on this order. If a table has more than one view, all views are
subject to an active index.
When an index is active, the word Indexed prefaces the record count in the status bar. For example:
Indexed Records: 500.
When the index is inactive, the records in a view revert to their original physical order. Upon opening
an Analytics table, any existing indexes are inactive by default.
Note
Sorting records is an alternative to indexing them, and in some situations may be a
better choice. For more information, see "Should I sort or index?" on page 1194
Nested indexing
You can index records using one key field, or you can create nested indexing schemes by indexing
on multiple key fields (primary key field, secondary key field, and so on).
Nested indexing supports mixing ascending and descending order, and mixing data types, across
key fields.
Conditional indexes
Indexes can include If, First, Next, and While parameters, in which case they become conditional
indexes. Only those records that match the condition are indexed, or are displayed or available for
analysis when the conditional index is active.
Show me more
Every time you activate the index the condition is automatically reapplied. You can facilitate certain
types of analysis by using conditional indexes to create subsets of larger tables.
When a conditional index with an If parameter is active, the words Filtered Index preface the record
count in the status bar. For example: Filtered Index Records: 500. When conditional indexes with
First, Next, and While parameters are active, the word Indexed prefaces the record count, like
indexes without any conditions.
Type of trans_
filter Description/Indexing syntax vendor_ID amount
Type of trans_
filter Description/Indexing syntax vendor_ID amount
Local Index contains only transaction amounts $2000 or greater 359 2200.00
INDEX ON trans_amount IF trans_amount >= 2000 TO "trans amount 108 2300.00
2000 or greater"
108 3400.00
359 3400.00
Global- Index contains only vendor #359 records with transaction amounts of 359 2200.00
Local $2000 or greater
359 3400.00
INDEX ON trans_amount IF trans_amount >= 2000 TO "vendor 359
transactions 2000 or greater"
Steps
Index records
You can index records by one or more key fields in the active table, and use the resulting index to
temporarily reorder the records without affecting the underlying physical order of the data.
Show me how
1. Select Data > Index.
2. On the Main tab, do one of the following:
l Select the field(s) to index from the Index On list.
If you select more than one field, the order in which you select the fields dictates the nested
indexing priority. The records are indexed by the first field you select, and if there are multiple
occurrences of a value in the first field, the records within the group are then indexed by the
second field you select, and so on. If you do not select additional fields, records within a group
retain their original sort order relative to one another.
For information about indexing using expressions and computed fields, see "Sorting or
indexing using a computed key field" on page 1215.
Note
The combined length of the fields being indexed cannot exceed 247
characters.
3. If you clicked Index On, you can optionally specify a descending index order for one or more
selected fields by clicking the sort arrow (the default is ascending).
4. If there are records in the current view that you want to exclude from processing, enter a
condition in the If text box, or click If to create an IF statement using the Expression Builder.
Note
The If condition is evaluated against only the records remaining in a table after
any scope options have been applied (First, Next, While).
The IF statement considers all records in the view and filters out those that do not meet the
specified condition.
5. Do one of the following:
l In the To text box, specify the name of the index file.
l Click To and specify the index file name, or select an existing index file in the Save or
Note
Index names are limited to 64 alphanumeric characters. The name can include
the underscore character ( _ ), but no other special characters, or any spaces.
The name cannot start with a number.
Tip
A best practice is to give indexes meaningful names that describe the nature of
the ordering imposed by the index. For example, “Date_Amount_D” could be
the name of an index that orders a table by Date in ascending order, and within
each day by Amount in descending order.
6. Select or deselect Use Output Table depending on whether or not you want to activate the
index immediately.
You can activate a table’s index at any time by selecting it from the Index drop-down list at the
top right of the view.
7. Click the More tab.
8. Select the appropriate option in the Scope panel:
l All
l First
l Next
l While
Show me more
All This option is selected by default. Leave it selected to specify that all records in the view are
processed.
First Select this option and enter a number in the text box to start processing at the first record in the
Next Select this option and enter a number in the text box to start processing at the currently selected
record in the view and include only the specified number of records. The actual record number in
the leftmost column must be selected, not data in the row.
While Select this option to use a WHILE statement to limit the processing of records in the view based on
a particular criterion or set of criteria. You can enter a condition in the While text box, or click While
to create a WHILE statement using the Expression Builder.
A WHILE statement allows records in the view to be processed only while the specified condition
evaluates to true. As soon as the condition evaluates to false, the processing terminates, and no
further records are considered. You can use the While option in conjunction with the All, First, or
Next options. Record processing stops as soon as one limit is reached.
Note
The number of records specified in the First or Next options references either the physical or
the indexed order of records in a table, and disregards any filtering or quick sorting applied to
the view. However, results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
9. Click OK.
10. If the overwrite prompt appears, select the appropriate option.
An entry for the index is added to the Index drop-down list in the View tab. If you selected Use
Output Table, the index is activated and the table is sorted according to the index.
Show me how
1. Open the table containing the index.
2. Right-click the table in the Navigator and select Properties.
3. Click the Indexes tab, select the index name, and click Details.
The Index Properties dialog box displays the index details:
lCommand – displays the syntax of the specific Index command, including any local filter.
lFilter – displays the syntax of any global filter that is part of the index.
4. Click OK and OK again to exit the Table Properties dialog box.
Maintain indexes
You can copy, rename, or delete an index in the Indexes tab of the Table Properties dialog box.
You can also add additional indexes from the same location.
Show me how
Note
You can perform these maintenance tasks only through Analytics. If you directly
rename an index file (.inx file) in a Windows folder the index file is automatically
recreated with the original name the next time you activate the index in Analytics. If
you directly delete an index file, the index file is automatically recreated the next time
you activate the index.
The index is copied with an incrementing number added to the end of the index name.
l Click Rename, enter a new name, and click OK to rename the index.
Note
Index names are limited to 64 alphanumeric characters. The name can
include the underscore character ( _ ), but no other special characters, or
any spaces. The name cannot start with a number.
Key field
Computed Key field
(sequential
key field
order, non- (order based on
Key field
Description/Computed Analytics Unicode edition (sequential computed key
key field expression Function (physical order) of Analytics) order) field order)
Key field
Computed Key field
(sequential
key field
order, non- (order based on
Key field
Description/Computed Analytics Unicode edition (sequential computed key
key field expression Function (physical order) of Analytics) order) field order)
INCLUDE(dept_ID, 20 92 85 #85
"1234567890")
#85 T-38 92 92
RECNO( )
Key field
Computed Key field
(sequential
key field
order, non- (order based on
Key field
Description/Computed Analytics Unicode edition (sequential computed key
key field expression Function (physical order) of Analytics) order) field order)
Note
Requires a
nested
sort/index of
key field
inside
computed
key field.
MOD(trans_amount,
1.00)
Steps
The steps for sorting or indexing a table using a computed key field are explained in general terms
below.
For detailed information about creating computed fields, and performing sorting or indexing, see the
relevant sections of this guide.
1. Using an appropriate expression, create a computed key field based on the sort or index
physical key field.
2. If you are going to perform an indexing operation, add the computed key field to the view.
3. Using the computed field as the key field, perform the regular sorting or indexing procedure.
l If necessary, specify a descending order for the computed key field. Some expressions
expression, select both the computed key field and the physical key field when sorting or
indexing. Make sure to select the computed key field first, so that it takes precedence over
the physical key field.
Filtering data
Filters are an essential tool when analyzing data. They allow you to exclude the data in a table that is
not currently relevant and focus analysis on a targeted subset of records.
Excluded data is not displayed in the View tab, or processed by Analytics operations such as
extracting. Excluded data is only hidden, not deleted, and it can be displayed at any time by
removing the filter. Filters are associated with a specific table in an Analytics project rather than the
entire project.
Types of filters
You can create several different types of filters in an Analytics project:
l Global filters, also called view filters
l Quick filters
l Local filters, also called command filters
l Data filters
Filters can be ad hoc – that is, not permanently saved with a table – or they can be named and saved
with a table for later reuse. Named filters can also be saved in a workspace so they can be shared
among multiple tables.
Quick filters
A quick filter is a global filter that is applied by right-clicking in a view and using the Quick Filter
option on the context menu. Quick filters are convenient because they allow you to select filter
values and criteria with the mouse, rather than specifying them manually, and they automatically
populate the Filter text box with valid filter syntax.
Because of the need to select filter values and criteria with the mouse, quick filters have certain
limitations. They typically cannot be used to create complex filters with multiple criteria.
For more information, see "Quick filtering data in a view" on page 1182.
Data filters
Data filters serve a specific purpose. They provide a method for selectively defining data in data
sources that contain more than one record type, such as Print Image (Report) files and Multiple
Record Type files. Unlike the other types of filters, they are not intended for general use when
analyzing data in Analytics.
For more information, see "About data filters" on page 836.
Named filters
You can name and save a global or local filter for subsequent reuse, in which case it is permanently
saved with the associated Analytics table. For example, you could name and save the ad hoc filter
Invoice_Amount > 1000.00 as “Inv_greater_than_1K”.
When you reapply the filter, you specify the filter name, rather than recreating the syntax, which
saves labor. Naming filters also makes it easy to differentiate between a number of saved filters. For
example:
l “Inv_less_than_1K”
l “Inv_1K_to_5K”
l “Inv_greater_than_5K”
You can name and save filters when you create them, or at any subsequent point if the ad hoc filter
still appears in the filter history. Once a filter is named and saved, it is available to use as a global
filter with any view associated with the table, or as a local filter with any operation performed on the
table.
For information about how to name and save a filter, or convert an ad hoc filter to a named filter, see
"Apply a global filter to a view" on page 1228.
Filter history
When you apply a global filter to a table it is saved in the filter history associated with the table. As
long as the filter remains in the filter history, it can be reapplied by selecting it from the Filter drop-
down list at the top of the view.
Both ad hoc and named global filters are saved in the filter history. Local filters are not saved in the
filter history.
Additional filter history details:
Each table has a separate filter history. Multiple views of the same table share
Tables, views, and filter history the same filter history.
The filter history persists when you close the table, close the project, or close
Persistence of the filter history Analytics.
Sequence of filters in the list The most recently applied filter appears at the top of the Filter drop-down list.
A maximum of 10 filters are stored. If you exceed the maximum, the oldest
filter is removed from the bottom of the list, and the most recent filter is added
Maximum number of stored filters to the top.
Filters in the filter history are unique. Applying a filter multiple times does not
Redundant filters cause redundant filter history entries.
Deleted named filters are not removed from the filter history but they no longer
Deleted named filters function.
You can clear the entire filter history by right-clicking the Filter text box and
selecting Clear History. You cannot selectively remove filters from the filter
Clearing the filter history history. Clearing the filter history does not delete named filters.
Controls whether filtered records in views are hidden, or displayed but visually
de-emphasized.
Hide Filtered Records For more information, see "View options" on page 130.
Vendor_No = "14438"
You can apply only one filter at a time to a view, but as the example above shows, you can use
Boolean operators such as AND and OR to combine multiple criteria in a single filter.
For more information about Boolean operators, see "Operators in Analytics expressions" on
page 870.
Tip
To help visualize which records are included by a filter, imagine prefacing the filter
expression with the phrase "Include records if". This technique can be helpful when
constructing complex expressions, or when using Boolean operators that negate,
such as NOT, and Not Equal To (<>).
Partial matching
Partial matching is supported when filtering character data – that is, the filter value can be contained
by a longer value in the field you are using for filtering.
For example:
l Vendor_Name = "R" restricts a table to vendors with names beginning with “R”.
l Address = "PO Box" restricts a table to addresses that start with “PO Box”.
Note
Filter values must appear at the start of fields to constitute a match.
Partial matching is enabled when the Exact Character Comparisons option is off (the default
setting). If the option is on, partial matching is disabled and the filter value must exactly match a
value in a field to constitute a match. For more information, see "Table options" on page 125.
Filter retention
A global filter remains active until you remove it, replace it with another global filter, or close the
table. You can make a global filter the default filter for a table so that it is automatically applied every
time you open the table.
Global filters differ from local filters, which are active only during a single execution of a single
Analytics operation.
When a global filter is active, the Global Filter indicator appears in the status bar followed by the
filter syntax or the filter name, depending on whether the filter is ad hoc or named:
l an ad hoc filter – Global Filter: (Vendor_No = "14438")
l a named filter – Global Filter: Vend_14438
Tip
You can use quick filtering to automatically create valid filter syntax, and then
manually edit the filter values to create the filter you want.
l
Expression Builder – Click Edit View Filter to open the Expression Builder, create the
filter expression, optionally enter a name for the filter in the Save As text box, and click OK.
If you enter a name for the filter, it is permanently saved with the table. If you do not enter a
name, the filter is ad hoc and retained only while it appears in the filter history associated with
the table.
Filter names are limited to 256 alphanumeric characters and cannot begin with a number.
For information about using the Expression Builder, see "Creating expressions using the
Expression Builder" on page 874.
Note
You cannot rename or delete a filter if it is currently applied to a table.
1. Open the table with the named filter that you want to maintain.
2. Select Edit > Filters.
Analytics displays the list of named filters associated with the table.
3. If you want to add a new filter, click New and use the Expression Builder to create the filter.
Note
Only logical expressions can be used to define filters.
For information about using the Expression Builder, see "Creating expressions using the
Expression Builder" on page 874.
4. If you want to work with an existing filter, select it in the list and do one of the following:
l Click OK to view or modify the selected filter in the Expression Builder. After viewing or
Tip
Duplicating a complex filter and modifying it can be easier than creating a
filter from scratch.
l Click Rename, enter a new name in the text box, and click OK.
Filter names are limited to 256 alphanumeric characters and cannot begin with a number.
Click Done to use the existing value of the filter, or click OK to modify the expression used
by the filter.
l Click Delete to delete the filter, click Delete again in the confirmation dialog box, and click
Done to close the dialog box.
For example, Invoice_Amount > 1000.00. The filter is ad hoc and retained only during
processing of the Analytics operation.
l Click If to create a filter, or select an existing filter, using the Expression Builder.
2. If you are using the Expression Builder, do one of the following:
l Create the filter expression, optionally enter a name for the filter in the Save As text box,
Searching data
You can use different methods for searching data in Analytics tables:
Isolate all matching Filter text box o Basic search – Do a basic search using operators such
records as Equals = , Less Than < , or Greater Than >
o Quick search – Do a quick search using the quick
search or quick filter features
o Functions – Search using Analytics functions
Select the first matching Search dialog box o Commands – Search using Analytics commands
record
Tip
Typically, users search to isolate all matching records, which returns a set of results.
So normally you use the Filter text box and you can ignore the Search dialog box.
Tip
Build search expressions from scratch only if the expressions are simple. For more
involved searching, use the quick filter method, or advanced searching using
functions.
ISBLANK(Vendor_Name)
NOT(ISBLANK(Vendor_Name))
Invoice_Amount = 0
l Isolates all records in which the Invoice_Amount field is not blank, and not zero (0):
Invoice_Amount <> 0
Invoice_Date = `19000101`
NOT VERIFY(Invoice_Date)
A date value can be invalid if it does not match the date format used by the field, or if the date
does not exist. For example: 31 April 2020.
l Isolates all records in which the Invoice_Date field is not blank, and the value is valid:
VERIFY(Invoice_Date)
Tip
To see the physical field name, right-click a column header in the table view and
Field names select Properties.
Search in You can build an expression that searches in more than one field. The easiest way to search across
more than all fields in a record is to search using a function. For more information, see "Search and filter using
one field Analytics functions" on page 1245.
Operators For the list of valid operators, see "Operators in Analytics expressions" on page 870.
Related fields To search in a related field you must specify the fully qualified field name: table name.field name.
Note
Some limitations exist with quick search and quick filter, which are explained in the
topics about these features.
For detailed information about searching using functions, see "Search and filter using Analytics
functions" on page 1245.
For more information, see "Selecting the first matching record" on the next page.
You can use an Analytics command to select the first record in a table that matches the search
criteria. The record is selected, but not isolated, unlike the other types of searching in Analytics. The
rest of the records are still present in the table view.
Usefulness in scripts
The ability to select the first matching record is primarily useful in Analytics scripts. For example, in
conjunction with other scripting techniques, the commands below can be used to move sequentially
through records in a table as a precursor to performing a repeated action based on the contents of
each selected record.
The table below explains the different options in the Search dialog box. It also provides the
equivalent ACLScript commands on the assumption that the options are primarily useful in
Analytics scripts.
Note
You can click any command name below for detailed information about the
command.
Equivalent
Search dialog Analytics
box option command Description
Locate If LOCATE Selects the first occurrence of any type of literal, or of an expression that uses any
data type, or mix of data types. The table does not have to be indexed.
For example:
o Vendor_City = "New York"
o Invoice_Amount = 296.50
o Invoice_Date = `20141231`
o Vendor_City = v_city
o Vendor_City = v_city AND Invoice_Amount > 1000
Find Literal FIND Selects the first occurrence of a character literal (for example, New York) in a
character field indexed in ascending order.
Note
The FIND command and the FIND( ) function are two separate
Analytics features with significant differences.
Seek SEEK Selects the first occurrence of a character literal (for example, “New York”), or a
Expression character expression (for example, v_city), in a character field indexed in
ascending order.
Index requirement
To use the Find Literal or Seek Expression options, you must first index the character field that you
want to search, in ascending order. Both options search in the indexed field only.
If a table is indexed by more than one field (a nested index), only the primary key field is searched,
assuming it is a character field indexed in ascending order. If an index is conditional, any records
excluded from the view are also excluded from the search.
Guidelines
All options can be used with character fields. Only the Locate If option can be used with datetime
Data type or numeric fields.
Partial matching Partial matching is supported when searching character fields, however the search string must
Case sensitivity When used to search character fields, all options are case-sensitive.
The Locate If option searches a table sequentially and therefore is slower than the Find Literal or
Seek Expression options, which search indexed tables. However, the Locate If option does not
Performance require the time spent to index a table.
The Locate If option maintains the original order of the records in a table, which depending on the
Record order nature of your analysis may be desirable.
l Click Expression to open the Expression Builder, create an expression, click OK, and click
OK again.
The expression can be as simple or as complex as required, can involve one field or multiple
fields, and can mix data types. For example:
l Vendor_Name = "United Equipment"
l Invoice_Amount > 1000
l Vendor_Name = "United Equipment" AND Invoice_Amount > 1000 AND Invoice_Date >
`20140930`
You must enclose character literal values in quotation marks, and datetime values in
backquotes.
If the specified value is found, the table is positioned at that record.
If the specified value is not found, the table is positioned at the first record in the table.
OK again.
For example:
l v_vendor_name
l "United Equipment"
o Character Character
o Datetime
o Numeric
(you can also search by
Data types searchable record number)
o Field Field
Searches in o Fields
Yes Yes
(fully qualified field name
Searches in related fields must be specified)
No Yes
Index required (ascending order required)
Yes No Yes
(spaces in data or search (spaces in data or search
Leading spaces search- string treated like a string treated like a
able character) character)
Case-sensitive Yes
Yes Yes
(search string must appear (search string must appear at the start of the field)
at the start of the field,
Partial matching Character only)
The Locate Record and The Find Literal operation The Seek Expression
the Locate If operations in in the Search dialog box, operation in the Search
the Search dialog box, and and the FIND command, dialog box, and the SEEK
the LOCATE are identical. command, are identical.
RECORD/LOCATE
Additional remarks command, are identical.
Tip
To see the physical field name, right-click a column header in the table view and
Field names select Properties.
Related fields To search in a related field you must specify the fully qualified field name: table name.field name.
Each function has specific rules that govern how it works – things like supported data types, and case-
sensitivity.
Function
rules For a high-level comparison of the rules governing Analytics search functions, see "A comparison of
Analytics search functions" on page 1255. For detailed information about any function, click the linked
function name below.
Types of searches
You can use a function to search or filter text, numeric, or datetime data. However, you need to use
the right function for the type of data that you are searching or filtering:
l Data type supported by a function – Functions are designed to work with a specific data type,
or in some cases they can work with more than one data type.
For example, you can use the ISBLANK( ) function with text data (character data) but not with
numeric or datetime data. You can use the MATCH( ) or BETWEEN( ) functions with
character, numeric, or datetime data.
l Data type of the data – You need to be aware of the data type of the data that you are
searching or filtering and use a function appropriate for the data type. Numbers and dates
typically have a numeric or datetime data type. However, they may be using a character data
type.
Note
You can click any function name below for detailed information about the function.
Tip
You can copy and paste any of the examples below directly into the Filter text box,
and modify the search terms and other inputs to match your data.
Example Result
Example Result
Example Result
Example Result
Example Result
“United Equipment” or
"Muller Corp." in the
Vendor_Name field in
the related Vendor
table.
Example Result
Note
MATCH( ) examples assume that the Exact Character Comparisons option is off, except where
noted.
Description: A versatile search function that allows you to search a field for multiple search terms
simultaneously, or search multiple fields for the same search term. Also allows you to find matching
values in two fields.
Example Result
Example Result
Example Result
Example Result
Example Result
Example Result
Example Result
Example Result
Example Result
Example Result
Numeric searches
Search for a number
Use: "MATCH( ) function" on page 2375
Description: A versatile search function that allows you to search a field for multiple search terms
simultaneously, or search multiple fields for the same search term. Also allows you to find matching
values in two fields.
Example Result
Example Result
Example Result
Note
Using the FIND( ) or FINDMULTI( ) functions to search for a numeric value can be
tricky. The functions search the exact characters in the source data file (.fil), which
can be presented differently in the table view.
If search results seem inconsistent to you, examine the source data in the Table
Layout dialog box.
Example Result
Datetime searches
Search for a datetime value
Use: "MATCH( ) function" on page 2375
Description: A versatile search function that allows you to search a field for multiple search terms
simultaneously, or search multiple fields for the same search term. Also allows you to find matching
values in two fields.
Example Result
Example Result
Example Result
Note
Using the FIND( ) or FINDMULTI( ) functions to search for a datetime value can be
tricky. The functions search the exact characters in the source data file (.fil), which
can be presented differently in the table view.
If search results seem inconsistent to you, examine the source data in the Table
Layout dialog box.
Example Result
Character AT( )
FIND( )
FINDMULTI( )
ISFUZZYDUP( )
LEVDIST( )
MAP( )
OCCURS( )
REGEXFIND( )
Character BETWEEN( )
Datetime MATCH( )
Numeric
Yes AT( )
Leading spaces in data can optionally be matched in BETWEEN( )
search string
FIND( )
FINDMULTI( )
OCCURS( )
Yes MAP( )
Leading spaces in data must be exactly matched in MATCH( )
search string
Yes ISFUZZYDUP( )
Spaces in data or search string treated like a character LEVDIST( )
REGEXFIND( )
Case-sensitivity
Show me more
Function is case-sensitive Function
Yes AT( )
BETWEEN( )
MAP( ) (literal characters)
MATCH( )
OCCURS( )
REGEXFIND( )
No FIND( )
FINDMULTI( )
ISFUZZYDUP( )
MAP( ) (wildcard characters)
Optional LEVDIST( )
Partial matching
Show me more
Partial matching supported Function
Yes AT( )
Search string can appear anywhere in the field FIND( )
FINDMULTI( )
OCCURS( )
REGEXFIND( )
Yes BETWEEN( )
Search string must appear at the start of the field, MATCH( )
character data type only
Yes MAP( )
Yes ISFUZZYDUP( )
LEVDIST( )
Yes FINDMULTI( )
MATCH( )
REGEXFIND( )
No AT( )
BETWEEN( )
FIND( )
ISFUZZYDUP( )
LEVDIST( )
MAP( )
OCCURS( )
Yes BETWEEN( )
MATCH( )
No AT( )
FIND( )
FINDMULTI( )
ISFUZZYDUP( )
LEVDIST( )
MAP( )
OCCURS( )
REGEXFIND( )
Testing sequential order (the Examine Sequence option) allows you to verify whether data has
already been sorted or indexed, or whether it needs to be before you perform certain analytical tests,
or data combining operations.
Several tests and operations in Analytics require that data is in sequential order for the results to be
valid, or for the operation to execute successfully. Instead of unnecessarily sorting or indexing a
table, you can first test it to find out if sorting or indexing is required. Testing first can save time, as
sorting especially can require considerable time and system resources with large tables.
You can test the sequential order of character, numeric, datetime, or computed fields, or a
combination of fields and data types if the data is sorted or indexed by more than one field.
Note
Sequentially ordered data does not mean that the data has no gaps. For example,
the numeric series (1, 3, 5) is sequentially ordered. Testing for gaps is a different
operation. For more information, see "Testing for gaps" on page 1267.
1
3
6
4 sequence error
4
5
6
9
1 sequence error
2
Date Amount
(primary key field, ascending) (secondary key field, nested, descending)
Valid result
Returns 0 sequence errors:
The sequence test uses the same order of priority and direction as the fields being tested.
Invalid result
Returns 2 sequence errors:
The sequence test uses a different order of priority from the fields being tested, and treats the
Amount field as unnested.
Invalid result
Returns 5 sequence errors:
The sequence test uses a different direction from one of the fields being tested, and treats the
Amount field as sorted ascending.
Steps
You can use the Examine Sequence option to determine if one or more fields in the active table are
ordered sequentially, or to identify out-of-sequence items.
Note
Ensure that a quick sort is not currently applied to the active table. The view must
display the actual physical order of the underlying Analytics table for the Examine
Sequence option to provide valid results.
Show me how
1. Select Analyze > Sequence.
2. On the Main tab, do one of the following:
o Select the field(s) to test from the Sequence On list.
o Click Sequence On to select the field(s), or to create an expression.
If you select more than one field, the order in which you select the fields dictates the testing
priority. The records are tested by the first field you select, and if there are multiple sequential
occurrences of the same value in the first field, the records within the group are then tested by
the second field you select, and so on. If you do not select additional fields, records within a
group are not subject to any secondary testing.
Note
When testing tables sorted or indexed by more than one field (nested sorting or
indexing), testing priority needs to match sorting or indexing priority (primary
key field, secondary key field, and so on) for results to be valid.
The order in which you select the fields is the order in which the columns appear in the results.
3. If you clicked Sequence On, you can optionally specify a descending sort order for one or
more selected fields by clicking the sort arrow (the default is ascending).
Note
When testing fields that have been previously sorted or indexed, the direction
of the sort order you specify – ascending or descending – must match the
direction of the field you are testing for results to be valid.
4. If there are records in the current view that you want to exclude from processing, enter a
condition in the If text box, or click If to create an IF statement using the Expression Builder.
Note
The If condition is evaluated against only the records remaining in a table after
any scope options have been applied (First, Next, While).
The IF statement considers all records in the view and filters out those that do not meet the
specified condition.
5. Click the Output tab.
6. Select the appropriate output option in the To panel:
l Screen – Select this option to display the results in the Analytics display area.
Tip
You can click any linked result value in the display area to drill down to the
associated record or records in the source table.
If the output table contains a large number of records, it is faster and more useful to save
the results to a file than to display the results on the screen.
l Print – Select this option to send the results to the default printer.
l Graph – Select this option to create a graph of the results and display it in the Analytics
display area.
l File – Select this option to save or append the results to a text file. The file is saved outside
Analytics.
Note
Output options that do not apply to a particular analytical operation are
disabled.
7. If you selected File as the output type, specify the following information in the As panel:
l File Type – ASCII Text File or Unicode Text file (depending on which edition of Analytics
you are using) is the only option. Saves the results to a new text file, or appends the results
to an existing text file.
l Name – Enter a file name in the Name text box. Or click Name and enter the file name, or
select an existing file in the Save or Save File As dialog box to overwrite or append to the
file. If Analytics prefills a file name, you can accept the prefilled name, or change it.
You can also specify an absolute or relative file path, or navigate to a different folder, to
save or append the file in a location other than the project location. For example:
C:\Results\Output.txt or Results\Output.txt.
l Local – Disabled and selected. Saving the file locally is the only option.
8. Depending on the output type, you can optionally specify a Header and/or a Footer in the text
box(es).
Headers and footers are centered by default. Type a left angle bracket (<) before the header
or footer text to left align the text. Click Header or Footer to enter a header or footer of more
than one line. Alternatively, you can enter a semi-colon (;) as a line-break character in the
header or footer text box. Left aligning multiple lines requires a left angle bracket at the
beginning of each line.
9. Click the More tab.
10. Select the appropriate option in the Scope panel:
l All
l First
l Next
l While
Show me more
All This option is selected by default. Leave it selected to specify that all records in the view are
processed.
First Select this option and enter a number in the text box to start processing at the first record in the
view and include only the specified number of records.
Next Select this option and enter a number in the text box to start processing at the currently selected
record in the view and include only the specified number of records. The actual record number in
the leftmost column must be selected, not data in the row.
While Select this option to use a WHILE statement to limit the processing of records in the view based on
a particular criterion or set of criteria. You can enter a condition in the While text box, or click While
to create a WHILE statement using the Expression Builder.
A WHILE statement allows records in the view to be processed only while the specified condition
evaluates to true. As soon as the condition evaluates to false, the processing terminates, and no
further records are considered. You can use the While option in conjunction with the All, First, or
Next options. Record processing stops as soon as one limit is reached.
Note
The number of records specified in the First or Next options references either the physical or
the indexed order of records in a table, and disregards any filtering or quick sorting applied to
the view. However, results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
11. In the Error Limit field, specify the maximum number of non-sequential items to list, or keep
the default of 10.
If the limit is reached, Analytics stops processing and outputs the non-sequential items to that
point.The Error Limit number applies to the combined number of errors across all fields being
tested. It is not a per-field limit.
12. If you selected File as the output type, and want to append the output results to the end of an
existing text file, select Append To Existing File.
13. Click OK.
14. If the overwrite prompt appears, select the appropriate option.
Gaps in sequentially ordered numeric or datetime fields could indicate a data file is incomplete. You
can test for gaps in sequentially ordered values in a field, and identify one or more gaps or missing
items, if they exist.
For results to be valid, the field being tested must be in sequential order prior to testing. You can sort
a field in advance, or use the Presort option during the gaps test.
You can test numeric or datetime fields, or numbers in character fields. You can test only one field at
a time.
Note
The number you specify in Maximum Missing Items applies on a per-gap basis. It
does not limit the total number of missing item results across a data set, whether
listed individually or by range.
When using the missing items method, the results can contain a mix of individual missing items and
ranges depending on the value in the Maximum Missing Items field and the size of the different
gaps.
-2 2 1 (integer)
-1 3 1 (integer)
0 6 (to) 14 (Inclusive) 9 (integers)
1
4
5
15
In the second example the numeric data contains two decimal places. The allowable interval
is 0.01.
In the second example the data contains datetimes. The allowable interval is one second.
Number of missing
Test values Missing items items
some are not, or in the non-Unicode edition of Analytics if some preceding letters are lowercase and
some are uppercase, results may not be accurate.
The reason for the inaccuracy is that the inconsistent presence of alpha characters, or the
inconsistent case of alpha characters, prevents the numbers being fully sequentially ordered by the
Presort option. In the table below, 126 and 127, and 124, are not actually missing items, but
because of the way the alphanumeric strings are sorted they are returned as missing items.
If you suspect an anomaly exists, perform a separate sort operation on the field in question to reveal
the sequence of character field values being tested for gaps. If sequential numeric order is being
disrupted by the presence of letters, you can ensure valid results by using an Analytics function such
as INCLUDE( ) to strip out the letters before testing for gaps.
Steps
You can test a single field at a time in the active table to detect whether sequentially ordered
numbers or datetime values contain any gaps.
Show me how
Note
The If condition is evaluated against only the records remaining in a table after
any scope options have been applied (First, Next, While).
The IF statement considers all records in the view and filters out those that do not meet the
specified condition.
5. If the field is already sorted based on a prior operation, you can optionally deselect Presort to
save time when testing large tables for gaps.
If data in the field is not sorted you must leave Presort selected to ensure that all gaps are
found.
Note
If you deselect Presort, the field you select for gaps testing must have been
previously sorted for results to be valid. The message Warning: File out of
sequence accompanies results if you test an unsorted field. If you output
results to an Analytics table, the warning message appears in the command
log.
Tip
You can click any linked result value in the display area to drill down to the
associated record or records in the source table.
If the output table contains a large number of records, it is faster and more useful to save
the results to a file than to display the results on the screen.
l Print – Select this option to send the results to the default printer.
l Graph – Select this option to create a graph of the results and display it in the Analytics
display area.
l File – Select this option to save or append the results to an Analytics table or a text file. If
you save or append to an Analytics table, the table is added to the open project if it is not
already in the project. If you save or append to a text file, the file is saved outside Analytics.
Note
Output options that do not apply to a particular analytical operation are
disabled.
9. If you selected File as the output type, specify the following information in the As panel:
l File Type – Select Analytics Table to save the results to a new Analytics table, or append
the results to an existing Analytics table. Select ASCII Text File or Unicode Text file
(depending on which edition of Analytics you are using) to save or append the results to a
text file.
l Name – Enter a file name in the Name text box. Or click Name and enter the file name, or
select an existing file in the Save or Save File As dialog box to overwrite or append to the
file. If Analytics prefills a file name, you can accept the prefilled name, or change it.
You can also specify an absolute or relative file path, or navigate to a different folder, to
save or append the file in a location other than the project location. For example:
C:\Results\Output.fil or Results\Output.fil.
Note
Analytics table names are limited to 64 alphanumeric characters, not
including the .FIL extension. The name can include the underscore
character ( _ ), but no other special characters, or any spaces. The name
cannot start with a number.
l Local – Only enabled when connected to a server table and saving or appending the results
to an Analytics table. Select Local to save the file to the same location as the project, or to
specify a path or navigate to a different local folder. Leave Local deselected to save the file
to the Prefix folder on a server.
Note
For output results produced from analysis or processing of AX Server tables,
select Local. You cannot deselect the Local setting to import results tables to
AX Server.
10. Depending on the output type, you can optionally specify a Header and/or a Footer in the text
box(es).
Headers and footers are centered by default. Type a left angle bracket (<) before the header
or footer text to left align the text. Click Header or Footer to enter a header or footer of more
than one line. Alternatively, you can enter a semi-colon (;) as a line-break character in the
header or footer text box. Left aligning multiple lines requires a left angle bracket at the
beginning of each line.
11. Click the More tab.
12. Select the appropriate option in the Scope panel:
l All
l First
l Next
l While
Show me more
All This option is selected by default. Leave it selected to specify that all records in the view are
processed.
First Select this option and enter a number in the text box to start processing at the first record in the
view and include only the specified number of records.
Next Select this option and enter a number in the text box to start processing at the currently selected
record in the view and include only the specified number of records. The actual record number in
the leftmost column must be selected, not data in the row.
While Select this option to use a WHILE statement to limit the processing of records in the view based on
a particular criterion or set of criteria. You can enter a condition in the While text box, or click While
to create a WHILE statement using the Expression Builder.
A WHILE statement allows records in the view to be processed only while the specified condition
evaluates to true. As soon as the condition evaluates to false, the processing terminates, and no
further records are considered. You can use the While option in conjunction with the All, First, or
Next options. Record processing stops as soon as one limit is reached.
Note
The number of records specified in the First or Next options references either the physical or
the indexed order of records in a table, and disregards any filtering or quick sorting applied to
the view. However, results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
13. If you selected File as the output type, and want to append the output results to the end of an
existing file, do one of the following:
o Select Append To Existing File if you are appending to a text file, or to an Analytics table
that you are certain is identical in structure to the output results.
o Leave Append To Existing File deselected if you are appending to an Analytics table and
you want Analytics to compare the record lengths of the output results and the existing
table. If the record lengths are not identical, the data structure is not identical, and the
append will not work correctly.
Note
Leaving Append To Existing File deselected is recommended if you are
uncertain whether the output results and the existing table have an identical
data structure. For more information about appending and data structure, see
"Appending output results to an existing table" on page 205.
14. If you selected File (Analytics Table) as the output type, select Use Output Table if you want
the output table to open automatically upon completion of the operation.
15. Click OK.
16. If the overwrite prompt appears, select the appropriate option.
If you are expecting the Append option to appear and it does not, click No to cancel the
operation and see "Appending output results to an existing table" on page 205.
Duplicate values in one or more fields, or duplicate records, can be the result of data entry errors or
fraudulent activity such as splitting credit card transactions to avoid scrutiny.
Valid duplicates
Duplicate values may also be valid. For example, a transaction table could have duplicate customer
numbers because of multiple transactions by the same customers.
All values in a particular field should be unique, such as employee numbers, or check
One field numbers.
Example
In a payroll file covering a year, the employee number field and the pay date field
are going to contain numerous duplicates. Employees get paid every two weeks,
and multiple employees are paid on the same date.
However, an individual employee should appear only once for a particular date.
If a duplicate exists across the employee number and pay date fields in
Two or more fields in com- combination, an employee may have been paid twice for the same pay period.
bination
Checking for entire duplicate records, in which every field in a record is duplicated. Entire
duplicate records could be the result of data entry error, or other transactional irregular-
All fields in a record ities.
Instead, you achieve the same result by creating a filter based on group number:
Steps
You can test one or more fields in the active table to detect whether duplicate values or entire
duplicate records exist.
Show me how
You can test character, numeric, and datetime fields for duplicates. If letters and numbers appear
together in a character field, all alphanumeric characters are tested.
Note
For results to be valid, the field(s) being tested must be in sequential order prior to
testing. You can sort the field(s) in advance, or use the Presort option during the
duplicates test.
Additional fields can provide useful context for the results. Fields selected for duplicates
testing are displayed automatically at the beginning of any result records and do not need
to be specifically selected under List Fields.
d. Optional. Select Add Groups if you want to include the Group Number field in the output
table.
The Group Number field assigns a sequentially incremented number to each unique group
of duplicates.
4. To detect entire duplicate records:
a. In the Main tab, click Duplicates On.
b. Click Add All to add all fields to Selected Fields.
c. Optionally specify a descending sort order in the output results for one or more fields by
clicking the sort arrow (the default is ascending).
d. Click OK.
You do not need to select any fields from the List Fields list because all fields in the table
are displayed automatically in the result records.
e. Optional. Select Add Groups if you want to include the Group Number field in the output
table.
The Group Number field assigns a sequentially incremented number to each unique group
of duplicates.
Note
The If condition is evaluated against only the records remaining in a table after any
scope options have been applied (First, Next, While).
The IF statement considers all records in the view and filters out those that do not meet the specified
condition.
Note
If you deselect Presort, the field or fields you select for duplicates testing must
match the field or fields that were previously sorted for results to be valid.
The message Warning: File out of sequence accompanies results if there is a
mismatch between selected and sorted fields. If you output results to an Analytics
table, the warning message appears in the command log.
If data in field(s) is not sorted you must leave Presort selected to ensure that all duplicates are
found.
Tip
You can click any linked result value in the display area to drill down to the
associated record or records in the source table.
If the output table contains a large number of records, it is faster and more useful to save
the results to a file than to display the results on the screen.
l Print – Select this option to send the results to the default printer.
l Graph – Select this option to create a graph of the results and display it in the Analytics
display area.
l File – Select this option to save or append the results to an Analytics table or a text file. If
you save or append to an Analytics table, the table is added to the open project if it is not
already in the project. If you save or append to a text file, the file is saved outside Analytics.
Note
Output options that do not apply to a particular analytical operation are
disabled.
3. If you selected File as the output type, specify the following information in the As panel:
l File Type – Select Analytics Table to save the results to a new Analytics table, or append
the results to an existing Analytics table. Select ASCII Text File or Unicode Text file
(depending on which edition of Analytics you are using) to save or append the results to a
text file.
l Name – Enter a file name in the Name text box. Or click Name and enter the file name, or
select an existing file in the Save or Save File As dialog box to overwrite or append to the
file. If Analytics prefills a file name, you can accept the prefilled name, or change it.
You can also specify an absolute or relative file path, or navigate to a different folder, to
save or append the file in a location other than the project location. For example:
C:\Results\Output.fil or Results\Output.fil.
Note
Analytics table names are limited to 64 alphanumeric characters, not
including the .FIL extension. The name can include the underscore
character ( _ ), but no other special characters, or any spaces. The name
cannot start with a number.
l Local – Only enabled when connected to a server table and saving or appending the results
to an Analytics table. Select Local to save the file to the same location as the project, or to
specify a path or navigate to a different local folder. Leave Local deselected to save the file
to the Prefix folder on a server.
Note
For output results produced from analysis or processing of AX Server tables,
select Local. You cannot deselect the Local setting to import results tables to
AX Server.
4. Depending on the output type, you can optionally specify a Header and/or a Footer in the text
box(es).
Headers and footers are centered by default. Type a left angle bracket (<) before the header
or footer text to left align the text. Click Header or Footer to enter a header or footer of more
than one line. Alternatively, you can enter a semi-colon (;) as a line-break character in the
header or footer text box. Left aligning multiple lines requires a left angle bracket at the
beginning of each line.
l While
Show me more
All This option is selected by default. Leave it selected to specify that all records in the view are
processed.
First Select this option and enter a number in the text box to start processing at the first record in the
view and include only the specified number of records.
Next Select this option and enter a number in the text box to start processing at the currently selected
record in the view and include only the specified number of records. The actual record number in
the leftmost column must be selected, not data in the row.
While Select this option to use a WHILE statement to limit the processing of records in the view based on
a particular criterion or set of criteria. You can enter a condition in the While text box, or click While
to create a WHILE statement using the Expression Builder.
A WHILE statement allows records in the view to be processed only while the specified condition
evaluates to true. As soon as the condition evaluates to false, the processing terminates, and no
further records are considered. You can use the While option in conjunction with the All, First, or
Next options. Record processing stops as soon as one limit is reached.
Note
The number of records specified in the First or Next options references either the physical or
the indexed order of records in a table, and disregards any filtering or quick sorting applied to
the view. However, results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
Note
Leaving Append To Existing File deselected is recommended if you are
uncertain whether the output results and the existing table have an identical
data structure. For more information about appending and data structure, see
"Appending output results to an existing table" on page 205.
2. If you selected File (Analytics Table) as the output type, select Use Output Table if you want
the output table to open automatically upon completion of the operation.
3. Click OK.
Note
Only the duplicate values or records are displayed, and not the initial
occurrence of a value or record, if you do both of the following:
l output the results to screen or a text file
l include only tested fields in the output results and do not select any
additional fields
If you output to screen, you can click any value to see the initial occurrence of a
value or record along with the duplicates.
Remove duplicates
You can use the summarize operation to remove duplicate values or records from a data set and
save the remaining unique values or records to a new Analytics table.
Show me how
The order in which you select the fields is the order in which the columns appear in the results.
Note
Select the appropriate fields to achieve your required degree of uniqueness.
For example, if you want to remove duplicate employee records and you select
only the last name field, you risk removing all records for employees who have
the same last name, but a different first name. Select both the last name and
the first name fields to increase the degree of uniqueness.
To remove only perfectly duplicate records, click Summarize On and Add All.
Note
Select only fields that contain the same value for all records in each
summarized group. For more information, see "The Other Fields option" on
page 1343.
Note
The If condition is evaluated against only the records remaining in a table after any
scope options have been applied (First, Next, While).
The IF statement considers all records in the view and filters out those that do not meet the specified
condition.
Note
For output results produced from analysis or processing of Analytics
Exchange server tables, select Local. You cannot use the Local setting to
import results tables to AX Server.
l Next
l While
Show me more
All This option is selected by default. Leave it selected to specify that all records in the view are
processed.
First Select this option and enter a number in the text box to start processing at the first record in the
view and include only the specified number of records.
Next Select this option and enter a number in the text box to start processing at the currently selected
record in the view and include only the specified number of records. The actual record number in
the leftmost column must be selected, not data in the row.
While Select this option to use a WHILE statement to limit the processing of records in the view based on
a particular criterion or set of criteria. You can enter a condition in the While text box, or click While
to create a WHILE statement using the Expression Builder.
A WHILE statement allows records in the view to be processed only while the specified condition
evaluates to true. As soon as the condition evaluates to false, the processing terminates, and no
further records are considered. You can use the While option in conjunction with the All, First, or
Next options. Record processing stops as soon as one limit is reached.
Note
The number of records specified in the First or Next options references either the physical or
the indexed order of records in a table, and disregards any filtering or quick sorting applied to
the view. However, results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
Note
Leaving Append To Existing File deselected is recommended if you are
uncertain whether the output results and the existing table have an identical
data structure. For more information about appending and data structure, see
"Appending output results to an existing table" on page 205.
3. Click OK.
4. If the overwrite prompt appears, select the appropriate option.
If you are expecting the Append option to appear and it does not, click No to cancel the
operation and see "Appending output results to an existing table" on page 205.
How it works
The fuzzy duplicates feature in Analytics lets you test a specific character field in a table to identify
any fuzzy duplicates contained by the field. The output results group fuzzy duplicates based on a
degree of difference that you specify. By adjusting the degree of difference, you can control the
number and the size of output groups and the amount of difference between group members.
To confirm whether fuzzy duplicate group members do in fact reference the same real-world entity,
you may need to perform additional analysis, such as a duplicates test of fields other than the test
field.
Note
Testing for fuzzy duplicates is more involved than identifying exact duplicates.
Understanding the settings that control the degree of difference between fuzzy
duplicates, and how fuzzy duplicates are grouped in the output results, will help
optimize your use of the feature.
The output results are arranged in groups identified as 2, 3, and 6. The Original Record Number of
the first fuzzy duplicate in each group is used to identify the group. For example, “Janson” is the
name in record number 3 in the original table, and because “Janson” is the first value in the group,
based on record sequence in the original table, the group is identified as Group 3. For more
information, see "How fuzzy duplicates are grouped" on page 1308.
Example
Consider these names:
l “JW Smith” and “John William Smith”
l “Diamond Tire” and “Diamond Tire & Auto”
The first example could be two versions of the same name, one using initials and the other
using spelled-out first and middle names. The second example could be a short version and a
longer version of a company name.
Neither of these pairs of names will be returned as fuzzy duplicates unless the difference
settings are quite loose, which would have the adverse effect of also returning large numbers
of false positives.
The fuzzy duplicates feature processes each pair of names as simply two strings of
characters. In each case, because the two strings differ significantly in length, the strings are
significantly different from each other when considered at the character level.
For more information, see "How the difference settings work" on page 1304.
Limit the size of the test data set Filters Reduce execution time by
processing only records that are
Extracting subsets of data
meaningful to your analysis
Sort individual elements in test field SORTWORDS( ) function Reduce the size and increase the
values precision of results by minimizing the
importance of the physical position of
individual elements in test values
Note
Although the fuzzy
duplicates feature uses
character-based
comparison, sorting
words or elements in test
values has the benefit of
aligning characters more
closely between strings
being compared.
Remove generic elements from test OMIT( ) function Reduce the size and increase the
Concatenate fields to increase the an Analytics expression using the Reduce the size and increase the
uniqueness of test values Add operator (+) precision of results by testing values
of greater uniqueness, which are
produced by concatenating two or
more fields
Note
Although sorting test field values does not increase effectiveness, sorting individual
elements in field values with multiple elements, such as addresses, can significantly
increase effectiveness. For more information, see "Fuzzy duplicate helper functions"
on page 1295.
You can test a character field in the active table to detect whether nearly identical values exist (fuzzy
duplicates). You can optionally include identical values (exact duplicates) in the output results as
well as nearly identical values.
A message appears in the log if one or more fuzzy duplicate groups in the results reach the
maximum size. For more information, see "Controlling the size of fuzzy duplicate results" on
page 1300.
Steps
Note
Detailed information appears after the steps. See "Fuzzy Duplicates dialog box
options" on the next page.
Tip
Creating an expression is how you concatenate test fields, remove generic
elements from test field values, or sort individual elements in test field
values. For more information, see "Fuzzy duplicate helper functions" on
page 1295, and "Concatenating fields" on page 231.
3. Optional. Select one or more List Fields to include any additional field(s) in the results, or click
List Fields to select the field(s), to Add All fields, or to create an expression.
Additional fields can provide useful context for the results, and can help verify whether fuzzy
duplicates reference the same real-world entity.
Note
The field selected for fuzzy duplicates testing is displayed automatically at the
beginning of any result records and does not need to be specifically selected
under List Fields.
4. Specify a Difference Threshold to control the amount of difference between fuzzy duplicates.
The setting is explained below.
5. Do one of the following:
l Specify a Difference Percentage to control the percentage of each fuzzy duplicate that can
be different.
l Deselect Difference Percentage to turn it off.
8. If there are records in the current view that you want to exclude from processing, enter a
condition in the If text box, or click If to create an IF statement using the Expression Builder.
The IF statement considers all records in the view and filters out those that do not meet the
specified condition.
9. If you are connected to a server table, do one of the following:
l Select Local to save the output table to the same location as the project, or to specify a path
Note
For output results produced from analysis or processing of Analytics
Exchange server tables, select Local. You cannot deselect the Local setting
to import results tables to Analytics Exchange.
results.
l Click To and select an existing table in the Save or Save File As dialog box to overwrite or
Note
Analytics table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
number.
11. Select Use Output Table if you want the output table to open automatically upon completion
of the operation.
12. Click OK.
13. If the overwrite prompt appears, select the appropriate option.
The maximum size of the results relative to the size of the test field.
Specify a percentage from 1 to 1000 (one thousand). This option allows you to automat-
ically terminate the fuzzy duplicates operation if the size of the results grows beyond
what you consider useful.
For example, for a test field with 50,000 values, a Result Size (%) of 1 would terminate
processing if the results exceeded 500 fuzzy duplicates. No output table is produced if
processing is terminated.
If you turn off Result Size (%), Analytics does not impose any limit on the size of the
results.
Caution
Turning off Result Size (%) can produce an unduly large set of results
that takes a very long time to process, or can cause available memory to
be exceeded, which terminates processing. Turn off this option only if
you are confident that the results will be of a manageable size.
Result Size (%) For more information, see "Controlling the size of fuzzy duplicate results" on page 1300.
SORTWORDS function
When using the fuzzy duplicates feature, use the SORTWORDS( ) function to create an expression
or a computed field that sorts individual elements in test field values into a sequential order.
Sorting elements, such as the components of an address, reduces the importance of the physical
position of elements in fuzzy duplicates comparisons. The resulting improvement in effectiveness
allows you to use a much lower Difference Threshold and produce a smaller, more focused set of
results containing fewer false positives.
For detailed information, see "SORTWORDS( ) function" on page 2521. For more information about
the Difference Threshold, see "How the difference settings work" on page 1304.
For a video providing an overview of SORTWORDS( ), see Fuzzy Matching Using SORTWORDS()
(English only).
Example
The following two values would require a Difference Threshold of at least 22 to be included
in fuzzy duplicate output results:
l 125 SW 39TH ST, Suite 100
l Suite 100, 125 SW 39TH ST
The maximum allowable Difference Threshold is 10, so the fuzzy duplicates feature would
never identify the two values as fuzzy duplicates of each other. Although, clearly, they are the
same address.
By contrast, if you use SORTWORDS( ) to create an expression or a computed field that sorts
the individual address elements, a Difference Threshold of only 2 would return the two
addresses as fuzzy duplicates of each other:
l 100 125 39TH ST, SW Suite
l 100, 125 39TH ST SW Suite
OMIT function
When using the fuzzy duplicates feature, use the OMIT( ) function to create an expression or a
computed field that removes generic elements from test field values.
Removal of elements such as hyphens, commas, and number signs, and words or abbreviations
such as "Inc.", "Street", or "St.", focuses the fuzzy duplicates comparisons on just the portion of the
test values where a meaningful difference may occur. The resulting improvement in effectiveness
allows you to use a much lower Difference Threshold and produce a smaller, more focused set of
results containing fewer false positives.
For detailed information, see "OMIT( ) function" on page 2413. For more information about the
Difference Threshold, see "How the difference settings work" on page 1304.
Example
The following two values require a Difference Threshold of at least 8 to be included in fuzzy
duplicate output results:
l Intercity Couriers Corporation
l Inter-city Couriers Corp.
A Difference Threshold of 8 might produce a large, unfocused set of results containing many
false positives. However, a lower Difference Threshold would allow the two values to escape
detection as fuzzy duplicates of each other.
By contrast, if you use OMIT( ) to create an expression or a computed field that removes
generic elements such as "Corporation" and "Corp.", a Difference Threshold of only 1 would
return the two names as fuzzy duplicates of each other:
l Intercity Couriers
l Inter-city Couriers
ISFUZZYDUP function
After using the fuzzy duplicates feature and reviewing the results, you can use the ISFUZZYDUP( )
function to output a single, exhaustive list of fuzzy duplicates for a specific value in the results. You
can take this additional step for values that appear to be of particular relevance to your analysis
goal.
Exhaustive means that all values within the specified degree of difference of the test value are
returned, regardless of their position in the test field relative to the test value.
By design, the fuzzy duplicates feature organizes the output results in non-exhaustive groups. The
results, in total, are exhaustive, but the individual groups may or may not be. This approach
prevents the output results from becoming very large and unmanageable.
The non-exhaustive groups may be sufficient for the purposes of your analysis. If they are not, you
can use ISFUZZYDUP( ) to produce exhaustive results for individual values.
For detailed information, see "ISFUZZYDUP( ) function" on page 2342. For more information about
non-exhaustive groups, see "How fuzzy duplicates are grouped" on page 1308.
100*DEC(Lev_Dist,2)/MINIMUM(LENGTH(ALLTRIM(Group_Owner)), LENGTH
(ALLTRIM(fuzzy_dup_test_field))
Replace fuzzy_dup_test_field with the actual name of the fuzzy duplicates test field.
d. Click Accept Entry and click Close to exit the Table Layout dialog box.
5. Add the Lev_Dist and Diff_Pct computed fields to the view.
The difference threshold (Levenshtein distance) between each group owner and group
member, and the difference percentage that applies to each owner-member pair, is now
displayed.
For information about how to add fields to a view, see "Add columns to a view" on page 850.
6. If you want to rank the output results by their degree of fuzziness, do the following:
a. Extract all fields except the Group field to a new table, and filter out records in which the
Group field is not blank.
The ACLScript syntax for the extract operation appears below.
Replace fuzzy_dup_test_field with the actual name of the fuzzy duplicates test field.
b. Perform a nested sort of the extracted table using Lev_Dist as the first sort field and Diff_
Pct as the second sort field.
The ACLScript syntax for the sort operation appears below.
The fuzziness of the output results increases as you go down the table. The Group Number
field is the original record number of the group owner in each fuzzy duplicate pair, and the
Original Record Number field is the original record number of the group member in each
pair.
For information about how to create a nested sort, see "Sorting on multiple key fields" on
page 1201.
Note
This setting has no effect on the inclusion or exclusion of false positives.
l Limit fuzzy duplicate group size – use the SET command to specify a maximum fuzzy
duplicate group size smaller than the default size of 20 — for example, SET FUZZYGROUPSIZE TO
10.
Note
This setting has no effect on the inclusion or exclusion of false positives.
Caution
Some of the methods itemized above, if set too restrictively, can exclude valid fuzzy
duplicates. You may need to try different combinations of settings to find out what
works best for a particular data set.
The methods least likely to exclude valid fuzzy duplicates are concatenating test
fields, using the SORTWORDS( ) function, and using the OMIT( ) function.
Why you can specify a result size limit greater than one
hundred percent
By default, the maximum size of the set of results is 10% of the size of the test field. You can specify
a different percentage from 1 to 1000 (one thousand). The limit of 1000% is to accommodate the
nature of many-to-many matching, and to prevent runaway processing. Many-to-many matching can
produce results that are more numerous than the original test data set. However, results that exceed
the size of the original test data set may be primarily false positives.
The greater the Levenshtein distance, the greater the difference between two values. A distance of
0 (zero) means two values are identical.
The table below provides examples of various Levenshtein distances. For more information about
Levenshtein distance, see LEVDIST( ).
Note
The Levenshtein algorithm treats blanks or spaces between words as characters.
Smith Brown 5 No
If the difference percentage is less than or equal to the specified Difference Percentage, the two
values are eligible to be included in the results, assuming they are also within the maximum
allowable Levenshtein distance of each other (the Difference Threshold).
The table below provides examples of various difference percentages.
With each comparison, the operation determines whether the two compared values are fuzzy
duplicates based on the difference settings you specified. (For information about the difference
settings, see "How the difference settings work" on page 1304.) If the two values are fuzzy
duplicates, they are placed together in a group. Redundant matches are suppressed (explained
later in this topic). The results of a fuzzy duplicates operation can contain multiple groups.
groups may not contain all the fuzzy duplicates in a test field that are within the specified degree of
difference of the group owner. However, if a group owner is a fuzzy duplicate of another value in the
test field, the two values will appear together in a group somewhere in the results, but not
necessarily in the group associated with the group owner. So groups may be non-exhaustive, but
the results, in total, are exhaustive.
If producing a single, exhaustive list of fuzzy duplicates for a specific value in the test field is
important to your analysis, you can use the ISFUZZYDUP( ) function for this purpose. For more
information, see "Fuzzy duplicate helper functions" on page 1295.
Rule Explanation
The owner-member relation is non- Because the fuzzy duplicates operation moves sequentially down the test
reciprocal field, group owners are associated with only those fuzzy duplicates that
appear below them in the field, not with any that appear above them.
In many cases, a group owner is a member of one or more groups that
appear above it. However, the reverse is not true. The owners of the groups
above are not members of the subsequent group. Once a value becomes a
group owner it never appears in a subsequent group.
In the example above, the Group 6 owner, “Jansen”, is a member of two
previous groups, but the owners of those groups (“Hansen” and “Janson”),
even though they are fuzzy duplicates of “Jansen”, are not members of
Group 6.
If two values are members of a In the example above, “Jansen”, “Jansan”, and “Jansn” are all members of
previous group, they will not be put Group 3. When “Jansen” becomes the Group 6 owner, “Jansan” and
together in a subsequent group if one “Jansn” are not placed in the group, even though they are both fuzzy
of the values is the owner of the duplicates that appear below “Jansen” in the test field.
subsequent group
If two values are members of a In the example above, “Hanson” and “Jansen” appear together in both
previous group, they can appear Group 2 and Group 3. In this instance, appearance together in more than
together in a subsequent group if one group can occur because the degree of difference is being measured
neither of the values is the owner of the from the respective group owners, not from each other.
subsequent group
Note
On occasion, there can be exceptions to the second and third rules. During execution, the fuzzy
duplicates operation stores temporary values. If the space allotted to these temporary values is filled,
the result can be some group owners with one or more group members that are redundant. (The
owner and the member have appeared together in a previous group.) The smaller the specified
maximum size for fuzzy duplicate groups, the more likely it is that this redundancy can occur.
Data processed
in descending
Input data sequence Output results
1 Ronson
4 Hanssen
5 Hanson
7 Jansan Jansn
8 Janszen
9 Jansn
l “Ronson (3)” does not form a group with “Ronson (4)” because the two values are already
together in Group 1.
l “Jansen (9)” is excluded from the group formed by “Jansen (8)” because the two values are
already together in Group 2 and Group 5.
Data processed in
descending
Input data sequence Output results
4 Ronson
5 Janson Hanson, Jansen (8), 5 Janson Hanson, Jansen (8), Jansen (9),
Jansen (9), Jansan, Jansan, Jansn
Jansn
6 Hanssen
7 Hanson
10 Jansan Jansn
11 Janszen
12 Jansn
(Difference settings: Difference Threshold = 1, Difference Percentage = 99, Include Exact Duplicates = Y)
Grouping data
Grouping data creates an overview that can help identify patterns, trends, irregularities, or outliers.
You group data based on values in a field, or on combinations of values in more than one field.
Grouping allows you to determine how many records, and how much value or quantity, is
concentrated by the measures or identifiers that you choose.
l Transaction code
l Product identifier
l Location code
Grouping operations
Operation Data type Functionality Output
Stratifying data
Stratifying groups the records in a table into numeric intervals (value ranges) based on values in a
numeric field, and counts the number of records in each interval.
For example, you could stratify an accounts receivable table on the invoice amount field to group
records into $5000 intervals – invoices from $0 to $4,999.99, from $5,000 to $9,999.99, and so on –
and to find the total number of transactions, and the total transaction amount, for each interval.
Note
If you do not specify a subtotal field, the field you are stratifying on is automatically
subtotaled.
Equal-sized intervals
Analytics calculates equal-sized intervals by grouping the values in the key field into a specified
number of intervals.
To create equal-sized intervals, you specify the minimum value of the first interval and the maximum
value of the last interval, and the number of intervals you want.
Tip
If you use the actual minimum and maximum values in the field, the interval size is
typically not a round amount. If you want the interval size to be a round amount, you
can specify minimum and maximum values in round amounts – for example, 0 and
5000.
Custom-sized intervals
Analytics calculates custom-sized intervals by grouping the values in the key field into intervals with
starting values that you specify.
To create custom-sized intervals, you specify the start value of each interval and the end value of
the last interval. You can create equal-sized intervals, or intervals that vary in size.
Stratifying in detail
Stratifying performs the following operations:
Location in "Stratify
Operation results" below
Groups the records into intervals based on a numeric field Trans Amount field, first
Counts (subtotals) the number of records falling into each interval, and calculates the Count field
percentage of the total count represented by each subtotal
Percent of Count field
Provides the minimum and maximum values in the numeric field being stratified not shown
Optionally subtotals the values of one or more numeric fields for each interval, and for Trans Amount field,
the first selected field calculates the percentage of the field total represented by each second
subtotal
Percent of Field field
Optionally calculates average, minimum, and maximum values for each subtotaled not shown
numeric field
Provides totals for all numeric fields included in the output results Totals row
Optionally breaks down the output results based on the values in a character field such not shown
as customer ID or transaction type (requires that the character field is sorted prior to
stratifying)
Stratify results
Output results produced by:
l stratifying on transaction amount in an accounts receivable table
(the Ar table in ACL DATA\Sample Data Files\Sample Project.ACL)
l using $1000 intervals
l outputting the results to screen
Steps
You can stratify data by grouping the records in a table into equal-sized, or custom-sized, numeric
intervals.
For each interval, you can optionally include the following calculations for associated numeric fields:
subtotal, average value, minimum value, maximum value.
Show me how
1. Select Analyze > Stratify.
2. On the Main tab, do one of the following:
o Select a field to stratify on from the Stratify On drop-down list.
o Click Stratify On to select the field, or to create an expression.
3. Optional. Select one or more Subtotal Fields, or click Subtotal Fields, to select the subtotal
field(s), or to create an expression.
If you do not select a subtotal field, the field you are stratifying on is automatically subtotaled.
You must explicitly select the stratify field if you want to subtotal it along with one or more
other fields, or if you want to include statistics for the subtotaled stratify field.
The order in which you select the subtotal fields is the order in which the columns appear in
the results. If you are appending results to an existing Analytics table, the column selection
and order must be identical to the column selection and order in the existing table.
4. In Minimum, enter the minimum value of the first interval.
If you previously performed a profile or statistics operation on the stratify field, the lowest
value in the stratify field is automatically entered by default. You can change the default, if
required.
5. In Maximum, enter the maximum value of the last interval.
If you previously performed a profile or statistics operation on the stratify field, the highest
value in the stratify field is automatically entered by default. You can change the default, if
required.
6. Under Interval Size, do one of the following:
o Select Equal, and enter the number of equal-sized intervals that you want in the range
specified by the Minimum and Maximum values. The default number of intervals is 10.
Tip
You can change the default number of intervals by selecting Tools >
Options and updating the Intervals number on the Command tab.
o Select Custom to create custom-sized intervals, and enter the start value of each interval
and the end value of the last interval. You must enter each value on a separate line. For
example:
1
26
51
76
100
Specifying Minimum and Maximum values is optional when you use Custom. If you do
specify Minimum and Maximum values, those values are the start point of the first interval
and the end point of the last interval. The values that you enter in the Custom field create
additional intervals within the range. The Custom values must be greater than the value
specified in Minimum, and equal to or less than the value specified in Maximum.
7. If there are records in the current view that you want to exclude from processing, enter a
condition in the If text box, or click If to create an IF statement using the Expression Builder.
Note
The If condition is evaluated against only the records remaining in a table after
any scope options have been applied (First, Next, While).
The IF statement considers all records in the view and filters out those that do not meet the
specified condition.
8. Optional. Select Include Statistics for Subtotal Fields if you want to calculate average,
minimum, and maximum values for each subtotaled numeric field.
You must select at least one subtotal field in order to include statistics.
9. Click the Output tab.
10. Select the appropriate output option in the To panel:
l Screen – Select this option to display the results in the Analytics display area.
Tip
You can click any linked result value in the display area to drill down to the
associated record or records in the source table.
If the output table contains a large number of records, it is faster and more useful to save
the results to a file than to display the results on the screen.
l Print – Select this option to send the results to the default printer.
l Graph – Select this option to create a graph of the results and display it in the Analytics
display area.
l File – Select this option to save or append the results to an Analytics table or a text file. If
you save or append to an Analytics table, the table is added to the open project if it is not
already in the project. If you save or append to a text file, the file is saved outside Analytics.
Note
Output options that do not apply to a particular analytical operation are
disabled.
11. If you selected File as the output type, specify the following information in the As panel:
l File Type – Select Analytics Table to save the results to a new Analytics table, or append
the results to an existing Analytics table. Select ASCII Text File or Unicode Text file
(depending on which edition of Analytics you are using) to save or append the results to a
text file.
l Name – Enter a file name in the Name text box. Or click Name and enter the file name, or
select an existing file in the Save or Save File As dialog box to overwrite or append to the
file. If Analytics prefills a file name, you can accept the prefilled name, or change it.
You can also specify an absolute or relative file path, or navigate to a different folder, to
save or append the file in a location other than the project location. For example:
C:\Results\Output.fil or Results\Output.fil.
Note
Analytics table names are limited to 64 alphanumeric characters, not
including the .FIL extension. The name can include the underscore
character ( _ ), but no other special characters, or any spaces. The name
cannot start with a number.
l Local – Only enabled when connected to a server table and saving or appending the results
to an Analytics table. Select Local to save the file to the same location as the project, or to
specify a path or navigate to a different local folder. Leave Local deselected to save the file
to the Prefix folder on a server.
Note
For output results produced from analysis or processing of AX Server tables,
select Local. You cannot deselect the Local setting to import results tables to
AX Server.
12. Depending on the output type, you can optionally specify a Header and/or a Footer in the text
box(es).
Headers and footers are centered by default. Type a left angle bracket (<) before the header
or footer text to left align the text. Click Header or Footer to enter a header or footer of more
than one line. Alternatively, you can enter a semi-colon (;) as a line-break character in the
header or footer text box. Left aligning multiple lines requires a left angle bracket at the
beginning of each line.
13. Click the More tab.
14. Select the appropriate option in the Scope panel:
l All
l First
l Next
l While
Show me more
All This option is selected by default. Leave it selected to specify that all records in the view are
processed.
First Select this option and enter a number in the text box to start processing at the first record in the
view and include only the specified number of records.
Next Select this option and enter a number in the text box to start processing at the currently selected
record in the view and include only the specified number of records. The actual record number in
the leftmost column must be selected, not data in the row.
While Select this option to use a WHILE statement to limit the processing of records in the view based on
a particular criterion or set of criteria. You can enter a condition in the While text box, or click While
to create a WHILE statement using the Expression Builder.
A WHILE statement allows records in the view to be processed only while the specified condition
evaluates to true. As soon as the condition evaluates to false, the processing terminates, and no
further records are considered. You can use the While option in conjunction with the All, First, or
Next options. Record processing stops as soon as one limit is reached.
Note
The number of records specified in the First or Next options references either the physical or
the indexed order of records in a table, and disregards any filtering or quick sorting applied to
the view. However, results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
15. If you do not want to include values that exceed the specified Minimum and Maximum values,
select Suppress Others.
16. If you want to break down the output results based on the values in a character field, enter the
field name in the Break text box, or click Break to select the field, or to create an expression.
For example, the results of stratifying an accounts receivable table by transaction amount
could be further broken down by customer. Break can only be used with a single character
field, so nested breakdowns are not supported.
Note
For the Break option to yield meaningful results, the character field used for
the breakdown must be sorted prior to stratifying.
17. If you selected File as the output type, and want to append the output results to the end of an
existing file, do one of the following:
o Select Append To Existing File if you are appending to a text file, or to an Analytics table
that you are certain is identical in structure to the output results.
o Leave Append To Existing File deselected if you are appending to an Analytics table and
you want Analytics to compare the record lengths of the output results and the existing
table. If the record lengths are not identical, the data structure is not identical, and the
append will not work correctly.
Note
Leaving Append To Existing File deselected is recommended if you are
uncertain whether the output results and the existing table have an identical
data structure. For more information about appending and data structure, see
"Appending output results to an existing table" on page 205.
18. If you selected File (Analytics Table) as the output type, select Use Output Table if you want
the output table to open automatically upon completion of the operation.
19. Click OK.
20. If the overwrite prompt appears, select the appropriate option.
If you are expecting the Append option to appear and it does not, click No to cancel the
operation and see "Appending output results to an existing table" on page 205.
Aging data
Aging groups the records in a table into aging periods based on values in a date or datetime field,
and counts the number of records in each period.
Common uses of aging include evaluating sales trends, looking at transaction volumes, and
grouping invoices by the number of days outstanding.
For example, you could age an accounts receivable table on the invoice date field to group records
into 30-day periods – invoices from the cutoff date to 29 days previous, from 30 days previous to 59
days previous, and so on – and to find the total number of outstanding invoices for each period.
Note
You can age on datetime values, however only the date portion of the values is
considered. The time portion is ignored. You cannot age on time data alone.
Aging in detail
Aging performs the following operations:
Location in "Aging
Operation results" on the next page
Groups the records into aging periods based on cutoff date and date intervals Days field
Counts (subtotals) the number of records in each aging period, and calculates the Count field
percentage of the total count represented by each subtotal
Percent of Count field
Provides the minimum and maximum ages of records (that is, the most recent and the not shown
oldest)
Optionally subtotals the values of one or more numeric fields for each aging period, and Trans Amount field
for the first selected field calculates the percentage of the total value represented by
Percent of Field field
each subtotal
Optionally calculates average, minimum, and maximum values for each subtotaled not shown
numeric field
Provides totals for all numeric fields included in the output results Totals row
Optionally breaks down the output results based on the values in a character field such not shown
as customer ID or transaction type (requires that the character field is sorted prior to
aging)
Aging results
Output results produced by:
l aging on invoice date in an accounts receivable table
(the Ar table in ACL DATA\Sample Data Files\Sample Project.ACL)
l subtotaling transaction amount
l using 30-day aging periods
l outputting the results to screen
Note
If you output the results to screen or graph, the graph displays the count subtotals for
each aging period, or the numeric subtotals if you include one or more numeric
subtotal fields in the aging operation.
Steps
You can age data by grouping the records in a table into aging periods.
For each period, you can optionally include the following calculations for associated numeric fields:
subtotal, average value, minimum value, maximum value.
Show me how
1. Select Analyze > Age.
2. On the Main tab, do one of the following:
o Select the field on which to base the aging from the Age On drop-down list.
o Click Age On to select the field, or to create an expression.
3. In the Cutoff Date field, leave the default current date, or do one of the following to specify a
different cutoff date:
l Edit the date directly in the Cutoff Date field.
l Click the down arrow to select a date from the calendar. You can use the left or right arrows
to move backward or forward one month at a time, or click the month and year, year, or
decade at the top center of the calendar to move backward or forward in larger intervals of
time.
Specifying a different cutoff date allows you to align the beginning of the first aging period with
a date such as a fiscal period end date. If you leave the default date, the first aging period
begins on the current date, which may or may not be appropriate for your analysis.
4. Enter the aging periods to use in the Aging Periods text box, or keep the default values.
The aging period values must be entered in days. Each value must be listed on a separate
line from lowest to highest (most recent to oldest). A value of ‘0’ specifies that the first aging
period begins on the specified cutoff date. The final value specifies the end of the oldest aging
period.
Note
You can change the values used for the default aging periods by selecting
Tools > Options and updating the Aging Periods on the Date and Time tab.
5. Optional. Select one or more Subtotal Fields, or click Subtotal Fields, to select the subtotal
field(s), or to create an expression.
The order in which you select the subtotal fields is the order in which the columns appear in
the results. If you are appending results to an existing Analytics table, the column selection
and order must be identical to the column selection and order in the existing table.
6. If there are records in the current view that you want to exclude from processing, enter a
condition in the If text box, or click If to create an IF statement using the Expression Builder.
Note
The If condition is evaluated against only the records remaining in a table after
any scope options have been applied (First, Next, While).
The IF statement considers all records in the view and filters out those that do not meet the
specified condition.
7. Optional. Select Include Statistics for Subtotal Fields if you want to calculate average,
minimum, and maximum values for each subtotaled numeric field.
You must select at least one subtotal field in order to include statistics.
8. Click the Output tab.
9. Select the appropriate output option in the To panel:
l Screen – Select this option to display the results in the Analytics display area.
Tip
You can click any linked result value in the display area to drill down to the
associated record or records in the source table.
If the output table contains a large number of records, it is faster and more useful to save
the results to a file than to display the results on the screen.
l Print – Select this option to send the results to the default printer.
l Graph – Select this option to create a graph of the results and display it in the Analytics
display area.
l File – Select this option to save or append the results to a text file. The file is saved outside
Analytics.
Note
Output options that do not apply to a particular analytical operation are
disabled.
10. If you selected File as the output type, specify the following information in the As panel:
l File Type – ASCII Text File or Unicode Text file (depending on which edition of Analytics
you are using) is the only option. Saves the results to a new text file, or appends the results
to an existing text file.
l Name – Enter a file name in the Name text box. Or click Name and enter the file name, or
select an existing file in the Save or Save File As dialog box to overwrite or append to the
file. If Analytics prefills a file name, you can accept the prefilled name, or change it.
You can also specify an absolute or relative file path, or navigate to a different folder, to
save or append the file in a location other than the project location. For example:
C:\Results\Output.txt or Results\Output.txt.
l Local – Disabled and selected. Saving the file locally is the only option.
11. Depending on the output type, you can optionally specify a Header and/or a Footer in the text
box(es).
Headers and footers are centered by default. Type a left angle bracket (<) before the header
or footer text to left align the text. Click Header or Footer to enter a header or footer of more
than one line. Alternatively, you can enter a semi-colon (;) as a line-break character in the
header or footer text box. Left aligning multiple lines requires a left angle bracket at the
beginning of each line.
12. Click the More tab.
13. Select the appropriate option in the Scope panel:
l All
l First
l Next
l While
Show me more
All This option is selected by default. Leave it selected to specify that all records in the view are
processed.
First Select this option and enter a number in the text box to start processing at the first record in the
view and include only the specified number of records.
Next Select this option and enter a number in the text box to start processing at the currently selected
record in the view and include only the specified number of records. The actual record number in
the leftmost column must be selected, not data in the row.
While Select this option to use a WHILE statement to limit the processing of records in the view based on
a particular criterion or set of criteria. You can enter a condition in the While text box, or click While
to create a WHILE statement using the Expression Builder.
A WHILE statement allows records in the view to be processed only while the specified condition
evaluates to true. As soon as the condition evaluates to false, the processing terminates, and no
further records are considered. You can use the While option in conjunction with the All, First, or
Next options. Record processing stops as soon as one limit is reached.
Note
The number of records specified in the First or Next options references either the physical or
the indexed order of records in a table, and disregards any filtering or quick sorting applied to
the view. However, results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
14. If you want to exclude from the output results any values that fall outside the specified aging
periods, select Suppress Others.
15. If you want to break down the output results based on the values in a character field, enter the
field name in the Break text box, or click Break to select the field, or to create an expression.
For example, an aged summary of an accounts receivable table could be broken down by
customer. Break can only be used with a single character field, so nested breakdowns are not
supported.
Note
For the Break option to yield meaningful results, the character field must be
sorted prior to aging.
16. If you selected File as the output type, and want to append the output results to the end of an
existing text file, select Append To Existing File.
17. Click OK.
If you output the results to screen or graph, you can switch between the two output types
using the Text and Graph buttons at the bottom of the display area.
18. If the overwrite prompt appears, select the appropriate option.
Calculates and reports the number of times a key field value appears Yes Yes
in a table
Computes and displays subtotals for selected numeric fields Yes Yes
Computes and displays average, minimum, and maximum values for Yes Yes
subtotaled numeric fields
Classifying data
Classifying groups the records in a table based on identical key field values, and counts the number
of records in each group. Key fields can be character or numeric.
For example, you could classify a transactions table on the customer number field to find the total
number of transactions for each customer.
In the example below, there are ten values in the Customer Number field in the input table. Some
values are unique, and some values are identical. After summarizing, the values are grouped into
four unique groups. The Count tells you how many records, or transactions, are in each customer
number group.
795401 230575 1
518008 518008 5
518008 795401 3
925007 925007 1
518008
795401
518008
230575
795401
518008
Classifying in detail
Classifying performs the following operations:
Location in "Classify
Operation results" on the next page
Groups the records based on identical values in a character or numeric field Product Class field
Counts (subtotals) the number of records for each group, and calculates the percentage Count field
of the total count represented by each subtotal
Percent of Count field
Optionally subtotals the values of one or more numeric fields for each group, and for the Inventory Value at Cost
first selected numeric field calculates the percentage of the total value represented by field
each subtotal
Percent of Field field
Optionally calculates average, minimum, and maximum values for each subtotaled not shown
numeric field
Provides totals for all numeric fields included in the output results Totals row
Optionally breaks down the output results based on the values in a character field such not shown
as customer ID or transaction type (requires that the character field is sorted prior to
classifying)
Classify results
Output results produced by:
l classifying on product class in an inventory table
(the Inventory table in ACL DATA\Sample Data Files\Sample Project.ACL)
l subtotaling inventory value
l outputting the results to screen
The results show that the inventory value is concentrated in four product classes: 03, 04, 08, 09.
Steps
You can classify data by grouping the records in a table based on identical values in a character or
numeric field.
For each group, you can optionally include the following calculations for associated numeric fields:
subtotal, average value, minimum value, maximum value.
Show me how
Note
Classifying supports a maximum key field length of 2048 characters.
If you want to classify a table using a key field longer than 2048 characters, you can
summarize, which does not have a length restriction. For more information, see
"Summarizing data" on page 1338.
If you classify a larger data set and output the results to screen or graph, you may
exceed available memory. You can reduce memory usage when outputting to
screen by selecting Suppress XML Output for Command Results (Tools > Options
> Command).
Note
The If condition is evaluated against only the records remaining in a table after
any scope options have been applied (First, Next, While).
The IF statement considers all records in the view and filters out those that do not meet the
specified condition.
5. Optional. Select Include Statistics for Subtotal Fields if you want to calculate average,
minimum, and maximum values for each subtotaled numeric field.
You must select at least one subtotal field in order to include statistics.
6. Click the Output tab.
7. Select the appropriate output option in the To panel:
l Screen – Select this option to display the results in the Analytics display area.
Tip
You can click any linked result value in the display area to drill down to the
associated record or records in the source table.
If the output table contains a large number of records, it is faster and more useful to save
the results to a file than to display the results on the screen.
l Print – Select this option to send the results to the default printer.
l Graph – Select this option to create a graph of the results and display it in the Analytics
display area.
l File – Select this option to save or append the results to an Analytics table. The table is
added to the open project if it is not already in the project.
Note
Output options that do not apply to a particular analytical operation are
disabled.
8. If you selected File as the output type, specify the following information in the As panel:
l File Type – Analytics Table is the only option. Saves the results to a new Analytics table, or
or select an existing table in the Save or Save File As dialog box to overwrite or append to
the table. If Analytics prefills a table name, you can accept the prefilled name, or change it.
You can also specify an absolute or relative file path, or navigate to a different folder, to
save or append the table in a location other than the project location. For example:
C:\Results\Output.fil or Results\Output.fil.
Note
Analytics table names are limited to 64 alphanumeric characters, not
including the .FIL extension. The name can include the underscore
character ( _ ), but no other special characters, or any spaces. The name
cannot start with a number.
l Local – Only enabled when connected to a server table. Select Local to save the output
table to the same location as the project, or to specify a path or navigate to a different local
folder. Leave Local deselected to save the output table to the Prefix folder on a server.
Note
For output results produced from analysis or processing of AX Server tables,
select Local. You cannot deselect the Local setting to import results tables to
AX Server.
9. Depending on the output type, you can optionally specify a Header and/or a Footer in the text
box(es).
Headers and footers are centered by default. Type a left angle bracket (<) before the header
or footer text to left align the text. Click Header or Footer to enter a header or footer of more
than one line. Alternatively, you can enter a semi-colon (;) as a line-break character in the
header or footer text box. Left aligning multiple lines requires a left angle bracket at the
beginning of each line.
10. Click the More tab.
11. Select the appropriate option in the Scope panel:
l All
l First
l Next
l While
Show me more
All This option is selected by default. Leave it selected to specify that all records in the view are
processed.
First Select this option and enter a number in the text box to start processing at the first record in the
view and include only the specified number of records.
Next Select this option and enter a number in the text box to start processing at the currently selected
record in the view and include only the specified number of records. The actual record number in
the leftmost column must be selected, not data in the row.
While Select this option to use a WHILE statement to limit the processing of records in the view based on
a particular criterion or set of criteria. You can enter a condition in the While text box, or click While
to create a WHILE statement using the Expression Builder.
A WHILE statement allows records in the view to be processed only while the specified condition
evaluates to true. As soon as the condition evaluates to false, the processing terminates, and no
further records are considered. You can use the While option in conjunction with the All, First, or
Next options. Record processing stops as soon as one limit is reached.
Note
The number of records specified in the First or Next options references either the physical or
the indexed order of records in a table, and disregards any filtering or quick sorting applied to
the view. However, results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
12. If you want to break down the output results based on the values in a character field, enter the
field name in the Break text box, or click Break to select the field, or to create an expression.
For example, the results of classifying an accounts receivable table by transaction type could
be further broken down by customer. Break can only be used with a single character field, so
nested breakdowns are not supported.
Note
For the Break option to yield meaningful results, the character field used for
the breakdown must be sorted prior to classifying.
13. If you selected File (Analytics Table) as the output type, select Use Output Table if you want
the output table to open automatically upon completion of the operation.
14. If you selected File as the output type, and want to append the output results to the end of an
existing Analytics table, do one of the following:
o Select Append To Existing File if you are certain the output results and the existing table
are identical in structure.
o Leave Append To Existing File deselected if you want Analytics to compare the record
lengths of the output results and the existing table. If the record lengths are not identical,
the data structure is not identical, and the append will not work correctly.
Note
Leaving Append To Existing File deselected is recommended if you are
uncertain whether the output results and the existing table have an identical
data structure. For more information about appending and data structure, see
"Appending output results to an existing table" on page 205.
Summarizing data
Summarizing groups the records in a table based on identical values in one or more key fields, and
counts the number of records in each group. You also have the option of performing various
statistical calculations for each group.
If you summarize by more than one key field (nested summarizing), groups are based on identical
combinations of values across the key fields.
Key fields can be character, numeric, or datetime.
795401 230575 1
518008 518008 5
518008 795401 3
925007 925007 1
518008
795401
518008
230575
795401
518008
230575 06/13/2016
795401 06/30/2016
518008 07/17/2016
Nesting hierarchy
The order in which you select the key fields dictates the nesting hierarchy. The records are
summarized by the first field you select, and within each of these primary groupings the records are
then summarized by the second field you select, and so on.
Note
Reversing the order in which you select two summarize key fields may give quite
different results.
Tip
If the input table is already sorted, you can save processing time by deselecting the
Presort option.
Note
Depending on the context, more than one group for each set of identical values, or
identical combination of values, can defeat the purpose of summarizing.
Median + subtotaled c_subtotaled field name The median value for each
alternate column title group
o Odd-numbered sets of
values: the middle
value
o Even-numbered sets of
values: the average of
the two values at the
middle
Q25 + subtotaled alternate q_subtotaled field name The first quartile value for
column title each group (lower quartile
value)
o The result is an
interpolated value
based on an Analytics
algorithm
o Produces the same
result as the
QUARTILE and
QUARTILE.INC
functions in Microsoft
Excel
Q75 + subtotaled alternate p_subtotaled field name The third quartile value for
column title each group (upper quartile
value)
o The result is an
interpolated value
based on an Analytics
algorithm
o Produces the same
result as the
QUARTILE and
QUARTILE.INC
functions in Microsoft
Median, Mode, Q25, Q75 Excel
Note
Does not
require a
% of Count subtotal field
Summarize results
The example below shows the results of summarizing an accounts receivable table on customer
number and transaction type. The transaction amount is subtotaled, with some associated statistics.
The results are output to screen.
The example uses a subset of customer numbers from the Ar table in ACL DATA\Sample Data
Files\Sample Project.ACL.
Summarizing in detail
Summarizing performs the following operations:
Groups the records based on identical values, or identical combinations of values, Cust Number field
in one or more character, numeric, or datetime key fields
Trans Type field
Optionally subtotals the values of one or more numeric fields for each group Total Trans Amount field
Optionally performs statistical calculations on each subtotaled numeric field Average, Minimum, and
Maximum Trans Amount fields
Note
Additional statistical
calculations not
shown
Optionally calculates the percentage of source table records belonging to each Percent of Count field
group
Counts (subtotals) the number of records for each group Count field
Optionally displays additional character, numeric, or datetime fields with Name field
complementary information
Provides totals for all numeric fields included in the output results Totals row
Note
The Totals row is only provided when you output the results to
screen.
Steps
You can summarize data by grouping the records in a table based on identical values, or identical
combinations of values, in one or more character, numeric, or datetime fields.
You can optionally subtotal associated numeric fields. You can also perform statistical calculations
on any subtotal field you specify. The results of the statistical calculations are broken down by group
in the summarized output table.
Show me how
1. Select Analyze > Summarize.
2. On the Main tab, do one of the following:
o Select the field(s) to summarize from the Summarize On list.
o Click Summarize On to select the field(s), or to create an expression.
Note
If you select more than one field you create nested summarized groups in the
output results. For more information, see "Nested summarizing in detail" on
page 1339.
3. Optional. Select one or more Subtotal Fields, or click Subtotal Fields, to select the subtotal
field(s), or to create an expression.
The order in which you select the subtotal fields is the order in which the columns appear in
the results. If you are appending results to an existing Analytics table, the column selection
and order must be identical to the column selection and order in the existing table.
4. Optional. Do one of the following:
o From the Other Fields list, select the other field(s) to include in the output results.
o Click Other Fields to select the field(s), or to create an expression.
Note
Select only fields that contain the same value for all records in each
summarized group. For more information, see "The Other Fields option" on
page 1343.
5. If the field(s) you are summarizing are already sorted, you can optionally deselect Presort.
Note
You can summarize unsorted fields, but the results may contain more than one
summarized group for the same value, which may defeat the purpose of
summarizing.
Depending on the nature of your analysis, summarizing unsorted fields may be
appropriate.
6. If there are records in the current view that you want to exclude from processing, enter a
condition in the If text box, or click If to create an IF statement using the Expression Builder.
Note
The If condition is evaluated against only the records remaining in a table after
any scope options have been applied (First, Next, While).
The IF statement considers all records in the view and filters out those that do not meet the
specified condition.
7. Optional. Select one or more of the statistical options to perform statistical calculations on
subtotal fields:
o Avg, min, max
o Std deviation, % of field
o Median, Mode, Q25, Q75
o % of Count
For more information, see "The statistical options" on page 1341.
Note
You must select at least one subtotal field in order to include statistics.
% of Count does not require a subtotal field.
Calculating these statistics requires additional computer memory. You may
exceed your computer's memory and get an error message if you calculate the
statistics for very large data sets.
Tip
You can click any linked result value in the display area to drill down to the
associated record or records in the source table.
If the output table contains a large number of records, it is faster and more useful to save
the results to a file than to display the results on the screen.
l Print – Select this option to send the results to the default printer.
l Graph – Select this option to create a graph of the results and display it in the Analytics
display area.
l File – Select this option to save or append the results to an Analytics table. The table is
added to the open project if it is not already in the project.
Note
Output options that do not apply to a particular analytical operation are
disabled.
10. If you selected File as the output type, specify the following information in the As panel:
l File Type – Analytics Table is the only option. Saves the results to a new Analytics table, or
or select an existing table in the Save or Save File As dialog box to overwrite or append to
the table. If Analytics prefills a table name, you can accept the prefilled name, or change it.
You can also specify an absolute or relative file path, or navigate to a different folder, to
save or append the table in a location other than the project location. For example:
C:\Results\Output.fil or Results\Output.fil.
Note
Analytics table names are limited to 64 alphanumeric characters, not
including the .FIL extension. The name can include the underscore
character ( _ ), but no other special characters, or any spaces. The name
cannot start with a number.
l Local – Only enabled when connected to a server table. Select Local to save the output
table to the same location as the project, or to specify a path or navigate to a different local
folder. Leave Local deselected to save the output table to the Prefix folder on a server.
Note
For output results produced from analysis or processing of AX Server tables,
select Local. You cannot deselect the Local setting to import results tables to
AX Server.
11. Depending on the output type, you can optionally specify a Header and/or a Footer in the text
box(es).
Headers and footers are centered by default. Type a left angle bracket (<) before the header
or footer text to left align the text. Click Header or Footer to enter a header or footer of more
than one line. Alternatively, you can enter a semi-colon (;) as a line-break character in the
header or footer text box. Left aligning multiple lines requires a left angle bracket at the
beginning of each line.
12. Click the More tab.
13. Select the appropriate option in the Scope panel:
l All
l First
l Next
l While
Show me more
All This option is selected by default. Leave it selected to specify that all records in the view are
processed.
First Select this option and enter a number in the text box to start processing at the first record in the
view and include only the specified number of records.
Next Select this option and enter a number in the text box to start processing at the currently selected
record in the view and include only the specified number of records. The actual record number in
the leftmost column must be selected, not data in the row.
While Select this option to use a WHILE statement to limit the processing of records in the view based on
a particular criterion or set of criteria. You can enter a condition in the While text box, or click While
to create a WHILE statement using the Expression Builder.
A WHILE statement allows records in the view to be processed only while the specified condition
evaluates to true. As soon as the condition evaluates to false, the processing terminates, and no
further records are considered. You can use the While option in conjunction with the All, First, or
Next options. Record processing stops as soon as one limit is reached.
Note
The number of records specified in the First or Next options references either the physical or
the indexed order of records in a table, and disregards any filtering or quick sorting applied to
the view. However, results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
14. If you selected File (Analytics Table) as the output type, select Use Output Table if you want
the output table to open automatically upon completion of the operation.
15. If you selected File as the output type, and want to append the output results to the end of an
existing Analytics table, do one of the following:
o Select Append To Existing File if you are certain the output results and the existing table
are identical in structure.
o Leave Append To Existing File deselected if you want Analytics to compare the record
lengths of the output results and the existing table. If the record lengths are not identical,
the data structure is not identical, and the append will not work correctly.
Note
Leaving Append To Existing File deselected is recommended if you are
uncertain whether the output results and the existing table have an identical
data structure. For more information about appending and data structure, see
"Appending output results to an existing table" on page 205.
Cross-tabulating data
Cross-tabulating groups the records in a table based on identical combinations of values in two or
more key fields, and counts the number of records in each group. Key fields can be character or
numeric.
The resulting groups are displayed in a grid of rows and columns, similar to a pivot table, that allows
you to visualize relations and patterns in the data.
For example, you could cross-tabulate an inventory table on the Product Location and Product
Class fields to find the number of records in each class at each location.
A-01 17 A-01 16 1
F-19 22 A-01 17 3
F-19 08 B-03 17 2
A-01 16 F-19 22 2
B-03 17 F-19 08 1
Q-28 03 Q-28 03 1
A-01 17
F-19 22
A-01 17
B-03 17
Cross-tabulating in detail
Cross-tabulating performs the following operations:
Location in "Cross-tab-
Operation ulate results" below
Groups the records based on identical combinations of values in two or more character intersections of
or numeric fields, and displays the groups in a grid of rows and columns Cust Number field (rows)
and Type field (columns)
Optionally subtotals the values of one or more numeric fields for each group Amount field
Optionally counts (subtotals) the number of records for each group Count field
Note
Counts are automatically included if you do not select any subtotal fields.
Provides totals for all columns included in the output results Totals row
Cross-tabulate results
Output results produced by:
l cross-tabulating customer number and transaction type in an accounts receivable table
(the Ar table in ACL DATA\Sample Data Files\Sample Project.ACL)
l subtotaling transaction amount
l outputting the results to screen
Steps
You can cross-tabulate data by grouping the records in a table based on identical combinations of
values in two or more character or numeric fields.
The resulting groups are displayed in a grid of rows and columns, similar to a pivot table, that allows
you to visualize relations and patterns in the data.
Show me how
1. Select Analyze > Cross-tab.
2. On the Main tab, do one of the following:
o Select the field(s) to display as rows from the Rows list.
o Click Rows to select the field(s), or to create an expression.
If you select more than one field you create an additional level of nesting in the output results.
(Cross-tabulating using one row and one column is already a form of nesting.) The order in
which you select the fields dictates the nesting hierarchy. The records are cross-tabulated by
the first field you select, and within each of these primary groupings the records are then
cross-tabulated by the second field you select, and so on. Reversing the order in which you
select two fields gives quite different results.
The order in which you select the fields is also the order in which they appear in the results. If
you are appending results to an existing Analytics table, the column selection and order must
be identical to the column selection and order in the existing table.
3. Do one of the following:
o Select the field to display as columns from the Columns drop-down list.
o Click Columns to select the field, or to create an expression.
4. Optional. Select one or more Subtotal Fields, or click Subtotal Fields, to select the subtotal
field(s), or to create an expression.
The order in which you select the subtotal fields is the order in which the columns appear in
the results. If you are appending results to an existing Analytics table, the column selection
and order must be identical to the column selection and order in the existing table.
5. If there are records in the current view that you want to exclude from processing, enter a
condition in the If text box, or click If to create an IF statement using the Expression Builder.
Note
The If condition is evaluated against only the records remaining in a table after
any scope options have been applied (First, Next, While).
The IF statement considers all records in the view and filters out those that do not meet the
specified condition.
6. If you want to include a count of the number of records for each row-column intersection,
select Include Count.
A count is automatically included if you do not select any subtotal fields.
7. Click the Output tab.
8. Select the appropriate output option in the To panel:
l Screen – Select this option to display the results in the Analytics display area.
Tip
You can click any linked result value in the display area to drill down to the
associated record or records in the source table.
If the output table contains a large number of records, it is faster and more useful to save
the results to a file than to display the results on the screen.
l Print – Select this option to send the results to the default printer.
l Graph – Select this option to create a graph of the results and display it in the Analytics
display area.
l File – Select this option to save or append the results to an Analytics table or a text file. If
you save or append to an Analytics table, the table is added to the open project if it is not
already in the project. If you save or append to a text file, the file is saved outside Analytics.
Note
Output options that do not apply to a particular analytical operation are
disabled.
9. If you selected File as the output type, specify the following information in the As panel:
l File Type – Select Analytics Table to save the results to a new Analytics table, or append
the results to an existing Analytics table. Select ASCII Text File or Unicode Text file
(depending on which edition of Analytics you are using) to save or append the results to a
text file.
l Name – Enter a file name in the Name text box. Or click Name and enter the file name, or
select an existing file in the Save or Save File As dialog box to overwrite or append to the
file. If Analytics prefills a file name, you can accept the prefilled name, or change it.
You can also specify an absolute or relative file path, or navigate to a different folder, to
save or append the file in a location other than the project location. For example:
C:\Results\Output.fil or Results\Output.fil.
Note
Analytics table names are limited to 64 alphanumeric characters, not
including the .FIL extension. The name can include the underscore
character ( _ ), but no other special characters, or any spaces. The name
cannot start with a number.
l Local – Only enabled when connected to a server table and saving or appending the results
to an Analytics table. Select Local to save the file to the same location as the project, or to
specify a path or navigate to a different local folder. Leave Local deselected to save the file
to the Prefix folder on a server.
Note
For output results produced from analysis or processing of AX Server tables,
select Local. You cannot deselect the Local setting to import results tables to
AX Server.
10. Depending on the output type, you can optionally specify a Header and/or a Footer in the text
box(es).
Headers and footers are centered by default. Type a left angle bracket (<) before the header
or footer text to left align the text. Click Header or Footer to enter a header or footer of more
than one line. Alternatively, you can enter a semi-colon (;) as a line-break character in the
header or footer text box. Left aligning multiple lines requires a left angle bracket at the
beginning of each line.
11. Click the More tab.
12. Select the appropriate option in the Scope panel:
l All
l First
l Next
l While
Show me more
All This option is selected by default. Leave it selected to specify that all records in the view are
processed.
First Select this option and enter a number in the text box to start processing at the first record in the
view and include only the specified number of records.
Next Select this option and enter a number in the text box to start processing at the currently selected
record in the view and include only the specified number of records. The actual record number in
While Select this option to use a WHILE statement to limit the processing of records in the view based on
a particular criterion or set of criteria. You can enter a condition in the While text box, or click While
to create a WHILE statement using the Expression Builder.
A WHILE statement allows records in the view to be processed only while the specified condition
evaluates to true. As soon as the condition evaluates to false, the processing terminates, and no
further records are considered. You can use the While option in conjunction with the All, First, or
Next options. Record processing stops as soon as one limit is reached.
Note
The number of records specified in the First or Next options references either the physical or
the indexed order of records in a table, and disregards any filtering or quick sorting applied to
the view. However, results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
13. If you selected File (Analytics Table) as the output type, select Use Output Table if you want
the output table to open automatically upon completion of the operation.
14. If you selected File as the output type, and want to append the output results to the end of an
existing file, do one of the following:
o Select Append To Existing File if you are appending to a text file, or to an Analytics table
that you are certain is identical in structure to the output results.
o Leave Append To Existing File deselected if you are appending to an Analytics table and
you want Analytics to compare the record lengths of the output results and the existing
table. If the record lengths are not identical, the data structure is not identical, and the
append will not work correctly.
Note
Leaving Append To Existing File deselected is recommended if you are
uncertain whether the output results and the existing table have an identical
data structure. For more information about appending and data structure, see
"Appending output results to an existing table" on page 205.
Creating histograms
Creating a histogram groups the records in a table, counts the number of records in each group, and
displays the groups and counts in a vertical bar chart.
You can group the records:
l Based on identical values in a character field (similar to classifying)
l Into equal-sized, or custom-sized, numeric intervals (similar to stratifying)
Steps
You can create a histogram that groups the records in a table and displays the groups in a bar chart.
You can group the records:
l Based on identical values in a character field
l Into equal-sized, or custom-sized, numeric intervals
Show me how
Tip
You can change the default number of intervals by selecting Tools >
Options and updating the Intervals number on the Command tab.
o Select Free to create custom-sized intervals, and enter the start value of each interval and
the end value of the last interval. You must enter each value on a separate line.
Specifying Minimum and Maximum values is optional when you use Free. If you do
specify Minimum and Maximum values, those values are the start point of the first interval
and the end point of the last interval, and the values you enter create additional intervals
within the range. The values you enter must be greater than the value specified in
Minimum, and equal to or less than the value specified in Maximum.
5. If there are records in the current view that you want to exclude from processing, enter a
condition in the If text box, or click If to create an IF statement using the Expression Builder.
Note
The If condition is evaluated against only the records remaining in a table after
any scope options have been applied (First, Next, While).
The IF statement considers all records in the view and filters out those that do not meet the
specified condition.
6. Click the Output tab.
Tip
You can click any linked result value in the display area to drill down to the
associated record or records in the source table.
If the output table contains a large number of records, it is faster and more useful to save
the results to a file than to display the results on the screen.
l Print – Select this option to send the results to the default printer.
l Graph – Select this option to create a graph of the results and display it in the Analytics
display area.
l File – Select this option to save or append the results to a text file. The file is saved outside
Analytics.
Note
Output options that do not apply to a particular analytical operation are
disabled.
8. If you selected File as the output type, specify the following information in the As panel:
l File Type – ASCII Text File or Unicode Text file (depending on which edition of Analytics
you are using) is the only option. Saves the results to a new text file, or appends the results
to an existing text file.
l Name – Enter a file name in the Name text box. Or click Name and enter the file name, or
select an existing file in the Save or Save File As dialog box to overwrite or append to the
file. If Analytics prefills a file name, you can accept the prefilled name, or change it.
You can also specify an absolute or relative file path, or navigate to a different folder, to
save or append the file in a location other than the project location. For example:
C:\Results\Output.txt or Results\Output.txt.
lLocal – Disabled and selected. Saving the file locally is the only option.
9. Depending on the output type, you can optionally specify a Header and/or a Footer in the text
box(es).
Headers and footers are centered by default. Type a left angle bracket (<) before the header
or footer text to left align the text. Click Header or Footer to enter a header or footer of more
than one line. Alternatively, you can enter a semi-colon (;) as a line-break character in the
header or footer text box. Left aligning multiple lines requires a left angle bracket at the
beginning of each line.
10. Click the More tab.
11. Select the appropriate option in the Scope panel:
l All
l First
l Next
l While
Show me more
All This option is selected by default. Leave it selected to specify that all records in the view are
processed.
First Select this option and enter a number in the text box to start processing at the first record in the
view and include only the specified number of records.
Next Select this option and enter a number in the text box to start processing at the currently selected
record in the view and include only the specified number of records. The actual record number in
the leftmost column must be selected, not data in the row.
While Select this option to use a WHILE statement to limit the processing of records in the view based on
a particular criterion or set of criteria. You can enter a condition in the While text box, or click While
to create a WHILE statement using the Expression Builder.
A WHILE statement allows records in the view to be processed only while the specified condition
evaluates to true. As soon as the condition evaluates to false, the processing terminates, and no
further records are considered. You can use the While option in conjunction with the All, First, or
Next options. Record processing stops as soon as one limit is reached.
Note
The number of records specified in the First or Next options references either the physical or
the indexed order of records in a table, and disregards any filtering or quick sorting applied to
the view. However, results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
12. If you do not want to include values that exceed the specified Minimum and Maximum values,
select Suppress Others.
13. Optional. If you are outputting histogram results to a text file, specify the length of the x-axis in
the textual representation of the bar chart by entering a number in Columns.
The number you enter specifies the number of character spaces (text columns) to use for the
x-axis (and the y-axis labels). In most cases, you can leave Columns blank to use the default
of 78 character spaces.
14. Optional. If you are outputting histogram results to screen, a file, or printer, enter the name of
a break field in the Break text box, or click Break to select the field, or to create an expression.
For example, a histogram of an accounts receivable table could be broken down by customer.
Break can only be used with a single character field, so nested breakdowns are not
supported.
Note
For the Break option to yield meaningful results, the character field must be
sorted prior to creating a histogram.
15. If you selected File as the output type, and want to append the output results to the end of an
existing text file, select Append To Existing File.
16. Click OK.
17. If the overwrite prompt appears, select the appropriate option.
Supported
Operation ML type data types Functionality Output
Use automated machine learning in Analytics to predict classes or numeric values associated with
unlabeled data. Data is unlabeled if the classes or numeric values you are interested in do not exist
in the data. For example, you could use machine learning to predict loan defaults, or future house
prices:
Loan defaults Classification Based on applicant information such as age, job category, credit
score, and so on, predict which applicants will default if given a loan.
Put another way, will applicants fall into the class of Default = Yes, or
Default = No?
Future house prices Regression Based on features such as age, square footage, ZIP code, number of
bedrooms and bathrooms, and so on, predict the future sale price of
houses.
Training process
The training process is performed first, using a training data set that includes a labeled field (also
called a target field).
The labeled field contains the known class, or the known numeric value, associated with each
record in the training data set. For example, whether a borrower defaulted on a loan (Y/N), or the
sale price of a house.
Using machine learning algorithms, the training process generates a predictive model. The training
process generates a number of different model permutations in order to discover the model that is
best suited to the predictive task you are performing.
Prediction process
The prediction process is performed second. It applies the predictive model generated by the
training process to a new, unlabeled data set that contains data similar to the data in the training
data set.
Label values such as loan default information or house sale price do not exist in the new data set
because these are future events.
Using the predictive model, the prediction process predicts a class or a numeric value associated
with each unlabeled record in the new data set.
Training o Train command – You run the train command against a o Loan data – historical
training data set to train a predictive model. loan data, including
(Train
loan default
command) The command uses several different machine learning
information (Y/N)
algorithms to generate numerous models before selecting
a single model best suited to the predictive task ("the "Default" is the labeled
winning model"). field.
o Training data set – The data set includes key fields o House data – recent
(features) and a labeled field (target field). house sales data,
o Learning – The training process builds a mathematical including the sale price
model that represents the relations between the key fields
"Sale price" is the
and the labeled field.
labeled field.
o Example – For example, with all other features equal, the
training process might find that a fourth bedroom increased
the selling price of a house by $35,000.
"Number of bedrooms" is a key field, and "sale price" is the
labeled field.
o Predictive model – The training process stores the
1 predictive model in an output file.
Prediction o Predict command – You use the predict command to apply o Loan data – current
the predictive model produced by the train command. loan applicant data
(Predict o New data – You apply the model to a new data set with the
command) Loan default
same key fields (features) as the training data set, but
information does not
without the labeled field.
yet exist because
o Predictions – The prediction process uses the
loans are only at the
mathematical relations stored in the predictive model to
application stage.
predict label values for similar key field relations in the new
data set. o House data – house
o Example – For example, with all other features equal, the price evaluation data
prediction process predicts a sale price of $400,000 for a
Recent sale price data
three-bedroom house, and $435,000 for a four-bedroom
does not exist
house.
o Probability – (classification only) For each predicted value, because the houses
the prediction output includes the probability or confidence are not yet on the
2 that the prediction is accurate. market.
Processing time
The computation required by machine learning is time consuming and processor-intensive. Training
a predictive model using a large data set with numerous fields can take hours, and is typically a task
you might run overnight.
Including datetime key fields in the training process is particularly processor-intensive because each
datetime field is used to automatically derive 10 synthetic features. Datetime synthetic features can
significantly expand the scope of the predictive data, but you should only include datetime fields if
you think that they might be relevant.
Tip
If you are just familiarizing yourself with machine learning in Analytics, use small
data sets so that you can keep processing times manageable, and see results
relatively quickly.
Steps
Specify basic settings for the training process
1. Open the Analytics table with the training data set.
2. From the Analytics main menu, select Machine Learning > Train.
3. Specify the time allotted to the training process:
Time to search for an optimal model The total time in minutes to spend generating and testing
predictive models, and selecting a winning model.
Specify a search time that is at least 10x the maximum evaluation
time per model.
Maximum time per model evaluation Maximum runtime in minutes per model evaluation.
Allot 45 minutes for every 100 MB of training data.
Note
The total runtime of the training process is the search time plus up to twice the
maximum model evaluation time.
The suggested time allotments strike a reasonable balance between
processing time and allowing a variety of model types to be evaluated.
Note
The classification metric AUC is only valid when used with a target field that
contains binary data – that is, two classes, such as Yes/No, or True/False.
Select fields
1. From the Train On list, select one or more key fields to use as input when training the model.
Key fields are the features that form the basis for predicting target field values in an unlabeled
data set. Key fields can be character, numeric, datetime, or logical. Synthetic features are
automatically derived from datetime key fields.
Note
Character fields must be "categorical". That is, they must identify categories or
classes, and they cannot exceed a maximum number of unique values.
The maximum is specified by the Maximum Categories option (Tools
> Options > Command).
Tip
You can Ctrl+click to select multiple non-adjacent fields, and Shift+click to
select multiple adjacent fields.
Note
Analytics table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
number.
3. If there are records in the current view that you want to exclude from processing, enter a
condition in the If text box, or click If to create an IF statement using the Expression Builder.
Note
The If condition is evaluated against only the records remaining in a table after
any scope options have been applied (First, Next, While).
The IF statement considers all records in the view and filters out those that do not meet the
specified condition.
Specify that only a subset of the training data set is used (optional)
On the More tab, select one of the options in the Scope panel:
First Select this option and enter a number in the text box to start processing at the first record in the
table and include only the specified number of records.
Next Select this option and enter a number in the text box to start processing at the currently
selected record in the table view and include only the specified number of records.
The actual record number in the leftmost column must be selected, not data in the row.
While Select this option to use a WHILE statement to limit the processing of records in the table
based on criteria.
Tip
Increasing the number of folds can produce a better estimate of the predictive
performance of a model, but it also increases overall runtime.
Note
With larger data sets, the training process typically completes more quickly if
you include only linear models.
Including only linear models guarantees coefficients in the output.
4. Optional. Select Disable feature selection and preprocessing if you want to exclude these
subprocesses from the training process.
Feature selection is the automated selection of the fields in the training data set that are the
most useful in optimizing the predictive model. Automated selection can improve predictive
performance, and reduce the amount of data involved in model optimization.
Data preprocessing performs transformations such as scaling and standardizing on the
training data set to make it better suited for the training algorithms.
Caution
You should only disable feature selection and data preprocessing if you have a
reason for doing so.
5. Click OK.
The training process launches, and a dialog box appears that shows the input settings you
specified, and elapsed processing time.
Steps
1. Open the Analytics table with the unlabeled data set.
2. From the Analytics main menu, select Machine Learning > Predict.
3. Click Model, in the Select File dialog box select a model file output by a previous training
process, and click Open.
Model files have a *.model file extension.
Note
The model file must have been trained on a data set with the same fields as the
unlabeled data set – or substantially the same fields.
You cannot use a model file trained in version 14.1 of Analytics. Version 14.1
model files are not compatible with subsequent versions of Analytics. Train a
new predictive model to use with the prediction process.
4. In the To text box, specify the name of the Analytics table output by the prediction process.
The output table contains the key fields you specified during the training process, and either
one or two fields generated by the prediction process:
l Predicted – the predicted classes or numeric values associated with each record in the
unlabeled data set
l Probability – (classification only) the probability that a predicted class is accurate
Note
Analytics table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
number.
5. If there are records in the current view that you want to exclude from processing, enter a
condition in the If text box, or click If to create an IF statement using the Expression Builder.
Note
The If condition is evaluated against only the records remaining in a table after
any scope options have been applied (First, Next, While).
The IF statement considers all records in the view and filters out those that do not meet the
specified condition.
6. Optional. To process only a subset of the unlabeled data set, on the More tab select one of
the options in the Scope panel.
7. Click OK.
Training algorithms
Three train command options dictate which machine learning algorithms are used for training a
predictive model:
The sections that follow summarize how the options control which algorithms are used.
The names of the algorithms do not appear in the Analytics user interface. The name of the
algorithm used for generating the model ultimately selected by the train command appears in the
log.
Note
For detailed information about the algorithms, consult the scikit-learn
documentation. Scikit-learn is the Python machine learning library used by
Analytics.
Classification algorithms
Show me more
Algorithm used Algorithm not used
Logistic Regression
Random Forest
Feature Agglomeration
Binarizer
Robust Scaler
Standard Scaler
Normalizer
Zero Counter
Variance Threshold
Importance Weights
Regression algorithms
Show me more
Algorithm used Algorithm not used
Elastic Net
Lasso
Ridge
Random Forest
Feature Agglomeration
Binarizer
Robust Scaler
Standard Scaler
Normalizer
Zero Counter
Variance Threshold
Importance Weights
Clustering data
Clustering groups the records in a table based on similar values in one or more numeric key fields.
Similar values are values that are nearby or close to one another in the context of the entire data set.
These similar values represent clusters that, once identified, reveal patterns in the data.
Note
If you want to make clustering a regular part of your analysis program, we
recommend taking the Diligent Academy course Finding data groups using the
CLUSTER command in Analytics (ACL 361) (customer log-in required).
The benefit of clustering over a traditional approach like stratifying is that you do not have to make
any assumptions, in advance, about where the concentrations may exist, or create arbitrary numeric
boundaries. Clustering discovers where the boundaries lie for any given number of clusters.
Show example
You cluster the Ap_Trans table on the Invoice Amount field to find out where amounts are
concentrated over the range of values. Your expectation is that most of the amounts will be
clustered at the lower end of the range. Clustering will confirm whether your expected pattern
is in fact the case.
You decide to group the Invoice Amount field into five clusters, and then summarize the
clusters to discover how many records are in each cluster.
In the output results shown below, the first five records are system-generated and equate to
the desired number of clusters that you specified. In the Invoice Amount field, the five
records show the centroid, or center point, that the clustering algorithm calculates for each of
the five clusters of invoice amounts. For example, the centroid for cluster 3 ( C3 ) is 2,969.04.
For more information, see "How the clustering algorithm works" on page 1381.
Beneath the system-generated fields are the source data fields grouped into clusters, starting
with cluster 0. The value in the Distance field is the distance from the actual invoice amount to
the calculated centroid value for that cluster. So, for example, in record 6, the invoice amount
of 618.30 minus the distance of 64.935317 equals the centroid value of 553.36.
Note
You subtract or add the distance value, depending on whether the actual value
is greater than or less than the centroid value.
If you summarize the Cluster field, and sort the summarized output by count, you get the
following results, which confirm that the distribution of values is what you expected. Overall,
invoice amounts are heavily skewed to lower values. (Centroid values added to the table for
ease of comparison.)
The single large value in a cluster by itself appears to be an outlier and should probably be
investigated.
0 73 553.36
3 16 2,969.04
4 8 8,061.46
2 4 18,010.28
1 1 56,767.20
Note
For this analysis, you need to avoid including any fields that do not clearly relate to
the hypothesis, such as number of sick days taken.
Tip
Graphing the cluster output table as a scatter plot in a reporting tool, with each
cluster assigned a different color, is the easiest way to quickly assess the overall
nature of the output clusters.
The following characteristics can help you assess the meaningfulness of the output clusters:
l Cluster coherence – Are the individual values in a cluster all relatively close to the centroid, or
is the cluster somewhat diffuse? The more coherent a cluster, the stronger the relation
between the values comprising the cluster.
l Cluster size – Are the majority of values contained in one or two large clusters? If so, the data
set is significantly skewed, versus a data set in which values are relatively evenly distributed
between a number of clusters.
l Outliers – Consider the values that resist inclusion in any of the significant clusters. These
outliers can represent items that warrant additional scrutiny. Also consider "internal outliers" –
that is, values that are included in a significant cluster, but at the outer extremity of the cluster.
Note
The characteristics above are all human or subjective methods of cluster
assessment. Various mathematical methods of cluster evaluation exist but they are
beyond the scope of the Analytics Help.
o Decide how many clusters, or groups, to use for grouping a data set.
"K" represents the number of clusters you specify.
o The data points in the data set can be values in a single numeric field,
or composite values that the algorithm computes based on multiple
1 Specify the number of clusters numeric fields.
o Find the shortest distance from each data point to a centroid. Distance
comparisons use squared Euclidean distance.
Assign each data point to the o Assign each data point to the nearest centroid. All the data points
3 nearest centroid assigned to a particular centroid become a cluster.
o Calculate the average, or mean, of all the data points in a cluster. The
4 Recalculate the centroids mean becomes the new centroid for that cluster.
Datetime data
You can use Analytics functions to convert datetime data to numeric data. However, the resulting
numeric data is not continuous, which presents problems for cluster analysis, which assumes
continuous sets of numbers.
For example, the following three numbers, as dates, are all one day apart. However, as numbers,
there is a considerable gap, or distance, between the first and second numbers.
l 20181130
l 20181201
l 20181202
You could use serial date values in cluster analysis. Serial dates are a continuous set of integers
representing the number of days that have elapsed since 01 January 1900.
Steps
Note
If the machine learning menu options are disabled, the Python engine is probably
not installed. For more information, see "Install ACL for Windows" on page 2705.
The scale and units of different numeric fields often vary. For example, a salary field containing
dollars per year could range from 20,000 to 100,000, whereas an age field containing years could
range from 18 to 70. If you cluster using the salary and age fields, without scaling, the output
clusters will be essentially salary clusters, skewed by the size of the salary numbers in comparison
to the age numbers, rather than salary/age clusters.
Preprocessing provides the methods explained below to scale all values in all cluster key fields so
that they are equally weighted during the clustering process.
Preprocessing
option Description
Key field values are centered on a mean of zero (0) and scaled, a process that converts the
values to their z-score equivalent (standard score).
The z-score is a measure of the number of standard deviations that separate a raw value from
the raw mean for each field. In the scaled field, the mean is represented by zero (0), and the z-
scores are positive or negative depending on whether the raw values they represent are
greater than or less than the raw mean for the field.
Note
Use this option if the key fields contain mostly non-zero values ("dense
matrices").
Show example
In a scaled age field, the raw age value of 55 is represented by the z-score of
1.038189.
l Age field raw mean: 42.04054054
l Age field standard deviation: 12.48276021
l Center the raw value by subtracting the raw mean: 55 - 42.04054054 =
12.95945946
l Scale the centered raw value by dividing by the standard
deviation: 12.95945946/12.48276021 = 1.038189
l 55 is 1.038189 standard deviations away from the raw mean.
Standardize
Key field values are scaled by being divided by their standard deviation, but they are not
centered on a mean of zero (0).
Note
Use this option if one or more key fields contain a large number of zero (0)
values ("sparse matrices").
Show example
Preprocessing
option Description
In a scaled age field, the raw age value of 55 is represented by the scaled value of
4.406077.
l Age field standard deviation: 12.48276021
l Scale the raw value by dividing by the standard deviation: 55/12.48276021 =
4.406077
Key field values are not centered or scaled. Clustering uses the raw values, uncentered and
None unscaled, when calculating the clusters.
Select fields
1. From the Cluster On list, select one or more key fields to use for clustering the records in the
table.
Key fields must be numeric.
2. Optional. From the Other Fields list, select one or more additional fields to include in the
output table.
Tip
You can Ctrl+click to select multiple non-adjacent fields, and Shift+click to select
multiple adjacent fields.
Note
The If condition is evaluated against only the records remaining in a table after
any scope options have been applied (First, Next, While).
The IF statement considers all records in the view and filters out those that do not meet the
specified condition.
Note
Analytics table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
number.
Benford analysis counts the number of times each leading digit (1–9) or leading digit combination
occurs in a field, and compares the actual count to the expected count.
The expected count, calculated using the Benford formula, provides the Benford distribution. In a
naturally occurring set of numbers, the frequency distribution of the actual count of leading digits
should approximate the Benford distribution.
If one or more leading digits or digit combinations in the data being tested deviate significantly from
the Benford distribution, it may indicate that the numbers have been manipulated. Deviations may
also have simple and reasonable explanations and are not necessarily indicative of manipulation.
l any numbering scheme with a range that prevents certain numbers from appearing
l Random numbers – Numbers generated by a random number generator are not suitable for
Benford analysis.
Usage details
The table below provides details about using the Benford analysis feature in Analytics.
You can analyze up to six leading digits. When analyzing four or more leading digits,
Number of leading digits Benford analysis output must be sent to a file instead of displayed on screen or sent to a
printer.
Depending on the number of records you are working with, analyzing five or more leading
digits may take several minutes. Regardless of how many digits you are analyzing, you
Processing time can press Esc to terminate the command at any time.
Effective Benford analysis requires large data sets. Analytics displays a warning in the
Size of data set results output when a data set may be too small for the specified number of digits.
Positive and negative val- Anomalous data is more apparent when you analyze positive and negative values
ues separately. You can use a filter to separate the two before beginning your analysis.
Records with values of zero are ignored, but the number of zero-value records bypassed
is reported.
Leading zeros, numeric formatting such as decimals and dollar signs, other non-numeric
Zeros and non-numeric digits, and records that fail to meet test criteria are also ignored. If the resulting number of
characters digits is less than specified, Analytics adds zeros to the right of the result.
Displays the leading digits that were tested. For example, if you specify one leading digit,
the numbers 1 to 9 are displayed. If you specify two leading digits, the numbers 10 to 99
Leading Digits are displayed.
Actual Count Displays the actual count of each leading digit or leading digit combination in the field.
Displays the expected count of each leading digit or leading digit combination calculated
Expected Count by the Benford formula.
Displays the Z-Stat ratio for each digit or digit combination, which is a measurement in
standard deviations of the distance between the actual count and the expected count.
Zstat Ratio For example, a Z-statistic of 0.500 represents one-half of a standard deviation.
Displays the computed lower and upper bound values for the count of each leading digit
or digit combination.
If the actual count of more than one digit or digit combination in the output results
exceeds either of the bounds, the data may have been manipulated and should be
investigated.
Steps
Perform Benford analysis on a field to discover if one or more leading digits or digit combinations
deviate significantly from the Benford distribution.
Show me how
1. Open the table containing the field you want to analyze.
2. Select Analyze > Benford.
3. On the Main tab, do one of the following:
o Select the field to analyze from the Benford On drop-down list.
o Click Benford On to select the field, or to create an expression.
Note
Select a field that contains "naturally occurring numbers", such as transaction
amounts. Benford analysis is not suitable for numeric data that is constrained
in any way. For more information, see "What data can I test using Benford
analysis?" on page 1387
4. Enter the Number of Leading Digits, from 1 to 6, that you want to analyze.
Note
If you are analyzing four or more leading digits, results output must be sent to a
file. Results of analyzing four or more digits cannot be displayed on the screen,
sent to the printer, or displayed in a graph.
5. If there are records in the current view that you want to exclude from processing, enter a
condition in the If text box, or click If to create an IF statement using the Expression Builder.
Note
The If condition is evaluated against only the records remaining in a table after
any scope options have been applied (First, Next, While).
The IF statement considers all records in the view and filters out those that do not meet the
specified condition.
6. (Optional) Select Include Upper and Lower Bounds if you want to include computed
boundary values in the output results for each digit or digit combination.
7. Click the Output tab.
8. Select the appropriate output option in the To panel:
l Screen – Select this option to display the results in the Analytics display area.
Tip
You can click any linked result value in the display area to drill down to the
associated record or records in the source table.
If the output table contains a large number of records, it is faster and more useful to save
the results to a file than to display the results on the screen.
l Print – Select this option to send the results to the default printer.
l Graph – Select this option to create a graph of the results and display it in the Analytics
display area.
l File – Select this option to save or append the results to an Analytics table. The table is
added to the open project if it is not already in the project.
Note
Output options that do not apply to a particular analytical operation are
disabled.
9. If you selected File as the output type, specify the following information in the As panel:
l File Type – Analytics Table is the only option. Saves the results to a new Analytics table, or
or select an existing table in the Save or Save File As dialog box to overwrite or append to
the table. If Analytics prefills a table name, you can accept the prefilled name, or change it.
You can also specify an absolute or relative file path, or navigate to a different folder, to
save or append the table in a location other than the project location. For example:
C:\Results\Output.fil or Results\Output.fil.
Note
Analytics table names are limited to 64 alphanumeric characters, not
including the .FIL extension. The name can include the underscore
character ( _ ), but no other special characters, or any spaces. The name
cannot start with a number.
l Local – Only enabled when connected to a server table. Select Local to save the output
table to the same location as the project, or to specify a path or navigate to a different local
folder. Leave Local deselected to save the output table to the Prefix folder on a server.
Note
For output results produced from analysis or processing of AX Server tables,
select Local. You cannot deselect the Local setting to import results tables to
AX Server.
10. Depending on the output type, you can optionally specify a Header and/or a Footer in the text
box(es).
Headers and footers are centered by default. Type a left angle bracket (<) before the header
or footer text to left align the text. Click Header or Footer to enter a header or footer of more
than one line. Alternatively, you can enter a semi-colon (;) as a line-break character in the
header or footer text box. Left aligning multiple lines requires a left angle bracket at the
beginning of each line.
11. Click the More tab.
l While
Show me more
All This option is selected by default. Leave it selected to specify that all records in the view are
processed.
First Select this option and enter a number in the text box to start processing at the first record in the
view and include only the specified number of records.
Next Select this option and enter a number in the text box to start processing at the currently selected
record in the view and include only the specified number of records. The actual record number in
the leftmost column must be selected, not data in the row.
While Select this option to use a WHILE statement to limit the processing of records in the view based on
a particular criterion or set of criteria. You can enter a condition in the While text box, or click While
to create a WHILE statement using the Expression Builder.
A WHILE statement allows records in the view to be processed only while the specified condition
evaluates to true. As soon as the condition evaluates to false, the processing terminates, and no
further records are considered. You can use the While option in conjunction with the All, First, or
Next options. Record processing stops as soon as one limit is reached.
Note
The number of records specified in the First or Next options references either the physical or
the indexed order of records in a table, and disregards any filtering or quick sorting applied to
the view. However, results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
13. If you selected File (Analytics Table) as the output type, select Use Output Table if you want
the output table to open automatically upon completion of the operation.
14. If you selected File as the output type, and want to append the output results to the end of an
existing Analytics table, do one of the following:
o Select Append To Existing File if you are certain the output results and the existing table
are identical in structure.
o Leave Append To Existing File deselected if you want Analytics to compare the record
lengths of the output results and the existing table. If the record lengths are not identical,
the data structure is not identical, and the append will not work correctly.
Note
Leaving Append To Existing File deselected is recommended if you are
uncertain whether the output results and the existing table have an identical
data structure. For more information about appending and data structure, see
"Appending output results to an existing table" on page 205.
Running R scripts
Analyze an Analytics table in an external R script and then return data from R to create a new table
in the Analytics project. Source data is passed to R as a data frame that you can reference using a
provided function.
# stores the Analytics table in a data frame called myTable that can be ref-
erenced throughout the script
myTable<-acl.readData()
To retrieve data from a cell in the data frame, you can use one of the following approaches:
l Using row and column coordinates:
# Retrieves the value in the first row and second column of the data
frame
myTable[1,2]
Note
Coordinates are based on the order of fields specified in the command, not the
table layout or view that is currently open.
You must specify the KEEPTITLE option of the command to use column names.
Rows are named "1", "2", "3", and increment accordingly. You may also use a combination of
names and coordinates.
Note
You must return a data frame or a matrix to Analytics when the R script terminates.
Ensure the columns in the data frame or matrix contain only atomic values and not
lists, matrices, arrays, or non-atomic objects. If the values cannot be translated into
Analytics data types, the command fails.
R data mapping
Analytics data types are translated into R data types using a translation process between the
Analytics project and the R script:
Logical Logical
Numeric Numeric
Character Character
R script (analysis.r)
srcTable<-acl.readData()
Run an R script
1. From the menu, select Analyze > R.
The RCOMMAND dialog box opens.
2. Next to the R Script field, click Browse and navigate to the R script on your computer that you
want to run.
3. Click Select Fields and add one or more fields to include in the data frame that Analytics
makes available in the R script.
Tip
You can also include expressions as fields in the data frame. To create an
expression, click Expr and use the functions, fields, and operators available to
you in the dialog box. For more information, see "Expression Builder overview"
on page 872.
4. Optional. In the RCommand Options section, define how you want to send the Analytics data
to the R script.
For more information, see "RCommand options" below.
5. Optional. To filter the records that are sent to the R script, click If and use the Expression
Builder dialog box to create a conditional expression to use as the filter.
For more information about creating expressions using the Expression Builder, see "Creating
expressions using the Expression Builder" on page 874.
6. To specify the output table, click To and in the File name field, enter a name for the table and
associated .FIL file.
Use the folder explorer to navigate to the folder you want to use to store the source data file.
Note
Analytics table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
number.
7. Optional. On the More tab of the dialog box, specify any scope options for the command.
For more information, see "More tab" on the next page.
8. To run the command, click OK.
Export with field names Use the column titles of the source Analytics table as header values for the R data frame.
This option sets KEEPTITLE option on the command and is required if you want to
retrieve data using column names in the R script.
Column Separator The character to use as the separator between fields when sending data to R.
Option Description
Text Qualifier The character to use as the text qualifier to identify field values when sending data to R.
More tab
Option Description
First Processes from the first record in the table and includes only the specified number of
records.
Next Processes from the currently selected record in the table and includes only the specified
number of records.
Note
The number of records specified in the First or Next options references
either the physical or the indexed order of records in a table, and
disregards any filtering or quick sorting applied to the view. However,
results of analytical operations respect any filtering.
If a view is quick sorted, Next behaves like First.
Caution
There is a known issue in the current version with Next when running the
RCOMMAND. Avoid using this option as the record reference may reset
to the first record regardless of which record is selected.
While Uses a WHILE statement to limit the processing of records in the primary table based on
criteria.
Records in the view are processed only while the specified condition evaluates to true.
As soon as the condition evaluates to false, the processing terminates, and no further
records are considered. For more information, see "Creating expressions using the
Expression Builder" on page 874.
Analytics reports
You can create text reports based on views you define in Analytics. A number of configurable
options let you determine the content and layout of the report.
For more information, see "Formatting and generating Analytics reports" on page 1401.
Analytics graphs
You can generate graphs as the output of some Analytics operations. You can also graph data you
select in views. The graph toolbar provides a number of options for formatting the graphs.
For more information, see "Working with Analytics graphs" on page 1407.
For more information, see "Connecting to Analytics from a third-party reporting application" on
page 1419.
You can create traditional tabular reports in Analytics based on the format of data and columns in
views. You configure various settings in a view to control how data is displayed in the report. These
configuration settings are saved with the view.
Tip
You can create a separate view for configuring and saving report settings, which
differs from the view you use for displaying data.
When you generate a report for the first time, you can specify a number of additional properties,
such as line spacing, header and footer text, and the report output type. These properties are saved
with the Analytics project when the project is saved.
Create a filter to remove irrelevant records from the view. Excluded records are not included in
the report. For example, you could filter a table of sales data to include only the stores that
Filter data interest you.
Index records Create an index to sort the records in the view by one or more columns.
Select specific Add or remove columns so that you display only relevant data. You can include any physical
columns data fields or computed fields in the table layout.
Arrange columns Reorder columns in the view to present the sequence of information you want.
Specify break columns to divide the report into sections with subtotals.
For example, specifying Customer_Name as a break column in an invoice table groups and
subtotals the invoices by customer. You also have the option of inserting a page break after
Create subsections each group in the report.
Suppress duplicate identifier values such as repeated names, suppress numeric totals that are
Tailor the data not meaningful, and display zeros as blanks.
Control report width Adjust the rows in a view to span multiple rows.
Note
For detailed information about configuring views, see "Customizing columns in views" on page 850.
Generate a report
Once you have configured a view to use as the basis for a report, you are ready to generate the
report.
Show me how
Steps
Note
Detailed information appears after the steps. See "Report dialog box options" on the
next page.
Tip
To quickly generate subsequent reports from the same view using the same report
options, select File > Print.
Main tab
Note
The Presort option is available only when at least one column in the view
Presort has Break Column or Sort Key Column selected.
optional For more information, see "Modify column properties" on page 855.
Summarize Generates a report that includes only subtotals and totals of break fields, and excludes
detail lines.
optional
Suppress blank detail Automatically removes blank detail lines from the report.
lines
optional
Note
Fit to page
Reports saved as files or displayed on the screen automatically include
optional all columns from the view.
Output tab
o Screen – displays the report in the Analytics display area. If the report contains a large
number of records, it is faster and more useful to save the report to a file than to
display the report on the screen.
o Print – sends the report to the default printer.
o File – saves or appends the report to a text file or an HTML file. The file is saved
To panel outside Analytics.
Header Replicates any header or footer text from the Main tab.
Footer If required, you can add header or footer text in the Output tab, or update existing header
or footer text. Changes you make to existing text are automatically updated on the Main
optional tab. Type a semi-colon (;) in the Header or Footer text boxes to create a line break.
Option Description
Option Description
selected.
Note
If you want to include record notes in a report, you must first add the RecordNote column to
the view. Record notes are not affected by any of the global report options.
Set margins
You can specify the margins used for printed reports.
Show me how
1. Select Tools > Options > Print.
2. Use the Margin text boxes to specify margins for printed reports.
The specified margins are used for every print report you generate.
Graph Type Used to select the type of graph that you want to display
Graph Used to edit graph properties such as font, background, frame, and whether you want
Properties the graph display to include axes, legends, or grid lines
Legend Used to edit legend properties such as font, border, and color schemes for each field
Properties displayed in the graph
Axis Used to edit axis properties such as font, style and scale
Properties
Format Data Used to edit data format properties such as font, which fields to include in the graph,
orientation, labels, and color schemes for data series
Label Used to edit label properties such as font, border, and orientation
Properties
Print Graph Used to print the graph to any installed Windows print device
Copy Graph to Used to copy the graph to the clipboard for pasting into other applications
Clipboard
Edit Used to edit the command that you executed to generate the graph
Command
Drill-down Used to open selected graph segments in a table view for analysis
Note
If you want to change the default type of graph that Analytics generates, enter an
appropriate SET GRAPH command in the command line.
Show me how
Note
If the results you are graphing contain a single item, Analytics disables the
stacked and 3-D layered options. If the results contain multiple items, stacked
and layered options are available but pie chart options are unavailable.
Tip
To separate the sections of a pie graph, right-click on a section and select
Explode Pie.
l Frame – Change border and background settings for the frame containing graphed results
data.
l Options – Select options for displaying the axis, legend, and grid lines.
3. Click OK.
shadow.
l Font – Change legend text font, style, size, color, or background settings.
l Data Series – Change color schemes for the graphical representation of fields and toggle
Note
You can right-click the legend to choose fields to display in the legend or to
hide the legend. You can also click Show/Hide Legend in the toolbar.
by which the axis is divided. Select Auto to have these values automatically assigned. You
can also specify the orientation of any text values you choose to display.
l Font – Change axis text font, style, size, color, or background settings.
3. Click OK.
Tip
You can right-click the axis to switch between a vertical and horizontal
representation of the axis. You can also click Show/Hide Axis in the toolbar.
Use the Up and Down buttons to change the order in which the fields are displayed in the
graph and in the legend.
Tip
You can also choose which available fields to display by right-clicking the
graph display area and selecting Select Fields.
Font – Change data display text font, style, size, or color of text on the x axis.
l
l Data Series – Change color schemes for the graphical representation of fields and toggle
1. Click the label you want to change and click Label Properties .
2. Click the appropriate tab for the label property you want to edit:
l Orientation – Rotate the label orientation by degrees, or change the vertical or horizontal
l Attributes – Change border attributes for the label, including style, color, thickness, and
drop shadow.
3. Click OK.
Tip
Right-click a label to cut, copy, paste, or delete the label.
Note
Drill-down functionality is not available for graphs created by selecting data in views.
This restriction exists because the data used to create the graph is already selected
in the view.
2. Click Drill-down .
Tip
If you want to analyze table data for a single graph segment, you can double-
click the appropriate segment.
Analytics displays a filtered view of the data selected from the graph. You can continue to
analyze the selected data using other Analytics commands and functions. To return to the
original table view, click Remove Filter.
Note
The Edit Command button is enabled only for graphs generated from an Analytics
command.
Printing graphs
The Print Graph command allows you to print a graph on any installed printer device. For maximum
print resolution, maximize the graph window before printing.
To print a graph:
Note
The data connection capabilities of third-party reporting applications differ. For
example, some applications require that to connect to multiple tables you must join
them, while other applications support connecting to multiple tables individually.
The ACL Connector for Analytics supports connecting to local Analytics tables only.
It does not support connecting to server tables in an Analytics project.
Optimal performance
You get the best performance from the ACL Connector for Analytics by limiting the size of the
Analytics data sets you connect to. The connector is designed to support a wide range of reporting
tools, but it is intended to work with the smaller data sets typical of results rather than with entire
source data tables. Joining tables in the process of connecting is particularly resource-intensive.
Analytics data is stored in flat files, which are slower to access with ODBC than databases.
Tip
You may choose to manually create data connections for Tableau or Excel as a way
of saving multiple connections to different Analytics projects.
1. From the Administrative Tools folder of your Windows operating system, open the version of
the ODBC Data Source Administrator that matches the bitness of the third-party application
you want to connect from (32-bit or 64-bit).
For example, if you want to connect from a 32-bit version of Excel, open the 32-bit ODBC
Data Source Administrator.
Caution
If you create the data connection in the wrong version of the ODBC Data
Source Administrator, the connection is not visible or accessible in the third-
party application. Or it may be accessible, but causes a connection error.
Note
A default Analytics data connection named ACL ODBC or ACL ODBC 64
already exists in the System DSN tab. Do not modify this default data
connection. For more information, see "Default Analytics data connection" on
the next page.
3. Click Add, select ACL Connector for Analytics, and click Finish.
4. In the ACL Data Store Interface DSN Setup dialog box, enter the following information:
l Data Source Name – enter a meaningful name such as "Analytics General Ledger project".
dialog box.
5. Click OK.
The new data connection to the specified Analytics project is created and is now available to
select in a third-party reporting application.
If required, you can create additional data connections to other Analytics projects.
6. Click OK to exit the ODBC Data Source Administrator.
Note
Do not add connection information to either of the default data connections if you
want to retain the ability to connect to different Analytics projects on the fly.
Note
These instructions provide general guidance only and are specific to the versions of
the third-party applications indicated.
For detailed information about creating ODBC connections in a third-party
application, consult the Help for the application.
l To use a pre-existing data connection to an Analytics project, select the name of the
connection, and click Connect.
Note
You must already have created the data connection. For more information,
see "Create a data connection (DSN)" on page 1420.
l To create a data connection to an Analytics project on the fly, select ACL ODBC or
ACL ODBC 64 and click Connect.
Note
If both ACL ODBC and ACL ODBC 64 appear, select the one that matches
the bitness of your version of Tableau (32-bit or 64-bit). For more
information, see "Default Analytics data connection" on the previous page.
4. If you selected ACL ODBC or ACL ODBC 64, in the Open Project File dialog box, navigate
to an Analytics project (.acl), select it and click Open.
5. In the Other Databases (ODBC) dialog box, click Sign In.
Tableau connects to the Analytics project.
6. Optional. If you want to connect to more than one Analytics project at the same time, in the
Data Source tab, in the Connections panel, click Add, and repeat steps 2 to 5.
7. In the Data Source tab, in the Database dropdown list, select the Analytics project you are
connected to.
If you are connected to more than one Analytics project, select the appropriate project first in
the Connections panel.
8. In the Table panel, do one of the following:
l To list all the tables in the Analytics project: click Search .
l To search for a specific table: type the name of a table and press Enter.
Tip
The table name search is case-sensitive.
If an Exact search is not returning any tables, try Contains or Starts with.
Note
Joining can be slow if one or both tables are large.
12. Click File > Save and save the Tableau workbook.
connection from the Data source name (DSN) dropdown list, and click OK.
Note
You must already have created the data connection. For more information,
see "Create a data connection (DSN)" on page 1420.
l To create a data connection to an Analytics project on the fly, select ACL ODBC or
ACL ODBC 64 from the Data source name (DSN) dropdown list, click Advanced options,
enter the appropriate Connection string, and click OK.
The connection string must use this format: DBF=;DBQ=<Analytics project path and
filename.acl>
For example: DBF=;DBQ=C:\Users\john_smith\Documents\ACL Data\Sample Data
Files\Sample Project.acl
Note
If both ACL ODBC and ACL ODBC 64 appear, select the one that matches
the bitness of your version of Power BI (32-bit or 64-bit). For more
information, see "Default Analytics data connection" on page 1421.
l Click Edit to edit the ODBC query. When you have finished editing the query, click Close
& Apply.
Multiple tables are separately loaded into Power BI. If required, you can relate tables in Power
BI. In some cases, table relations are automatically generated.
For detailed information about relating tables or editing the ODBC query, consult the Power
BI Desktop Help.
7. Optional. If you want to connect to more than one Analytics project at the same time, repeat
steps 1 to 6.
If required, you can relate tables from different Analytics projects in Power BI.
8. Save the Power BI file.
1. In the Excel Data tab, click the From Other Sources dropdown list, and select From
Microsoft Query.
2. In the Choose Data Source dialog box, make sure Use the Query Wizard to create/edit
queries is selected.
3. In the Databases tab, do one of the following:
l To use a pre-existing data connection to an Analytics project, select the name of the
Note
You must already have created the data connection. For more information,
see "Create a data connection (DSN)" on page 1420.
l To create a data connection to an Analytics project on the fly, select ACL ODBC or
ACL ODBC 64, and click OK.
Note
If both ACL ODBC and ACL ODBC 64 appear, select the one that matches
the bitness of your version of Excel (32-bit or 64-bit). For more information,
see "Default Analytics data connection" on page 1421.
4. If you selected ACL ODBC or ACL ODBC 64, in the Open Project File dialog box, navigate
to an Analytics project (.acl), select it and click Open.
5. In the Query Wizard, follow the on-screen instructions to do the following:
l Select the tables or columns that you want to import from the Analytics project.
For detailed information about using the Query Wizard, consult the Excel Help.
Note
If you want to connect to multiple Analytics tables without joining them during
the ODBC connection process, you must perform separate connection
operations.
6. In the Import Data dialog box, specify any options you require and click OK.
Excel runs the ODBC query and populates an Excel worksheet with the Analytics data.
7. Click File > Save and save the Excel workbook.
Reference information
This section contains information that applies throughout Analytics:
"Character and size limits in Application-enforced limits to certain input ranges and user-defined parameters in
Analytics" on the facing page Analytics
"Reserved keywords" on Keywords that are reserved for Analytics internal processes and cannot be used
page 1435 for field or variable names
Remarks
These additional details apply to Analytics character and size limits:
l Non-Unicode versus Unicode – specified limits apply to both the non-Unicode and Unicode
editions of Analytics, except where noted.
l Characters and bytes – Character limits apply to the single-byte character encoding used in
the non-Unicode edition, and the double-byte character encoding used in the Unicode edition.
In other words, a 256-character limit means 256 characters in either edition.
l Location of source data – Analytics limits are the same whether the source data resides in an
Analytics data file (.fil), or in an external file or a database. External data sources may impose
their own limits that differ from the Analytics limits.
Table limits
Parameter Limit Result when limit exceeded
Valid characters in a table layout Alphanumeric characters, and the Replacement of an invalid character
name underscore character ( _ ) with an underscore character ( _ )
The name cannot contain any special
characters or spaces, or start with a
number
Maximum length of a source data file 255 characters Analytics stops working
path and name
View limits
Parameter Limit Result when limit exceeded
characters (Unicode)
Note
After the initial import of
data, the default view
displays a maximum of
256 columns, even if a
greater number of
columns were imported. If
required, you can
manually add the
additional columns to the
view. For more
information see "Add
columns to a view" on
page 850.
Valid characters in a view name Alphanumeric characters, and the Replacement of an invalid character
underscore character ( _ ) with an underscore character ( _ )
The name cannot contain any special
characters or spaces, or start with a
number
Valid characters in a field name Alphanumeric characters, and the Replacement of an invalid character
underscore character ( _ ) with an underscore character ( _ )
The name cannot contain any
special characters or spaces, or start
with a number
Maximum width of a computed field 255 characters Error message and value resets to 1
if value entered exceeds 255
characters
Maximum width of a column in a view 255 characters Error message and value resets to 1
if value entered exceeds 255
characters
Columns can temporarily be
extended beyond 255 characters by
dragging the column boundary in the
view, but will be reset in the Modify
Columns dialog box
Filter limits
Parameter Limit Result when limit exceeded
Valid characters in a filter name Alphanumeric characters, and the Replacement of an invalid character
underscore character ( _ ) with an underscore character ( _ )
The name cannot contain any special
characters or spaces, or start with a
number
Index limits
Parameter Limit Result when limit exceeded
Valid characters in an index name Alphanumeric characters, and the Replacement of an invalid character
underscore character ( _ ) with an underscore character ( _ )
The name cannot contain any special
characters or spaces, or start with a
number
Maximum number of index key fields 246 characters total length Error message
Maximum length of quick sort field 247 characters Quick Sort menu option disabled
Command limits
Parameter Limit Result when limit exceeded
Password limits
Parameter Limit Result when limit exceeded
Maximum number of characters in a o Most commands with a Truncation to the maximum length
specified or entered password password requirement – 256 and a connection error
characters
o DEFINE TABLE DB, NOTIFY –
30 characters
Expression limits
Parameter Limit Result when limit exceeded
Variable limits
Parameter Limit Result when limit exceeded
Valid characters in a variable name Alphanumeric characters, and the Replacement of an invalid character
underscore character ( _ ) with an underscore character ( _ ), or
error message
The name cannot contain any special
characters or spaces, or start with a
number
Script limits
Parameter Limit Result when limit exceeded
Valid characters in a script name Alphanumeric characters, and the Replacement of an invalid character
underscore character ( _ ) with an underscore character ( _ )
The name cannot contain any special
characters or spaces, or start with a
number
Workspace limits
Parameter Limit Result when limit exceeded
Valid characters in a workspace Alphanumeric characters, and the Replacement of an invalid character
name underscore character ( _ ) with an underscore character ( _ )
The name cannot contain any special
characters or spaces, or start with a
number
Date limits
Parameter Limit Result when limit exceeded
Maximum number of Drop-down list 32 list items Will not accept additional text beyond
options 32 items in the Label List
Reserved keywords
Analytics reserves certain keywords for special purposes. You cannot name fields or variables with
these reserved keyword values.
If you add a suffix to a reserved keyword, then you can use it as a field or variable name. For
example, the name "Field" is not permitted, but "Field_1" or "Field_2" are permitted.
Note
In some cases, you are also prevented from using abbreviations of the reserved
keywords, such as "Can" (CANCEL), "Form" (FORMAT), or "Rec" (RECORD).
D Specifies a descending sort order for the preceding expression or field name.
END Concludes the input stream and acts like a null line.
IF Specifies a condition.
LINE Used by the DEFINE COLUMN command to specify whether a field breaks over a specified
number of lines.
NODUPS Suppresses duplicate display values in the break field in an Analytics report.
OTHER Indicates which fields or expressions to include, but not subtotal, in the output of the
SUMMARIZE command.
Keyboard shortcuts
The following table lists the keyboard shortcuts that can be used in Analytics.
Ctrl+PgDn Navigator Toggle between the Overview tab, the Log tab, and the Variables tab
view Display the next view (if the table has more than one view)
command results Display the results as a graph (for commands with graphable results)
Ctrl+PgUp Navigator Toggle between the Overview tab, the Log tab, and the Variables tab
view Display the previous view (if the table has more than one view)
F8 command line Open the Date & Time Selector dialog box
Filter text box
Script Editor
Expression text box
Scripting in Analytics
Scripting is how you automate work in Analytics. You can gain a lot of value using Analytics in an ad
hoc or manual fashion without ever writing a script. However, to gain the most value, power, and
efficiency from Analytics you need to script.
The good news is that Analytics provides tools to make scripting relatively easy, even for a novice.
Run more than one command Scripts allow you to assemble multiple Analytics commands and run them in an
at a time unbroken sequence.
Scripts can be run repeatedly, which represents a huge savings of labor if you
perform the same analytic tests, and the same analysis-related tasks such as
Automate repetition importing and preparing particular data files, on a regular basis.
Scripts are portable and sharable. They can be sent to other users, made available
Share analysis in network locations, and copied between Analytics projects.
Scripts allow expert Analytics users to develop analytic tests and share the tests
Disseminate expertise with non-scriptwriting users.
Scripts can be designed to prompt users for input, allowing users to run them
Allow user interaction against their own uniquely named tables and fields, using their own input criteria.
Scripts can be scheduled, and can run unattended, which allows companies to
perform time-intensive data processing overnight, and to set up programs of
Schedule unattended execution automated or continuous analysis.
l "Analytic scripts overview" on page 2605 – guidance for developing analytic scripts that can
run in Robots
Scripting tutorials
Several tutorials are available to help you get started with scripting in Analytics. See "Get started
with scripting" on page 1445.
Complete beginners
For users that want a slow and steady introduction to scripting and Analytics, see the following
sections for some interactive beginner-level tutorials:
l "Scripting for complete beginners" on the facing page
l "How to use functions" on page 1491
l "Analytics scripting basics" on page 1464
Installing Analytics
Before you can start scripting, you need to install Analytics and get it running on your computer. For
more information, see "ACL for Windows Installation and Activation Guide" on page 2687.
Note
By default, the sample data projects are installed at C:\Users\username\Document-
s\ACL Data\Sample Data Files on your local file system.
What is a script?
A script is a list of commands that run in Analytics. Scripts are useful for performing a series of tasks
automatically so that you do not need to run each command manually through the user interface.
For more on scripts, see "What is a script?" on the next page
What is a script?
A script is a series of Analytics commands that are executed sequentially and used to automate
work within Analytics. Any Analytics command can be contained in a script.
Automate processes
Do you need to perform a series of repetitive tasks or routines on a regular basis? Are you currently
performing these tasks manually? If so, you can probably use a script to automate these types of
processes. By using a script, you can avoid manual efforts associated with complex routines. The
more complex the routine, the more time will be saved by running a script.
Schedule processes
Scheduling scripts is often essential when you are dealing with large data sets. If you are using
Robots, you can run scripts on a schedule, even outside of work hours. You can also schedule a
single script or series of scripts to run at a specific date and time.
Improve accuracy
When performed manually, complex data analysis routines are prone to human error. By using a
script, you can ensure process consistency and precision. You can also be absolutely certain that
the same instructions will be executed in the same order each time the same script is run.
Reduce complexity
Scripts are able to process complex file structures and make complex computations on data fields.
Sometimes, more complex analysis can only be performed with a script. For example, continuous
monitoring programs often require scripts to automate processes.
Share analysis
Scripts are portable and sharable. They can be sent to other users, made available in network
locations, and copied between Analytics projects.
Capture documentation
Scripts are a great source of documentation for audit reviews, and can be used as part of an audit
trail. By creating a script, you are documenting the process of creating the results of an analytic test -
which is something that can be easily referenced in the future. You can also add comments to
scripts to further supplement the documentation.
Import data
You can use a script to import various source files into Analytics, including fixed-width, delimited,
report/PDF, Excel, and files accessed via ODBC.
COMMENT *** Imports data from a Microsoft Access database file to an Ana-
lytics table named employees_list.
IMPORT ACCESS TO employees_list PASSWORD 1 "C:\ACL DATA\Sample Data Files\em-
ployees_list.fil" FROM "Employees_List.mdb" TABLE "[Employees_List]" CHARMAX
60 MEMOMAX 70
Prepare data
You can use a script to prepare data for analysis. Scripts can be used to standardize fields prior to
joining or relating tables, remove leading or trailing spaces from values, remove unwanted
characters, and convert data types of fields.
COMMENT *** Creates a new computed field containing the PO_No value. All
leading blank spaces are removed so that the value is properly left
justified.
DEFINE FIELD c_PO_No COMPUTED ALLTRIM(PO_No)
Analyze data
Scripts use data analysis commands and functions to achieve analysis objectives. You can use a
script to group records, make comparisons, and identify issues, trends, or outliers.
Example script
Scenario
Each month, a client provides you with vendor, invoice, and purchase order information. You need
to verify the integrity of the data by ensuring that there are no blanks in the purchase order field.
You decide this is a good opportunity to write a script, given the repetitive nature of the task. You
want to have all fields available for analysis and be able to search the purchase order field for
blanks.
Process
You create a script that performs the following actions:
1. Opens the Invoice_Amts table.
2. Searches the purchase order field (PO_No) for blanks.
3. Extracts records with blank purchase order numbers to a new table (r_Blank_Purchase_
Orders), allowing you to follow up with exceptions.
Tip
To easily identify tables, you can use the following naming conventions:
l Prepared table – prefix table name with p_
l Temporary table – prefix table name with t_
l Results table – prefix table name with r_
Result
COMMENT *** Opens table "Invoice_Amts".
OPEN Invoice_Amts
Next steps
Complete the short tutorial ""Your first Analytics script" on the next page" and try creating your own
script.
Note
By default, the sample data projects are installed at C:\Users\username\Document-
s\ACL Data\Sample Data Files on your local file system.
Setting up
Open the sample Analytics project
1. Open ACL for Windows.
2. Click Open Analytic Project and from the ACL Data\Sample Data Files folder, select
Sample Project.ACL.
OPEN Ap_Trans
Copy this line, paste it into the script editor, and then click Run on the editor toolbar.
If the Ap_Trans table opens, your script is working. Close the table and continue.
Copy this line, paste it into the script editor on a line after the OPEN command, and then click Run
on the editor toolbar.
You should see the Ap_Trans_High table appear in the Navigator under Tables > Accounts_
Payable. This new table contains the copied records from Ap_Trans.
Copy this line, replace the existing EXTRACT command in the script editor with it, and then click Run
on the editor toolbar.
When prompted, click Yes to overwrite the Ap_Trans_High table. The Ap_Trans_High table now
contains the copied records with amounts exceeding 1000.00 from Ap_Trans.
OPEN Ap_Trans_High
Copy this line, paste it into the script editor on a line after the EXTRACT command, and then click Run
on the editor toolbar.
The Ap_Trans_High now opens when the script completes and you can review the extracted records
from Ap_Trans.
OPEN Ap_Trans_High
Where to next?
l For an overview of the basics of scripting in Analytics, see "Analytics scripting basics" on
page 1464
l For advanced training, see the scripting course in Academy
To filter the table, you create a simple expression using the equality operator (=):
Because the equality operator is case-sensitive, records where the Department field contains
"finance" are excluded from the results. You need to include these records in the results as well.
When the expression is evaluated, LOWER("Finance") becomes "finance" and is then compared to
the string on the right-hand side of the equality operator.
Office Supplies 3 6
Tip
Notice the backquotes ` that surround the literal date value. You must always
surround literal datetime values with this qualifier. For more information, see "Data
types" on page 1471.
COMMENT filters out records with an order date of Jan 1 2011 or later
SET FILTER TO Order_Date < `20110101`
Office Supplies 3 6
COMMENT excludes blank dates and order dates from 2011 and later
SET FILTER TO NOT ISBLANK(DATETIME(Order_Date)) AND Order_Date < `20110101`
When this expression evaluates, the functions run from inside out and several things happen:
1. The DATETIME( ) function converts the Order_Date date value to a text value (`20100828`
becomes "20100828").
2. The ISBLANK( ) function checks if the text value is blank and evaluates to either true or false.
3. The NOT operator flips the logical value returned from ISBLANK( ) so that:
l If the Order_Date is blank (true), then the value is flipped to false and the filter excludes the
record
l If the Order_Date is not blank (false), then the value is flipped to true and the filter checks if
the date is earlier than 2011 and includes all records that have an Order_Date value before
January 1, 2011
Tip
Only those records where the sub-expressions evaluate to true on both sides of the
AND operator are included. If either of the sub-expressions evaluate to false, the
record is excluded.
Example
You are walking down the street and you see someone that you know. It is polite to greet this
person, but do you say "Good morning" or do you say "Good afternoon" when you meet?
The answer depends on a simple condition: is it 12:00 PM or later? If the answer is yes, then
you say "Good afternoon", otherwise you say "Good morning".
In this example, the conditional expression determines the action you take (which greeting
you use) based on whether or not it evaluates to true (yes).
The expression from the preceding example could be translated into ACLScript as follows:
You can run this example by copying the following line, and then pasting it into the command line of
Analytics. Depending on the time of day you do this, the expression evaluates to either true or false:
Tip
If the command line is not visible, select Window > Command Line.
Once you run the example, you can try changing the literal time value of 12:00 PM in the expression
so that it evaluates to the opposite.
If the time is after 12:00 PM, then the DISPLAY command prints "Good afternoon" to the output tab.
But if it is still morning where you are, then nothing is printed. The script does not run the DISPLAY
command.
This example works like before, except now if the time is before 12:00 PM, then the
DISPLAY command prints "Good morning".
If this script runs before 12:00 PM, then the value stored in the variable is "Good morning", and if it
runs at 12:00 PM or later, then the value stored in the variable is "Good afternoon". Try pasting this
into your script editor and running it. You can check the value of the variable on the Variables tab
after it runs.
COMMENT sums the Amount field for records that have a Quantity greater than
5
TOTAL Amount IF Quantity > 5
To calculate the sum of the Transaction_Amount field, you use the TOTAL command:
This command processes every record in the table and calculates a total of 38,611.42, which is the
sum of all transactions.
To add some decision-making to the command, and process only those transactions that occurred
at 12:00 PM or later, you add the IF parameter to TOTAL. You use the same conditional expression
from the example at the start, but replace NOW( ) with the time part of the transaction date:
In the command, you have to use some functions to isolate the time part of the transaction date, but
once you do that, the decision is the same conditional expression from the example at the start: is it
12:00 PM or later? If the answer is yes, then the amount is included in the sum.
This command calculates a total of 15,640.59, which is the sum of all afternoon transactions in the
table.
Note
If you are completely new to scripting, consider visiting the Academy for some basic
training before jumping into this content. For courses on scripting and using
Analytics, visit www.highbond.com.
Commands
Every line in a script executes an ACLScript command and starts with the command name. A
command is an instruction to execute an operation in Analytics.
The command name is followed by one or more parameters that are specified as parameter_name
parameter_value.
Tip
Depending on the command, some parameters are required and some are optional.
You do not need to specify optional parameters. If you omit them, the command
either executes without them, or uses default values.
Comments
Like any scripting language, you can add comments in ACLScript With the COMMENT keyword. Use
comments to make your code easier to understand and to communicate with anyone who may try to
read, use, understand, or update your script. ACLScript supports two types of comments:
l single line comments – all text following COMMENT is ignored until the end of the line is reached
l multiple line comment blocks – begin with COMMENT and each subsequent line is ignored until
the END keyword, or a blank line, is reached
For more information and examples, see "Comments" on page 1469.
Data types
ACLScript supports four basic data types:
l logical – the simplest data type. Logical data expresses a truth value of either true (T) or false
(F)
l numeric – contain digits from 0 to 9 and, optionally, a negative sign and a decimal point
l character – a series of one or more alphanumeric characters
l datetime – a date, datetime, or time value expressed in a supported format
Each data type is treated differently by Analytics and can be used in different commands and
functions. For more information about data types, see "Data types" on page 1471.
Expressions
An expression is any statement that has a value, or that produces a value. The simplest form of
expression is a literal value such as 2 or "test". However, expressions usually appear as calcula-
tions and can be as complex as any valid combination of operators, conditions, functions, and
values that you can imagine:
Expressions are typically used in Analytics to populate computed fields or as input for conditional
logic. For more information about expressions, see "Expressions" on page 1472.
Functions
Functions are built-in routines that accept a given number of parameters and return a single value.
Use functions to manipulate field contents and variables that are used in commands.
Note
Functions do not modify field data. Functions generate and return a new value based
on a calculation or algorithm that uses field data or variables as input. Use the value
the function returns as input for a command.
Functions start with the function name followed directly by an opening parenthesis, a comma-
separated list of 0 or more values that are passed into the function as arguments, and a closing
parenthesis.
Example
The BETWEEN(value, min, max) function takes three arguments and returns true if the value falls
within the range or false if it falls outside the range:
l value – the expression or field to test
l min – the minimum of the range
l max – the maximum of the range
Variables
A variable is temporary storage location used to hold a value. Variables have an associated
identifier that lets you reference and work with the value stored in your computer's memory.
ACLScript uses the ASSIGN command to create a variable and assign it a value at the same time:
ASSIGN v_age_in_years = 3
For simplicity you can omit the ASSIGN keyword, however ASSIGN is implicitly used and the same
command runs:
v_age_in_years = 3
Note
ACLScript does not support null values. All variables must have an associated value
of one of the supported data types. The script interpreter evaluates the data type
using the data format and qualifier you use to assign the value. For more
information, see "Data types" on page 1471.
Using variables
Once a variable is created, you can reference it anywhere you reference field names or variables.
You can also reassign it a new value using the ASSIGN command.
You can also use string interpolation, or variable substitution, to include a variable in a string literal
by wrapping the variable name in % characters. When Analytics encounters the substituted variable,
it replaces the placeholder with its corresponding value:
Control structures
A control structure is a component of a script that decides which direction to take based on given
parameters. ACLScript provides both conditional logic and looping structures.
Conditional logic
ACLScript implements conditional logic as an IF command and as an optional parameter on many
commands in the language.
Tip
You use the IF command to control if a command runs or not while you use the IF
parameter to decide which records in a table a command runs against.
IF command
IF parameter
Looping
The LOOP command provides the looping control structure in ACLScript. This command processes
the statements inside the loop for as long as the control test expression evaluates to true.
For more information about control structures, see "Control structures" on page 1481
Comments
Like an scripting language, you can add comments in ACLScript With the COMMENT keyword. Use
comments to make your code easier to understand and to communicate with anyone who may try to
read, use, or understand your script.
Comment types
ACLScript supports two types of comments:
l single line comments – all text following COMMENT is ignored until the end of the line is reached
l multiple line comment blocks – begin with COMMENT and each subsequent line is ignored until
the END keyword, or a blank line, is reached
COMMENT
**********************
** This section of the script prepares data for import
**********************
END
COMMENT
************************************************************
Data types
ACLScript supports four basic data types: logical, numeric, character, and datetime.
Character A series of one or more 32,767 bytes Single quotation o 'John Doe'
characters. marks, or double o "John Doe"
quotation marks
Expressions
An expression is any statement that has a value. The simplest form of expression is a literal,
however expressions can be as complex as any legal combination of operators, conditions,
functions, and values you can imagine.
Expression components
Literal values
A literal value is a value written exactly as it is meant to be interpreted, such as the character literal
'my value'. For information about literals, see "Data types" on the previous page.
Operators
Operators are symbols that tell the script interpreter to perform arithmetic, string, comparison, or
logical evaluation of the specified values:
Arithmetic o ^ exponentiation 1 + 5 - 3 * 2
o * multiplies, / divides
o + adds, - subtracts
Note
Multiplicative operators
have equal precedence
with each other and
evaluate from left to right.
Additive operators have
equal precedence with
each other and evaluate
from left to right.
o = equality
o >= greater than or equal to
o <= less than or equal to
o <> not equal
Note
Comparative operators
have equal precedence
with each other and
evaluate from left to right.
Functions
Expressions are evaluated using the values returned by functions. Functions execute with the
highest precedence of any expression component. For more information about functions, see
"Functions" on page 1476.
Example expressions
Evaluates to 6
(2 + (3 - 2)) * 2
Evaluates to true
((2 + (3 - 2)) * 2) > ROOT(9,0)
Tip
Prefix computed field names with c_ to identify them as computed data rather than
original source data.
When the first conditional expression evaluates to true, the value specified for that case is used. In
this example, amount * general_rate is the default value used when neither of the conditional
expressions evaluate to true.
Note
You must add an empty line between the line command and the conditions unless
you include the IF , WIDTH, PIC, or AS parameters on the DEFINE FIELD command. For
more information, see "DEFINE FIELD . . . COMPUTED command" on page 1734.
Functions
Functions are built-in routines that accept a given number of parameters and return a single value.
Use functions to manipulate field contents and variables that are used in commands.
Note
Functions do not modify field data. Functions generate and return a new value based
on a calculation or algorithm that uses field data or variables as input. Use the value
the function returns as input for a command.
Function syntax
Functions start with the function name followed directly by an opening parenthesis, a comma-
separated list of 0 or more values that are passed into the function as arguments, and a closing
parenthesis.
Example
The BETWEEN(value, min, max) function takes three arguments and returns true if the value falls
within the range or false if it falls outside the range:
l value – the expression or field to test
l min – the minimum of the range
l max – the maximum of the range
Function arguments
An argument of a function is a specific input value passed into the function.
Function arguments are passed to functions via an argument list. This is a comma-delimited list of
literal values, variables, or expressions that evaluate to values of the parameter data type. For more
information about working with data types, see "Data types" on page 1471.
Note
If your project works with European number formats, or if you are writing scripts that
are portable across regions, separate function arguments with a space character
instead of a comma unless you are passing in a signed numeric value. Functions
accepting signed numeric values require an explicit delimiter.
Functions vs commands
The distinction between commands and functions is subtle but critical to using ACLScript:
Functions Commands
Use fields, values, or records as input and generate a new Use tables as input and generate new records and tables.
value that is returned.
Used in expressions, computed fields, command Used to analyze data, import data, and produce results.
parameter values, variables, and filters to assist and
modify command execution.
Variables
A variable is temporary storage location used to hold a value. Variables have an associated
identifier that lets you reference and work with the value stored in your computer's memory.
Note
This topic provides a basic understanding of variables in ACLScript. For
comprehensive information, see "Working with variables in ACLScript" on
page 1568.
ASSIGN v_age_in_years = 3
For simplicity you can omit the ASSIGN keyword, however ASSIGN is implicitly used and the same
command runs:
v_age_in_years = 3
Note
ACLScript does not support null values. All variables must have an associated value
of one of the supported data types. The script interpreter evaluates the data type
using the data format and qualifier you use to assign the value. For more
information, see "Data types" on page 1471.
Using variables
Once a variable is created, you can reference it anywhere you reference field names or variables.
You can also reassign it a new value using the ASSIGN command.
You can also use string interpolation, or variable substitution, to include a variable in a string literal
by wrapping the variable name in % characters. When Analytics encounters the substituted variable,
it replaces the placeholder with its corresponding value:
Types of variables
Analytics uses the following types of variables:
l system-generated variables – automatically created after executing a command
l permanent variables – remain in your computer's memory until you delete them and persist
after closing the Analytics project
Note
To define a permanent variable, prefix the identifier with an '_': _v_company_
name = 'Acme'.
l session variables – remain in your computer's memory until you delete them or until the
Analytics project is closed
Variable identifiers
Variable identifiers are case-insensitive and follow certain conventions related to the type of
variable:
l system-generated variable identifiers use all caps: OUTPUTFOLDER
l permanent variable identifiers must have a '_' prefix: _v_permanent
l session variable identifiers use the format v_varname by convention but you are not restricted
to this naming convention
DISPLAY v_age_in_years
When the script encounters this command, it writes the command to the log file. To view the variable
value at that stage of script execution, click the entry in the log.
Tip
You can also use variables to help debug by inserting breakpoints in your script and
inspecting the variable values on the Variables tab of the Navigator.
Control structures
A control structure is a component of a script that decides which direction to take based on given
parameters. ACLScript provides both conditional IF logic and looping structures.
The IF command
When using the IF command, you specify a conditional expression followed by the command to
execute if the expression evaluates to true:
This conditional structure controls which code executes, so you can use the IF command when you
want to process an entire table based on the test expression. If the expression evaluates as true, the
command is run against all records in the table. For more information about the IF command, see
"IF command" on page 1889.
IF parameter
Many commands accept an optional IF parameter that you can use to filter which records the
command is executed against:
When this statement executes, the script classifies all records in the table where the value of the
state field is 'NY'.
Looping
The LOOP command
The LOOP command provides the looping control structure in ACLScript.
Note
The LOOP command must execute within the GROUP command, it cannot stand alone.
The LOOP command in the example below processes the statements inside the loop for as long as
the specified WHILE expression is true:
ASSIGN v_counter = 10
GROUP
LOOP WHILE v_counter > 0
v_total = v_total + amount
v_counter = v_counter - 1
END
END
This structure iterates 10 times and adds the value of the amount field to the variable v_total. At the
end of each iteration, the v_counter variable is decremented by 1 and then tested in the WHILE
expression. Once the expression evaluates to false, the loop completes and the script progresses.
When the loop completes, v_total holds the sum of the amount field values from 10 records.
For more information about looping, see "LOOP command" on page 2007.
Example
You need to import all the CSV files in the C:\data folder into your project. You can use the
DIRECTORY command to get a list of files from the folder, however you cannot use the
IMPORT command inside the GROUP structure. You need an alternative way of looping through
the table that DIRECTORY creates.
To achieve this, you create a main script that:
1. Executes the DIRECTORY command and saves the results to a table.
2. Gets the number of records in the table to use as a counter.
3. Calls a subscript once per record in the table to execute the IMPORT command against
the current record.
Main script
Import subscript
COMMENT Import_Subscript
OPEN T_Table_To_Loop
LOCATE RECORD v_Counter
Variables are shared among all scripts that run in the project, so the main script calls the
subscript until the value of v_Counter exceeds the value of v_Num_Records. Each time the
subscript executes, it increments v_Counter.
This structure allows you to call the IMPORT command against each record while looping
through the table. When the main script completes, you have imported all CSV files from the
C:\data folder.
To calculate this amount, you use the GROUP command. Inside each iteration of GROUP, you:
1. Calculate the running total as of the current record.
2. Extract the invoice number, amount, date, and running total to a results table.
OPEN Ap_Trans
COMMENT iterate over each record in the table and then calculate and extract
the running total END
GROUP
ASSIGN v_running_total = v_running_total + Amount
EXTRACT Invoice_Number, Amount, Date, v_running_total AS "Running total"
TO results1
END
When the script runs, the commands inside the GROUP block are processed against each record in
the table, from top to bottom, and the running total is calculated and extracted. If we could walk
through GROUP as it runs, this is how it would look:
Note
If a record evaluates to true for more than one case, the record is only processed by
the first IF/ELSE block that tests it. Records are never processed by more than one
IF/ELSE block in a GROUP command.
OPEN Ap_Trans
COMMENT use GROUP IF to run different ASSIGN and EXTRACT commands depending
on invoice amount END
GROUP IF Amount >= 1000
ASSIGN v_running_total_hi = v_running_total_hi + Amount
EXTRACT Invoice_Number, Amount, Date, v_running_total_hi AS "Running
total" TO results_hi
ELSE IF Amount >= 100
ASSIGN v_running_total_med = v_running_total_med + Amount
EXTRACT Invoice_Number, Amount, Date, v_running_total_med AS "Running
total" TO results_med
ELSE
ASSIGN v_running_total_low = v_running_total_low + Amount
EXTRACT Invoice_Number, Amount, Date, v_running_total_low AS "Running
total" TO results_low
END
When the script runs, the GROUP command tests the invoice amount for each record. Depending
on the amount, the record is used to update one of three running totals (low, medium, high) and
three result tables are produced.
Note
You must increment the v_counter variable inside LOOP. If you do not, the
WHILE test always evaluates to true and the script enters an infinite loop. You can
include a SET LOOP command in your scripts to guard against infinite loops. For
more information, see SET LOOP command.
COMMENT
Use GROUP to count commas in each department code field as a way of identi-
fying how many departments are associated with the record
"LOOP" over each record for each code in the field, with each iteration of
the loop extracting the record with a single code to the result1 table
END
GROUP
v_department_count = OCCURS(Dept_Code,',')
v_counter = 0
LOOP WHILE v_counter <= v_department_count
v_dept = SPLIT(Dept_Code, ',', (v_counter + 1))
EXTRACT FIELDS Invoice_Number, Amount, v_dept AS "Department" TO result1
v_counter = v_counter + 1
END
END
When the script runs, the commands inside the GROUP block are processed against each record in
the table, from top to bottom. For each record, the LOOP command iterates over the record once per
department code in the comma-delimited list and then extracts a record. If we could walk through
GROUP and LOOP as they run, this is how it would look:
For the first record in the table, the value of v_department_count is 1, so LOOP iterates twice:
l v_depart = CCD
The following record is extracted and the value of v_counter is incremented to 1, therefore
LOOP iterates again:
l v_depart = RDR
The following record is extracted and the value of v_counter is incremented to 2, therefore
LOOP does not iterate again and GROUP proceeds to the next record:
For the second record in the table, the value of v_department_count is 0, so LOOP iterates once:
l v_counter = 0
l v_depart = CCD
The following record is extracted and the value of v_counter is incremented to 1, therefore LOOP
does not iterate again and GROUP proceeds to the next record:
For the third record in the table, the value of v_department_count is 2, so LOOP iterates three times:
l v_depart = CCD
The following record is extracted and the value of v_counter is incremented to 1, therefore
LOOP iterates again:
l v_depart = LMO
The following record is extracted and the value of v_counter is incremented to 2, therefore
LOOP iterates again:
l v_depart = RDR
The following record is extracted and the value of v_counter is incremented to 3, therefore
LOOP does not iterate again and GROUP reaches the end of the table:
Short tutorials
Taken together, the short tutorials in this section provide a solid introduction to Analytics functions,
and show you how to use them to achieve some useful things.
You can work through the tutorials in sequence, or do only the tutorial that meets your immediate
need:
Learn an easy way to familiarize with any "Familiarizing with different functions" on page 1497
Analytics function o How to quickly and easily familiarize with any
Analytics function
o Common errors when using functions
Learn how to filter or search data using functions "Using functions to create filters" on page 1501
o Brief overview of filters
o Using functions to:
l filter by date
l filter by multiple values
l filter by fuzzy values
Learn how to clean or prepare data using functions "Using functions to clean data" on page 1505
o Brief overview of cleaning data
o Using functions to:
l remove blank spaces
l remove unwanted characters
Learn how to increase efficiency and power by combining "Cleaning and filtering data at the same time" on
functions page 1509
o Introduction to nested functions
What is a function?
You can think of an Analytics function as a small tool that performs a specific, useful task. For
example, you can use a function to standardize upper and lowercase in a piece of inconsistently
formatted text:
Another way to think of a function is as an "opaque box". The input goes in one side, something
happens inside to transform it, and the output comes out the other side.
Note
Throughout Analytics documentation, function names are presented in uppercase,
which is simply a formatting convention. Analytics does not require that functions are
entered in uppercase.
Example
Here are examples of what three different functions can do:
l the ALLTRIM( ) function
l the EXCLUDE( ) function
l the BETWEEN( ) function
Example
Here is the BETWEEN( ) example from above, but now with a date field as input rather than a
literal date value.
The function returns T for True for every date in the Invoice_Date field that falls in the year
2017, and F for False for dates in other years.
Note
The two boundary values you specify for the BETWEEN( ) function are
inclusive. Small details like this one are included in the Help topic for each
function.
Where to next?
Learn how to quickly and easily familiarize with any Analytics function: "Familiarizing with different
functions" on the next page
If it is not open, on the main menu, select Window > Command Line.
3. Copy and paste one of the function examples above into the command line.
4. Type DISPLAY and a space before the pasted example and press Enter.
The function output, also known as the return value, appears in the Analytics display screen.
Note
You can't do anything with the function output in the display screen. It's simply
a read-only output that allows you to see what a particular function with a
particular input returns.
Tip
You can click the linked function in the display screen to quickly reload it into
the command line.
Tip
If you start doing a lot of experimenting with functions in the command line, you can
just type disp instead of DISPLAY.
EXCLUDE( ) example
In the EXCLUDE( ) example, if you add VT to the characters to exclude, you should have output that
includes only numbers.
EXCLUDE("VT-123-45", "VT-")
BETWEEN( ) example
In the BETWEEN( ) example, what happens when you change the literal invoice date to 01 July
2016?
The invoice date is the first of the three input values.
You should find that the output has now changed from T to F, or from True to False, because 01 July
2016 is not between 01 January and 31 December 2017.
Note
Using DISPLAY with a function in the command line is only for testing or learning
purposes. You do not use DISPLAY with functions anywhere else in Analytics.
Tip
Consult the function Help topic if you need help understanding some of the
function inputs.
The opening parenthesis must immediately follow the function name with no intervening space:
PROPER("john SMITH") , not PROPER ("john SMITH")
Literal date values must be enclosed in `backquotes`, and use a YYYYMMDD format (or
Dates YYMMDD).
o Invoice_Date
o 1000.00
DISPLAY You must preface a function with DISPLAY in the command line (and nowhere else).
Tip
Minor errors in function syntax can be difficult to spot. Check your syntax carefully if
an error recurs.
Function Help topics provide comprehensive information about the required syntax
for each function.
Where to next?
Learn how to use functions to filter data in a variety of different ways: "Using functions to create
filters" on the next page
Example
You want to examine only those amounts in an accounts receivable table that you consider
material. Your threshold for materiality is $1000.00, so you create the following filter:
This filter returns True for amounts greater than or equal to $1000.00, and False for amounts
less than $1000.00. Records that evaluate to True are included by the filter, and records that
evaluate to False are excluded.
Excluded records are hidden from view while the filter is applied, and they are excluded from
any Analytics commands you run on the table.
Filter by date
We can use a version of the BETWEEN( ) example from the previous tutorials to create a filter that
includes only invoices from the first quarter.
1. In Analytics, open Sample Project.ACL, and open the Ap_Trans table (Tables\Accounts_
Payable\Ap_Trans).
If Sample Project.ACL is not available, open any table with a date field. To work with this
example, the field must use the Datetime data type.
2. Copy and paste this version of the BETWEEN( ) example into the Filter text box at the top of
the View tab, and press Enter:
Result: The table is filtered to display only invoices from the first quarter of the year.
If you not using the Ap_Trans table, update the field name and boundary dates in the
BETWEEN( ) function to match your data.
The field name must be the physical field name, not the display name (alternate column title).
Right-click the header for the date field and select Properties to see both the physical and the
display field names.
Note
Do not use DISPLAY in the Filter text box.
3. Try changing one or both boundary dates to create a different date filter.
When entering a literal date, you must use the format `YYYYMMDD`. If you are using the Ap_
Trans table, all dates are in the year 2000.
Tip
You can also use BETWEEN( ) to filter numeric or text data. Enclose text inputs in
"quotation marks". Do not enclose field names or numeric inputs in any
punctuation: Invoice_Amount, 1000.00
1. Copy and paste the MATCH( ) function with these inputs into the Filter text box, and press
Enter:
Result: The filter on the Ap_Trans table updates to display only invoices from vendors in the
three specified cities.
Note
The Vendor_City field is in the Vendor table, which is related to the Ap_Trans
table in Sample Project.ACL. To reference related fields in functions, you
use table name.field name syntax.
To reference fields in the open table, you use just field name.
2. Try changing the field, and the three terms to match against, to create different sorts of filters.
Note
Search terms in the MATCH( ) function are case-sensitive.
Result: The filter on the Ap_Trans table updates to display only invoices from vendors with
names that are identical or nearly identical to "Miller Co". You should see two records for the
vendor "Muller Corp."
2. Increase the degree of fuzziness from 4 to 8 and press Enter.
An additional record for "MGMT Mfg." should now be included by the filter.
3. Click Remove Filter , review the vendor names, and change "Miller Co" to something
close to, but not exactly matching, one of the other vendor names.
Experiment with different fuzziness settings. Valid settings are 1 to 10, inclusive.
Key point
You can use functions to create filters throughout Analytics, including in scripts. Filters created with
functions are a fundamental building block of data analysis in Analytics.
Where to next?
Learn how to use functions to perform data cleansing or data preparation tasks: "Using functions to
clean data" on the next page
Key point
Using one or more functions, you can perform a wide range of data cleansing or data preparation
tasks that allow you to work effectively and accurately even if source data is inconsistent. Data
preparation is a fundamental preliminary task for much data analysis.
Vendor_City sorted
[ ] [ ] Chicago
Ann Arbor
Austin
Englewood
[ ] = blank space
You can use the ALLTRIM( ) function to get rid of the leading spaces and ensure accurate
sorting:
ALLTRIM(Vendor_City)
ALLTRIM(Vendor_City) sorted
Ann Arbor
Austin
Chicago
Englewood
Note
To apply the ALLTRIM( ) function to the Vendor_City field, you create a
computed field that uses ALLTRIM( ). Computed fields are discussed in a
subsequent tutorial.
Standardize telephone
numbers INCLUDE("(604) 555-1212", "1234567890")
Returns 6045551212
Returns 6045551212
The INCLUDE( ) function includes only the specified characters in the output – in
this case, only the numbers 0 to 9
Tip
Use INCLUDE( ) if the set of characters you want to include is
small, and the set you want to exclude is large.
Standardize addresses
EXCLUDE("#1550-980 Howe St.", "#.")
Tip
Use EXCLUDE( ) if the set of characters you want to exclude is
small, and the set you want to include is large.
Standardize addresses
and remove street OMIT("#1550-980 Howe St.", " Street, St.,#")
abbreviations
Tip
Use OMIT( ) if you want to exclude specific strings of characters,
but not the individual characters that make up the string.
For example, exclude Street when it occurs as a unit, but not S, t, r,
e, or t when they occur in other words.
Where to next?
Learn how to use functions to perform multiple tasks simultaneously: "Cleaning and filtering data at
the same time" on the next page
Nested functions
You can nest one function inside another function to achieve results that you couldn't achieve with
either function alone.
Basic structure
Here is the basic structure of a nested function with one level of nesting:
Order of evaluation
Nested functions are evaluated starting with the innermost function and working outward to the
outermost function. So, in the generic example above:
1. FUNCTION_1(function_1 input) is evaluated first.
2. The output of FUNCTION_1( ) becomes one of the inputs for FUNCTION_2( ).
3. FUNCTION_2( ) is evaluated second.
Key point
Nesting functions is a powerful and flexible capability that can allow you to achieve a great range of
useful results. You can perform multiple transformations of source data simultaneously in
preparation for inputting the data to a command.
Example
You want to use the Vendor_City field to filter records in a table, but the city names have been
entered inconsistently. Some have an initial capital ("Austin"), and some are entirely
uppercase ("AUSTIN").
You can nest the UPPER( ) function inside the MATCH( ) function to:
1. transform all values in the Vendor_City field to uppercase
2. filter the records by city
Note that you have to adjust your filter terms to be all uppercase so that they match the
uppercase values output by the UPPER( ) function.
MATCH( UPPER(Vendor_City) , "AUSTIN", "CHICAGO")
The table below illustrates the difference between using the MATCH( ) function alone, and
using the nested function.
With MATCH( ) alone, the filter is too restrictive and excludes records that should be included.
Austin Austin
Chicago Chicago
AUSTIN
CHICAGO
Tip
Instead of using a nested function, you could add variations to the filter terms:
MATCH(Vendor_City, "Austin", "AUSTIN", "Chicago", "CHICAGO").
However, with additional filter terms this approach quickly becomes labor-
intensive, and would fail to capture values with typos, such as "AUstin".
Nesting UPPER( ) is the better approach.
Note
To apply the MATCH( ) or UPPER( ) functions to the Vendor_City field, you
create a computed field that uses the function. Computed fields are discussed
in a subsequent tutorial.
Example
In a second situation, the data in the Vendor_City field is even less consistent. Not only is
case inconsistent, but some values are preceded by one or more blank spaces and some are
not.
You can nest the UPPER( ) function inside the ALLTRIM( ) function, and the ALLTRIM
( ) function inside the MATCH( ) function to:
1. transform all values in the Vendor_City field to uppercase
2. remove all leading blank spaces
Tip
It's easy to lose track of opening and closing parentheses when building
nested functions. Missing or unmatched parentheses are a common
cause of function errors.
The number of opening parentheses ( must always equal the number of
closing parentheses ). In the example above, there are three opening
parentheses and three closing parentheses.
The table below illustrates the difference between using the MATCH( ) function alone, and
using the nested function.
With MATCH( ) alone, the filter is too restrictive and excludes records that should be included.
MATCH(ALLTRIM( UPPER(Vendor_City) ),
MATCH(Vendor_City, "Austin", "Chicago") "AUSTIN", "CHICAGO")
Austin Austin
Chicago Chicago
AUSTIN
CHICAGO
[ ] Austin
[ ] [ ] [ ] Chicago
[ ] [ ] AUSTIN
[ ] CHICAGO
[ ] = blank space
Where to next?
If you have completed all the tutorials in "How to use functions" on page 1491, you are ready to
move on to "Advanced use of functions" on the next page.
The advanced tutorials teach you how to use functions with core Analytics features.
Note
Using functions in these other situations is a little more involved than the usage
presented in previous tutorials. However, the functions themselves behave in
exactly the same way.
Remember that you can quickly and easily test any function in the
Analytics command line to see what it does: "Familiarizing with different functions"
on page 1497.
Short tutorials
The tutorials are designed to be completed in sequence:
Apply a function to all the values in a field "Using a function to group records by month" on
page 1515
o Applying a function to all the values in a field:
l by creating a computed field
l by embedding a function in an Analytics command
Use variables with functions "Using variables with a function to allow user input" on
page 1522
o Brief overview of variables
o Using variables as inputs for a function
Computed field
One way to apply a function to all the values in a field is to create a computed field. A computed field
is one that you create, often based on an actual physical field, but composed entirely of values
computed by Analytics.
Similar to the output of a function, you can think of a computed field as virtual data, calculated by
Analytics, that exists in memory. Once calculated, this virtual data can be used in subsequent
operations.
MONTH(Invoice_Date)
If you not using the Ap_Trans table, update the field name to match your data.
d. Click Accept Entry , and close the Table Layout dialog box.
e. In the table view, right-click the header of the Invoice Date column, select Add Columns,
under Available Fields double-click Month, and click OK.
Result: The Month computed field is added to the view. It contains the month portion of
each date in the Invoice Date column, displayed as a number from 1 to 12.
1 85,670.22 12
2 4,496.56 6
3 2,941.80 5
4 467.40 1
5 8,272.57 5
6 1,582.86 2
7 3,101.98 4
8 21,146.96 2
9 32,577.32 20
10 41,595.89 19
11 70,779.26 19
12 6,008.51 7
l In the Default Value field copy and paste this version of the CMOY( ) function:
CMOY(Invoice_Date, 9)
Result: The Month_2 computed field is added to the view with the name of each month.
2. Follow the same steps you used to group the records from the Ap_Trans table by month, but
with these differences:
l In the Other Fields list, select Month_2.
Result: Analytics outputs the new table, which groups the records from the Ap_Trans table by
month, but now the month names are included.
1 85,670.22 12 January
2 4,496.56 6 February
3 2,941.80 5 March
4 467.40 1 April
5 8,272.57 5 May
6 1,582.86 2 June
7 3,101.98 4 July
8 21,146.96 2 August
9 32,577.32 20 September
10 41,595.89 19 October
11 70,779.26 19 November
12 6,008.51 7 December
Tip
To make it easier to locate the MONTH( ) function, select Date & Time from
the drop-down filter at the top of the Functions list.
3. In the Expression text box, select date/datetime and double-click Invoice_Date in the
Available Fields list.
You should have MONTH( Invoice_Date ) in the Expression text box.
Note
The expression should look familiar. It's the same as the computed field from
the previous example, only now it's embedded in the summarize command.
4. Click OK to exit the Expression Builder, and click OK to exit the Select Fields dialog box.
1 85,670.22 12 January
2 4,496.56 6 February
3 2,941.80 5 March
4 467.40 1 April
5 8,272.57 5 May
6 1,582.86 2 June
7 3,101.98 4 July
8 21,146.96 2 August
9 32,577.32 20 September
10 41,595.89 19 October
11 70,779.26 19 November
12 6,008.51 7 December
Key point
You used two different methods to achieve exactly the same result:
l Computed field – Creating a computed field before using the field in a command is a more
literal, step-by-step approach. It may be an appropriate approach if you want to use the
Tip
Using DOW( ) and CDOW( ), you could analyze how sales figures compare for
different days of the week.
UPPER(Vendor.Vendor_Name)
3. Type or reload the function into the command line and press Enter.
The function output is UNITED EQUIPMENT.
4. Select one or two other records and repeat the process.
Key point: On a record-by-record basis you are seeing what a computed field, or an
embedded function, would do to all the values in the Vendor.Vendor_Name field.
You can use this testing method with any Analytics function that takes a field for input.
Where to next?
Learn how to use variables with a function to create interactivity: "Using variables with a function to
allow user input" on the facing page
The filter restricts the records in the Invoice_Date field to the first quarter of the year 2000.
This version of the BETWEEN( ) function is fine if we don't mind manually changing the field name,
and the start and end dates, every time we want to use it in a different context.
But what if we want to include this filter in a script to be run by other users, against different data, and
the other users don't understand how to update the function inputs?
Note, as well, that based solely on a visual inspection, there's no way of knowing conclusively the
purpose of the raw data providing function inputs.
In conjunction with an interactive script, this version of the BETWEEN( ) function allows a user to
pick any date field they want, and specify the two boundary dates.
Note, also, that just by looking at the function the purpose of each input is clear.
Note
By convention, scriptwriters preface their variable names with "v_" so that in a
complex script it's easy to see what's a variable and what isn't.
Key point
By using variables, you can create a much broader and more flexible application of a function.
In the Variables tab, you should see the three variables you just created, with the assigned
values.
Test BETWEEN( )
1. Copy and paste the BETWEEN( ) example into the command line:
BETWEEN(v_date_field, v_start_date, v_end_date)
2. Type DISPLAY and a space before the example, and press Enter.
The result should be T for True, based on the values contained in the variables:
15 July 2017 is between the specified start and end dates.
Don't worry if you can't understand all the script syntax. The main point is to see the BETWEEN
( ) function in action in a script.
A COMMENT before each piece of script syntax explains in simple terms what the syntax is doing.
Functions are highlighted brown.
Tip
If you get an empty table, or a large number of records, check the dates in the
unfiltered table, and rerun the script with boundary dates that you know will
return a small number of records.
Things to note
l Note that in the filtered table the BETWEEN( ) function appears in the Filter text box with the
actual input values you specified.
l Check the Variables tab. The values in the three example variables are updated with
whatever values you selected and specified when you ran the script.
Note
You may notice that the CTOD( ) function is nested inside the BETWEEN( ) function.
The CTOD( ) function converts character values to date values, which is required in
this situation.
If you want to know more, see "ACCEPT command" on page 1641.
COMMENT
This simple script allows you to apply a date filter to any Analytics table
with a date field.
END
COMMENT Prompts you to specify the start and end dates for the filter.
ACCEPT "Specify a start date (YYYYMMDD):" TO v_start_date, "Specify an end
date (YYYYMMDD):" TO v_end_date
COMMENT Applies the filter to the table and field you selected.
SET FILTER TO BETWEEN(%v_date_field%, CTOD(%v_start_date%), CTOD(%v_end_
date%))
Where to next?
Review and run a script that uses several functions to help perform a real-world task: "Putting it all
together: using functions in a script" on the next page
Note
You do not need to know anything about scripting to do this tutorial. You copy and
paste the pre-written script at the bottom of the tutorial into Analytics.
Suggested activities
l Review the script
Review the example script at the bottom of the tutorial. Analytics scripts are executed in
sequence, line by line. So you can proceed sequentially down the script and read each
COMMENT to get a general idea of what the script logic is doing.
COMMENT lines are not part of the script logic and are not executed.
l Understand what the functions are doing
Pay special attention to the functions contained in the script. The functions are highlighted in
brown. Refer to the table above the script for additional detail about the small task performed
by each function.
If you've done the previous function tutorials, most of the functions in the script and the tasks
they perform will already be familiar to you.
l Run the script
Once you are familiar with the script and the functions it contains, copy and paste the script
into Analytics and run it to see how the script interactivity works.
Function in
script Purpose
DATE( ) Converts the MIN1 and MAX1 variables from the Datetime to the Character data type. The Character
data type is required in order to display the contents of the variables in a text string in a dialog box.
MIN1 and MAX1 are system variables automatically created by the STATISTICS command. They contain
the oldest and the most recent dates in the date field you select.
ALLTRIM( ) Cleans up extra spaces around the oldest and the most recent dates when they are displayed in the
Function in
script Purpose
dialog box.
CTOD( ) Converts the v_start_date and v_end_date variables from the Character data type to the Datetime
data type. The Datetime data type is required for subtracting or comparing dates.
CTOD( ) Converts the v_start_date and v_end_date variables from the Character data type to the Datetime
data type so that they are consistent with the v_date_field variable. All BETWEEN function parameters
must be the same data type.
BETWEEN( ) Filters the date field based on the start and end dates you specified.
MONTH( ) Extracts the month portion from every date in the date field as a number.
CMOY( ) Extracts the month portion from every date in the date field as a character value.
COMMENT Identifies the oldest and the most recent dates in the selected date
field.
STATISTICS ON %v_date_field%
COMMENT Assigns the oldest and the most recent dates to variables. The vari-
ables are used to display the existing date range in the dialog box where
you specify the start and end dates for the date filter. It's easier to spe-
cify filter dates if you know what the existing date range is.
ASSIGN v_min_date = ALLTRIM(DATE(MIN1, "YYYYMMDD"))
ASSIGN v_max_date = ALLTRIM(DATE(MAX1, "YYYYMMDD"))
COMMENT Prompts you to specify the start and end dates for the date filter.
DIALOG (DIALOG TITLE "User Dialog" WIDTH 484 HEIGHT 153 ) (BUTTONSET TITLE
"&OK;&Cancel" AT 370 12 DEFAULT 1 ) (TEXT TITLE "Specify a start date:" AT
12 16 ) (EDIT TO "v_start_date" AT 156 12 DEFAULT "YYYYMMDD" ) (TEXT TITLE
"Specify an end date:" AT 12 52 ) (EDIT TO "v_end_date" AT 156 48 DEFAULT
"YYYYMMDD" ) (TEXT TITLE "Date range in table:" AT 12 88 ) (TEXT TITLE "%v_
min_date% to %v_max_date%" AT 156 88 )
COMMENT Displays a warning if the user-specified date filter spans more than
1 year.
IF CTOD(v_end_date) - CTOD(v_start_date) > 365 OR CTOD(v_start_date) - CTOD
(v_end_date) > 365 DIALOG (DIALOG TITLE "User Dialog" WIDTH 469 HEIGHT 100 )
(BUTTONSET TITLE "&OK;&Cancel" AT 348 8 DEFAULT 1 ) (TEXT TITLE "Date range
exceeds 1 year. Monthly groupings may include records from more than 1
year." AT 12 28 WIDTH 326 HEIGHT 33 ) (TEXT TITLE "Caution" AT 12 8 )
COMMENT Displays a warning if the user-specified start date is after the end
date.
IF CTOD(v_start_date) > CTOD(v_end_date) DIALOG (DIALOG TITLE "User Dialog"
WIDTH 469 HEIGHT 100 ) (BUTTONSET TITLE "&OK;&Cancel" AT 348 8 DEFAULT 1 )
(TEXT TITLE "Start date is after end date. Records between the two dates are
included." AT 12 28 WIDTH 326 HEIGHT 33 ) (TEXT TITLE "Caution" AT 12 8 )
COMMENT Applies the date filter to the table and field you selected.
SET FILTER TO BETWEEN(%v_date_field%, CTOD(%v_start_date%), CTOD(%v_end_
date%))
COMMENT Groups the table by month, and outputs the results to a new table.
SUMMARIZE ON MONTH(%v_date_field%) SUBTOTAL %v_subtotal_field% OTHER CMOY
(%v_date_field%, 9) TO "%v_table_name%_by_month.FIL" OPEN PRESORT
Where to next?
If you've completed all the tutorials in "How to use functions" on page 1491 and "Advanced use of
functions" on page 1513, congratulations! You now have a solid grounding in how
Analytics functions work throughout Analytics.
Here are some suggestions for continuing to increase your expertise with functions:
l Continue to explore
l Check out "Top 30 Analytics functions" on page 1532 for a list of the most frequently used
Analytics functions, with accompanying examples.
l "Search and filter using Analytics functions" on page 1245 provides numerous examples of
using Analytics functions to perform powerful and effective searching and filtering of data in
tables.
l Browse through the entire set of Analytics "Functions overview" on page 2163. Familiarize
yourself at a high level with all the different things that functions can do.
l Don't forget about functions
When you're presented with a data analysis challenge in your Analytics work, ask yourself,
"Could a function help me out? Or several functions in combination?"
With data analysis using Analytics commands, a large part of the challenge can be preparing
the data for analysis. Functions, either singly, or in combination, are often critical in the
preparation.
ALLTRIM( )
Returns a string with leading and trailing spaces removed from the input string.
Note
It is good practice to use ALLTRIM() on any character field that you are using as input
for another function so that no leading or trailing spaces affect the returned value.
Example
The Vendor_Number field contains the value " 1254". You need to remove this extra space
from Vendor_Number so that you can harmonize the field with data in another table.
UPPER( )
Returns a string with alphabetic characters converted to uppercase.
Example
The Last_Name field contains the value "Smith". You need to make this value uppercase to
compare with an uppercase value from another table.
LOWER( )
Returns a string with alphabetic characters converted to lowercase.
Example
The Last_Name field contains the value "Smith". You need to make this value lowercase to
compare with an lowercase value from another table.
PROPER( )
Returns a string with the first character of each word set to uppercase and the remaining characters
set to lowercase.
Example
The Last_Name field contains the value "smith". You need to display it as a proper noun in
your output.
SUBSTR( )
Returns a specified substring from a string.
Example
The GL_Account_Code field contains the value "001-458-873-99". You need to extract the first
three bytes, or characters, from the string.
LAST( )
Returns a specified number of characters from the end of a string.
Example
The GL_Account_Code field contains the value "001-458-873-99". You need to extract the last
two bytes, or characters, from the string.
SPLIT( )
Returns a specified segment from a string.
Example
The GL_Account_Code field contains the value "001-458-873-99". You need to extract the
second segment of the code from the string.
AT( )
Returns a number specifying the starting location of a particular occurrence of a substring within a
character value.
Example
The GL_Account_Code field contains the value "001-458-873-99". You need to determine the
starting byte position of the value "458" to test whether the GL code's second segment is
"458" (start position "5").
OCCURS( )
Returns a count of the number of times a substring occurs in a specified character value.
Example
The GL_Account_Code field contains the value "001-458-873-99". You need to determine that
the GL code is correctly formatted by ensuring the data contains three hyphen characters.
LENGTH( )
Returns the number of characters in a string.
Example
The GL_Account_Code field contains the value "001-458-873-99". You need to determine that
the GL code is correctly formatted by ensuring the data contains 14 characters.
STRING( )
Converts a numeric value to a character string.
Example
The Invoice_Amount field contains the value 12345.67. You need to convert this to character
data.
VALUE( )
Converts a character string to a numeric value.
Tip
VALUE( ) is often used with ZONED( ) to add leading zeros.
Example
The Invoice_Amount field contains the value "12345.67". You need to convert this to numeric
data.
CTOD( )
Converts a character or numeric date value to a date. Can also extract the date from a character or
numeric datetime value and return it as a date. Abbreviation for "Character to Date".
Example
The Submission_Date field contains the value "April 25, 2016". You need to convert this to
datetime data.
DATE( )
Extracts the date from a specified date or datetime and returns it as a character string. Can also
return the current operating system date.
Example
The Submission_Date field contains the value `20160425`. You need to convert this to
character data.
ZONED( )
Converts numeric data to character data and adds leading zeros to the output.
Example
The Employee_Number field contains the value "254879". You need to convert the value to a
10-digit string with leading zeros.
Tip
You must use the VALUE() function to convert the character to numeric data
before using the numeric as input for ZONED().
BINTOSTR( )
Returns Unicode character data converted from ZONED or EBCDIC character data. Abbreviation
for "Binary to String".
Note
Unicode edition only. For non-Unicode editions, see ZONED() above.
Example
The Employee_Number field contains the value "254879". You need to convert the value to a
10-digit string with leading zeros.
Tip
You must use the VALUE() function to convert the character to numeric data
before using the numeric as input for ZONED(). You then use BINTOSTR() to
convert the ASCII data returned from ZONED() to Unicode.
MONTH( )
Extracts the month from a specified date or datetime and returns it as a numeric value (1 to 12).
Example
The Transaction_Date field contains the value `20160815 100252`. You need to extract the
month as character data with a leading zero.
DAY( )
Extracts the day of the month from a specified date or datetime and returns it as a numeric value (1
to 31).
Example
The Transaction_Date field contains the value `20160815 100252`. You need to extract the
day as character data.
YEAR( )
Extracts the year from a specified date or datetime and returns it as a numeric value using the YYYY
format.
Example
The Transaction_Date field contains the value `20160815 100252`. You need to extract the
year as a numeric value.
HOUR( )
Extracts the hour from a specified time or datetime and returns it as a numeric value using the 24-
hour clock.
Example
The Transaction_Date field contains the value `20160815 100252`. You need to extract the
hours as a numeric value.
COMMENT returns 10
HOUR(Transaction_Date)
MINUTE( )
Extracts the minutes from a specified time or datetime and returns it as a numeric value.
Example
The Transaction_Date field contains the value `20160815 100252`. You need to extract the
minutes as a numeric value.
COMMENT returns 2
MINUTE(Transaction_Date)
SECOND( )
Extracts the seconds from a specified time or datetime and returns it as a numeric value.
Example
The Transaction_Date field contains the value `20160815 100252`. You need to extract the
seconds as a numeric value.
COMMENT returns 52
SECOND(Transaction_Date)
CDOW( )
Returns the name of the day of the week for a specified date or datetime. Abbreviation for
"Character Day of Week".
Example
The Transaction_Date field contains the value `20160815 100252`. You need to extract the
name of the day as character data.
CMOY( )
Returns the name of the month of the year for a specified date or datetime. Abbreviation for
"Character Month of Year".
Example
The Transaction_Date field contains the value `20160815 100252`. You need to extract the
name of the month as character data.
Manipulating strings
Remove or replace segments of character fields using these functions.
INCLUDE( )
Returns a string that includes only the specified characters.
Example
The Address field contains the value "12345 ABC Corporation". You need to extract the
address number and exclude the name of the company.
EXCLUDE( )
Returns a string that excludes the specified characters.
Example
The Address field contains the value "12345 ABC Corporation". You need to extract the name
of the company and exclude the address number.
REPLACE( )
Replaces all instances of a specified character string with a new character string.
Example
The Address field contains the value "12345 Acme&Sons". You need to replace the "&"
character with the word " and ".
OMIT( )
Returns a string with one or more specified substrings removed.
Example
The Address field contains the value "12345 Fake St". You need to extract the address
without the street suffix.
REVERSE( )
Returns a string with the characters in reverse order.
Example
The Report_Line field contains the value "001 Correction 5874.39 CR ". You need to
reverse the value and omit any leading or trailing spaces.
BLANKS( )
Returns a string containing a specified number of blank spaces.
Example
You need to create a computed field for a region name based on a value in the region_code
field. You must ensure that the default value you specify at the end of the command is at least
as long as the longest input value.
"Southern" IF region_code = 1
"Northern" IF region_code = 2
"Eastern" IF region_code = 3
"Western" IF region_code = 4
BLANKS(v_length)
Scriptwriting tools
You have a number of tools to choose from when you create, edit, or debug scripts. Some of the
tools allow you to automatically create ACLScript syntax without requiring that you know the syntax
in advance.
You can use the tools individually, or in combination, to create new scripts or to modify existing
scripts.
Tool Description
Automatically create ACLScript syntax from the table history of any Analytics table
that has been created as the output of an ACLScript command or series of
Table history commands.
Debugging features Set break points, or step through scripts one line at a time, to test or debug scripts.
Syntax auto-completion
As you type syntax in the Script Editor, Analytics provides auto-completion for ACLScript
commands and keywords, and automatic on-screen help for function parameters.
You can turn off auto-completion by selecting Disable auto complete in scripts in the Interface tab
in the Options dialog box (Tools > Options). On-screen help for function parameters cannot be
disabled.
Note
When you create or edit a script you must ensure that each ACLScript command is
entered on a separate line.
Show me how
The script is created with the name New_Script. Right-click the name and select Rename
to rename the script.
Note
Script names are limited to 64 alphanumeric characters. The name can
include the underscore character ( _ ), but no other special characters, or
any spaces. The name cannot start with a number.
l To open an existing script, double-click the script in the Overview tab in the Navigator.
Tip
You can use these shortcut keys for common actions:
l Ctrl+Z – undo one or more actions
l Ctrl+Y – redo one or more actions
l Ctrl+S – save the Analytics project, including the open script
3. (Optional) Position the cursor at an appropriate place in the script and complete any of the
following steps to insert one or more specific items:
Item Steps
Project item name a. Right-click and select Insert > Project Item.
b. Select the type of item from the Item Type drop-down list.
(table, script, view,
c. Select one or more item name(s), and click OK.
workspace, or index)
Item Steps
For more information, see "Creating custom dialog boxes" on page 1605.
a. Right-click and select Insert > HighBond Token to insert a HighBond access
token in the script.
The Manage API tokens page opens in your browser. You may be required to
first sign in to Launchpad.
b. Do one of the following:
l Use an existing token – In the Token column, click the partially masked
token that you want to use and enter your HighBond account password. The
unmasked token is displayed.
l Create a new token – Click Create token > HighBond API and enter your
HighBond account password.
A new HighBond token is created.
Tip
Use an existing token unless you have a reason for creating a
new one. If the existing token does not work, create a new one.
Using an existing token cuts down on the number of tokens you
need to manage.
Tip
Do not close the dialog box containing the token until you have
successfully pasted the token into the script.
Caution
Safeguard your access tokens like any account password. They
contain information unique to your HighBond account. You should
HighBond token not share access tokens.
Note
This method is available only for commands that have dialog boxes.
Note
If you run or step through a script, all open scripts are automatically saved.
Note
Script names are limited to 64 alphanumeric characters. The
name can include the underscore character ( _ ), but no other
special characters, or any spaces. The name cannot start with a
number.
The new script is added to the Overview tab in the Navigator. The script is
saved in the folder containing the active Analytics table, or in the root project
folder if no table is open.
Tip
The Script Recorder is also a useful tool for learning ACLScript. You can record a
series of analysis steps using the Script Recorder and then view the resulting script
to see the series of commands and syntax required to reproduce the behavior in a
script.
Show me how
1. From the Analytics main menu, select Tools > Set Script Recorder On.
The Script Recorder icon is displayed in the status bar, and a checkbox is displayed to the
left of the menu item, to indicate that the Script Recorder is on.
2. Perform the analysis steps or processing you want to record.
Analytics records each processed command in a new script.
3. When you have finished analyzing or processing data, select Tools > Set Script Recorder
On again to turn the Script Recorder off.
Analytics prompts you to save the script.
4. Enter a meaningful name for the script in the text box and click OK.
Note
Script names are limited to 64 alphanumeric characters. The name can include
the underscore character ( _ ), but no other special characters, or any spaces.
The name cannot start with a number.
Tip
If you start syntax capture before you open a table, the table does not
physically open in the View tab because commands are not actually executed
during syntax capture. You may find it difficult to visualize subsequent
commands without an open table for guidance.
5. Click End Syntax Capture to stop inserting command syntax in the script.
1. Open an output table that is the result of a process you want to automate in a script.
2. Select Tools > Create Script from Table History.
If Default_View is active, Analytics prompts you to rename the view to prevent you from
overwriting it when you run the new script.
3. If Analytics prompts you to rename the view, click Rename, enter a new name, and click OK.
4. Enter a name for the new script in the Save As dialog box and click OK.
Note
Script names are limited to 64 alphanumeric characters. The name can include
the underscore character ( _ ), but no other special characters, or any spaces.
The name cannot start with a number.
5. (Optional) Open and edit the new script if you want to adjust any of the script behavior.
For example, instead of overwriting the original table you could choose to save the output to a
table with a different name.
Note
If a table remains open at the completion of running or stepping through a script, the
Analytics display area automatically switches from the Script Editor to displaying the
open table in the View tab. If you want to keep the Script Editor continuously
displayed while you are testing or debugging scripts, you can temporarily include the
CLOSE command at the end of the script.
Note
If you use script execution from the cursor to bypass a section of a script that
contains prerequisite operations required by a subsequent section of the script, the
subsequent section is unlikely to run correctly.
Steps
Show me how
1. Open the Analytics script in which you want to set one or more break points .
2. Click the break point column immediately to the left of the target line in the Analytics script.
The break point column is located between the line numbering column and the left margin of
the script.
You can also set a break point by positioning the cursor in the target line in the script and
pressing F9 or clicking Toggle breakpoint in the Script Editor toolbar.
3. To remove a break point, click the break point, or position the cursor in the target line and
press F9 or click Toggle breakpoint .
3. If the step arrow turns red and stops at a line, indicating an error, the script becomes
editable and you can fix the error, and then do either of the following:
l Continue running the script from the point of the error, or from any other line, by placing the
cursor in the appropriate line, and right-clicking and selecting Run From Cursor.
l
Restart the script from the beginning by clicking Run or pressing F5.
If a table is open when the error occurs, the Analytics display area automatically switches
from the Script Editor to displaying the open table in the View tab. Switch back to the Script
Editor to fix the error.
4. If you want to exit the script before it completes, press Esc and click Yes in the confirmation
prompt.
You can also exit the script by closing Analytics.
5. After a break point, or after fixing an error, if you want to step through the remainder of the
script, do one of the following:
l
After a break point, click Step or press F10.
l After fixing an error, place the cursor in the appropriate line, and right-click and select Step
From Cursor.
Steps
Show me how
1. Open the Analytics script that you want to step through.
2. Click Step or press F10 repeatedly.
The script starts when you click Step or press F10. A single line is executed, in sequence,
each additional time you click Step or press F10.
While the script is running in step mode it is read-only, and most other Analytics functionality
is disabled, including the command line.
3. If the step arrow turns red , indicating an error, the script becomes editable and you can fix
the error, and then do either of the following:
l Continue stepping through the script from the point of the error, or from any other line, by
placing the cursor in the appropriate line, and right-clicking and selecting Step From
Cursor.
l
Restart the script and begin stepping through from the beginning by clicking Step or
pressing F10.
If a table is open when the error occurs, the Analytics display area automatically switches
from the Script Editor to displaying the open table in the View tab. Switch back to the Script
Editor to fix the error.
4. If you want to exit the script before it completes, press Esc and click Yes in the confirmation
prompt.
You can also exit the script by closing Analytics.
5. At any point, if you want to run the remainder of the script without stepping through, click Run
or press F5.
If you step through a script line by line, any variable defined in the script, or any system-generated
variable, appears in the Variables tab at the moment of its creation. If the variable already exists, the
value updates dynamically, based on the script logic. (In the Script Editor, use the Step option
to step through a script.)
Being able to watch exactly what changes are happening with script variables, as they happen, is an
important diagnostic tool. This capability allows you to pinpoint script errors that might be hard to
locate by examining script syntax alone.
If you run a script, all changes associated with variables are displayed in the Variables tab when a
break point is reached, or when the script completes.
Multiline commands
You cannot step through the content of multiline commands such as GROUP, LOOP, or DEFINE
FIELD . . . COMPUTED. If you run a script in step mode and you encounter a multiline command,
the entire content of the command is executed and the step arrow is positioned at the line
immediately following the multiline command.
Break points are not recognized inside multiline commands. If you set a break point inside a
multiline command, the script is paused at the line immediately following the multiline command.
Tip
You may be able to test portions of the content of a multiline command by copying
the content, without the surrounding command syntax, into a separate script.
Run scripts
When you run a script in Analytics, each command in the script is processed in sequence until the
end of the script is reached.
You cannot continue working in Analytics while the script is running, and you can run only one script
at a time. However, using the DO SCRIPT command, you can create scripts that call and run other
scripts.
Script status
While a script is running, Analytics displays the processing status and the name of the script, or
subscript, in the status bar.
When the script finishes running, an icon appears in the status bar indicating if the script ran
successfully to completion , or failed . If a script fails, the line where the error occurs is
automatically highlighted in the Script Editor.
If necessary, you can stop the processing of a script by pressing the Esc key, or by closing
Analytics.
The logical expression is evaluated just once to determine if the script should run. If the
expression evaluates to false the script does not run.
4. Click OK.
acl_executable_path_and_filename acl_project_path_and_filename
</vVarName=value> /bScript_name </min>
Example
The command line syntax below opens Sample Project.ACL and runs a script called
Calculate_Median_Value.
"ACL_exe_ Specifies the path to the Analytics executable file, and the executable file name (ACLWin.exe).
path_and_
filename"
"C:\Program Files (x86)\ACL Software\ACL for Windows 14\ACLWin.exe"
"ACL_ Specifies the path to the Analytics project file, and the file name of the project (*.acl) containing the
project_path_ script.
and_
filename"
"C:\Users\username\Documents\ACL Data\Sample Data Files\Sample Project.ACL"
/v Specifies variable names and assigns values. The variables are automatically initialized when the
Analytics project opens.
optional
Do not enter a space between the /v switch and the variable name. For example, for the variable v_
table_name :
/vv_table_name="Ap_Trans"
Note
The data type of an assigned value must match the data type of the variable in the
script. If the data types are mismatched, an "Expression type mismatch" error occurs
and the script fails.
Use quotation marks to qualify character values, and backquotes to qualify datetime
values.
Character variables
/vv_table_name="Ap_Trans" /vv_field_name="Invoice_Amount"
Numeric variable
/vv_materiality=10000
Datetime variables
/vv_start_date=`20180101` /vv_end_date=`20180331`
/bCalculate_Median_Value
Instead, specify any required variables, and assign values, using the command line syntax
explained above.
Exit Analytics
End the script with the QUIT command to exit Analytics.
What is a variable?
You can think of a variable as a named container that holds or stores a value that can change. The
value can change, but the name of the variable does not change. As the scriptwriter, you use the
fixed variable name throughout the script logic. When the script runs, it does not process the
variable name. Rather, it accesses and processes whatever value is currently contained by the
variable.
In the example below, v_start_date and v_end_date are variable names, and the dates are the
values contained by the variables.
Example
You want a script to have a customizable date range so you create start date and end date
variables.
In the example below, a variable with the name v_start_date currently contains the date
value `20210101`, and a variable with the name v_end_date currently contains the date value
`20210331`.
You can use these two variables to store whatever start and end dates a user specifies. In the
script logic, you specify v_start_date and v_end_date wherever the dates are required, but
when the script runs, it uses the actual dates specified by the user.
Tip
You can create one of these variables by copying the ASSIGN command and
its parameters to the Analytics command line and pressing Enter. In the
Navigator, open the Variables tab to see the result.
If the Command Line text box is not visible, select Window > Command Line.
If you step through a script line by line, any variable defined in the script, or any system-generated
variable, appears in the Variables tab at the moment of its creation. If the variable already exists, the
value updates dynamically, based on the script logic. (In the Script Editor, use the Step option
to step through a script.)
Being able to watch exactly what changes are happening with script variables, as they happen, is an
important diagnostic tool. This capability allows you to pinpoint script errors that might be hard to
locate by examining script syntax alone.
If you run a script, all changes associated with variables are displayed in the Variables tab when a
break point is reached, or when the script completes.
l State of project variables at different points in a script – Add DISPLAY VARIABLES to a script
at the point or points in the script where you want to capture the state of project variables. You
can also use a break point for this purpose, with the difference that a break point pauses script
execution while the DISPLAY VARIABLES command does not.
After the script completes, double-click the corresponding DISPLAY VARIABLES entry in the
command log. The state of project variables at the point in the script that you specified is
displayed in reverse chronological order on screen.
Note
You cannot use the DISPLAY VARIABLES command inside a GROUP command.
variable_name = variable_value
DIALOG command
Use the "DIALOG command" on page 1754, and the associated Dialog Builder, to create a more
advanced dialog box that interactively prompts users for one or more script input values. Each input
value is stored in a named variable. Most of the input options use a character variable.
In addition to the options provided by the ACCEPT command, the DIALOG command gives you
additional options such as checkboxes, radio buttons, and drop-down lists.
Also see "Creating interactive scripts" on page 1603.
PASSWORD tag
For credential input in scripts that run in Robots, create an analytic header and use the
"PASSWORD tag" on page 2652.
Tip
Pay close attention to the data types of variables in scripts that you write. A common
cause of script errors is a mismatch between the data type of a variable and the way
in which you are using the variable. For more information, see "The importance of
the data type of a variable" on page 1580.
Note
It is important to understand the difference between assigning a
qualified and an unqualified field name to a variable.
Assigning "Vendor_number" assigns the actual string of characters
that make up the field name.
Assigning Vendor_number assigns one of the values contained in
the Vendor_number field.
Note
Analytics also
supports datetime
values that use the
character data type.
For more information,
see "A word about
datetime values" on
page 1581.
Assigns the value of the logical Approved field in the currently selected record to
the v_approved variable.
Voluntary conventions
These voluntary conventions make scripts easier to read and understand:
l Give variables easily understandable, descriptive names that directly relate to the roles the
variables perform in a script. A slightly longer, clearly descriptive name is better than a
shorter, cryptic name that does not make the purpose of a variable clear.
l Adopt a general naming convention such as prefacing every variable name with v_ .
Imposed restrictions
Analytics imposes these restrictions on variable names:
l Maximum length – 31 characters
l Valid characters – Alphanumeric characters, and the underscore character ( _ ). The name
cannot contain any special characters or spaces, or start with a number.
Note
Do not use non-English characters, such as é , in the names of variables that
will be used in variable substitution. Variable names that contain non-English
characters cause variable substitution to fail.
Non-English versions of this Help topic, such as the French version, may show
variable names with accented characters. Make sure that in an actual script
you do not use accented characters in any variable name that will be used in
variable substitution.
l Uniqueness – Variable names must be unique within an Analytics project because variables
function globally across the entire project
Variable names are not case-sensitive. In ACLScript, v_start_date and v_Start_Date are the same
variable.
Note
Permanent variables are not supported in scripts that run in Robots.
DELETE variable_name OK
DELETE ALL OK
Example
The two examples below illustrate how a variable, and the item referred to by a variable, are
separate entities. Deleting one does not affect the other.
Note
The examples use variable substitution to substitute the contents of the
variable for the variable name.
In the first example, deleting the variable v_test_table deletes the variable value "Running_
totals" but it does not delete the actual Running_totals table.
In the second example, deleting the actual Running_totals table has no effect on the v_test_
table variable, although the variable value now refers to a table that does not exist.
OPEN %v_test_table%
For more information, see "System variables created by Analytics commands" on page 1599.
CTOD(v_character_date)
This expression converts a number stored in a character variable to a numeric data type:
VALUE(v_character_number, 2)
Note
Dates and numbers are stored in character variables if they are supplied by user
input. For more information, see Different methods exist for creating variables.
Example
The two examples below show the syntax for filtering a date field based on a user-supplied
date range.
l In the first example, the date field uses a datetime data type.
l In the second example, the date field uses a character data type.
l In both examples, the v_start_date and v_end_date variables use the character data
type because they were created using either the ACCEPT command or the DIALOG
command.
In the first example, you must use the CTOD( ) function to convert the date range values from
the character data type to the datetime data type. (CTOD stands for "Character to Date".) You
must perform this conversion so that the data type of the date range values matches the data
type of the datetime date field.
In the second example, you do not perform any conversion of the date range values because
they already match the data type of the character date field. If you convert them, they no
longer match and you get a script error.
Variable substitution
When you use a character variable as input for an Analytics command or function you need to
substitute the value of the variable for the variable name. If you do not perform this substitution, the
command or function attempts to operate on the actual variable name, rather than the value
contained by the variable, and an error results.
Variable substitution is the method for substituting the value contained in a character variable for the
variable name. To use variable substitution, you enclose the name of the character variable in
percentage signs ( % ). For example, %v_input_table% retrieves the actual table name stored in v_
input_table and substitutes it for the variable name.
Because user input for a script is most often stored in a character variable, a common use for
variable substitution is when incorporating user input into script logic.
Note
Variable substitution is only intended for use with character variables that contain
values that represent character data. An unreliable result or an error can occur if you
use variable substitution with variables of other data types, or with character
variables that contain values that represents a number, a datetime, or a logical
value.
Example
You want a script to allow a user to select an input table. The script then opens the table
selected by the user. You use variable substitution with the OPEN command so that the
command acts upon the correct table name.
When you specify OPEN %v_input_table% , what the script actually sees is:
OPEN Name_of_table_selected_by_user
If you do not use variable substitution in this example, the script will most likely fail because
the OPEN command is trying to open a table called v_input_table , and no table with that
name exists.
In this example, you are comparing date values stored as character data in both the variables and
the field, so using variable substitution with the variables should work:
So why does variable substitution cause an error in this situation? The answer is that variable
substitution is absolutely literal. To troubleshoot the error, look at the precise values stored in the
variables, manually substitute them into the expression, and look at the resulting expression. For
example:
This expression compares dates that use a character data type with numbers that post-substitution
use a numeric data type, which is a mismatch of data types.
Because you specified a character field with BETWEEN( ), the function automatically interprets the
values in v_start_date and v_end_date as character values and there is no need to use variable
substitution.
For more information, see "Troubleshooting" on page 1597.
Any maintenance you perform affects the current instance of the variable in memory only. For
example, if you rename a variable, you are renaming only the instance of the variable in memory.
You are not renaming the variable in a script.
Note
The ability to manually maintain variables through the user interface may be
convenient in some instances. Manual maintenance does not offer any additional
functionality versus maintaining variables using commands.
Most script writers work with variables exclusively in the Script Editor and
associated features such as the command line and the Variables tab.
variable b. In the Expression text box, enter the value or the expression to assign to the variable.
Literal values must use the correct format and qualifiers (when required). For more
information, see The data type of a variable is automatically specified.
c. Optional. Click Verify to check that the value or expression is valid.
d. Type the variable name in the Save As text box.
For more information, see:
l Variable names are flexible, with some restrictions
l A variable persists until the Analytics project is closed
e. Click OK.
The variable is created and appears in the Variables tab.
Update a a. Select a variable in the list and click OK to open the Expression Builder.
variable
b. In the Expression text box, update the value or the expression assigned to the variable.
value
Literal values must use the correct format and qualifiers (when required). For more
information, see The data type of a variable is automatically specified.
c. Optional. Click Verify to check that the value or expression is valid.
d. Click OK.
The value assigned to the variable is updated in your computer's memory.
Required variables
To allow configuration of different tax rates and a date range, you use the "ASSIGN
command" on page 1677 to create the following set of variables.
v_tax_2_start The date that the second tax rate goes into effect
v_tax_2_end The date that the second tax rate ends, or the current date if the tax rate is still in effect.
The script
COMMENT Create and initialize variables for sales tax rates and a date
range
COMMENT If required, you can extend the script by adding additional
tax rate and date range variables
ASSIGN v_tax_1 = 0.05
ASSIGN v_tax_2 = 0.06
ASSIGN v_tax_2_start = `20210701`
ASSIGN v_tax_2_end = `20211231`
Required variables
To capture the user input for the script, you use the "ACCEPT command" on page 1641 to
create the following set of variables.
v_output_table The name of the Analytics output table for the filtered records
v_numeric_field The numeric field in the input table to use with the numeric range
v_date_field The date field in the input table to use with the date range
Scripting considerations
Because you use the ACCEPT command to interactively prompt users for script input values,
each input value is stored in a named character variable even if the value represents a
number or a date. To account for this fact, you need to use Analytics functions at certain
points in the script to convert the variable value to the data type required by the script logic.
For example:
l The VALUE( ) function converts the number stored in v_min_amount from a character
data type to a numeric data type:
VALUE(v_min_amount, 2)
l The CTOD( ) function converts the date stored in v_start_date from a character data
type to a datetime data type:
CTOD(v_start_date)
You need to make these data type conversions because the values in these variables are
being compared against values in fields that use a numeric or datetime data type.
You also need to use variable substitution to access the actual names of the tables and the
fields stored in some of the variables.
For example:
OPEN %v_input_table%
The script
COMMENT Create a dialog box to prompt the user for an input table and
an output table
ACCEPT "Select an input table:" FIELDS "xf" TO v_input_table, "Specify
an output table name (no spaces):" TO v_output_table
COMMENT Create a dialog box to prompt the user for a numeric field and
a numeric range
ACCEPT "Select a numeric field to filter by:" FIELDS "N" TO v_numeric_
field, "Specify a minumum amount:" TO v_min_amount, "Specify a maximum
amount:" TO v_max_amount
COMMENT Create a dialog box to prompt the user for a date field and a
date range
ACCEPT "Select a date field to filter by:" FIELDS "D" TO v_date_field,
"Specify a start date (YYYYMMDD):" TO v_start_date, "Specify an end
date (YYYYMMDD):" TO v_end_date
COMMENT Filter the input table based on the user's numeric and date
ranges
SET FILTER TO BETWEEN(%v_numeric_field%, VALUE(v_min_amount, 2), VALUE
(v_max_amount, 2)) AND BETWEEN(%v_date_field%, CTOD(v_start_date),
CTOD(v_end_date))
COMMENT Extract the filtered set of records to the output table spe-
cified by the user
EXTRACT RECORD TO %v_output_table%
WRITE1 is a system variable. In this current situation, the value represents the number of
records in the output table ( v_output_table ). For more information, see "System variables
created by Analytics commands" on page 1599.
Scripting considerations
Because you are prefilling default values into fields created by the ACCEPT command, those
values must use the character data type. If you attempt to prefill values of another data type,
the values do not appear.
To account for this fact, you may need to use Analytics functions to convert the default values
to the character data type. (Later in the script, you can use other functions to covert the
variable values back to the data type required by the script logic.)
For example:
l The STRING( ) function converts the number 5000 to a character string that is then
stored in the v_min_amount variable:
l The DATE( ) function converts the calculated end date to a character string that is then
stored in the v_end_date variable:
The script
COMMENT Set the date format for the duration of the Analytics session
SET DATE "YYYYMMDD"
COMMENT Specify default values for the bottom and top ends of the
numeric range
ASSIGN v_min_amount = STRING(5000, 4)
ASSIGN v_max_amount = STRING(100000, 6)
COMMENT Calculate the start and end dates of the default date range
based on the current date and the length specified by v_number_of_
months
ASSIGN v_end_date = ALLTRIM(DATE(EOMONTH(TODAY(),-1)))
ASSIGN v_start_date = ALLTRIM(DATE(EOMONTH(CTOD(v_end_date), -v_num-
ber_of_months) + 1))
COMMENT Create a dialog box to prompt the user for an input table and
an output table
ACCEPT "Select an input table:" FIELDS "xf" TO v_input_table, "Specify
an output table name (no spaces):" TO v_output_table
COMMENT Create a dialog box to prompt the user for a numeric field and
a numeric range
ACCEPT "Select a numeric field to filter by:" FIELDS "N" TO v_numeric_
field, "Specify a minumum amount:" TO v_min_amount, "Specify a maximum
amount:" TO v_max_amount
COMMENT Create a dialog box to prompt the user for a date field and a
date range
ACCEPT "Select a date field to filter by:" FIELDS "D" TO v_date_field,
"Specify a start date (YYYYMMDD):" TO v_start_date, "Specify an end
date (YYYYMMDD):" TO v_end_date
COMMENT Filter the input table based on the user's numeric and date
ranges
SET FILTER TO BETWEEN(%v_numeric_field%, VALUE(v_min_amount, 2), VALUE
(v_max_amount, 2)) AND BETWEEN(%v_date_field%, CTOD(v_start_date),
CTOD(v_end_date))
COMMENT Extract the filtered set of records to the output table spe-
cified by the user
EXTRACT RECORD TO %v_output_table%
Required variables
The script uses variables for three different purposes:
l user input
l temporary storage of values
l script configuration
User input
To capture the user input for the script, you use the "ACCEPT command" on page 1641 to
create the following set of variables.
v_output_table The name of the Analytics output table for the running totals
v_id_field The field in the input table containing identifier values such as customer or vendor IDs
v_numeric_field The numeric field in the input table to use for calculating running totals
To allow the temporary storage of values as the script processes the input table record by
record, you use the "ASSIGN command" on page 1677 to create, and also update, the
following two variables. If required, you can configure a start point for the running total other
than zero (0.00).
v_id_value The identifier value in the record that the script is currently processing
v_running_total The running total value in the record that the script is currently processing
The script
COMMENT
Allow overwriting of files without displaying a confirmation dialog
box
END
SET SAFETY OFF
COMMENT
Create a dialog box to prompt the user for an input table and an out-
put table
END
ACCEPT "Select an input table:" FIELDS "xf" TO v_input_table, "Specify
an output table name (no spaces):" TO v_output_table
OPEN %v_input_table%
COMMENT
Create a dialog box to prompt the user for a character identifier
field
END
ACCEPT "Select a character identifier field:" FIELDS "C" TO v_id_field
COMMENT
Create a dialog box to prompt the user for a numeric field
END
ACCEPT "Select a numeric field:" FIELDS "N" TO v_numeric_field
COMMENT
Index (sort) the table on the character identifier field
END
INDEX ON %v_id_field% TO "ID_field_sorted"
SET INDEX TO "ID_field_sorted"
COMMENT
Assign the current value in the character identifier field to the v_
id_value variable.
When v_input_table is first opened, the current value is the first
value in the field. Subsequently, the current value depends on the
COMMENT
Set the start value for the running total to zero (0.00)
END
ASSIGN v_running_total = 0.00
COMMENT
Process the table record by record. For each unique identifier, cal-
culate a running total for the numeric field.
END
GROUP IF v_id_value = %v_id_field%
ASSIGN v_running_total = v_running_total + %v_numeric_field%
EXTRACT %v_id_field% %v_numeric_field% v_running_total AS "%v_
numeric_field% running total" TO %v_output_table%
ELSE
ASSIGN v_id_value = %v_id_field%
ASSIGN v_running_total = 0.00
ASSIGN v_running_total = v_running_total + %v_numeric_field%
EXTRACT %v_id_field% %v_numeric_field% v_running_total AS "%v_
numeric_field% running total" TO %v_output_table%
END
COMMENT Open the output table with the calculated running totals
OPEN %v_output_table%
Troubleshooting
Two general categories of error are the most common when working with variables in scripts:
l Unexpected results – The script runs to completion but analysis that includes variables does
not produce the expected results.
l Data type issue – The script fails with an error related to data type such as "Expression type
mismatch" or "Character expression is required".
Unexpected results
For the first kind of error, try this troubleshooting approach:
1. In the Navigator, open the Variables tab.
2. In the Analytics command line enter DELETE ALL OK to delete any existing variables.
If the Command Line text box is not visible, select Window > Command Line.
3. In the Script Editor, use the Step option to step through the script line by line and track the
creation of each variable and assigned value in the Variables tab.
You may discover that the value being assigned to a variable is not what you intended and
your script logic needs to be adjusted. For more information, see "Testing and debugging
scripts" on page 1557.
Note
You cannot step through the content of multiline commands such as GROUP,
LOOP, or DEFINE FIELD . . . COMPUTED. To test script logic in this situation,
temporarily copy the script logic without the surrounding command syntax into a
separate script.
Note
System variables, and the values they contain, are retained for the duration of the
current Analytics session only.
Any command that WRITEn The number of records in the output table or file.
outputs a table or a
file
Any command that OUTPUTFOLDER The path to the Analytics project folder in the Navigator that
outputs an Analytics contains the output table.
table
This DOS-style path uses the format /foldername/subfoldername,
in which the initial slash (/) indicates the root level in the Overview
tab.
Tip
Use the SET FOLDER command to specify a different
output folder or to create a new output folder.
DISPLAY VERSION ACL_Ver_Major The major version of Analytics that is currently running.
Analytics version
numbers use the ACL_Ver_Minor The minor version of Analytics that is currently running.
format
major.minor.patch ACL_Ver_Patch The patch version of Analytics that is currently running.
EXECUTE RETURN_CODE The code returned by an external application or process run using
the Execute command.
Return codes are numbers generated by the external application or
process and sent back to Analytics to indicate the outcome of the
external process. Analytics does not generate the return code.
Typical return codes are integer values that map to specific notific-
ations or error messages. For example, the return code "0" could
mean "The operation completed successfully". The return code "2"
could mean "The system cannot find the file specified".
Specific return codes and their meanings vary depending on the
external application or process. Lists of return codes, also called
'error codes' or 'exit codes', and their meanings, can often be found
in the documentation for the associated external application. Lists of
return codes can also be found on the Internet.
The RETURN_CODE variable is created when the Execute
command is used synchronously, but not when the command is
used asynchronously.
Note
When Analytics identifies the lowest value, duplicate
values are not factored out. For example, if values in
ascending order are 1, 1, 2, 3, the 3rd lowest value is
2, not 3.
MODEn The most frequently occurring value in the first specified field.
Q25n The first quartile value (lower quartile value) in the first specified
field.
Q75n The third quartile value (upper quartile value) in the first specified
field.
RANGEn The difference between the maximum and minimum values in the
first specified field.
TOTALn The sum total of the values in the first specified field.
TOTAL TOTALn The sum total of the values in the first specified field.
Sequencing interactivity
Whenever possible, you should place all interactive dialog boxes at the beginning of a script so that
the remainder of the script can run without interruption.
If interactive dialog boxes occur mid-script, the user may no longer be attending the script execution
at the point that input is required, and the script remains stalled until the input is provided.
Command Description
"ACCEPT The ACCEPT command creates the default interactive dialog box, which supports two methods
of user input:
Command Description
command" on o Text box – gathers information that the user must type in, such as dates, or vendor or
page 1641 customer IDs
o Project item list – presents a list of Analytics project items, such as tables, fields, or
variables, to the user
The list of items is dynamically populated based on the contents of the Analytics project in
which the script is run.
You can create separate dialog boxes that prompt for one item at a time, or you can create one
dialog box that prompts for multiple items.
"DIALOG command" The DIALOG command creates a custom interactive dialog box. Custom dialog boxes support
on page 1754 more advanced layout options, and five methods of user input:
Dialog Builder o Text box – gathers information that the user must type in, such as dates, or vendor or
customer IDs
o Check box – presents a binary choice to the user — that is, the associated option can be
either on or off
o Radio buttons – present mutually exclusive options to the user — that is, only one of the
presented options can be selected at a time
o Drop-down list – presents a list of custom, text-based options to the user
o Project item list – presents a list of Analytics project items, such as tables, fields, or
variables, to the user
The list of items is dynamically populated based on the contents of the Analytics project in
which the script is run.
You can create separate dialog boxes that prompt for one item at a time, or you can create one
dialog box that prompts for multiple items.
"PASSWORD The PASSWORD command creates a simple dialog box with a single field for entering a
command" on password.
page 2036
When a user enters a password, the characters are displayed as asterisks (*) in the dialog box.
The password is retained in memory of the duration of the Analytics session, but it does not
appear in either the script or the log.
The Analytics Dialog Builder allows you to create one or more custom dialog boxes to gather user
input during execution of a script.
You can use a custom dialog box to perform various functions:
l prompt a user for input, such as a table name, a field name, or a date range
l allow a user to select from among several options
l display more information than a standard message box
l dynamically list Analytics project items
Note
Using a custom dialog box to enter passwords is not secure. You should use the
"PASSWORD command" on page 2036 instead.
Note
Position the cursor in a blank line. Create a new blank line if necessary.
You specify the Width and Height of the dialog box in pixels. You can also resize the dialog
box by dragging the bottom right corner of the working area in the Dialog Builder (Snap to
Grid must be on).
l
Click Snap to Grid to turn the grid on or off in the Dialog Builder.
Use the grid to align controls in the layout area. When the grid is turned on, the top-left
corner of each control is aligned with the closest grid point.
l On the left side of the Dialog Builder, click a control icon and then click in the layout area to
add the control.
Note
The steps for adding and designing specific controls appear below.
7. If you need to delete a control from the Dialog Builder, select the control and click Delete
.
Note
You cannot delete the OK and Cancel buttons, but you can rename them (see
below).
Steps
Show me how
1. In the Dialog Builder, click Text and then click the layout area at the position where you
want the top left corner of the control.
The Text dialog box opens.
2. In the Label field, type the text that you want to display in the custom dialog box.
You are limited to a maximum of 255 characters, including spaces.
3. Optional. If you want to specify the exact position of the control, modify the x (horizontal) and y
(vertical) values, which are specified in pixels.
Tip
You can also position the control by dragging it in the Dialog Builder.
4. Optional. If you want to specify a specific size for the control, deselect Auto beside the Width
or Height fields and modify the values, which are specified in pixels.
l Auto selected – the text control automatically adjusts to the size of the text contained by the
control
l Auto deselected – the text control remains at the specified size, regardless of the size of the
Tip
You can also resize the control using the resize handles in the Dialog Builder.
5. Under Alignment, specify the alignment of the text in the control by selecting Left, Right, or
Center.
6. Click OK to add the control to the Dialog Builder.
Steps
Show me how
1. In the Dialog Builder, click Edit Box and then click the layout area at the position where
you want the top left corner of the control.
The Editbox dialog box opens.
2. Optional. In the Variable field, type the name of the variable that will store the value input by
the user in the custom dialog box.
You can choose to keep the default variable name of EDITn.
3. Optional. In the Default Text field, specify a default input value for the text box.
If the user does not specify an input value, the default value is used.
4. Optional. If you want to specify the exact position of the control, modify the x (horizontal) and y
(vertical) values, which are specified in pixels.
Tip
You can also position the control by dragging it in the Dialog Builder.
5. Optional. If you want to specify a specific size for the control, deselect Auto beside the Width
or Height fields and modify the values, which are specified in pixels.
l Auto selected – the edit box control automatically adjusts to the size of the text contained by
the control
l Auto deselected – the edit box control remains at the specified size, regardless of the size
Tip
You can also resize the control using the resize handles in the Dialog Builder.
Add a checkbox
Use the checkbox control to add a checkbox to the custom dialog box.
A checkbox presents a binary choice to the user — that is, the associated option can be either on or
off. For example, you could use a checkbox to allow a user to either include or exclude the Email
Address field in a data extract from a personnel table.
Combinations of options
Use multiple checkboxes to allow a user to select any combination of options in a custom dialog box.
If options are mutually exclusive, use radio buttons instead.
Checkbox variable
The checkbox control creates a logical variable for storing the user input. The variable stores a value
of True if the checkbox is selected, and False if the checkbox is unselected.
Steps
Show me how
1. In the Dialog Builder, click Check Box and then click the layout area at the position
where you want the top left corner of the control.
The Checkbox dialog box opens.
2. Optional. In the Variable field, type the name of the variable that will store the value input by
the user in the custom dialog box.
You can choose to keep the default variable name of CHECKBOXn.
3. In the Label field, type the text that you want to accompany the checkbox.
You are limited to a maximum of 255 characters, including spaces.
4. Optional. If you want to specify the exact position of the control, modify the x (horizontal) and y
(vertical) values, which are specified in pixels.
Tip
You can also position the control by dragging it in the Dialog Builder.
5. Optional. If you want to specify a specific size for the control, deselect Auto beside the Width
or Height fields and modify the values, which are specified in pixels.
l Auto selected – the checkbox control automatically adjusts to the size of the text contained
by the control
l Auto deselected – the checkbox control remains at the specified size, regardless of the size
Tip
You can also resize the control using the resize handles in the Dialog Builder.
6. Under Initial State, specify whether the checkbox is Unchecked or Checked when the
custom dialog box first opens.
7. Click OK to add the control to the Dialog Builder.
Radio buttons present mutually exclusive options to the user — that is, only one of the presented
options can be selected at a time. For example, you could use two radio buttons to allow a user to
select either:
l amounts less than $5000
l amounts greater than or equal to $5000
Steps
Show me how
1. In the Dialog Builder, click Radio Button and then click the layout area at the position
where you want the top left corner of the control.
The Radiobuttons dialog box opens.
2. Optional. In the Variable field, type the name of the variable that will store the value input by
the user in the custom dialog box.
You can choose to keep the default variable name of RADIOn.
3. In the Label field, type the text that you want to accompany the first radio button and click
Add.
You are limited to a maximum of 255 characters, including spaces.
The radio button is added to the Label List.
4. Add additional labels for each additional radio button that you want.
Each additional radio button is added to the end of the Label List.
Note
Because the radio button control creates mutually exclusive options, you
should have at least two radio buttons.
5. Optional. Instead of adding a radio button to the end of the Label List, you can use any of
these other options:
Option Description
Allows you to replace a radio button in the Label List. Replace essentially renames the
radio button.
Replace
Before you click Replace, select the list item that you want to replace with the new radio
(Rename) button.
Allows you to specify which radio button is selected by default when the custom dialog
box first opens.
Set Default Select the list item that you want to specify as the default and click Set Default.
6. Optional. If you want to specify the exact position of the control, modify the x (horizontal) and y
(vertical) values, which are specified in pixels.
Tip
You can also position the control by dragging it in the Dialog Builder.
7. Optional. If you want to specify a specific size for the control, deselect Auto beside the Width
or Height fields and modify the values, which are specified in pixels.
l Auto selected – the radio button control automatically adjusts to the size of the text
Tip
You can also resize the control using the resize handles in the Dialog Builder.
8. Under Alignment, specify whether the radio buttons have a Horizontal or Vertical alignment
in the custom dialog box.
9. Click OK to add the control to the Dialog Builder.
Steps
Show me how
1. In the Dialog Builder, click Drop-down List and then click the layout area at the position
where you want the top left corner of the control.
The Dropdown list dialog box opens.
2. Optional. In the Variable field, type the name of the variable that will store the value input by
the user in the custom dialog box.
You can choose to keep the default variable name of DROPDOWNn.
3. In the Label field, type the text that you want to accompany the first drop-down list item and
click Add.
You are limited to a maximum of 255 characters, including spaces.
The list item is added to the Label List.
4. Add additional labels for each additional list item that you want.
Each additional list item is added to the end of the Label List.
Note
Because the drop-down list control creates mutually exclusive options, you
should have at least two list items.
5. Optional. Instead of adding a list item to the end of the Label List, you can use any of these
other options:
Option Description
Option Description
Allows you to replace a list item in the Label List. Replace essentially renames the list
Replace item.
(Rename) Before you click Replace, select the list item that you want to replace with the new item.
Allows you to specify which list item is selected by default when the custom dialog box
first opens.
Set Default Select the list item that you want to specify as the default and click Set Default.
6. Optional. If you want to specify the exact position of the control, modify the x (horizontal) and y
(vertical) values, which are specified in pixels.
Tip
You can also position the control by dragging it in the Dialog Builder.
7. Optional. If you want to specify a specific size for the control, deselect Auto beside the Width
or Height fields and modify the values, which are specified in pixels.
l Auto selected – the drop-down list control automatically adjusts to the size of the text
Tip
You can also resize the control using the resize handles in the Dialog Builder.
Available categories
The following categories are available:
Steps
Show me how
1. In the Dialog Builder, click Project Item List and then click the layout area at the position
where you want the top left corner of the control.
The Project item list dialog box opens.
2. Optional. In the Variable field, type the name of the variable that will store the value input by
the user in the custom dialog box.
You can choose to keep the default variable name of ITEMn.
3. In the Category drop-down list, select the category of project item that you want in the project
item list and click Add.
For example, if you select Numeric Fields, the project item list contains all numeric fields in
the open table when the script is run.
The category is added to the Category List.
4. Optional. Add additional categories that you want.
Each additional category is added to the end of the Category List.
Caution
Adding dissimilar categories, such as tables and fields, or scripts and
variables, is potentially confusing for users. A best practice is to add only
similar categories, such as character fields and numeric fields.
5. Optional. Instead of adding a category to the end of the Category List, you can use any of
these other options:
Option Description
6. Optional. In the Default field, specify a project item that is selected by default when the
custom dialog box first opens.
For example, you could specify a particular table name, or field name.
Note
Do not specify a Category name.
Make sure you exactly replicate the spelling of the project item, including any
underscores (_).
7. Optional. If you want to specify the exact position of the control, modify the x (horizontal) and y
(vertical) values, which are specified in pixels.
Tip
You can also position the control by dragging it in the Dialog Builder.
8. Optional. If you want to specify a specific size for the control, deselect Auto beside the Width
or Height fields and modify the values, which are specified in pixels.
l Auto selected – the project item list control automatically adjusts to the size of the text
Tip
You can also resize the control using the resize handles in the Dialog Builder.
1. To enable or disable word wrapping, click Word Wrap in the Script Editor toolbar.
2. To change the text styles or background color in the Script Editor, do the following:
a. Select Tools > Options.
b. Click the Application Font tab.
Note
The fixed-width and proportional font settings on the Application Font tab
apply to all application fonts, not only to the fonts in the Script Editor.
c. In the Script Editor Settings area, select a text style or Background Color and click
Change Color.
d. In the Color dialog box, select a color from the Basic colors area or from the color palette.
Or, if you know the Red, Green, and Blue (RGB) values of the color you want to use, enter
them in the appropriate text boxes.
e. Click OK.
f. To bold a selected style, select Bold.
g. To italicize a selected style, select Italic.
h. Click OK.
If you want to revert to the text styles and background color used when Analytics was first
installed, click Factory at the bottom of the Options dialog box. Clicking Factory sets all
options on all Options tabs to their default settings, not just the text styles and background
color in the Script Editor.
3. If you want to disable keyword auto-completion, do the following:
a. Select Tools > Options.
b. Click the Interface tab.
c. Select Disable auto complete in scripts.
d. Click OK.
Copy scripts
You can copy a script from one Analytics project to another. You can copy a single script, or multiple
scripts simultaneously.
If you want to import a script that exists as a separate file outside an Analytics project, see "Import
scripts" on the next page.
1. Open the project that will contain the copied script or scripts.
2. In the Overview tab of the Navigator, right-click the Analytics project entry, or a project folder,
and select Copy from another Project > Script.
The Analytics project is the top-level folder in the treeview.
3. In the Locate Project File dialog box, locate and select the Analytics project you want to copy
the script or scripts from and click Open.
4. In the Import dialog box, complete any of the following tasks to add one or more scripts to the
To project_name list:
l Double-click a script.
You can remove scripts from the To project_name list by double-clicking an individual script,
by using Ctrl+click to select multiple scripts and then clicking the left-arrow button, or by
clicking Clear All.
5. Click OK to copy the script or scripts into the destination project.
If a script with the same name already exists in the project, the copied script is given an
incrementing numeric suffix.
Import scripts
You can import a script that exists as a separate .aclscript file outside an Analytics project. You
can import only one script at a time.
If you want to import a script from another Analytics project, see "Copy scripts" on the previous
page.
1. In the Overview tab of the Navigator, right-click the Analytics project entry, or a project folder,
and select Import Project Item > Script.
The Analytics project is the top-level folder in the treeview.
2. In the Project dialog box, locate and select a script file (.aclscript) and click Open.
3. Click OK in the confirmation dialog box.
The script is imported into the project. If a script with the same name already exists in the
project, the imported script is given an incrementing numeric suffix.
Note
Make sure that you read the contents in the Script Details, which includes
important information about prerequisites, data requirements, and limitations.
5. At the top of the Script Files panel, click Download All Script Files .
The ScriptHub content downloads and appears in the Navigator.
Note
Make sure that you read the contents in the Script Details, which includes
important information about prerequisites, data requirements, and limitations.
l If you are importing a code snippet, open an existing script you want to paste the snippet
into.
5. Click ScriptHub Access in the Script Editor toolbar to display the Paste ScriptHub
content link dialog box.
6. Click Paste to paste the ScriptHub ID into the dialog box.
7. Click Done.
The ScriptHub content downloads and appears in the Navigator.
Note
Code snippets are inserted into the open script. Analytics and scripts appear
as separate scripts in the Navigator. In this situation you can delete the empty
script you used to import the items.
Export scripts
You can export a script as a separate .aclscript file saved outside the Analytics project. A script
exported as a separate file can later be imported into any Analytics project. You can export only one
script at a time.
1. Right-click the script in the Overview tab of the Navigator and select Export Project Item.
2. In the Save As dialog box, choose a location to save the script, rename the script if required,
click Save, and click OK in the confirmation dialog box.
The script is exported to the location you specified.
Note
Limit the script name to 64 alphanumeric characters, not including the
.aclscript extension, to ensure that the name is not truncated when the
script is imported back into Analytics.
The name can include the underscore character ( _ ), but do not use any other
special characters, or any spaces, or start the name with a number. Special
characters, spaces, and a leading number are all replaced by the underscore
character when the script is imported.
Commands overview
ACLScript commands perform operations on data that are often broad in scope.
For example, the SUMMARIZE command groups records based on identical values in a field, and
calculates subtotals and statistical values for each group.
A number of commands output results to a new Analytics table. Other commands perform various
application tasks.
A full list of commands available in Analytics, organized by category, appears on subsequent pages:
l "Import and export data" on page 1630
l "Profile and verify data" on page 1631
l "Sort data" on page 1632
l "Group data" on page 1632
l "Combine data" on page 1633
l "Sample data" on page 1634
l "Machine learning" on page 1635
l "Field, record, and table" on page 1635
l "User interaction and general scripting" on page 1637
l "HighBond API request" on page 1638
l "Report" on page 1639
l "File and system" on page 1639
When specifying commands in scripts, you can abbreviate their names. You must include enough
leading characters from a command name to uniquely identify the command among all
Analytics commands.
For example:
l EXT uniquely identifies the EXTRACT command and therefore is a valid abbreviation.
l EX does not uniquely identify the EXTRACT command and generates an error message.
You can make an abbreviation as short as you want, provided that it still uniquely identifies the
command.
For example, all the following abbreviations are valid for the OPEN command:
l OPE
l OP
l O
Note
As abbreviations get shorter they become harder for other users to recognize.
Many Analytics commands allow some flexibility in the order of their parameters. For example,
these three variations of the same CLASSIFY command all perform an identical operation, and all
execute correctly:
CLASSIFY ON CUSTNO SUBTOTAL AMOUNT KEY CODES IF AMOUNT >= 100 TO "Classify_
1.FIL" OPEN APPEND STATISTICS
CLASSIFY ON CUSTNO IF AMOUNT >= 100 SUBTOTAL AMOUNT STATISTICS KEY CODES TO
"Classify_1.FIL" APPEND OPEN
A few commands require that one or more parameters appear in a specific order. The required order
is stated in the topics for those commands.
Note
The physical order of parameters in commands has no effect on the order that
Analytics processes the parameters. For example, the scope parameters (ALL,
FIRST, NEXT, WHILE) are applied before the IF parameter, regardless of the
relative position of the parameters.
Note
Throughout Analytics documentation, command and parameter keywords are
presented in uppercase, which is simply a formatting convention. Analytics
does not require that keywords are entered in uppercase.
| Separates syntax items enclosed in brackets or braces. You can use only one of the items.
(vertical bar)
<,...n> Indicates the preceding item can be repeated n number of times. The occurrences are
separated by commas.
<...n> Indicates the preceding item can be repeated n number of times. The occurrences are
separated by blanks.
Command descriptions
Command Description
DEFINE TABLE DB Defines an Analytics server table by connecting to a database table using AX Connector. You
can connect to a Microsoft SQL Server, Oracle, or DB2 database.
EXPORT Exports data from Analytics to the specified file format, or to the Results app or the Robots
app in HighBond.
IMPORT ACCESS Creates an Analytics table by defining and importing a Microsoft Access database file.
IMPORT DELIMITED Creates an Analytics table by defining and importing a delimited text file.
IMPORT EXCEL Creates an Analytics table by defining and importing a Microsoft Excel worksheet or named
range.
Command Description
GRCRESULTS
IMPORT Creates multiple Analytics tables by defining and importing multiple delimited files.
MULTIDELIMITED
IMPORT Creates multiple Analytics tables by defining and importing multiple Microsoft Excel
MULTIEXCEL worksheets or named ranges.
IMPORT ODBC Creates an Analytics table by defining and importing data from an ODBC data source.
ODBC stands for Open Database Connectivity, a standard method for accessing databases.
IMPORT PDF Creates an Analytics table by defining and importing an Adobe PDF file.
IMPORT PRINT Creates an Analytics table by defining and importing a Print Image (Report) file.
IMPORT SAP Creates an Analytics table by importing data from an SAP system using Direct Link.
IMPORT XBRL Creates an Analytics table by defining and importing an XBRL file.
IMPORT XML Creates an Analytics table by defining and importing an XML file.
RETRIEVE Retrieves the result of a Direct Link query submitted for background processing.
Command descriptions
Command Description
BENFORD Counts the number of times each leading digit (1–9) or leading digit combination occurs in a field,
and compares the actual count to the expected count. The expected count is calculated using the
Benford formula.
COUNT Counts the total number of records in the current view, or only those records that meet the
specified condition.
DUPLICATES Detects whether duplicate values or entire duplicate records exist in an Analytics table.
Command Description
GAPS Detects whether a numeric or datetime field in an Analytics table contains one or more gaps in
sequential data.
OUTLIERS Identifies statistical outliers in a numeric field. Outliers can be identified for the field as a whole, or
for separate groups based on identical values in one or more character, numeric, or datetime key
fields.
PROFILE Generates summary statistics for one or more numeric fields, or numeric expressions, in an
Analytics table.
SEQUENCE Determines if one or more fields in an Analytics table are in sequential order, and identifies out-of-
sequence items.
STATISTICS Calculates statistics for one or more numeric or datetime fields in an Analytics table.
TOTAL Calculates the total value of one or more fields in an Analytics table.
VERIFY Checks for data validity errors in one or more fields in an Analytics table by verifying that the data
is consistent with the field definitions in the table layout.
Sort data
The sort commands provide two different methods for sorting records in Analytics. The
INDEX command temporarily reorders an existing table. The SORT command produces a new table
with physically reordered records.
Command descriptions
Command Description
INDEX Creates an index for an Analytics table that allows access to the records in a sequential order
rather than a physical order.
SORT Sorts records in an Analytics table into an ascending or descending sequential order, based on a
specified key field or fields. The results are output to a new, physically reordered Analytics table.
Group data
The group commands let you group records based on identical or similar values. Depending on the
command, you can group text values, numbers, or dates, or a combination of these types.
Command descriptions
Command Description
AGE Groups records into aging periods based on values in a date or datetime field. Counts the number
of records in each period, and also subtotals specified numeric fields for each period.
CLASSIFY Groups records based on identical values in a character or numeric field. Counts the number of
records in each group, and also subtotals specified numeric fields for each group.
CLUSTER Groups records into clusters based on similar values in one or more numeric fields. Clusters can
be uni-dimensional or multidimensional.
CROSSTAB Groups records based on identical combinations of values in two or more character or numeric
fields, and displays the resulting groups in a grid of rows and columns. Counts the number of
records in each group, and also subtotals specified numeric fields for each group.
HISTOGRAM Groups records based on values in a character or numeric field, counts the number of records in
each group, and displays the groups and counts in a bar chart.
OUTLIERS Identifies statistical outliers in a numeric field. Outliers can be identified for the field as a whole, or
for separate groups based on identical values in one or more character, numeric, or datetime key
fields.
STRATIFY Groups records into numeric intervals based on values in a numeric field. Counts the number of
records in each interval, and also subtotals specified numeric fields for each interval.
SUMMARIZE Groups records based on identical values in one or more character, numeric, or datetime fields.
Counts the number of records in each group, and also subtotals specified numeric fields for each
group.
Combine data
The combine data commands provide several different ways for combining data inside Analytics.
For an overview of combing data in Analytics, see "Combining data" on page 913.
Command descriptions
Command Description
APPEND Combines records from two or more Analytics tables by appending them in a new Analytics table.
EXTRACT Extracts data from an Analytics table and outputs it to a new Analytics table, or appends it to an
Command Description
existing Analytics table. You can extract entire records or selected fields.
FUZZYJOIN Uses fuzzy matching to combine fields from two Analytics tables into a new, single Analytics
table.
JOIN Combines fields from two Analytics tables into a new, single Analytics table.
MERGE Combines records from two sorted Analytics tables with an identical structure into a new Analytics
table that uses the same sort order as the original tables.
Sample data
Analytics has three types of sampling:
l record sampling (attributes sampling)
l monetary unit sampling
l classical variables sampling
The type of sampling you choose depends on the nature of the analysis you are doing, and the
nature of the data.
For guidance on which type of sampling to use, see "Sampling data" on page 1023.
Command descriptions
Command Description
CVSPREPARE Stratifies a population, and calculates a statistically valid sample size for each stratum, for
classical variables sampling.
CVSSAMPLE Draws a sample of records using the classical variables sampling method.
CVSEVALUATE For classical variables sampling, provides four different methods for projecting the results of
sample analysis to the entire population.
SIZE Calculates a statistically valid sample size, and sample interval, for record sampling or
monetary unit sampling.
SAMPLE Draws a sample of records using either the record sampling or monetary unit sampling method.
EVALUATE For record sampling or monetary unit sampling, projects errors found in sampled data to the
entire population, and calculates upper limits on deviation rate, or misstatement amount.
Machine learning
The machine learning commands let you predict classes or numeric values, or discover patterns, in
unlabeled data.
Command descriptions
Command Description
CLUSTER Groups records into clusters based on similar values in one or more numeric fields. Clusters can
be uni-dimensional or multidimensional.
TRAIN Uses automated machine learning to create an optimum predictive model using a training data
set.
PREDICT Applies a predictive model to an unlabeled data set to predict classes or numeric values
associated with individual records.
Command descriptions
Command Description
ACTIVATE Adds field definitions stored in an Analytics workspace to the existing set of field definitions
in an Analytics table layout.
CREATE LAYOUT Creates an empty Analytics table layout, which may be required in certain scripting
situations.
DEFINE COLUMN Creates and adds one or more columns to an existing view.
EXTRACT Extracts data from an Analytics table and outputs it to a new Analytics table, or appends it
to an existing Analytics table. You can extract entire records or selected fields.
FIND Searches an indexed character field for the first value that matches the specified character
string.
IMPORT LAYOUT Imports an external table layout file (.layout) to an Analytics project.
LIST Outputs the data in one or more fields in an Analytics table to a display formatted in
columns.
LOCATE Searches for the first record that matches the specified value or condition, or moves to the
specified record number.
NOTES Creates, modifies, or removes a note associated with an individual record in an Analytics
table.
REFRESH Updates the data in an Analytics table from its associated data source.
SAVE Copies an Analytics table and saves it with a different name, or saves an Analytics project.
SAVE LAYOUT Saves an Analytics table layout to an external table layout file (.layout), or saves table
layout metadata to an Analytics table.
SAVE TABLELIST Saves a list of all tables in an Analytics project to an Analytics table or a CSV file.
Command Description
SEEK Searches an indexed character field for the first value that matches the specified character
expression or character string.
Command descriptions
Command Description
ACCEPT Creates a dialog box that interactively prompts users for one or more script input values. Each
input value is stored in a named character variable.
CLOSE Closes an Analytics table, index file, or log file, or ends a Script Recorder session.
DELETE Deletes an Analytics project item, a field from a table layout, a variable, one or more table history
entries, a relation between tables, or a file in a Windows folder. Also removes a column from a
view.
DIALOG Creates a custom dialog box that interactively prompts users for one or more script input values.
Each input value is stored in a named variable.
DO SCRIPT Executes a secondary script, or an external script, from within an Analytics script.
ESCAPE Terminates the script being processed, or all scripts, without exiting Analytics.
EXECUTE Executes an application or process external to Analytics. Emulates the Windows Run command.
Can be used to interact with the Windows command prompt.
GROUP Executes one or more ACLScript commands on a record before moving to the next record in the
table, with only one pass through the table. Command execution can be controlled by conditions.
Command Description
LOOP Executes a series of ACLScript commands repeatedly on a record while a specified condition
evaluates to true.
NOTIFY Submits an outgoing email notification message to an SMTP mail server to be relayed to
recipients.
PASSWORD Creates a password definition, without a password value, that prompts users for a password while
a script is running.
PAUSE Pauses a script, and displays information in a dialog box for users.
RCOMMAND Passes an Analytics table to an external R script as a data frame and creates a new table in the
Analytics project using output from the external R script.
Note
The HighBond API request commands can only be used with the HighBond API.
They do not work with any other API.
The commands are supported in ACL scripts only, with no equivalent in the Analytics
user interface.
Command descriptions
Command Description
Command Description
Report
The report commands let you format, generate, and print a basic Analytics report.
Command descriptions
Command Description
PRINT Prints a text file, an Analytics log file, or an Analytics project item that has been exported as an
external file – a script (.aclscript), a table layout (.layout), or a workspace (.wsp). You can also print
a graph that has been generated by a command.
REPORT Formats and generates a report based on the open Analytics table.
Command descriptions
Command Description
DISPLAY Displays information about the specified Analytics item type. Can also display the result of an
expression, or the output of a function.
DUMP Displays the contents of a file, or the current record, in hexadecimal, ASCII, and EBCDIC
character encodings.
Command Description
SAVE LOG Saves the entire command log, or the log entries for the current Analytics session, to an external
file.
ACCEPT command
Creates a dialog box that interactively prompts users for one or more script input values. Each input
value is stored in a named character variable.
Note
Using the ACCEPT command to enter passwords is not secure. You should use the
"PASSWORD command" on page 2036 instead.
The ACCEPT command is not supported in scripts run in Robots.
You can create a more advanced interactive dialog box with the "DIALOG
command" on page 1754.
Syntax
ACCEPT {message_text <FIELDS project_item_category> TO variable_name} <...n>
Parameters
Name Description
message_ The label displayed in the dialog box used to prompt for input. Must be a quoted string or a character
text variable.
When entering multiple prompts, you can separate them with commas. Using commas improves script
readability, but it is not required:
FIELDS Creates a drop-down list of project items for user input instead of a text box. The user can select a
project_ single project item, field, or variable from the list.
item_
project_item_category specifies which item types to display in the list. For example, specifying xf
category
displays all the project tables in the list. Enclose project_item_category in quotation marks:
optional
FIELDS "xf"
For the codes used to specify categories, see "Codes for project item categories" on page 1644.
You can specify more than one code in the same prompt, but you cannot mix project items, fields, or
variables.
Name Description
TO The name of the character variable to use to store the user input. If the variable does not exist, it is
variable_ created.
name
If the variable already exists, its current value is displayed in the dialog box as the default value.
Note
Do not use non-English characters, such as é , in the names of variables that will be
used in variable substitution. Variable names that contain non-English characters
cause variable substitution to fail.
The ACCEPT command creates character variables only. If you need input of another
data type, you must convert the character variable to the required type in subsequent
processing in a script. For more information, see "Input data type" on page 1645.
Examples
The percent signs are required because they indicate that the table name to open is stored in
the v_table_name variable. If the percent signs are omitted, the script attempts to open a
table called "v_table_name".
l a sampling interval
l a random start value
Remarks
For detailed information about using variables, see "Working with variables in ACLScript" on
page 1568.
Interactivity
Use ACCEPT to create an interactive script. When the ACCEPT command is processed, the script
pauses and a dialog box is displayed that prompts the user for input that Analytics uses in
subsequent processing.
You can create separate dialog boxes that prompt for one item at a time, or you can create one
dialog box that prompts for multiple items.
Project categories
Code Category
xf Tables
xb Scripts
xi Indexes
xw Workspaces
Field categories
Code Category
C Character fields
N Numeric fields
D Datetime fields
L Logical fields
Variable categories
Code Category
c Character variables
n Numeric variables
d Datetime variables
l Logical variables
In the example, the start and end dates for this filter are stored as character values. They must be
converted to date values in order to be used with a date field that uses a Datetime data type.
Enclosing the variable name in percent signs (%) substitutes the character value contained by the
variable for the variable name. The CTOD( ) function then converts the character value to a date
value.
information.
Note
You cannot use the ACCEPT command inside the GROUP command.
ACCESSDATA command
Syntax
{ACCESSDATA64 | ACCESSDATA32} {CONNECTOR | ODBC {"Driver"|"Dsn"|"File"}}
NAME value <USER user_id> <PASSWORD num | PROMPT_PASSWORD> <PASSWORD num AS
password_keyname <...n>> TO table_name CHARMAX max_field_length MEMOMAX max_
field_length <ALLCHARACTER> SOURCE (connection_settings) <HASH(salt_value,
fields)>
SQL_QUERY
(SQL_syntax)
END_QUERY
Parameters
Name Description
NAME value The name of the Analytics data connector, the ODBC driver, or the DSN.
For example:
o NAME "Amazon Redshift"
o NAME "Microsoft Access Driver (*.mdb, *.accdb)"
o NAME "My Excel DSN"
o NAME "excel.dsn"
USER user_id The user ID for data sources that require a user ID.
optional
Name Description
PASSWORD num AS For data sources that require multiple passwords, the password definitions to use.
password_keyname <...n>
password_keyname must replicate exactly the password key name as it appears in the
optional connection settings specified by SOURCE.
For more information, see "Using password definitions with ACCESSDATA" on
page 1653.
By default, the table data file (.FIL) is saved to the folder containing the
Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
l TO "C:\Output.FIL"
l TO "Results\Output.FIL"
Note
Table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _
), but no other special characters, or any spaces. The name cannot
start with a number.
CHARMAX max_field_ The maximum length in characters for any field in the Analytics table that originates as
length character data in the source from which you are importing.
The default value is 50. Data that exceeds the maximum field length is truncated when
imported to Analytics.
The ability to truncate fields prevents occasional long values from expanding the overall
record length beyond what is supported by the import process:
o 32,767 characters (non-Unicode Analytics)
o 16,383 characters (Unicode Analytics)
MEMOMAX max_field_ The maximum length in characters for text, note, or memo fields you are importing.
length
The default value is 100. Data that exceeds the maximum field length is truncated when
Name Description
imported to Analytics.
ALLCHARACTER Automatically assign the Character data type to all imported fields.
optional Once the data is in Analytics, you can assign different data types, such as Numeric or
Datetime, to the fields, and specify format details.
Tip
ALLCHARACTER is useful if you are importing a table that contains
numeric ID values. You can use ALLCHARACTER to prevent Analytics
automatically assigning the Numeric data type to values that should use
the Character data type.
SOURCE connection_ The connection settings (connection string) required to connect to the data source.
settings
HASH(salt_value, fields) Imports the specified fields as cryptographic hash values. Hash values are one-way
transformations and cannot be decoded after you import the fields:
optional
o salt_value – an alphanumeric string that is concatenated with the source data values
to strengthen the hashing of the values in the fields. Enter the hash value as a quoted
string.
The salt value is limited to 128 characters. Do not use any of the following characters:
( ) "
o fields – a list of one or more fields to hash. Enter the fields as a quoted string and
separate each field with a comma.
You must specify the field name you see in the Data Access window preview and
staging area, not the physical field name in the data source.
Note
The field name that is shown in the Data Access window preview is
the field alias value in the SQL query ("field_name" AS "alias"). You
must use the alias value to reference fields.
For information about comparing values hashed during import to values hashed in
ACLScript, see "Comparing data hashed with ACCESSDATA to data hashed with the
ACLScript HASH( ) function" on page 1659.
Note
You cannot use ACLScript syntax (commands or functions) in the body of
the SQL import statement. You must use valid SQL syntax only.
Examples
(
`Customer`.`Region` = 'BC'
OR `Customer`.`Region` = 'WA'
)
) END_QUERY
Remarks
For more information about how this command works, see "Working with the Data Access window"
on page 370.
Note
You can use the two options separately, or you can use them together.
Use the PASSWORD num parameter if a data source requires only a single password.
In the example below:
1. The PASSWORD 1 command prompts a user to enter a password and creates a password
definition that securely stores the entered password.
PASSWORD 1
ACCESSDATA64 CONNECTOR NAME "Concur" PASSWORD 1 TO "Concur_data_
import.FIL" CHARMAX 50 MEMOMAX 100
SOURCE( auth_accesstoken=[$pwd];auth_type=OAuth 2.0;en-
able-
double-
buf-
fer-
=1;hos-
st=www.concursolutions.com;useencryptedendpoints=1;userparam=all)
SQL_QUERY(
SELECT
"List_Items"."Level_7_Code" AS "Level_7_Code",
"List_Items"."Name" AS "Name",
"List_Items"."Level_10_Code" AS "Level_10_Code",
"List_Items"."Level_8_Code" AS "Level_8_Code",
"List_Items"."URI" AS "URI",
"List_Items"."Id" AS "Id",
"List_Items"."Level_3_Code" AS "Level_3_Code",
"List_Items"."List_Id" AS "List_Id",
"List_Items"."Level_4_Code" AS "Level_4_Code",
"List_Items"."Level_1_Code" AS "Level_1_Code",
"List_Items"."Parent_Id" AS "Parent_Id",
"List_Items"."Level_2_Code" AS "Level_2_Code",
"List_Items"."Level_5_Code" AS "Level_5_Code",
"List_Items"."Level_6_Code" AS "Level_6_Code",
"List_Items"."Level_9_Code" AS "Level_9_Code"
FROM
"Concur"."List_Items" "List_Items"
) END_QUERY
2. In the ACCESSDATA command, the four PASSWORD parameters reference the password
definitions and securely pass the stored authentication values into the connection
settings specified by SOURCE :
l oauthclientid=
l oauthclientsecret=
l oauthaccesstoken=
l oauthaccesstokensecret=
For more information, see "Configuring ACCESSDATA to work with multiple password
definitions" on the facing page.
COMMENT
//ANALYTIC TYPE IMPORT Import Twitter data
//PASSWORD 1 Enter OAuth Client ID:
//PASSWORD 2 Enter OAuth Client Secret:
//PASSWORD 3 Enter OAuth Access Token:
//PASSWORD 4 Enter OAuth Access Token Secret:
//RESULT TABLE Twitter_user_data
END
ers-
=false;su-
pportenhancedsql=true;proxyauthscheme=BASIC;proxyautodetect=true;_
persist_=encrypted-dp{AQA ... kX3E8yyh05HoG1rH4bm1lhwudUQ==}})
SQL_QUERY(
SELECT
"Users"."ID" AS "ID",
"Users"."Name" AS "Name",
"Users"."Screen_Name" AS "Screen_Name",
"Users"."Location" AS "Location",
"Users"."Profile_URL" AS "Profile_URL",
"Users"."Lang" AS "Lang",
"Users"."Created_At" AS "Created_At",
"Users"."Friends_Count" AS "Friends_Count",
"Users"."Followers_Count" AS "Followers_Count",
"Users"."Favourites_Count" AS "Favourites_Count",
"Users"."Statuses_Count" AS "Statuses_Count",
"Users"."Time_Zone" AS "Time_Zone",
"Users"."Following" AS "Following",
"Users"."Contributors_Enabled" AS "Contributors_Enabled",
"Users"."Follow_Request_Sent" AS "Follow_Request_Sent",
"Users"."Listed_Count" AS "Listed_Count",
"Users"."Description" AS "Description",
"Users"."Default_Profile" AS "Default_Profile"
FROM
"Twitter"."Users" "Users"
) END_QUERY
3. Delete the clear text authentication values from the SOURCE parameter and leave only the
password key names and the equals sign.
For example:
SOURCE( oauthcli-
entid=;oauthclientsecret=;oauthaccesstoken=;oauthaccesstokensecret=
[$pwd]; ... )
Note
Authentication values must now be supplied by users via password definitions
created with the PASSWORD command or the PASSWORD analytic tag. For
more information, see "Creating a password definition" on page 1653.
4. Optional. Delete [$pwd] from the one password key name with a masked authentication
value.
With this password key name you can use either of the two methods for specifying a
password definition in the ACCESSDATA command. For more information, see "Two options
for specifying password definitions" on page 1653.
5. Delete the PROMPT_PASSWORD parameter from the ACCESSDATA command.
6. Insert numbered PASSWORD parameters at the location where you deleted PROMPT_PASSWORD and
copy and paste the password key names from the SOURCE parameter to the PASSWORD
parameters.
For example:
Important
Password key names must be exactly identical between the
SOURCE parameter and the PASSWORD parameters. If they are not, the
ACCESSDATA command fails.
7. If you did not remove [$pwd] from the password key name with a masked authentication
value, use the method for specifying a single password definition.
For example:
oauthcli-
entid=;oauthclientsecret=;oauthaccesstoken=;oauthaccesstokensecret=
[$pwd]; ... )
Note
Before connecting to a data source and re-running the import, clear the
connector cache to flush the existing set of table names.
In the Existing Connections tab in the Data Access window, beside the
connector name, select > Clear cache.
l Update field specifications – You may also need to update field specifications in the script
body to align with table schema changes in the data source or ODBC driver. Possible
changes include field names, field data types, and field and record lengths.
l Check the results of any filtering – You should also check the results of any filtering that you
apply as part of the data import. Confirm that the import filtering is including and excluding
records correctly.
Note
The "Server" in ServerDataAccess.log refers to the data access component
of Analytics running locally on the computer where Analytics is installed.
l DataAccess.log – records information about the import operation and the Analytics project
that you are importing data to
Location: ..\<Analytics project folder>\DataAccess.log
Once you hash the Analytics values, you can compare them with values hashed as part of the
ACCESSDATA command import.
ACTIVATE command
Adds field definitions stored in an Analytics workspace to the existing set of field definitions in an
Analytics table layout.
Syntax
ACTIVATE <WORKSPACE> workspace_name <OK>
Parameters
Name Description
Examples
Remarks
How it works
ACTIVATE makes workspace field definitions available to the active table. Once you activate a
workspace, its fields remain available for use with the active table until you close the table.
AGE command
Groups records into aging periods based on values in a date or datetime field. Counts the number of
records in each period, and also subtotals specified numeric fields for each period.
Syntax
AGE <ON> date_field <CUTOFF cutoff_date> <INTERVAL days <,...n>> <SUPPRESS>
<SUBTOTAL numeric_field <...n>|SUBTOTAL ALL <EXCLUDE numeric_field <...n>>>
<IF test> <WHILE test> <FIRST range|NEXT range> <TO
{SCREEN|filename|GRAPH|PRINT}> <KEY break_field> <HEADER header_text>
<FOOTER footer_text> <APPEND> <STATISTICS>
Parameters
Name Description
ON date_field The name of the date or datetime field or the expression to be aged.
Although you can age on a datetime field, only the date portion of datetime values is
considered. The time portion is ignored. You cannot age on time data alone.
CUTOFF cutoff_date The date that values in date_field are compared against.
optional You must specify cutoff_date as an unquoted string in YYMMDD or YYYYMMDD format,
regardless of the format of the date field. For example: CUTOFF 20141231
If you omit CUTOFF, the current system date is used as the cutoff date.
INTERVAL days <,...n> The date intervals (that is, number of days) to use in calculating the aging periods.
optional days represents the beginning of each aging period measured backward in time from
cutoff_date:
o the first days value identifies the beginning of the first aging period
o a first days value of '0' specifies that the first aging period begins on the specified
cutoff_date
o the last days value identifies the end of the final aging period
You must specify the intervals as an unquoted string with comma separated values:
INTERVAL 0,90,180,270,365
The default aging periods are 0, 30, 60, 90, 120, and 10,000 days. An interval of 10,000
Name Description
days is used to isolate records with dates that are probably invalid.
If required, date intervals can be customized to mirror other internal aging reports.
SUPPRESS Suppresses dates that fall outside the aging period from the command output.
optional
SUBTOTAL numeric_field One or more numeric fields or expressions to subtotal for each group.
<...n> | SUBTOTAL ALL
Multiple fields must be separated by spaces. Specify ALL to subtotal all the numeric
optional fields in the table.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
TO SCREEN | filename | The location to send the results of the command to:
GRAPH | PRINT o SCREEN – displays the results in the Analytics display area
Name Description
Tip
You can click any linked result value in the display area to drill down to
the associated record or records in the source table.
By default, the file is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the file to a different, existing folder:
l TO "C:\Output.TXT"
l TO "Results\Output.TXT"
o GRAPH – displays the results in a graph in the Analytics display area
o PRINT – sends the results to the default printer
KEY break_field The field or expression that groups subtotal calculations. A subtotal is calculated each
time the value of break_field changes.
optional
break_field must be a character field or expression. You can specify only one field, but
you can use an expression that contains more than one field.
HEADER header_text The text to insert at the top of each page of a report.
optional header_text must be specified as a quoted string. The value overrides the Analytics
HEADER system variable.
FOOTER footer_text The text to insert at the bottom of each page of a report.
optional footer_text must be specified as a quoted string. The value overrides the Analytics
FOOTER system variable.
APPEND Appends the command output to the end of an existing file instead of overwriting it.
optional
Note
You must ensure that the structure of the command output and the
existing file are identical:
l the same fields
l the same field order
l matching fields are the same length
l matching fields are the same data type
Analytics appends output to an existing file regardless of its structure. If
the structure of the output and the existing file do not match, jumbled,
missing, or inaccurate data can result.
STATISTICS Note
optional Cannot be used unless SUBTOTAL is also specified.
Calculates average, minimum, and maximum values for all SUBTOTAL fields.
Examples
OPEN Ar
AGE ON Invoice_Date CUTOFF 20141231 INTERVAL 0,30,60,90,120,10000
SUBTOTAL Invoice_Amount TO SCREEN
Remarks
For more information about how this command works, see "Aging data" on page 1323.
Aging periods
The AGE command groups records into aging periods based on values in a date or datetime field.
The output results contain a single record for each period, with a count of the number of records in
the source table that fall into each period.
Interval measurement
Aging periods are based on date intervals (that is, number of days) measured backward in time from
the current system date, or from a cutoff date you specify such as a fiscal period end date.
Future periods
You can create aging periods more recent than the cutoff date by entering negative values for date
intervals. For example, the following creates aging periods running forward and backward from the
cutoff date:
INTERVAL -60,-30,0,30,60,90
This approach creates a date profile of all the records in a table using different points in time.
APPEND command
Combines records from two or more Analytics tables by appending them in a new Analytics table.
Syntax
APPEND table_1, table_2, <...n> TO table_name <COMMONFIELDS> <OPEN> <ASCHAR>
<ALLCHAR> <SOURCETABLE>
Parameters
Name Description
By default, the table data file (.FIL) is saved to the folder containing the
Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
l TO "C:\Output.FIL"
l TO "Results\Output.FIL"
Note
Table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _
), but no other special characters, or any spaces. The name cannot
start with a number.
COMMONFIELDS Only those fields that are common to all tables being appended are included in the output
table.
Name Description
optional If you omit COMMONFIELDS, all fields from all tables are included in the output table.
Blank values appear in the output table where no fields exist in the source tables.
Tip
For diagrams and screen captures illustrating the two options, see
"Appending tables" on page 931.
Note
The APPEND command does not support appending computed fields.
For more information, see "Computed fields not supported" on
page 1673.
Note
You can avoid this situation by using either ASCHAR or ALLCHAR to
harmonize data categories.
OPEN Opens the table created by the command after the command executes. Only valid if the
command creates an output table.
optional
ASCHAR Harmonizes fields with identical names but different data categories by converting non-
character fields to the character data category.
optional
For example, you append two tables in which the Employee_ID field is character data in
one table, and numeric data in the other. The numeric Employee_ID field is converted to
character data and the two fields are appended without an error.
ASCHAR is ignored if ALLCHAR is also specified.
ALLCHAR Converts all non-character fields in all tables being appended to the character data
category.
optional
This global conversion to character data ensures that all identically named fields are
appended without error.
Name Description
Note
After appending, you can change the data category of an entire
appended field if appropriate for the data contained by the field.
SOURCETABLE Include the Source Table field ( Source_Table ) in the output table.
optional For each record in the output table, the Source Table field identifies the table from which
the record originated.
Tip
Including the names of the source tables you are appending may provide
useful information when you analyze data in the output table.
Examples
The second example converts all non-character fields to the character data category whether
required for harmonization or not:
Remarks
For more information about how this command works, see "Appending tables" on page 931.
How it works
The APPEND command combines records from two or more tables by appending them and creating
a new table. Appending means to add one group of records to the bottom of another group of
records.
Source table fields with identical physical names and identical data categories are directly
appended to one another.
Fields with physical names that are unique across all the source tables are added to the output table
but not directly appended to any other field.
Tip
If you want to directly append inconsistently named fields, standardize the physical
names of the fields in the table layouts before appending. (Assumes that the fields
belong to the same data category, or that you use ASCHAR or ALLCHAR to
harmonize the data category of the fields.)
Tip
A single execution of the APPEND command can replace multiple executions of the
EXTRACT command with the APPEND option.
Note
You can harmonize dissimilar datetime fields by converting them to the character
data category, and then append them. This approach allows you to combine the data
in a single table. However, depending on the nature of the source data, you may not
be able to convert the combined data back to datetime data.
Automatic harmonization
In some situations the APPEND command automatically harmonizes fields in order to append them:
Data category of
fields Harmonization performed
Numeric o Different field lengths are harmonized. The fields are converted to the ACL data type.
o A different number of defined decimal places are harmonized. Decimal places are
standardized on the greatest number of places, with trailing zeros added to numeric values
where necessary. The fields are converted to the ACL data type.
o Different numeric data types such as Print, Float, EBCDIC, and Micro are harmonized by
converting the fields to the ACL data type.
Datetime o Different date, datetime, or time formats in the source data are harmonized by converting
the fields to the Analytics default formats:
l YYYYMMDD
l YYYYMMDD hh:mm:ss
l hh:mm:ss
Note
User-specified harmonization of fields with identical names but different data
categories is explained above. For more information, see "ASCHAR" on page 1669
and "ALLCHAR" on page 1669.
Tip
You can append a computed field by first extracting it to convert the field to a
physical field. (For more information, see "EXTRACT command" on page 1818.)
You then use the extracted table in the append operation.
Another approach is to recreate the computed field in the appended output table.
Record length
If you include all fields from all source tables when appending, the record length in the output table
can be longer than the longest record in the source tables.
An error message appears if the output record length exceeds the Analytics maximum of 32 KB.
Note
The Dec setting may not be the same as the actual number of decimal places in the
source data. Decimal places that exceed the Dec setting are undefined, and are
rounded in calculations.
Sorting
Any existing sort orders in the source tables are separately maintained in the respective record sets
in the output table.
Even if the records in all source tables are sorted, the output table is considered unsorted because
the source records are appended as groups, without consideration of any existing sort order in other
source tables.
For example, if you append monthly or quarterly tables to create an annual table, any internal
sorting of the monthly or quarterly data is retained. If required, you can sort the output table after
performing the append operation.
Table Fields
The first table specified in the APPEND command dictates the order of the fields in the output table.
So in the example above, the order in the output table is:
l Last_name | First_name | Middle_name
Non-common fields
Non-common fields in source tables appear in the output table in the order that they appear in the
selected group of source tables.
For example, when appending these two tables:
Table Fields
ASSIGN command
Creates a variable and assigns a value to the variable.
Syntax
ASSIGN variable_name = value <IF test>
Note
Explicitly specifying the ASSIGN keyword is a best practice because it makes
scripts easier to read and understand. However, you can omit ASSIGN and simply
specify:
variable_name = value
Parameters
Name Description
variable_name The name of the variable to assign the value to. If the variable does not exist, it is
created. If the variable already exists, it is updated with the new value.
Do not use non-English characters, such as é , in the names of variables that will be used
in variable substitution. Variable names that contain non-English characters cause
variable substitution to fail.
Note
Variable names are limited to 31 alphanumeric characters. The name
can include the underscore character ( _ ), but no other special
characters, or any spaces. The name cannot start with a number.
value The value to assign to the variable. If a new variable is created, the variable type is based
on the data type in value.
IF test A conditional expression that must be true to create the variable or assign the value to
the variable.
Optional
Examples
Remarks
For detailed information about using variables, see "Working with variables in ACLScript" on
page 1568.
Duration of variables
Variables are retained for the duration of the current Analytics session only. Normally, when you
close an Analytics project, all the variables in the project are automatically deleted.
If you want a variable to be permanently saved with an Analytics project, preface the variable name
with an underscore:
BENFORD command
Counts the number of times each leading digit (1–9) or leading digit combination occurs in a field,
and compares the actual count to the expected count. The expected count is calculated using the
Benford formula.
Syntax
BENFORD <ON> numeric_field <LEADING n> <IF test> <BOUNDS> <TO {SCREEN|table_
name|GRAPH|PRINT}> <LOCAL> <HEADER header_text> <FOOTER footer_text>
<WHILE test> <FIRST range|NEXT range> <APPEND> <OPEN>
Parameters
Name Description
Note
Select a field that contains "naturally occurring numbers", such as
transaction amounts. Benford analysis is not suitable for numeric data
that is constrained in any way.
For more information, see "What data can I test using Benford analysis?"
on page 1683
LEADING n The number of leading digits to analyze. The value of n must be from 1 to 6.
optional If LEADING is omitted, the default value of 1 is used.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
BOUNDS Includes computed upper and lower bound values in the output results.
optional If two or more counts in the output results exceed either of the bounds, the data may
have been manipulated and should be investigated.
Name Description
TO SCREEN | table_name The location to send the results of the command to:
| GRAPH | PRINT o SCREEN – displays the results in the Analytics display area
optional
Tip
You can click any linked result value in the display area to drill down to
the associated record or records in the source table.
By default, the table data file (.FIL) is saved to the folder containing the
Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
l TO "C:\Output.FIL"
l TO "Results\Output.FIL"
Note
Table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _
), but no other special characters, or any spaces. The name cannot
start with a number.
LOCAL Saves the output file in the same location as the Analytics project.
optional
Note
Applicable only when running the command against a server table with
an output file that is an Analytics table.
The LOCAL parameter must immediately follow the TO parameter.
HEADER header_text The text to insert at the top of each page of a report.
optional header_text must be specified as a quoted string. The value overrides the Analytics
HEADER system variable.
FOOTER footer_text The text to insert at the bottom of each page of a report.
optional footer_text must be specified as a quoted string. The value overrides the Analytics
FOOTER system variable.
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Name Description
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
APPEND Appends the command output to the end of an existing file instead of overwriting it.
optional
Note
You must ensure that the structure of the command output and the
existing file are identical:
l the same fields
l the same field order
l matching fields are the same length
l matching fields are the same data type
Analytics appends output to an existing file regardless of its structure. If
the structure of the output and the existing file do not match, jumbled,
missing, or inaccurate data can result.
OPEN Opens the table created by the command after the command executes. Only valid if the
command creates an output table.
optional
Examples
Remarks
For more information about how this command works, see "Performing Benford analysis" on
page 1387.
l any numbering scheme with a range that prevents certain numbers from appearing
l Random numbers – Numbers generated by a random number generator are not suitable for
Benford analysis.
CALCULATE command
Calculates the value of one or more expressions.
Syntax
CALCULATE expression <AS result_label> <,...n>
Parameters
Name Description
AS result_label The name of the result when displayed on screen and in the Analytics command log.
optional result_label must be a quoted string or a valid character expression.
If omitted, the expression being calculated is used as the result name.
Examples
Remarks
How it works
CALCULATE provides the functionality of a calculator combined with access to Analytics functions,
variables, and the data in the currently selected record.
Command output
Depending on where you run CALCULATE, the results are output to different locations:
l From the command line – the result is displayed on screen
l From within a script – the result is recorded in the log
The result_label value is not a variable that you can use in a script. It is only used to identify the
calculation on screen or in the log.
CALCULATE 365/52/7
Returns 1.0027:
CALCULATE 365.0000/52/7
CLASSIFY command
Groups records based on identical values in a character or numeric field. Counts the number of
records in each group, and also subtotals specified numeric fields for each group.
Syntax
CLASSIFY <ON> key_field <SUBTOTAL numeric_field <...n>|SUBTOTAL ALL <EXCLUDE
numeric_field <...n>>> <INTERVALS number> <SUPPRESS> <TO {SCREEN|table_
name|GRAPH|PRINT}> <LOCAL> <IF test> <WHILE test> <FIRST range|NEXT range>
<HEADER header_text> <FOOTER footer_text> <KEY break_field> <OPEN> <APPEND>
<STATISTICS>
Parameters
Name Description
SUBTOTAL numeric_field One or more numeric fields or expressions to subtotal for each group.
<...n> | SUBTOTAL ALL
Multiple fields must be separated by spaces. Specify ALL to subtotal all the numeric
optional fields in the table.
Name Description
If INTERVALS is omitted, a group is created for each set of identical values in the field
being classified.
Note
This parameter is not available in the Analytics user interface and can
only be used as part of ACLScript syntax in a script or the command line.
SUPPRESS Note
optional Cannot be used unless INTERVALS is also specified. SUPPRESS is not
available in the Analytics user interface and can only be used as part of
ACLScript syntax in a script or the command line.
Excludes sets of identical values exceeding the maximum specified by INTERVALS from
the command output.
TO SCREEN | table_name The location to send the results of the command to:
| GRAPH | PRINT o SCREEN – displays the results in the Analytics display area
Tip
You can click any linked result value in the display area to drill down to
the associated record or records in the source table.
By default, the table data file (.FIL) is saved to the folder containing the
Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
l TO "C:\Output.FIL"
l TO "Results\Output.FIL"
Note
Table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _
), but no other special characters, or any spaces. The name cannot
start with a number.
LOCAL Saves the output file in the same location as the Analytics project.
optional
Note
Applicable only when running the command against a server table with
an output file that is an Analytics table.
The LOCAL parameter must immediately follow the TO parameter.
Name Description
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
HEADER header_text The text to insert at the top of each page of a report.
optional header_text must be specified as a quoted string. The value overrides the Analytics
HEADER system variable.
FOOTER footer_text The text to insert at the bottom of each page of a report.
optional footer_text must be specified as a quoted string. The value overrides the Analytics
FOOTER system variable.
KEY break_field The field or expression that groups subtotal calculations. A subtotal is calculated each
time the value of break_field changes.
optional
break_field must be a character field or expression. You can specify only one field, but
you can use an expression that contains more than one field.
OPEN Opens the table created by the command after the command executes. Only valid if the
command creates an output table.
optional
APPEND Appends the command output to the end of an existing file instead of overwriting it.
optional
Name Description
Note
You must ensure that the structure of the command output and the
existing file are identical:
l the same fields
l the same field order
l matching fields are the same length
l matching fields are the same data type
Analytics appends output to an existing file regardless of its structure. If
the structure of the output and the existing file do not match, jumbled,
missing, or inaccurate data can result.
STATISTICS Note
optional Cannot be used unless SUBTOTAL is also specified.
Calculates average, minimum, and maximum values for all SUBTOTAL fields.
Examples
OPEN Ar
CLASSIFY ON Customer_Number SUBTOTAL Trans_Amount TO "Customer_
total.FIL"
OPEN Ar
CLASSIFY ON Customer_Number SUBTOTAL Trans_Amount TO "Customer_stat-
s.FIL" STATISTICS
OPEN Ap_Trans
CLASSIFY ON Invoice_Amount TO "Grouped_invoice_amounts.FIL" OPEN
SET FILTER TO COUNT > 1
Remarks
For more information about how this command works, see "Classifying data" on page 1331.
How it works
CLASSIFY groups records that have the same value in a character or numeric field.
Output contains a single record for each group, with a count of the number of records in the source
table that belong to the group.
Subtotal field subtotaled field name in source Total + subtotaled alternate column title in source
table table
Average field a_subtotaled field name in Average + subtotaled alternate column title in
source table source table
Minimum field m_subtotaled field name in Minimum + subtotaled alternate column title in
source table source table
Maximum field x_subtotaled field name in Maximum + subtotaled alternate column title in
source table source table
CLOSE command
Closes an Analytics table, index file, or log file, or ends a Script Recorder session.
Syntax
CLOSE <table_name|PRIMARY|SECONDARY|INDEX|LOG|LEARN>
Parameters
Name Description
Examples
CLOSE Inventory
CLOSE SECONDARY
Remarks
When to use CLOSE
You typically do not need to close Analytics tables. The active Analytics table automatically closes
when you open another table. The primary table also closes automatically before the OPEN or QUIT
commands execute.
You cannot use CLOSE to close an Analytics project. Use QUIT instead.
CLUSTER command
Groups records into clusters based on similar values in one or more numeric fields. Clusters can be
uni-dimensional or multidimensional.
Note
The CLUSTER command is not supported if you are running Analytics on a 32-bit
computer. The computation required by the command is processor-intensive and
better suited to 64-bit computers.
Syntax
CLUSTER ON key_field <...n> KVALUE number_of_clusters ITERATIONS number_of_
iterations INITIALIZATIONS number_of_initializations <SEED seed_value>
<OTHER field < ...n>|OTHER ALL> TO table_name <IF test> <WHILE test> <FIRST
range|NEXT range> OPEN {no_keyword|NOCENTER|NOSCALE}
Parameters
Name Description
ON key_field <...n> One or more numeric fields to cluster. Multiple fields must be separated by spaces.
ITERATIONS number_of_ The maximum number of times the cluster calculation is re-performed.
iterations
SEED seed_value The seed value to use to initialize the random number generator in Analytics.
optional If you omit SEED, Analytics randomly selects the seed value.
OTHER field <...n> | One or more additional fields to include in the output.
OTHER ALL o OTHER field <...n> – include the specified field or fields
optional
Fields are included in the order that you list them.
Name Description
Note
Key fields are automatically included in the output table, although the
values are scaled unless you specify NOSCALE. You can use OTHER to
include a second, unscaled instance of a key field or fields.
By default, the table data file (.FIL) is saved to the folder containing the
Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
l TO "C:\Output.FIL"
l TO "Results\Output.FIL"
Note
Table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _
), but no other special characters, or any spaces. The name cannot
start with a number.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
Name Description
If you omit FIRST and NEXT, all records are processed by default.
OPEN Opens the table created by the command after the command executes. Only valid if the
command creates an output table.
optional
no_keyword | NOCENTER The method for preprocessing key field numeric values before calculating the clusters.
| NOSCALE o no_keyword – center key field values on a mean of zero (0), and scale them by
dividing by their standard deviation, a process that converts the values to their z-score
equivalent (standard score)
o NOCENTER – scale key field values by dividing by their standard deviation, but do
not center them on a mean of zero (0)
o NOSCALE – use the raw key field values, uncentered and unscaled
For more information, see "Specify a data preprocessing method" on page 1383.
Examples
OPEN Ar
CLUSTER ON Invoice_Amount KVALUE 8 ITERATIONS 30 INITIALIZATIONS 10
OTHER No Due Date Ref Type TO "Clustered_invoices" NOSCALE
As a quick way of discovering how many records are contained in each output cluster, you
classify the Clustered_invoices output table on the Cluster field.
OPEN Clustered_invoices
CLASSIFY ON Cluster TO SCREEN
Remarks
For more information about how this command works, see "Clustering data" on page 1377.
COMMENT command
Adds an explanatory note to a script without affecting processing.
Syntax
Single-line comments
COMMENT comment_text
Multiline comments
COMMENT
comment_text
<...n>
<END>
Note
Do not use a caret character ^ to preface lines of comment text. The caret has a
special use in the .acl project file, and comment text is not saved if you preface it with
a caret.
Parameters
Name Description
Examples
Single-line comments
You use single-line comments before commands to add documentation for future users who
will maintain the script:
Multiline comment
You begin each script you write with a multiline comment that explains the purpose of the
script:
COMMENT
This analytic identifies multiple records having common
transaction originator IDs (like vendor ID or merchant ID)
where the transaction date values are either equal or one day apart.
This analytic can be used for split invoices, split purchase orders,
split requisitions, and split corporate card transactions.
END
Remarks
When to use COMMENT
Use COMMENT to include information about the purpose of a script, the logic used, and other
information such as the required inputs for the script and the purpose of each variable you define.
The comments in a script are written to the Analytics command log each time the script runs.
COUNT command
Counts the total number of records in the current view, or only those records that meet the specified
condition.
Syntax
COUNT <IF test> <WHILE test> <FIRST range|NEXT range>
Parameters
Name Description
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
Examples
Storing COUNT1
The result of the COUNT command is stored in the COUNT1 output variable. You can
retrieve and store this value in a user-defined variable.
The COUNT command overwrites the COUNT1 variable each time it is executed, so the
value needs to be stored in a user-defined variable before the command is executed for the
second time after the filter is applied to the table:
OPEN CustomerAddress
COUNT
TotalRec = COUNT1
SET FILTER TO ModifiedDate > '20100101'
COUNT
TotalFilteredRec = COUNT1
Remarks
When to use COUNT
Use the COUNT command to count the number of records in an Analytics table, or to count the
number of records that meet a particular test condition. If no test is specified, the total number of
Syntax
CREATE LAYOUT layout_name WIDTH characters <RECORD 0|RECORD 1>
Parameters
Name Description
RECORD 0 | RECORD 1 o If you specify RECORD 0, or omit this parameter, the table layout is created without any
records or a source data file.
optional o If you specify RECORD 1 the table layout is created with a single empty record and a
source data file named layout_name.fil.
Examples
Remarks
The empty table layout is created with a single character field called Field_1. The field length is the
same as the record length you specify with WIDTH.
CROSSTAB command
Groups records based on identical combinations of values in two or more character or numeric
fields, and displays the resulting groups in a grid of rows and columns. Counts the number of
records in each group, and also subtotals specified numeric fields for each group.
Syntax
CROSSTAB {ON row_field <...n>|ON ALL <EXCLUDE field_name <...n>>} COLUMNS
column_field <SUBTOTAL numeric_field <...n>|SUBTOTAL ALL <EXCLUDE numeric_
field <...n>>> TO {SCREEN|table_name|filename|GRAPH|PRINT} <LOCAL> <IF test>
<WHILE test> <FIRST range|NEXT range> <APPEND> <COUNT> <OPEN> <HEADER
header_text> <FOOTER footer_text>
Parameters
Name Description
ON row_field <...n> | ON One or more character or numeric fields or expressions to use for rows in the resulting
ALL grid of rows and columns.
o ON row_field <...n> – use the specified field or fields
Multiple fields must be separated by spaces, and can be different data types.
If you use more than one field, fields are included in the order that you list them.
o ON ALL – use all fields in the table
If you use all fields, fields are included in the order that they appear in the table layout.
COLUMNS column_field The character or numeric field or expression to use for columns in the resulting grid of
rows and columns. You can specify only one field or expression for the columns.
SUBTOTAL numeric_field One or more numeric fields or expressions to subtotal for each group.
Name Description
<...n> | SUBTOTAL ALL Multiple fields must be separated by spaces. Specify ALL to subtotal all the numeric
fields in the table.
optional
TO SCREEN | table_name The location to send the results of the command to:
| filename | GRAPH o SCREEN – displays the results in the Analytics display area
| PRINT
Tip
You can click any linked result value in the display area to drill down to
the associated record or records in the source table.
By default, the table data file (.FIL) is saved to the folder containing the
Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
l TO "C:\Output.FIL"
l TO "Results\Output.FIL"
Note
Table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _
), but no other special characters, or any spaces. The name cannot
start with a number.
By default, the file is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the file to a different, existing folder:
l TO "C:\Output.TXT"
l TO "Results\Output.TXT"
o GRAPH – displays the results in a graph in the Analytics display area
o PRINT – sends the results to the default printer
LOCAL Saves the output file in the same location as the Analytics project.
Name Description
optional Note
Applicable only when running the command against a server table with
an output file that is an Analytics table.
The LOCAL parameter must immediately follow the TO parameter.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
APPEND Appends the command output to the end of an existing file instead of overwriting it.
optional
Note
You must ensure that the structure of the command output and the
existing file are identical:
l the same fields
l the same field order
l matching fields are the same length
l matching fields are the same data type
Analytics appends output to an existing file regardless of its structure. If
the structure of the output and the existing file do not match, jumbled,
missing, or inaccurate data can result.
COUNT Includes record counts as columns. Counts are useful when you use SUBTOTAL.
optional Counts are automatically included if you do not select any subtotal fields.
OPEN Opens the table created by the command after the command executes. Only valid if the
command creates an output table.
optional
Name Description
HEADER header_text The text to insert at the top of each page of a report.
optional header_text must be specified as a quoted string. The value overrides the Analytics
HEADER system variable.
FOOTER footer_text The text to insert at the bottom of each page of a report.
optional footer_text must be specified as a quoted string. The value overrides the Analytics
FOOTER system variable.
Examples
OPEN Ar
CROSSTAB ON Customer_Number COLUMNS Trans_Type SUBTOTAL Trans_Amount
COUNT TO SCREEN
OPEN Ar
CROSSTAB ON Trans_Amount COLUMNS Trans_Type TO SCREEN
Remarks
For more information about how this command works, see "Cross-tabulating data" on page 1350.
How it works
CROSSTAB groups records that have the same combination of values in two or more character or
numeric fields.
The output contains a grid of rows and columns similar to a pivot table. It includes a single row-
column intersection for each group, with a count of the number of records in the source table that
belong to the group.
CVSEVALUATE command
For classical variables sampling, provides four different methods for projecting the results of sample
analysis to the entire population.
Syntax
CVSEVALUATE BOOKED book_value_field AUDITED audit_value_field ETYPE
{MPU|DIFFERENCE|RATIO SEPARATE|RATIO COMBINED|ALL} STRATA boundary_value
<,...n> POPULATION stratum_count, stratum_book_value <,...n> CONFIDENCE con-
fidence_level CUTOFF value, certainty_stratum_count, certainty_stratum_book_
value ERRORLIMIT number PLIMIT {BOTH|UPPER|LOWER} <BCUTOFF value, certainty_
stratum_count, certainty_stratum_book_value> <TO {SCREEN|filename}>
Parameters
Note
If you are using the output results of the CVSPREPARE and
CVSSAMPLE commands as input for the CVSEVALUATE command, a number of
the parameter values are already specified and stored in variables. For more
information, see "CVSPREPARE command" on page 1715 and "CVSSAMPLE
command" on page 1720.
Do not include thousands separators, or percentage signs, when you specify values.
Name Description
BOOKED book_value_ The numeric book value field to use in the evaluation.
field
AUDITED audit_value_ The numeric audit value field to use in the evaluation.
field
Name Description
STRATA boundary_value The upper boundary values to use for stratifying the book_value_field.
<,...n>
POPULATION stratum_ The number of records and the total value for each stratum in the book_value_field.
count, stratum_value
<,...n>
CONFIDENCE The confidence level used during the preparation stage of the classical variables sample.
confidence_level
CUTOFF value, certainty_ o value – the top certainty stratum cutoff value used during the preparation and
stratum_count, certainty_ sampling stage of the classical variables sample
stratum_book_value o certainty_stratum_count – the number of records in the top certainty stratum
o certainty_stratum_book_value – the total book value of the records in the top
certainty stratum
ERRORLIMIT number The minimum number of errors you expect in the sample.
Note
If the actual number of errors you found when you analyzed the sample is
less than the ERRORLIMIT number, the only evaluation method
available is mean-per-unit.
BCUTOFF o value – the bottom certainty stratum cutoff value used during the preparation and
value, certainty_stratum_ sampling stage of the classical variables sample
count, certainty_stratum_ o certainty_stratum_count – the number of records in the bottom certainty stratum
book_value o certainty_stratum_book_value – the total book value of the records in the bottom
certainty stratum
optional
TO SCREEN | filename The location to send the results of the command to:
o SCREEN – displays the results in the Analytics display area
Tip
You can click any linked result value in the display area to drill down to
the associated record or records in the source table.
By default, the file is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the file to a different, existing folder:
l TO "C:\Output.TXT"
Name Description
l TO "Results\Output.TXT"
Examples
Remarks
For more information about how this command works, see "Evaluating errors in a classical variables
sample" on page 1151.
Guidelines
The guidelines below help you select an estimation type.
Tip
If you want to compare the results produced by different estimation types, you can
specify ETYPE ALL to include all estimation types in the evaluation output.
CVSPREPARE command
Stratifies a population, and calculates a statistically valid sample size for each stratum, for classical
variables sampling.
Syntax
CVSPREPARE ON book_value_field NUMSTRATA number MINIMUM minimum_strata_
sample_size PRECISION value CONFIDENCE confidence_level <CUTOFF value>
<BCUTOFF value> NCELLS number PLIMIT {BOTH|UPPER|LOWER} ERRORLIMIT number
<IF test> <MINSAMPSIZE minimum_sample_size> TO {SCREEN|filename}
Parameters
Note
Do not include thousands separators, or percentage signs, when you specify values.
Name Description
ON book_value_field The numeric book value field to use as the basis for preparing the classical variables
sample.
NUMSTRATA number The number of strata to use for numerically stratifying the book_value_field.
The minimum number of strata is 1, and the maximum is 256.
If you specify NUMSTRATA 1, and do not specify a CUTOFF, the population is unstratified
prior to drawing a sample.
Note
The number of strata cannot exceed 50% of the number of cells specified
for NCELLS.
MINIMUM minimum_ The minimum number of records to sample from each stratum.
strata_sample_size
Leave the default of zero (0) if you do not have a specific reason for specifying a
minimum number.
PRECISION value The monetary amount that is the difference between the tolerable misstatement and the
expected misstatement in the account.
o Tolerable misstatement – the maximum total amount of misstatement that can occur
Name Description
CONFIDENCE The desired confidence level that the resulting sample is representative of the entire
confidence_level population.
For example, specifying 95 means that you want to be confident that 95% of the time the
sample will in fact be representative. Confidence is the complement of "sampling risk". A
95% confidence level is the same as a 5% sampling risk.
o If PLIMIT is BOTH, the minimum confidence level is 10%, and the maximum is 99.5%.
o If PLIMIT is UPPER or LOWER, the minimum confidence level is 55%, and the maximum is
99.5%.
NCELLS number The number of cells to use for pre-stratifying the book_value_field.
Cells are narrower numeric divisions than strata. Pre-stratification is part of an internal
process that optimizes the position of strata boundaries. Cells are not retained in the final
stratified output.
The minimum number of cells is 2, and the maximum is 999.
Note
The number of cells must be at least twice (2 x) the number of strata
specified for NUMSTRATA.
Name Description
Caution
Specify BOTH if you are not sure which option to specify.
ERRORLIMIT number The minimum number of errors you expect in the sample.
Note
If the actual number of errors you find when you analyze the sample is
less than the ERRORLIMIT number, the only evaluation method
available is mean-per-unit.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Caution
If you specify a conditional expression, an identical conditional
expression must be used during both the calculation of the sample size,
and the drawing of the sample.
If you use a condition at one stage and not the other, or if the two
conditions are not identical, the sampling results will probably not be
statistically valid.
MINSAMPSIZE minimum_ The minimum number of records to sample from the entire population.
sample_size
Leave the default of zero (0) if you do not have a specific reason for specifying a
optional minimum number.
TO SCREEN | filename The location to send the results of the command to:
o SCREEN – displays the results in the Analytics display area
Tip
You can click any linked result value in the display area to drill down to
the associated record or records in the source table.
By default, the file is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the file to a different, existing folder:
l TO "C:\Output.TXT"
l TO "Results\Output.TXT"
S_TOP The top certainty stratum cutoff value specified by the user, or if none was specified, the
upper boundary of the top stratum calculated by the command.
SBOTTOM The bottom certainty stratum cutoff value specified by the user, or if none was specified,
the lower boundary of the bottom stratum calculated by the command.
SBOUNDARY All strata upper boundaries calculated by the command. Does not include top or bottom
certainty strata.
SPOPULATION The count of the number of records in each stratum, and the total monetary value for
each stratum. Does not include top or bottom certainty strata.
SSAMPLE The sample size for each stratum calculated by the command. Does not include top or
bottom certainty strata.
Examples
Using your specified confidence level, the example below stratifies a table based on the
invoice_amount field, and calculates the sample size for each stratum and the top certainty
stratum:
Remarks
For more information about how this command works, see "Preparing a classical variables sample"
on page 1132.
CVSSAMPLE command
Syntax
CVSSAMPLE ON book_value_field NUMSTRATA number <SEED seed_value> CUTOFF
value <BCUTOFF value> STRATA boundary_value <,...n> SAMPLESIZE number
<,...n> POPULATION stratum_count, stratum_value <,...n> <IF test> TO table_
name
Parameters
Note
If you are using the output results of the CVSPREPARE command as input for the
CVSSAMPLE command, a number of the parameter values are already specified
and stored in variables. For more information, see "CVSPREPARE command" on
page 1715.
Do not include thousands separators, or percentage signs, when you specify values.
Name Description
ON book_value_field The numeric book value field to use as the basis for the sample.
NUMSTRATA number The number of strata to use for stratifying the book_value_field.
SEED seed_value The seed value to use to initialize the random number generator in Analytics.
optional If you omit SEED, Analytics randomly selects the seed value.
STRATA boundary_value The upper boundary values to use for stratifying the book_value_field.
Name Description
<,...n>
POPULATION stratum_ The number of records in each stratum, and the total value for each stratum.
count, stratum_value
<,...n>
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Caution
If you specify a conditional expression, an identical conditional
expression must be used during both the calculation of the sample size,
and the drawing of the sample.
If you use a condition at one stage and not the other, or if the two
conditions are not identical, the sampling results will probably not be
statistically valid.
By default, the table data file (.FIL) is saved to the folder containing the
Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
l TO "C:\Output.FIL"
l TO "Results\Output.FIL"
Note
Table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _
), but no other special characters, or any spaces. The name cannot
start with a number.
S_TOPEV The top certainty stratum cutoff value specified by the user, or if none was specified, the
upper boundary of the top stratum previously calculated by the CVSPREPARE
command.
Also stores the count of the number of records in the top certainty stratum, and their total
Name Contains
monetary value.
SBOTTOMEV The bottom certainty stratum cutoff value specified by the user, or if none was specified,
the lower boundary of the bottom stratum previously calculated by the CVSPREPARE
command.
Also stores the count of the number of records in the bottom certainty stratum, and their
total monetary value.
SBOUNDARYEV All strata upper boundaries prefilled by the command, or specified by the user. Does not
include top or bottom certainty strata.
SPOPULATION The count of the number of records in each stratum, and the total monetary value for
each stratum. Does not include top or bottom certainty strata.
Examples
Remarks
For more information about how this command works, see "Performing classical variables sampling"
on page 1143.
System-generated fields
Analytics automatically generates four fields and adds them to the sample output table. For each
record included in the sample, the fields contain the following descriptive information:
l STRATUM – the number of the stratum to which the record is allocated
l ORIGIN_RECORD_NUMBER – the original record number in the source data table
l SELECTION_ORDER – on a per-stratum basis, the order in which the record was randomly
selected
l SAMPLE_RECORD_NUMBER – the record number in the sample output table
Syntax
DEFINE COLUMN view_name field_name <AS display_name> <POSITION n> <WIDTH
characters> <PIC format> <SORT|SORT D> <KEY> <PAGE> <NODUPS> <NOZEROS> <LINE
n>
Parameters
Name Description
AS display_name The display name (alternate column title) for the field in the view. If you want the display
name to be the same as the field name do not use AS.
optional
Specify display_name as a quoted string. Use a semi-colon (;) between words if you want
a line break in the column title.
POSITION n The position of the column in the view numerically from left to right:
optional o if omitted, the column is placed as the rightmost column at the time that the column is
added
o if a position number is missing, column positions are adjusted so that the columns are
positioned sequentially
o if a position number is already in use, the new column is placed to the left of the
column already using the position number
Name Description
Note
The characters specified by WIDTH are fixed-width characters. Every
character is allotted the same amount of space, regardless of the width of
the actual character.
By default, views in Analytics use a proportional width font that does not
correspond with fixed-width character spacing.
If you want a one-to-one correspondence between the WIDTH value and
the characters in the view, you can change the Proportional Font setting
in the Options dialog box to a fixed-width font such as Courier New.
o numeric fields – the display format of numeric values in Analytics views and reports
o datetime fields – the physical format of datetime values in the source data (order of
date and time characters, separators, and so on)
Note
For datetime fields, format must exactly match the physical format in
the source data. For example, if the source data is 12/31/2014, you
must enter the format as "MM/DD/YYYY".
KEY The column is designated as a break field in reports. Reports are subtotaled and
subdivided when the value of the column changes. The following restrictions apply to
optional
break fields:
o must be a character field or expression
o if a break field is set in the view, it must be the leftmost column
o the last column in the view cannot be a break field
o if you have more than one break field, all of the columns to the left of any additional
break field must also be break fields
PAGE Inserts a page break each time the value in the break field changes.
optional
Name Description
LINE n The number of lines in the column. If no value is specified, the column defaults to a single
line. The value of n must be between 2 and 60.
optional
Examples
OPEN Ar
DEFINE VIEW AR_Report OK
DEFINE COLUMN AR_Report No AS "Customer Number" WIDTH 7 KEY
DEFINE COLUMN AR_Report Date AS "Invoice Date" WIDTH 10
DEFINE COLUMN AR_Report Due AS "Due Date" WIDTH 10
DEFINE COLUMN AR_Report Reference AS "Reference Number" WIDTH 6
DEFINE COLUMN AR_Report Type AS "Transaction Type" WIDTH 5
DEFINE COLUMN AR_Report Amount AS "Transaction Amount" WIDTH 12 PIC "-
9999999999.99"
Syntax
DEFINE FIELD field_name data_type start_position length <decimals|date_
format> <NDATETIME> <PIC format> <AS display_name> <WIDTH characters>
<SUPPRESS> <field_note>
Parameters
Name Description
Note
Field names are limited to 256 upper and lowercase alphanumeric
characters. The name can include the underscore character ( _ ), but no
other special characters, or any spaces. The name cannot start with a
number.
Analytics has a number of reserved keywords that cannot be used as
field names. For a complete list, see "Reserved keywords" on page 1435.
data_type The data type to use when interpreting the data. For a list of supported data types, see
"Supported data types" on page 1733.
For example, invoice numbers may be stored as numeric values in the data source. To
treat these values as strings rather than numbers, you can define the field as character
data instead.
start_position The starting byte position of the field in the Analytics data file.
Name Description
Note
Note
NDATETIME Date, datetime, or time values stored in a numeric field are treated as datetime data.
optional NDATETIME requires that you also specify the source datetime format using PIC format.
o numeric fields – the display format of numeric values in Analytics views and reports
o datetime fields – the physical format of datetime values in the source data (order of
date and time characters, separators, and so on)
Note
For datetime fields, format must exactly match the physical format in
the source data. For example, if the source data is 12/31/2014, you
must enter the format as "MM/DD/YYYY".
Name Description
AS display_name The display name (alternate column title) for the field in the view. If you want the display
name to be the same as the field name do not use AS.
optional
Specify display_name as a quoted string. Use a semi-colon (;) between words if you want
a line break in the column title.
Note
The characters specified by WIDTH are fixed-width characters. Every
character is allotted the same amount of space, regardless of the width of
the actual character.
By default, views in Analytics use a proportional width font that does not
correspond with fixed-width character spacing.
If you want a one-to-one correspondence between the WIDTH value and
the characters in the view, you can change the Proportional Font setting
in the Options dialog box to a fixed-width font such as Courier New.
field_note Field note text that is added to the field definition in the table layout.
optional field_note must be last, after all other required and optional parameters. The text cannot
be multiline. Quotation marks are not required.
Examples
non-Unicode Analytics
l Starts at: byte 12 (character position 12)
l Length: 24 bytes (24 characters)
From source character data, the first two examples below define a datetime field called
Transaction_date. In the source data, the date format is DD/MM/YYYY. No column title is
specified, so the column title defaults to using the field name.
l Starts at: byte 20
l Length: 10 bytes
Here, the date format is specified using date_format:
When defining datetime fields that include time data, you must use PIC format,
The example below defines a datetime field called email_timestamp. In the source data, the
datetime format is YYYY/MM/DD hh:mm:ss-hh:mm.
l Starts at: byte 1
l Length: 25 bytes
From source numeric data, defines a numeric field called Receipt_timestamp that has the
specified datetime format in the source data.
The NDATETIME parameter allows datetime values stored in the numeric field to be treated
as datetime data by Analytics.
l Starts at: byte 15
l Length: 15 bytes
l Decimal places: 6
Remarks
For more information about how this command works, see "Defining physical fields" on page 788.
Character ASCII
CUSTOM
EBCDIC
NOTE
PCASCII
UNICODE
Numeric ACCPAC
ACL
BASIC
BINARY
FLOAT
HALFBYTE
IBMFLOAT
MICRO
NUMERIC
PACKED
UNISYS
UNSIGNED
VAXFLOAT
ZONED
Datetime DATETIME
Logical LOGICAL
Syntax
To define a computed field:
Note
Multiline syntax must be structured exactly as shown in the generic syntax above
and the examples below.
Parameters
Name Description
Note
Field names are limited to 256 upper and lowercase alphanumeric
characters. The name can include the underscore character ( _ ), but no
other special characters, or any spaces. The name cannot start with a
number.
Analytics has a number of reserved keywords that cannot be used as
field names. For a complete list, see "Reserved keywords" on page 1435.
expression A valid Analytics expression that defines the value of the computed field.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
STATIC The field displays the same value on every line of the table until a new value is
encountered.
optional
For example, if there is a Last Name field in the source data where:
o the first record displays the value "Smith"
o the next five records display blank lines
o the seventh record displays the value "Wong"
In this case, "Smith" displays on six consecutive lines, then "Wong" displays on the
seventh line.
AS display_name The display name (alternate column title) for the field in the view. If you want the display
name to be the same as the field name do not use AS.
optional
Specify display_name as a quoted string. Use a semi-colon (;) between words if you want
a line break in the column title.
Name Description
Note
The characters specified by WIDTH are fixed-width characters. Every
character is allotted the same amount of space, regardless of the width of
the actual character.
By default, views in Analytics use a proportional width font that does not
correspond with fixed-width character spacing.
If you want a one-to-one correspondence between the WIDTH value and
the characters in the view, you can change the Proportional Font setting
in the Options dialog box to a fixed-width font such as Courier New.
field_note Field note text that is added to the field definition in the table layout.
optional field_note must be last, after all other required and optional parameters. The text cannot
be multiline. Quotation marks are not required.
Note
The decimal precision of all numeric computed values is controlled by the
precision of default_value. For example, if you specify a default value of
0.00, all computed values are calculated to two decimal places, and
rounded if necessary. For greater precision, increase the number of
decimal places in default_value.
Examples
Note
The second line must be left blank because there are no optional parameters.
Note
When you specify optional parameters, do not leave any lines blank.
Remarks
For more information about how this command works, see "Defining computed fields" on page 795.
In addition to a default value, conditional computed fields require at least one conditional value. You
must use the following multiline syntax to define a conditional computed field:
l optional parameters appear on the second line
l if there are no optional parameters, the second line must be left blank
l the first condition statement appears on the third line
l each additional condition statement requires a separate line
l the default value appears on the last line
Note
You can relate up to 18 Analytics tables and access and analyze data from any
combination of fields in the related tables as if they existed in a single table. You
must specify a separate DEFINE RELATION command for each pair of related
tables.
Syntax
DEFINE RELATION key_field WITH related_table_name INDEX index_name <AS rela-
tion_name>
Parameters
Name Description
Note
When creating relations between parent tables and grandchild tables,
you must specify a fully qualified key field name in the format table_
name.field_name.
In "Relate three tables" on the next page, see: Vouchers.created_by
INDEX index_name The name of the index for the key field in the related table.
You must index the related table on the key field before you can relate the table.
Examples
Customer_on_CustNum is the name of the child table index on the key field. A child table
index is required when you relate tables.
If the child table index does not already exist when you run the DEFINE RELATION
command, an error message appears and the relation is not performed.
Tip
If you define a relation in the Analytics user interface, the child table index is
automatically created for you.
OPEN Customer
INDEX ON CustNum TO Customer_on_CustNum
Open Ar
DEFINE RELATION CustNum WITH Customer INDEX Customer_on_CustNum
OPEN Vouchers
INDEX ON voucher_number TO "Vouchers_on_voucher_number"
OPEN Vouchers_items
DEFINE RELATION voucher_number WITH Vouchers INDEX Vouchers_on_
voucher_number
OPEN Employees
INDEX ON employee_number TO "Employees_on_employee_number"
OPEN Vouchers_items
DEFINE RELATION Vouchers.created_by WITH Employees INDEX Employees_on_
employee_number
Note
Vouchers.created_by is available as a key field in the second relation
because you already related Vouchers_items and Vouchers in the first
relation.
Remarks
For more information about how this command works, see "Relating tables" on page 1001.
Syntax
DEFINE REPORT view_name
Parameters
Name Description
Examples
Syntax
DEFINE TABLE DB {SOURCE database_profile <PASSWORD num> <PASSWORD num> |
SERVER server_profile <PASSWORD num>} <FORMAT format_name> SCHEMA schema
<TITLED acl_table_name> <PRIMARY|SECONDARY> DBTABLE db_tablename FIELDS
{field_names|ALL} <...n> <WHERE condition> <ORDER field_names>
Parameters
SOURCE The Analytics database profile to use to access the database engine.
database_
Database profiles include information required to connect to the database engine, including:
profile
o a reference to the associated server profile
o the database type
o the database name
o user account information
Note
DEFINE TABLE DB supports connecting to only the following databases: Microsoft
SQL Server, Oracle, or DB2.
Note
Analytics supports a maximum length of 30 characters when specifying or entering a
server profile password, a database profile password, or a mail server password.
Specifying a password value that exceeds the length results in a truncated password
and a connection failure.
FORMAT The name of an Analytics table, or table layout file (.layout), with a table layout that you want to use.
format_
name
optional
SCHEMA The schema to connect to. You must enclose the schema name in quotation marks.
schema
PRIMARY | Use the table as either a primary or secondary table in multi-file commands. If neither option is
SECONDA- specified, the default value of PRIMARY is used.
RY
optional
DBTABLE The database table that you want to access. database_table must be a quoted string.
database_
table
Note
Using AX Connector, you can access an unlimited number of related tables, but no
more than five is recommended. Processing time increases when you access multiple
tables.
WHERE An SQL WHERE clause that limits the data to those records that meet the specified condition.
condition
You must use valid SQL syntax entered as a quoted string.
optional
When you join tables, Analytics displays the condition of the join in the WHERE clause:
"Table_1.First_name = Table_2.First_name"
ORDER The fields the database engine uses to sort records. field_names must be a quoted string.
field_names
The command takes longer to run when sorting records. Only use ORDER when sorting is important.
optional
Examples
Example
You want to access data from a Microsoft SQL Server database via AX Connector. To do this,
you use the DEFINE TABLE DB command. You include the SOURCE parameter to connect
to AX Connector through a database profile:
Remarks
How it works
The Analytics server table is defined as a query that uses a database profile to connect to a
database table.
Using SET SUPPRESSTIME ON is for pre-version-10.0 Analytics scripts that assume the time
portion of datetime values will be truncated. If SET SUPPRESSTIME ON is not added to these
scripts, they cannot run in the datetime-enabled version of Analytics.
For more information, see the "SET SUPPRESSTIME" section in "SET command" on page 2102.
Syntax
DEFINE VIEW view_name <RLINES n> <ALL> <SUPPRESS> <SUMMARIZED> <IF test>
<WHILE test> <HEADER header_text> <FOOTER footer_text> <TO report_file_name
<HTML>> <OK>
Parameters
Name Description
Note
View names are limited to 64 alphanumeric characters. The name can
include the underscore character ( _ ), but no other special characters, or
any spaces. The name cannot start with a number.
RLINES n The line spacing for detail records in views and reports. By default, detail lines are single
spaced.
optional
ALL All fields in the active Analytics table layout are added to the view.
optional
SUPPRESS Suppresses blank detail lines in reports generated from the view. When the report is
generated the blank detail lines will be omitted from the output. This option applies to
optional
reports based on multiline views.
SUMMARIZED Specifies that reports generated from the view should include subtotals and totals, but
not include the detail lines.
optional
The subtotals are generated based on the break fields defined in the view. If this option is
not selected, the report includes detail lines, as well as subtotals for each of the specified
break fields.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Name Description
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
HEADER header_text The text to insert at the top of each page of a report.
optional header_text must be specified as a quoted string. The value overrides the Analytics
HEADER system variable.
FOOTER footer_text The text to insert at the bottom of each page of a report.
optional footer_text must be specified as a quoted string. The value overrides the Analytics
FOOTER system variable.
TO report_filename HTML The filename and type for reports created from this view.
optional Use the HTML keyword to save reports generated from this view as HTML files (.htm). By
default, generated reports are output as ASCII text files.
Examples
Creating a view
You open the Ar table and create a view called AR_Report, which includes all of the fields in
the table layout:
OPEN Ar
DEFINE VIEW AR_Report HEADER "AR Report" ALL OK
DELETE command
Deletes an Analytics project item, a field from a table layout, a variable, one or more table history
entries, a relation between tables, or a file in a Windows folder. Also removes a column from a view.
Syntax
Purpose Syntax
To delete a file
DELETE file_name <OK>
Parameters
Name Description
Name Description
o FORMAT – the specified table layout, all its views, and its associated indexes and
relations
Any other table layouts for the associated table are retained.
The data file (.fil) associated with the table layout is not deleted unless the Delete
Data File with Table option is selected in the Table tab in the Options dialog box
(Tools > Options).
You can also use the SET DELETE_FILE {ON|OFF} command in a script or on the
command line to turn this option on or off. For more information, see "SET command"
on page 2102.
Caution
Use caution when turning on the Delete Data File with Table option.
It may be an original data file that is deleted along with the table
layout.
Data files are deleted outright. They are not sent to the Windows
Recycle Bin.
field_name ALL
Delete a field
The name of the field to delete from the current Analytics table layout.
You can delete a field from a table layout even if the field is included in the current view.
Note
You cannot delete a field referenced by a computed field unless you first
delete the computed field.
Remove a column
The name of the column to remove from the specified view.
Note
Use the physical field name, not the column display name.
Name Description
variable_name | ALL The name of the variable to delete. Use ALL to delete all variables.
If you specify ALL, all occurrences of the following types of the variables are deleted from
the project:
o system variables
o temporary user-defined variables
o permanent user-defined variables
Note
You cannot delete a variable referenced by a computed field unless you
first delete the computed field.
HISTORY retain_history_ Deletes all table history entries except for the number of most recent entries specified by
entries retain_history_entries.
Omit retain_history_entries to delete all entries.
RELATION child_table_ Deletes any relation that has no dependent relations and no related fields referenced in
name | relation_name either the active view or in an active computed field.
Use the options to specify which relation to delete:
o child_table_name – use when the relation was not specifically named (default name
when a relation is created)
o relation_name – use when the relation was specifically named when it was created.
Otherwise, use child_table_name
If you do not use either option, the last relation that was defined gets deleted.
Examples
OPEN Ar
DELETE Date
OPEN Ar
DELETE COLUMN AR_Report Date OK
DELETE COLUMN AR_Report Invoice_Date OK
DIALOG command
Creates a custom dialog box that interactively prompts users for one or more script input values.
Each input value is stored in a named variable.
Note
Using the DIALOG command to enter passwords is not secure. You should use the
"PASSWORD command" on page 2036 instead.
The DIALOG command is not supported in scripts run in Robots.
You can create a basic interactive dialog box with the "ACCEPT command" on
page 1641.
Tip
The easiest way to create custom dialog boxes is with the Dialog Builder. For more
information, see "Creating custom dialog boxes" on page 1605.
Syntax
DIALOG (DIALOG TITLE title_text WIDTH pixels HEIGHT pixels) (BUTTONSET TITLE
"&OK;&Cancel" AT x_pos y_pos <WIDTH pixels> <HEIGHT pixels> DEFAULT item_num
<HORZ>) <[label_syntax]|[text_box_syntax]|[check_box_syntax]|[radio_button_
syntax]|[drop_down_list_syntax]|[project_item_list_syntax]> <...n>
label_syntax ::=
(TEXT TITLE title_text AT x_pos y_pos <WIDTH pixels> <HEIGHT pixels>
<CENTER|RIGHT>)
text_box_syntax ::=
(EDIT TO var_name AT x_pos y_pos <WIDTH pixels> <HEIGHT pixels> <DEFAULT
string>)
check_box_syntax ::=
(CHECKBOX TITLE title_text TO var_name AT x_pos y_pos <WIDTH pixels> <HEIGHT
pixels> <CHECKED>)
radio_button_syntax ::=
(RADIOBUTTON TITLE value_list TO var_name AT x_pos y_pos <WIDTH pixels>
<HEIGHT pixels> <DEFAULT item_num> <HORZ>)
drop_down_list_syntax ::=
(DROPDOWN TITLE value_list TO var_name AT x_pos y_pos <WIDTH pixels> <HEIGHT
pixels> <DEFAULT item_num>)
project_item_list_syntax ::=
(ITEM TITLE project_item_category TO var_name AT x_pos y_pos <WIDTH pixels>
<HEIGHT pixels> <DEFAULT string>)
Parameters
General parameters
Name Description
DIALOG TITLE title_text Creates the main dialog box and the dialog box title.
title_text must be specified as a quoted string.
BUTTONSET TITLE The labels for the OK and Cancel buttons in the dialog box.
"&OK;&Cancel"
Normally, you should not edit the text values of the labels. If you do edit the values, make
sure that the positive value comes before the negative value. For example: "&Yes;&No"
WIDTH pixels The width of the individual control, or the width of the dialog box if specified for the
DIALOG control.
The value is specified in pixels. If no value is specified for a control the width is calculated
based on the longest value contained by the control.
HEIGHT pixels The height of the individual control, or the height of the dialog box if specified for the
DIALOG control.
The value is specified in pixels.
AT x_posy_pos The location of the top left corner of the control in the custom dialog box:
o x_pos is the horizontal distance in pixels from the left-hand side of the dialog box
o y_pos is the vertical distance in pixels from the top of the dialog box
DEFAULT item_num The numeric value that corresponds to the BUTTONSET value that you want to select as
the default.
For example, if the BUTTONSET values are "&OK;&Cancel", specify DEFAULT 1 to select
OK by default.
Name Description
HORZ Displays the values for the BUTTONSET control horizontally. Values are displayed
vertically by default.
optional
Note
For most of the control types, the DIALOG command creates a variable to store user
input. Do not use non-English characters, such as é , in the names of variables that
will be used in variable substitution. Variable names that contain non-English
characters cause variable substitution to fail.
By default, some of the DIALOG variables are created as character variables. If you
use a character variable to store numeric or datetime values, you must convert the
variable to the required data type in subsequent processing in a script. For more
information, see "Input data type" on page 1761.
Label parameters
Name Description
TO var_name The name of the character variable that stores the input specified by the user.
If the variable already exists, the specified value is assigned. If the variable does not
exist, it is created, and the specified value is assigned.
TO var_name The name of the logical variable that stores the True or False value specified by the user.
If the variable already exists, the specified value is assigned. If the variable does not
exist, it is created, and the specified value is assigned.
RADIOBUTTON Creates radio buttons to present mutually exclusive options to the user.
TO var_name The name of the numeric variable that stores the numeric position of the radio button
value selected by the user.
If the variable already exists, the specified value is assigned. If the variable does not
exist, it is created, and the specified value is assigned.
DEFAULT item_num The numeric value that corresponds to the list item that you want to select as the default.
optional For example, if value_list is "Red;Green;Blue", specify DEFAULT 2 to select Green by
default.
HORZ Displays the values for the control horizontally. Values are displayed vertically by default.
optional
Name Description
TO var_name The name of the character variable that stores the drop-down list value selected by the
user.
If the variable already exists, the specified value is assigned. If the variable does not
exist, it is created, and the specified value is assigned.
DEFAULT item_num The numeric value that corresponds to the list item that you want to select as the default.
optional For example, if value_list is "Red;Green;Blue", specify DEFAULT 2 to select Green by
default when the drop-down list is displayed.
ITEM Creates a project item list to present a list of Analytics project items, such as fields, to the
user.
Note
Do not mix dissimilar categories in the same ITEM control, unless you
have a reason for doing so. For example, do not mix tables and fields.
The resulting project item list is potentially confusing for the user.
TO var_name The name of the character variable that stores the name of the project item selected by
the user.
If the variable already exists, the specified value is assigned. If the variable does not
exist, it is created, and the specified value is assigned.
DEFAULT string The exact name of the project item that you want to select as the default.
optional string must be specified as a quoted string.
Examples
Additional examples
For additional DIALOG examples, see "Example script: filter records by date, and group
filtered records by month" on page 1529.
Remarks
For more information about how this command works, see "Creating custom dialog boxes" on
page 1605.
For detailed information about using variables, see "Working with variables in ACLScript" on
page 1568.
Interactivity
Use DIALOG to create an interactive script. When the DIALOG command is processed, the script
pauses and a dialog box is displayed that prompts the user for input that Analytics uses in
subsequent processing.
You can create separate dialog boxes that prompt for one item at a time, or you can create one
dialog box that prompts for multiple items.
Project categories
Code Category
f Tables
b Scripts
i Indexes
w Workspaces
Field categories
Code Category
C Character fields
N Numeric fields
D Datetime fields
L Logical fields
Variable categories
Code Category
c Character variables
n Numeric variables
d Datetime variables
l Logical variables
In the example, the start and end dates for this filter are stored as character values. They must be
converted to date values in order to be used with a date field that uses a Datetime data type.
Enclosing the variable name in percent signs (%) substitutes the character value contained by the
variable for the variable name. The CTOD( ) function then converts the character value to a date
value.
Note
You cannot use the DIALOG command inside the GROUP command.
DIRECTORY command
Generates a list of files and folders in the specified directory.
Syntax
DIRECTORY <file_spec> <SUPPRESS> <SUBDIRECTORY> <APPEND> <TO table_name|file-
name>
Parameters
Name Description
file_spec The Windows folder or files to list and display information for.
optional You can use the asterisk wildcard (*) to list all files with a particular extension, all files that
start with a particular string, or all files in a folder. For example:
o *.fil – lists all files with the .fil extension (Analytics data files)
o Inv*.* – lists all files that begin with "Inv" regardless of what file extension they have
o Results\* or Results\*.* – lists all files in the Results folder
To limit the files listed to a particular folder, you can specify a path relative to the
Analytics project folder, or specify a full path. For example:
o Results\*.* – displays the contents of the Results subfolder in the Analytics project
folder
o C:\ACL Data\Results\*.* – displays the contents of the specified folder
Note
The wildcard character cannot be used in intermediary levels of a
specified file path. It can only be used in the final level of the path, as
shown above.
Paths or file names that contain spaces must be enclosed in double
quotation marks.
If you use file_spec, it must be placed before any of the other parameters. If file_spec
appears in any other position, the DIRECTORY command is not processed and an error
is generated.
If you omit file_spec, all files in the folder containing the Analytics project are listed. You
cannot use any of the other parameters if you omit file_spec.
SUPPRESS Suppresses path information in the output, leaving only the file names and properties.
optional
Name Description
optional For example, if file_spec specifies Results\*.fil, the Results folder, and all subfolders
contained in the Results folder, are searched for .fil files.
Depending on the number of subfolders and files that need to be listed, using
SUBDIRECTORY may result in a delay while the subfolders are searched. Analytics
displays a dialog box showing progress of the command.
APPEND Appends the command output to the end of an existing file instead of overwriting it.
optional
Note
You must ensure that the structure of the command output and the
existing file are identical:
l the same fields
l the same field order
l matching fields are the same length
l matching fields are the same data type
Analytics appends output to an existing file regardless of its structure. If
the structure of the output and the existing file do not match, jumbled,
missing, or inaccurate data can result.
TO table_name | filename The location to send the results of the command to:
optional o table_name – saves the results to an Analytics table
Specify table_name as a quoted string with a .FIL file extension. For example: TO
"Output.FIL"
By default, the table data file (.FIL) is saved to the folder containing the
Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
l TO "C:\Output.FIL"
l TO "Results\Output.FIL"
Note
Table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _
), but no other special characters, or any spaces. The name cannot
start with a number.
By default, the file is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the file to a different, existing folder:
l TO "C:\Output.TXT"
l TO "Results\Output.TXT"
If you omit TO, the directory listing appears in the Analytics display area.
Examples
Different options for listing files
The ability to list files is useful for ad hoc investigation, and for incorporating in scripting.
A number of different options for listing files with the DIRECTORY command appear below.
DIRECTORY
DIRECTORY *.fil
DIRECTORY Inv*.*
DIRECTORY "Results\*"
List all the files in a specified folder and output the list
to an Analytics table
Lists all the files in the Results folder and outputs the list to an Analytics table in the folder
containing the Analytics project:
List all the files in one folder and output the list to an
Analytics table in another folder
Lists all the files in the ACL Data\Results folder and outputs the list to an Analytics table in
the GL Audit 2014\Results folder:
The new table Results_Folder_Contents is added to the open project. The associated
data file (Results_Folder_Contents.fil) is created in the specified output folder, which
may or may not be the folder containing the Analytics project.
Remarks
Properties displayed by DIRECTORY
The DIRECTORY command is similar to the DIR command in Windows. In addition to listing files
and subfolders in a folder, the DIRECTORY command also displays the following file and folder
properties:
DISPLAY command
Displays information about the specified Analytics item type. Can also display the result of an
expression, or the output of a function.
Note
A table may or may not have associated table
history.
Syntax Purpose
Examples
Displaying the layout of a table can be useful in a number of circumstances. For example, you
may want to combine two or more tables, and you need to examine field lengths and data
types.
The example below displays the layout of the Ap_Trans table:
OPEN Ap_Trans
DISPLAY
Note
If you enter DISPLAY directly in the Analytics command line, the output appears
immediately.
If you run DISPLAY in a script, double-click the corresponding DISPLAY entry in
the command log to display the output.
Output to screen
Relationship
'Vendor' related by 'Vendor_No' using index 'Vendor_on_Vendor_No'
File
'Ap_Trans.fil' (format 'Ap_Trans') is your PRIMARY file.
The record length is 59
Fields
Note
If you enter DISPLAY VARIABLES directly in the Analytics command line, the
output appears immediately.
If you run DISPLAY VARIABLES in a script, double-click the corresponding
DISPLAY VARIABLES entry in the command log to display the output.
Output to screen
TOTAL1 N 278,641.33
OUTPUTFOLDER C "/Tables/Accounts_Payable"
v_field_name C "Invoice_Amount"
v_table_name C "Ap_Trans"
DISPLAY AGE(Invoice_Date)
Remarks
Location of command results
DISPLAY run from the Analytics command line – the results are displayed on screen.
DISPLAY executed in a script – the results are written to the Analytics command log. You can
double-click the command log entry to display the results on screen.
DO REPORT command
Generates the specified Analytics report.
Syntax
DO REPORT report_name
Parameters
Name Description
Example
OPEN AP_Trans
DO REPORT Default_View
Remarks
Running DO REPORT on the command line vs in a script
The settings used to print the report depend on where you run the command:
l from the command line – the Print dialog box opens for you to select the pages to print and
configure other options for the report
l in a script – the report is printed immediately using the default settings for the report
DO SCRIPT command
Executes a secondary script, or an external script, from within an Analytics script.
Syntax
DO <SCRIPT> script_name {<IF test>|<WHILE test>}
Parameters
Name Description
SCRIPT script_name The name of the script to run. You can run secondary scripts in the Analytics project, or
external scripts stored in text files with extensions such as .aclscript, .txt. or .bat.
You can specify a file path to an external script. You must enclose the path in quotation
marks if it contains any spaces.
Note
You cannot call a script that is already running. For example, if ScriptA
calls ScriptB, ScriptB cannot call ScriptA. ScriptA is still running while it
waits for ScriptB to complete.
IF test A conditional expression that is evaluated one time to determine if the script should be
executed. If the condition evaluates to true the script runs, otherwise it does not.
optional
Cannot be used with WHILE in the same command. If both are used, WHILE is ignored
when the script is processed. A comment is entered in the log, but the script does not
stop executing.
WHILE test A conditional expression that is evaluated after the script runs to determine if the script
should be executed again. If the test evaluates to true the script runs again, otherwise it
optional
does not.
Note
If you use WHILE, ensure that your test eventually evaluates to false. If
you do not, the script enters an infinite loop. In case of an infinite loop,
press the Esc key to cancel script processing.
Cannot be used with IF in the same command. If both are used, WHILE is ignored when
the script is processed. A comment is entered in the log, but the script does not stop
executing.
Examples
Remarks
Related commands
DO SCRIPT is the equivalent of the DO BATCH command found in scripts created with earlier
releases of Analytics.
You cannot include the DO SCRIPT command inside a GROUP command.
DUMP command
Displays the contents of a file, or the current record, in hexadecimal, ASCII, and EBCDIC character
encodings.
Note
This command can only be entered in the command line. It cannot be used in scripts.
Syntax
DUMP {RECORD|file_name} <SKIP bytes> <COLUMN bytes> <HORIZONTAL>
Parameters
Name Description
Note
To display the character encodings for an Analytics table you must
specify the name of the source data file and the file extension. For
example: Ap_Trans.fil
SKIP bytes The number of bytes to bypass before the dump begins. The default is 0.
optional
The default is 16 bytes for each column in a vertical display, and 64 bytes for the single
column in a horizontal display. The maximum number of bytes you can specify is 255.
Name Description
HORIZONTAL Displays the character encodings in horizontal rows rather than in side-by-side vertical
blocks (the default).
optional
Examples
DUPLICATES command
Detects whether duplicate values or entire duplicate records exist in an Analytics table.
Syntax
DUPLICATES {<ON> key_field <D> <...n>|<ON> ALL <EXCLUDE field_name <...n>>}
<OTHER field <...n>|OTHER ALL <EXCLUDE field_name <...n>>> <UNFORMATTED>
<ADDGROUP> <PRESORT> <IF test> <WHILE test> <FIRST range|NEXT range>
<APPEND> <OPEN> <TO {SCREEN|table_name|filename|PRINT}> <LOCAL> <HEADER
header_text> <FOOTER footer_text> <ISOLOCALE locale_code>
Parameters
Name Description
ON key_field D <...n> | ON The key field or fields, or the expression, to test for duplicates.
ALL o ON key_field – use the specified field or fields
If you test by more than one field, records identified as duplicates require identical
values in every specified field.
Fields are included in the output results in the order that you list them.
Include D to sort a key field in descending order. The default sort order is ascending.
o ON ALL – use all fields in the table
If you test by all the fields in a table, records identified as duplicates must be entirely
identical.
Fields are included in the output results in the order that they appear in the table
layout.
An ascending sort order is the only option for ON ALL.
Note
Undefined portions of records are not tested.
EXCLUDE field_name Only valid when testing for duplicates using ON ALL.
optional The field or fields to exclude from the command. EXCLUDE allows you to fine-tune ON
ALL, by excluding the specified fields.
EXCLUDE must immediately follow ON ALL. For example:
Name Description
OTHER field <...n> | One or more additional fields to include in the output.
OTHER ALL o OTHER field <...n> – include the specified field or fields
optional o OTHER ALL – include all fields in the table that are not specified as key fields
UNFORMATTED Suppresses page headings and page breaks when the results are output to a file.
optional
ADDGROUP Include the Group Number field ( GROUP_NUM ) in the output table.
optional The Group Number field assigns a sequentially incremented number to each unique
group of duplicates.
Tip
The ability to reference groups of duplicates by number can be useful
when you analyze data in the output table.
PRESORT Sorts the table on the key field before executing the command.
optional
Note
You cannot use PRESORT inside the GROUP command.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
Name Description
APPEND Appends the command output to the end of an existing file instead of overwriting it.
optional
Note
You must ensure that the structure of the command output and the
existing file are identical:
l the same fields
l the same field order
l matching fields are the same length
l matching fields are the same data type
Analytics appends output to an existing file regardless of its structure. If
the structure of the output and the existing file do not match, jumbled,
missing, or inaccurate data can result.
OPEN Opens the table created by the command after the command executes. Only valid if the
command creates an output table.
optional
TO SCREEN | table_ The location to send the results of the command to:
name | filename | PRINT o SCREEN – displays the results in the Analytics display area
optional
Tip
You can click any linked result value in the display area to drill down to
the associated record or records in the source table.
By default, the table data file (.FIL) is saved to the folder containing the
Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
l TO "C:\Output.FIL"
l TO "Results\Output.FIL"
Note
Table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _
), but no other special characters, or any spaces. The name cannot
start with a number.
Name Description
By default, the file is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the file to a different, existing folder:
l TO "C:\Output.TXT"
l TO "Results\Output.TXT"
o PRINT – sends the results to the default printer
LOCAL Saves the output file in the same location as the Analytics project.
optional
Note
Applicable only when running the command against a server table with
an output file that is an Analytics table.
The LOCAL parameter must immediately follow the TO parameter.
HEADER header_text The text to insert at the top of each page of a report.
optional header_text must be specified as a quoted string. The value overrides the Analytics
HEADER system variable.
FOOTER footer_text The text to insert at the bottom of each page of a report.
optional footer_text must be specified as a quoted string. The value overrides the Analytics
FOOTER system variable.
The system locale in the format language_country. For example, to use Canadian
French, enter fr_ca.
Use the following codes:
o language – ISO 639 standard language code
o country – ISO 3166 standard country code
If you do not specify a country code, the default country for the language is used.
If you do not use ISOLOCALE, the default system locale is used.
GAPDUPn The total number of gaps, duplicates, or fuzzy duplicate groups identified by the
command.
Examples
Instead, you achieve the same result by creating a filter based on group number:
Remarks
For more information about how this command works, see "Testing for duplicates" on page 1276.
ESCAPE command
Terminates the script being processed, or all scripts, without exiting Analytics.
Note
To exit a script and also close Analytics, see "QUIT command" on page 2048.
Syntax
ESCAPE <ALL> <IF test>
Parameters
Name Description
ALL Terminates all active scripts. If omitted, the current script is terminated.
optional
IF test A test that must evaluate to true before the command is executed. If the test evaluates to
false the command does not run.
optional
Examples
COUNT
ESCAPE IF COUNT1 < 100
Remarks
When to use ESCAPE
Use ESCAPE to halt the execution of a script or subscript based on a condition, or to stop the
execution of all running scripts.
ESCAPE ALL
EVALUATE command
For record sampling or monetary unit sampling, projects errors found in sampled data to the entire
population, and calculates upper limits on deviation rate, or misstatement amount.
Record samplingMonetary unit sampling
Syntax
EVALUATE RECORD CONFIDENCE confidence_level SIZE sample_size ERRORLIMIT num-
ber_of_errors <TO {SCREEN|filename}>
Parameters
Note
Do not include thousands separators, or percentage signs, when you specify values.
Name Description
CONFIDENCE The same confidence level that you specified when you calculated the sample size.
confidence_level
Note
Specify the actual sample size as drawn, which might differ from the
sample size initially calculated by Analytics.
ERRORLIMIT number_of_ The total number of errors, or deviations, that you found in the sample.
errors
TO SCREEN | filename The location to send the results of the command to:
o SCREEN – displays the results in the Analytics display area
Tip
You can click any linked result value in the display area to drill down to
the associated record or records in the source table.
Name Description
By default, the file is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the file to a different, existing folder:
l TO "C:\Output.TXT"
l TO "Results\Output.TXT"
MLEn The Upper error limit frequency rate (computed upper deviation rate) calculated by the
command.
Examples
For a detailed explanation of how Analytics calculates values when evaluating errors, see
"Evaluating errors in a record sample" on page 1062.
Remarks
For more information about how this command works, see "Evaluating errors in a record sample" on
page 1062.
Syntax
EVALUATE MONETARY CONFIDENCE confidence_level <ERRORLIMIT book_value, mis-
statement_amount <,...n>> INTERVAL interval_value <TO {SCREEN|filename}>
Parameters
Note
Do not include thousands separators, or percentage signs, when you specify values.
Name Description
CONFIDENCE The same confidence level that you specified when you calculated the sample size.
confidence_level
ERRORLIMIT book_ All misstatement errors that you found in the sample.
value,misstatement_
Specify the book value of the amount and the misstatement amount, separated by a
amount
comma. For example, if an amount has a book value of $1,000 and an audit value of
$930, specify 1000,70.
Specify overstatements as positive amounts, and understatements as negative amounts.
For example, if an amount has a book value of $1,250 and an audit value of $1,450,
specify 1250,-200.
Separate multiple book_value, misstatement_amount pairs with a comma:
1000,70,1250,-200
INTERVAL interval_value The interval value that you used when you drew the sample.
Note
The interval value that you used might differ from the interval value
initially calculated by Analytics.
TO SCREEN | filename The location to send the results of the command to:
o SCREEN – displays the results in the Analytics display area
Tip
You can click any linked result value in the display area to drill down to
the associated record or records in the source table.
Name Description
By default, the file is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the file to a different, existing folder:
l TO "C:\Output.TXT"
l TO "Results\Output.TXT"
MLEn The Most Likely Error amount (projected misstatement) calculated by the command.
UELn The Upper Error Limit amount (upper misstatement limit) calculated by the command.
Examples
For a detailed explanation of how Analytics calculates values when evaluating errors, see
"Evaluating errors in a monetary unit sample" on page 1096.
Remarks
For more information about how this command works, see "Evaluating errors in a monetary unit
sample" on page 1096.
EXECUTE command
Executes an application or process external to Analytics. Emulates the Windows Run command.
Can be used to interact with the Windows command prompt.
Note
Because the EXECUTE command gives you the ability to interact with the operating
system and applications external to Analytics, technical issues may arise that are
beyond the scope of Analytics's native functionality.
Support can assist with operation of the EXECUTE command inside Analytics, but
issues that arise with processes and applications external to Analytics are not
covered under Support.
Syntax
EXECUTE Windows_Run_command_syntax <ASYNC>
Parameters
Name Description
Windows_Run_ The name of the application to execute, the folder or file to open, or the command to run,
command_syntax followed by any required arguments or command switches.
Requires valid Windows Run command syntax enclosed by quotation marks.
Note
When running EXECUTE from the Analytics command line, you must
specify ASYNC.
RETURN_CODE The code returned by an external application or process run using the EXECUTE
command.
Examples
Open an application
Opens Microsoft Excel:
EXECUTE "Excel"
EXECUTE "AcroRd32.exe"
Close an application
Closes Microsoft Excel:
Note
Use the /f switch with caution. It forces an application to close without
presenting any dialog boxes, such as those for saving changes.
Open a file
Opens the Excel workbook AP_Trans.xlsx:
Note
Running an Analytics script in another project launches a second instance of
Analytics. The script in the second project should end with the QUIT command
so that the second instance of Analytics closes and control is returned to the
initial instance of Analytics.
Remarks
Use EXECUTE to perform useful tasks
The EXECUTE command allows you to run Windows and DOS commands from the Analytics
command line or from an Analytics script.
You can use this ability to increase the automation of Analytics scripts by performing a variety of
useful tasks that are not possible using ACLScript syntax alone.
Open other programs and Pass parameters to a Access data from network Incorporate Active
applications and perform batch file locations Directory account lists
tasks required by the
Analytics script
Open any file in its default Run Analytics scripts in Use FTP to access data Integrate with VBScript
application other Analytics projects from remote locations
Perform file and folder Incorporate waiting Zip or unzip data Integrate with SQL
administrative tasks such periods in Analytics scripts databases
as copying, moving,
creating, deleting, or
comparing files or folders
that exist outside of
Analytics
Run external scripts or Incorporate Windows task Encrypt or decrypt data Open web pages
non-Analytics batch files scheduling in Analytics
(.bat) scripts
Note
Specific details of how to perform any of these tasks are beyond the scope of Diligent Help document-
ation. For assistance, consult appropriate Windows operating system documentation, or other third-
party documentation.
o file and folder administrative tasks o external tasks cause an application interface or pop-
o specifying waiting periods up dialog box to open
o any task that subsequent tasks depend on
o subsequent script execution depends on the result in
the RETURN_CODE variable
Note
Until interface elements are closed, they represent processes that are still running. If
these interface elements are opened with EXECUTE in default mode, they prevent
subsequent lines in an Analytics script from executing, and cause the script to hang.
Quotation marks
The Windows Run command syntax that you use with the EXECUTE command must be enclosed
by either single or double quotation marks.
The following example uses the Windows MD command to create a new folder:
You may find this method easier to read than the second method.
Note
Reversing the order of the nesting – using double quotation marks to enclose
the entire string, and single quotation marks to enclose paths – does not work.
l Two double quotation marks – Use double quotation marks to enclose the entire Run
command string, and use two double quotation marks internally to enclose paths:
If you use this second method, the two double quotation marks used internally must be
immediately adjacent and cannot have a space between them.
You can avoid this complication by creating external scripts or batch files to contain Windows
commands, and by using the EXECUTE command only to start the batch file. For example:
EXECUTE 'C:\My_Batch.bat'
Method Example
Repeat the
EXECUTE EXECUTE 'cmd /c md "C:\New Data Folder"'
EXECUTE 'cmd /c copy C:\File_1.txt "C:\New Data Folder"'
command for
each Run
command.
Combine
Run EXECUTE 'cmd /c md "C:\New Data Folder" & copy C:\File_1.txt
"C:\New Data Folder"'
commands
using '&'.
Create an
external EXECUTE 'C:\My_Batch.bat'
script or
batch file to
contain multi-
line Run
commands,
and use the
EXECUTE
command
only to start
the batch file.
EXPORT command
Exports data from Analytics to the specified file format, or to the Results app or the Robots app in
HighBond.
Note
You must have 32-bit Microsoft Access Database Engine installed for the EXPORT
command to work with older Excel files (*.xls) and Microsoft Access files (*.mdb).
For more information, see "Exclude optional Microsoft Access Database Engine" on
page 2689.
Syntax
EXPORT {<FIELDS> field_name <AS export_name> <...n>|<FIELDS> ALL <EXCLUDE
field_name <...n>>} <UNICODE> export_type <SCHEMA> <PASSWORD num> TO {file-
name|aclgrc_id|highbond_api_url} <OVERWRITE> <IF test> <WHILE test> <{FIRST
range|NEXT range}> <APPEND> <KEEPTITLE> <SEPARATOR character> <QUALIFIER
character> <WORKSHEET worksheet_name> <DISPLAYNAME>
Parameters
Name Description
Name Description
UNICODE Available in the Unicode edition of Analytics only. Applies to text files, delimited text files, XML files,
and Windows Clipboard output only. ( ASCII , DELIMITED , XML , CLIPBOARD )
optional
Exports Analytics data with Unicode UTF-16 LE character encoding applied.
o Specify UNICODE – if the data you are exporting contains characters that are not supported by
extended ASCII (ANSI)
o Do not specify UNICODE – if all the characters in the data you are exporting are supported by
extended ASCII (ANSI)
The exported data is encoded as extended ASCII (ANSI).
Note
Any unsupported characters are omitted from the exported file.
Name Description
Note
PASSWORD num may or may not be required, depending on the environment in
which the script runs:
Robots
Note
To export to a comma-separated values file (*.csv), you must specify the .csv file
extension as part of filename. For example: vendors.csv
TO aclgrc_id For exports to the HighBond Results app, the destination in Results. ( ACLGRC )
The aclgrc_id value must include the Results control test ID number, and if you are exporting to a
data center other than North America (US), the data center code. The aclgrc_id value must be
enclosed in quotation marks.
The control test ID number and the data center code must be separated by the at sign (@). For
example, TO "99@eu".
If you do not know the control test ID number, use the Analytics user interface to begin an export to
Results. Cancel the export once you have identified the control test ID number. For more
information, see "Exporting exceptions to the Results app in HighBond" on page 214.
Name Description
The data center code specifies which regional HighBond server you are exporting the data to:
o af – Africa (South Africa)
o ap – Asia Pacific (Singapore)
o au – Asia Pacific (Australia)
o ca – North America (Canada)
o eu – Europe (Germany)
o jp – Asia Pacific (Tokyo)
o sa – South America (Brazil)
o us – North America (US)
You can use only the data center code or codes authorized for your organization's instance of
HighBond. The North America (US) data center is the default, so specifying @us is optional.
TO highbond_ For exports to the HighBond Robots app, the destination in Robots. ( HBDATA )
api_url
Note
You cannot export to an ACL robot. You must export to a HighBond robot or a
Workflow robot.
The highbond_api_url value is the HighBond API request URL for the destination robot. The
example below exports a *.csv.gz file to this destination:
o the robot with ID number 52053
o in the HighBond org with ID number 1000236
o in the HighBond North America (US) data center
TO "https://apis-us.highbond.com/v1/orgs/1000236/robots/52053/working_
files?env=development"
Use the env query string parameter to specify whether the file is exported to development mode or
production mode in the robot:
(default) or
o no query string specified
Name Description
IF test A conditional expression that must be true in order to process each record. The command is
executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a table after
any scope parameters have been applied (WHILE, FIRST, NEXT).
WHILE test A conditional expression that must be true in order to process each record. The command is
executed until the condition evaluates as false, or the end of the table is reached.
optional
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing stops as
soon as one limit is reached.
APPEND Applies to text files and delimited text files only. ( ASCII , DELIMITED )
optional Appends the command output to the end of an existing file instead of overwriting it.
Note
You must ensure that the structure of the command output and the existing file are
identical:
l the same fields
l the same field order
l matching fields are the same length
l matching fields are the same data type
Analytics appends output to an existing file regardless of its structure. If the
structure of the output and the existing file do not match, jumbled, missing, or
inaccurate data can result.
KEEPTITLE Applies to text files, delimited text files, and comma-separated values files only. ( ASCII , DELIMITED )
optional Include the Analytics field names with the exported data. If omitted, no field names appear in the
output file.
SEPARATOR Applies to delimited text files and comma-separated values files only. ( DELIMITED )
character
The character to use as the separator between fields. You must specify the character as a quoted
optional string.
By default, Analytics uses a comma. Do not specify any character other than a comma if you are
exporting to a comma-separated values file.
QUALIFIER Applies to delimited text files and comma-separated values files only. ( DELIMITED )
character
The character to use as the text qualifier to wrap and identify field values. You must specify the
Name Description
Examples
"Excel examples" below
"Delimited file examples" on the next page
"Comma-separated values (CSV) file example" on page 1809
"Results app example" on page 1809
"Robots app examples" on page 1810
Excel examples
OPEN Vendor
EXPORT FIELDS Vendor_No Vendor_Name Vendor_City XLSX TO "VendorExport"
OPEN Vendor
EXPORT FIELDS Vendor_No Vendor_Name Vendor_City XLSX TO "VendorExport"
WORKSHEET Vendors_US
OPEN Vendor
EXPORT FIELDS ALL DELIMITED TO "VendorExport"
Tip
Use whichever method is the least labor-intensive.
The examples below refer to the Vendor table, which has eight fields:
l vendor number
l vendor name
l vendor street
l vendor city
l vendor state
l vendor ZIP
l last active date
l review date
OPEN Vendor
EXPORT FIELDS Vendor_No Vendor_Name DELIMITED TO "Vendors" KEEPTITLE
SEPARATOR "|" QUALIFIER '"'
OPEN Vendor
EXPORT FIELDS ALL EXCLUDE Vendor_Last_Active Vendor_Review_Date
DELIMITED TO "Vendor_addresses" KEEPTITLE SEPARATOR "|" QUALIFIER '"'
GROUP
EXPORT FIELDS Vendor_No Vendor_Name DELIMITED TO "AtoM" IF BETWEEN
(UPPER(VENDOR_NAME), "A", "M")
EXPORT FIELDS Vendor_No Vendor_Name DELIMITED TO "NtoZ" IF BETWEEN
(UPPER(VENDOR_NAME), "N", "Z")
END
OPEN Vendor
EXPORT FIELDS ALL DELIMITED TO "VendorExport.csv"
OPEN AR_Exceptions
EXPORT FIELDS No Due Date Ref Amount Type ACLGRC TO "10926@us"
OVERWRITE
COMMENT
//ANALYTIC Export data to Results
//PASSWORD 1 HighBond access token:
//RESULT LOG
END
OPEN AR_Exceptions
EXPORT FIELDS No Due Date Ref Amount Type ACLGRC PASSWORD 1 TO
"10926@us" OVERWRITE
Note
You cannot export to an ACL robot. You must export to a HighBond robot or a
Workflow robot.
For more information about how to access the data after exporting it to Robots,
see load_working_file() method.
OPEN Trans_May
EXPORT FIELDS CARDNUM AS 'CARDNUM' CODES AS 'CODES' DATE AS 'DATE'
CUSTNO AS 'CUSTNO' DESCRIPTION AS 'DESCRIPTION' AMOUNT AS 'AMOUNT'
HBDATA TO "https://apis-us.high-
bond.com/v1/orgs/1000236/robots/52053/working_files?env=development"
OVERWRITE
token. For more information, see "Creating a password definition and specifying a password
value" on page 1815.
COMMENT
//ANALYTIC Export Analytics data to Robots
//PASSWORD 1 HighBond access token:
//RESULT LOG
END
OPEN Trans_May
EXPORT FIELDS CARDNUM AS 'CARDNUM' CODES AS 'CODES' DATE AS 'DATE'
CUSTNO AS 'CUSTNO' DESCRIPTION AS 'DESCRIPTION' AMOUNT AS 'AMOUNT'
HBDATA PASSWORD 1 TO "https://apis-us.high-
bond.com/v1/orgs/1000236/robots/52053/working_files?env=development"
OVERWRITE
OPEN Trans_May
EXPORT FIELDS ALL HBDATA PASSWORD 3 TO "https://apis-us.high-
bond.com/v1/orgs/1000236/robots/52053/working_files?env=development"
OVERWRITE
OPEN Vendor
EXPORT FIELDS ALL EXCLUDE Vendor_Last_Active Vendor_Review_Date HBDATA
PASSWORD 3 TO "https://apis-us.high-
bond.com/v1/orgs/1000236/robots/52053/working_files?env=development"
OVERWRITE
Remarks
Using EXPORT with the GROUP command
For most export formats, you can export data into multiple files simultaneously using the GROUP
command.
Only one file can be created at a time when you are exporting data to Microsoft Excel and Microsoft
Access.
Exporting to Excel
The following limits apply when exporting data to an Excel file.
Limit Details
Number of records o Excel 2007 and later (*.xlsx) – a maximum of 1,048,576 records by 16,384 fields
(maximum worksheet size supported by Excel)
o Excel 97 and 2003 – a maximum of 65,536 records
Analytics tables that exceed these maximums export successfully, but the excess
records are ignored and not exported.
No matching Excel file o TO filename value A new Excel file is created, A new Excel file is created,
name does not match any with a worksheet with the with a worksheet that uses
existing Excel file name specified name the name of the exported
Analytics table
Matching Excel file name o TO filename value, A worksheet with the The existing Excel file is
and an existing Excel specified name is added to overwritten by a new Excel
No matching worksheet
file name, are identical the existing Excel file file, with a worksheet that
name o WORKSHEET uses the name of the
worksheet_name does exported Analytics table
not match a worksheet
name in the Excel file
Matching Excel file name o TO filename value, A worksheet with the The existing Excel file is
and worksheet name and an existing Excel specified name overwrites overwritten by a new Excel
file name, are identical the existing worksheet if it file, with a worksheet that
o WORKSHEET was originally created from uses the name of the
worksheet_name Analytics. exported Analytics table
matches a worksheet
An error message appears
name in the Excel file
and the export operation is
canceled if the existing
worksheet was originally
created directly in Excel.
Item Details
Required The ability to export results to a control test in Results requires a specific HighBond role
permissions assignment, or administrative privileges:
o Users with a Professional User or Professional Manager role for a Results collection can
export results to any control test in the collection.
Note
Only users with the Professional Manager role can export and overwrite
existing data in a control test.
o HighBond System Admins and Results admins automatically get a Professional Manager
role in all collections in the HighBond organization or organizations they administer.
For more information, see Results app permissions.
Export limits The following limits apply when exporting to a control test:
o A maximum of 100,000 records per export
o A maximum of 100,000 records per control test
o A maximum of 500 fields per record
o A maximum of 256 characters per field
You can export multiple times to the same control test, but you cannot exceed the overall limits.
Appending fields Regardless of their order in an Analytics table, exported fields are appended to existing fields in
Item Details
(OVERWRITE not a control test if they have matching physical field names.
specified)
In Analytics, the physical field name is the name in the table layout. Exported fields that do not
match the name of any existing field are added as additional columns to the table in Results.
Display names of fields in Analytics, and in Results, are not considered. However, if you use
the optional AS export_name parameter, the export_name value is used as the physical field
name if you do not use DISPLAYNAME .
When appending data to questionnaire fields, the display name of the column in Results
remains the name that is specified in the questionnaire configuration.
Appending works differently if the target control test has a primary key field specified. For more
information, see "Exporting exceptions to the Results app in HighBond" on page 214.
Note
If you are round-tripping data between Results and Analytics, and data ends
up misaligned in Results, you probably have mismatched field names.
For more information, see "Field name considerations when importing and
exporting Results data" on page 1926.
Password See "Creating a password definition and specifying a password value" on the next page.
requirement
Without AS With AS
Field name and display name Field name and display name in
in Results are the field name from Results are the display name in the
Without DISPLAYNAME Analytics. AS parameter.
Field name in Results is the field Field name in Results is the field
name from Analytics. Display name name from Analytics. Display name
in Results is the display name in Results is the display name in the
With DISPLAYNAME from Analytics. AS parameter.
l Robots Admins are automatically a collaborator for every robot, with the role of Owner.
l A HighBond System Admin with a Professional subscription is automatically a Robots Admin.
For more information, see Robots app permissions.
Method Description
PASSWORD If you use the PASSWORD analytic tag to create the numbered password definition for connecting
analytic tag to HighBond, no password value is specified in the script. When you create a task to run the script
in Robots, an input field in the Task Designer allows you or another user to specify the actual
(For scripts that
password.
run in Robots)
For more information, see PASSWORD analytic tag.
PASSWORD If you use the PASSWORD command to create the numbered password definition for connecting to
command HighBond, no password value is specified in the script. A password prompt is displayed when the
script attempts to connect.
(For scripts that
run in Analytics, For more information, see "PASSWORD command" on page 2036.
offline
activation)
SET If you use the SET PASSWORD command to create the numbered password definition for
PASSWORD connecting to HighBond, a password value is specified in the script, so no password prompt is
command displayed. This approach is appropriate for scripts designed to run unattended, but it exposes an
actual password in clear text in the script, which may not be appropriate for your situation.
(For scripts that
run in Analytics, For more information, see SET PASSWORD command.
offline
activation)
l In the Script Editor, right-click and select Insert > HighBond Token.
The Manage API tokens page opens in your browser. You may be required to first sign in to
HighBond.
Tip
Access to the Manage API tokens page through Analytics is a convenience
feature. You can also sign in to HighBond and access the page through your
user profile without using Analytics.
want to use and enter your HighBond account password. The unmasked token is
displayed.
Tip
Use an existing token unless you have a reason for creating a new one. If the
existing token does not work, create a new one.
Using an existing token cuts down on the number of tokens you need to
manage.
l Create a new token – Click Create token > Analytics and enter your HighBond account
password.
A new Analytics token is created.
3. Click Copy to copy the token.
Tip
Do not close the dialog box containing the token until you have successfully
pasted the token.
4. Depending on which password definition method you are using, do one of the following:
l PASSWORD analytic tag – In the Task Designer in an ACL robot, paste the copied token
into a password parameter field.
l PASSWORD command – In Analytics, paste the copied token into a password prompt that
appears during script execution.
l SET PASSWORD command – In Analytics, paste the copied token at the appropriate point
in the SET PASSWORD command syntax in a script.
5. In Launchpad, close the dialog box containing the token.
If you created a new token, a partially masked version of the token is added to the top of your
list of tokens.
For more information, see Creating and managing HighBond access tokens.
EXTRACT command
Extracts data from an Analytics table and outputs it to a new Analytics table, or appends it to an
existing Analytics table. You can extract entire records or selected fields.
Syntax
EXTRACT {RECORD|FIELDS field_name <AS display_name> <...n>|FIELDS ALL
<EXCLUDE field_name <...n>>} TO table_name <LOCAL> <IF test> <WHILE test>
<FIRST range|NEXT range> <EOF> <APPEND> <OPEN>
Parameters
Name Description
Name Description
Specify display_name as a quoted string. Use a semi-colon (;) between words if you want
a line break in the column title.
Note
AS works only when extracting to a new table. If you are appending to an
existing table, the alternate column titles in the existing table take
precedence.
By default, the table data file (.FIL) is saved to the folder containing the
Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
l TO "C:\Output.FIL"
l TO "Results\Output.FIL"
Note
Table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _
), but no other special characters, or any spaces. The name cannot
start with a number.
LOCAL Saves the output file in the same location as the Analytics project.
optional
Note
Applicable only when running the command against a server table with
an output file that is an Analytics table.
The LOCAL parameter must immediately follow the TO parameter.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
Name Description
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
EOF Execute the command one more time after the end of the file has been reached.
optional This ensures that the final record in the table is processed when inside a GROUP
command. Only use EOF if all fields are computed fields referring to earlier records.
APPEND Appends the command output to the end of an existing file instead of overwriting it.
optional
Note
You must ensure that the structure of the command output and the
existing file are identical:
l the same fields
l the same field order
l matching fields are the same length
l matching fields are the same data type
Analytics appends output to an existing file regardless of its structure. If
the structure of the output and the existing file do not match, jumbled,
missing, or inaccurate data can result.
OPEN Opens the table created by the command after the command executes. Only valid if the
command creates an output table.
optional
Examples
You create an exact duplicate of the AR_Customer table by extracting all the records to a
new Analytics table. Any computed fields are preserved as computed fields:
OPEN AR_Customer
EXTRACT RECORD TO "AR_Customer_2"
OPEN AR_Customer
EXTRACT FIELDS ALL TO "AR_Customer_2"
OPEN AR_Customer
EXTRACT RECORD TO "AR_Customer_Master" APPEND
OPEN AR_Customer
EXTRACT RECORD TO "C:\Users\Customer Data\AR_Customer_Master" APPEND
Tip
Use whichever method is the least labor-intensive.
The examples below refer to the AR_Customer table, which has seven fields:
l reference number
l customer number
l customer name
l transaction type
l invoice date
l due date
l invoice amount
OPEN AR_Customer
EXTRACT FIELDS Name Due Date TO "AR_Customer_Dates.fil"
OPEN AR_Customer
EXTRACT FIELDS ALL EXCLUDE Reference_num TO "AR_Customer_Dates.fil"
You extract three fields from the AR_Customer table and create display names for the fields
in the new Analytics table:
OPEN AR_Customer
EXTRACT FIELDS Name AS "Customer;Name" Due AS "Due;Date" Date AS
"Invoice;Date" TO "AR_Customer_Dates.fil"
OPEN AR_Customer
EXTRACT FIELDS Name Due Date IF Due < `20140701` TO "Overdue.fil"
Remarks
For more information about how this command works, see "Extracting data" on page 199 or
"Extracting and appending data" on page 943.
FIELDSHIFT command
Syntax
FIELDSHIFT START starting_position COLUMNS bytes_to_shift <FILTER data_fil-
ter_name> <OK>
Parameters
Name Description
START starting_position The starting byte position of the first field definition you want to shift.
All field definitions to the right of the specified field definition are also shifted.
If you specify a non-starting byte position, the next starting byte position is used.
Note
Name Description
Note
FILTER data_filter_name The name of the filter that identifies field definitions associated with a particular record
definition.
optional
Examples
Remarks
For more information about how this command works, see "Shifting fields in table layouts" on
page 825.
Keep in mind that FIELDSHIFT moves both the specified field definition, and any field definitions to
the right of the specified definition. If the shifted block of definitions would exceed the record length
in either direction, an error message appears and the command is not executed.
Tip
If the error message is appearing because you are exceeding the end of the record,
try removing the final field definition to make room for the field definitions being
shifted.
FIND command
Searches an indexed character field for the first value that matches the specified character string.
Note
The FIND command and the FIND( ) function are two separate Analytics features
with significant differences. For information about the function, see "FIND( ) function"
on page 2292.
Syntax
FIND search_value
Parameters
Name Description
Examples
Remarks
For more information about how this command works, see "Selecting the first matching record" on
page 1239.
INDEX requirement
To use the command, the table you are searching must be indexed on a character field in ascending
order.
If multiple character fields are indexed in ascending order, only the first field specified in the index is
searched. The command cannot be used to search non-character index fields, or character fields
indexed in descending order.
Partial matching
Partial matching is supported. The search value can be contained by a longer value in the indexed
field. However, the search value must appear at the start of the field to constitute a match.
FUZZYDUP command
Note
To use fuzzy matching to combine fields from two Analytics tables into a new, single
Analytics table, see "FUZZYJOIN command" on page 1835.
Syntax
FUZZYDUP ON key_field <OTHER field <...n>|OTHER ALL <EXCLUDE field_name
<...n>>> LEVDISTANCE value <DIFFPCT percentage> <RESULTSIZE percentage>
<EXACT> <IF test> TO table_name <LOCAL> <OPEN>
Parameters
Name Description
OTHER field <...n> | One or more additional fields to include in the output.
OTHER ALL o OTHER field <...n> – include the specified field or fields
optional
Fields are included in the order that you list them.
o OTHER ALL – include all fields in the table that are not specified as the key field.
Fields are included in the order that they appear in the table layout.
LEVDISTANCE value The maximum allowable Levenshtein distance between two strings for them to be
identified as fuzzy duplicates and included in the results.
The LEVDISTANCE value cannot be less than 1 or greater than 10. Increasing the
Name Description
LEVDISTANCE value increases the number of results by including values with a greater
degree of fuzziness – that is, values that are more different from one another.
For more information, see "FUZZYDUP behavior" on page 1832.
DIFFPCT percentage A threshold that limits the 'difference percentage' or the proportion of a string that can be
different.
optional
The percentage that results from an internal Analytics calculation performed on potential
fuzzy duplicate pairs must be less than or equal to the DIFFPCT value for the pair to be
included in the results. The DIFFPCT value cannot be less than 1 or greater than 99.
If DIFFPCT is omitted the threshold is turned off and difference percentage is not
considered during processing of the FUZZYDUP command.
For more information, see "FUZZYDUP behavior" on page 1832.
RESULTSIZE percentage The maximum size of the set of output results as a percentage of the number of records
in the key field.
optional
For example, for a key field with 50,000 records, a RESULTSIZE of 3 would terminate
processing if the results exceeded 1500 fuzzy duplicates (50,000 x 0.03). No output table
is produced if processing is terminated.
The RESULTSIZE value cannot be less than 1 or greater than 1000 (one thousand)
percent. The limit of 1000% is to accommodate the nature of many-to-many matching,
which can produce results that are more numerous than the original test data set.
If RESULTSIZE is omitted the threshold is turned off and result size is not considered
during processing of the FUZZYDUP command.
Caution
Omitting RESULTSIZE can produce an unduly large set of results that
takes a very long time to process, or can cause available memory to be
exceeded, which terminates processing. Omit RESULTSIZE only if you
are confident that the results will be of a manageable size.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
By default, the table data file (.FIL) is saved to the folder containing the
Analytics project.
Name Description
Use either an absolute or relative file path to save the data file to a different, existing
folder:
l TO "C:\Output.FIL"
l TO "Results\Output.FIL"
Note
Table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _
), but no other special characters, or any spaces. The name cannot
start with a number.
LOCAL Saves the output file in the same location as the Analytics project.
optional
Note
Applicable only when running the command against a server table with
an output file that is an Analytics table.
The LOCAL parameter must immediately follow the TO parameter.
OPEN Opens the table created by the command after the command executes. Only valid if the
command creates an output table.
optional
GAPDUPn The total number of gaps, duplicates, or fuzzy duplicate groups identified by the
command.
Examples
l The size of the results is limited to 20% of the test field size.
l In addition to fuzzy duplicates, exact duplicates are included.
OPEN Employee_List
FUZZYDUP ON Last_Name OTHER First_Name EmpNo LEVDISTANCE 1 DIFFPCT 50
RESULTSIZE 20 EXACT TO "Fuzzy_Last_Name" OPEN
Remarks
How it works
The FUZZYDUP command finds nearly identical values (fuzzy duplicates), or locates inconsistent
spelling in manually entered data.
Unlike the ISFUZZYDUP( ) function, which identifies an exhaustive list of fuzzy duplicates for a
single character value, the FUZZYDUP command identifies all fuzzy duplicates in a field, organizes
them in non-exhaustive groups, and outputs results.
For detailed information about how this command works, see "Fuzzy duplicates analysis" on
page 1287.
FUZZYDUP behavior
The FUZZYDUP command has two parameters that allow you to control the degree of difference
between fuzzy duplicates, and the size of the results:
l LEVDISTANCE
l DIFFPCT
You may need to try different combinations of settings for these two parameters to find out what
works best for a particular data set.
More information
For detailed information about the fuzzy duplicate difference settings, controlling result size, and
fuzzy duplicate groups, see "Fuzzy duplicates analysis" on page 1287.
Case-sensitivity
The FUZZYDUP command is not case-sensitive, so "SMITH" is equivalent to "smith."
FUZZYJOIN command
Uses fuzzy matching to combine fields from two Analytics tables into a new, single Analytics table.
Note
To detect nearly identical values in a single character field (fuzzy duplicates), see
"FUZZYDUP command" on page 1829.
To join tables using exactly matching key field values, see "JOIN command" on
page 1992.
Syntax
FUZZYJOIN {DICE PERCENT percentage NGRAM n-gram_length|LEVDISTANCE DISTANCE
value} PKEY primary_key_field SKEY secondary_key_field {FIELDS primary_
fields|FIELDS ALL <EXCLUDE primary_fields <...n>>} <WITH secondary_
fields|WITH ALL <EXCLUDE secondary_fields <...n>>> <IF test> <OPEN> TO
table_name <FIRSTMATCH> <WHILE test> <FIRST range|NEXT range> <APPEND>
Note
You cannot run the FUZZYJOIN command locally against a server table.
You must specify the FUZZYJOIN command name in full. You cannot abbreviate it.
Parameters
Name Description
Name Description
Increasing the n-gram length makes the criterion for similarity between two strings
stricter.
N-grams are overlapping substrings (character blocks) into which the comparison
strings are divided as part of the Dice's coefficient calculation.
Note
When you specify DICE, the FUZZYJOIN command uses the
DICECOEFFICIENT( ) function in an IF statement to conditionally join
key field values. For detailed information about the function, see
"DICECOEFFICIENT( ) function" on page 2263.
Note
When you specify LEVDISTANCE, the FUZZYJOIN command uses
the LEVDIST( ) function in an IF statement to conditionally join key
field values. For detailed information about the function, see
"LEVDIST( ) function" on page 2358.
Unlike the function, the Levenshtein distance algorithm in the
FUZZYJOIN command automatically trims leading and trailing blanks,
and is not case-sensitive.
PKEY primary_key_field The character key field, or expression, in the primary table.
You can specify only one primary key field.
SKEY secondary_key_ The character key field, or expression, in the secondary table.
field
You can specify only one secondary key field.
FIELDS primary_fields | The fields or expressions from the primary table to include in the joined output table.
FIELDS ALL o FIELDS primary_fields – include the specified field or fields
Fields are included in the order that you list them.
o FIELDS ALL – include all fields from the table
Fields are included in the order that they appear in the table layout.
Note
You must explicitly specify the primary key field if you want to include it in
the joined table. Specifying FIELDS ALL also includes it.
EXCLUDE primary_fields Only valid when performing a fuzzy join using FIELDS ALL.
optional The field or fields to exclude from the command. EXCLUDE allows you to fine-tune
FIELDS ALL, by excluding the specified fields.
Name Description
WITH secondary_fields | The fields or expressions from the secondary table to include in the joined output table.
WITH ALL o WITH secondary_fields – include the specified field or fields
optional
Fields are included in the order that you list them.
o WITH ALL – include all fields from the table
Fields are included in the order that they appear in the table layout.
Note
You must explicitly specify the secondary key field if you want to include it
in the joined table. Specifying WITH ALL also includes it.
EXCLUDE secondary_ Only valid when performing a fuzzy join using WITH ALL.
fields
The field or fields to exclude from the command. EXCLUDE allows you to fine-tune
optional WITH ALL, by excluding the specified fields.
EXCLUDE must immediately follow WITH ALL. For example:
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
Note
The IF condition can reference the primary table, the secondary table, or
both.
OPEN Opens the table created by the command after the command executes. Only valid if the
command creates an output table.
optional
By default, the table data file (.FIL) is saved to the folder containing the
Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
Name Description
folder:
l TO "C:\Output.FIL"
l TO "Results\Output.FIL"
Note
Table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _
), but no other special characters, or any spaces. The name cannot
start with a number.
FIRSTMATCH Specifies that each primary key value is joined to only the first occurrence of any
secondary key matches.
optional
If the first occurrence happens to be an exact match, any subsequent fuzzy matches for
the primary key value are not included in the joined output table.
If you omit FIRSTMATCH, the default behavior of FUZZYJOIN is to join each primary key
value to all occurrences of any secondary key matches.
FIRSTMATCH is useful if you only want to know if any matches, exact or fuzzy, exist
between two tables, and you want to avoid the processing time required to identify all
matches.
You can also use FIRSTMATCH if you are certain that at most only one match exists in
the secondary table for each primary key value.
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
APPEND Appends the command output to the end of an existing file instead of overwriting it.
optional
Name Description
Note
You must ensure that the structure of the command output and the
existing file are identical:
l the same fields
l the same field order
l matching fields are the same length
l matching fields are the same data type
Analytics appends output to an existing file regardless of its structure. If
the structure of the output and the existing file do not match, jumbled,
missing, or inaccurate data can result.
The system locale in the format language_country. For example, to use Canadian
French, enter fr_ca.
Use the following codes:
o language – ISO 639 standard language code
o country – ISO 3166 standard country code
If you do not specify a country code, the default country for the language is used.
If you do not use ISOLOCALE, the default system locale is used.
Examples
Remarks
For more information about how this command works, see "Fuzzy join" on page 987.
Case sensitivity
The FUZZYJOIN command is not case-sensitive, regardless of which fuzzy matching algorithm you
use. So "SMITH" is equivalent to "smith."
Note
Sorting elements in key field values is best suited for fuzzy joining using the
Levenshtein distance algorithm.
Sorting elements when fuzzy joining using the Dice coefficient algorithm may or may
not be beneficial. Test a set of sample data before deciding whether to use
SORTWORDS( ) in conjunction with the Dice coefficient algorithm in a production
setting.
Caution
If you use SORTWORDS( ) in conjunction with the FUZZYJOIN command you must
apply SORTWORDS( ) to both strings or both fields being compared.
GAPS command
Detects whether a numeric or datetime field in an Analytics table contains one or more gaps in
sequential data.
Syntax
GAPS <ON> key_field <D> <UNFORMATTED> <PRESORT> <MISSING limit>
<HEADER header_text> <FOOTER footer_text> <IF test> <WHILE test> <FIRST
range|NEXT range> <TO {SCREEN|table_name|filename|PRINT}> <LOCAL> <APPEND>
<OPEN>
Parameters
Name Description
UNFORMATTED Suppresses page headings and page breaks when the results are output to a file.
optional
PRESORT Sorts the table on the key field before executing the command.
optional
Note
You cannot use PRESORT inside the GROUP command.
MISSING limit The output results contain individual missing items rather than gap ranges.
optional The limit value specifies the maximum number of missing items to report for each
identified gap. The default value is 5. If the limit is exceeded for a particular gap, the
missing items are reported as a range for that particular gap.
The limit value does not restrict the total number of missing items reported, it only
restricts the number of missing items reported within a specific gap.
HEADER header_text The text to insert at the top of each page of a report.
optional header_text must be specified as a quoted string. The value overrides the Analytics
HEADER system variable.
FOOTER footer_text The text to insert at the bottom of each page of a report.
Name Description
optional footer_text must be specified as a quoted string. The value overrides the Analytics
FOOTER system variable.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
TO SCREEN | table_name The location to send the results of the command to:
| filename | PRINT o SCREEN – displays the results in the Analytics display area
optional
Tip
You can click any linked result value in the display area to drill down to
the associated record or records in the source table.
By default, the table data file (.FIL) is saved to the folder containing the
Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
l TO "C:\Output.FIL"
l TO "Results\Output.FIL"
Name Description
Note
Table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _
), but no other special characters, or any spaces. The name cannot
start with a number.
By default, the file is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the file to a different, existing folder:
l TO "C:\Output.TXT"
l TO "Results\Output.TXT"
o PRINT – sends the results to the default printer
LOCAL Saves the output file in the same location as the Analytics project.
optional
Note
Applicable only when running the command against a server table with
an output file that is an Analytics table.
The LOCAL parameter must immediately follow the TO parameter.
APPEND Appends the command output to the end of an existing file instead of overwriting it.
optional
Note
You must ensure that the structure of the command output and the
existing file are identical:
l the same fields
l the same field order
l matching fields are the same length
l matching fields are the same data type
Analytics appends output to an existing file regardless of its structure. If
the structure of the output and the existing file do not match, jumbled,
missing, or inaccurate data can result.
OPEN Opens the table created by the command after the command executes. Only valid if the
command creates an output table.
optional
GAPDUPn The total number of gaps, duplicates, or fuzzy duplicate groups identified by the
command.
Examples
OPEN Invoices
GAPS ON Inv_Num PRESORT TO "Invoices_Gaps.fil"
Remarks
For more information about how this command works, see "Testing for gaps" on page 1267.
GROUP command
Executes one or more ACLScript commands on a record before moving to the next record in the
table, with only one pass through the table. Command execution can be controlled by conditions.
Syntax
GROUP <IF test> <WHILE test> <FIRST range|NEXT range>
command
<...n>
<ELSE IF test>
command
<...n>
<ELSE>
command
<...n>
END
Note
Some Analytics commands cannot be used with the GROUP command. For more
information, see "Commands that can be used inside the GROUP command" on
page 1851.
Parameters
Name Description
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
Name Description
command <...n> One or more ACLScript commands to execute inside the GROUP. For a complete list of
commands supported inside GROUP, see "Commands that can be used inside the
GROUP command" on page 1851.
If there is a preceding IF or ELSE IF, the test must evaluate to true.
If the command is listed under ELSE, the command is executed if there are records that
have not been processed by any of the preceding commands. You can include multiple
commands, with each command starting on a separate line.
ELSE IF test Opens an ELSE IF block for the GROUP command. The condition tests records that did
not match the GROUP command test, or any previous ELSE IF tests.
optional
You can include multiple ELSE IF tests and they are evaluated from top to bottom, until
the record evaluates to true and the commands that follow that ELSE IF statement are
executed.
ELSE Opens an ELSE block for the GROUP command. The commands that follow are
executed for records that evaluated to false for all of the previous tests.
optional
Examples
Simple GROUP
Simple groups start with a GROUP command, are followed by a series of commands, and
terminate with an END command:
GROUP
COUNT
HISTOGRAM ON Quantity MINIMUM 0 MAXIMUM 100 INTERVALS 10
CLASSIFY ON Location SUBTOTAL Quantity
END
GROUP IF
Conditional groups execute commands based on whether a condition is true or false. The
following GROUP command is executed only on records with a Product_class value less
than 5:
GROUP IF ...ELSE
Records that do not meet the test condition are ignored unless you include an ELSE block.
Any number of commands can follow an ELSE statement. In the following example, all
records that do not meet the condition are processed by having their Quantity field totaled:
In this example, all of the commands from COUNT up to and including the next GROUP are
executed only if Product_class is less than 05.
The STATISTICS and HISTOGRAM commands are executed if Quantity is greater than
zero. However, because the second GROUP command is nested, the STATISTICS and
HISTOGRAM commands are executed only for records that meet the conditions Product_
class < "05" and Quantity > 0.
OPEN Metaphor_Trans_2002
GROUP
TOTAL AMOUNT IF PRODCLS = "03"
TOTAL AMOUNT IF PRODCLS = "05"
TOTAL AMOUNT IF PRODCLS = "08"
TOTAL AMOUNT IF PRODCLS = "09"
END
CLOSE Metaphor_Trans_2002
Remarks
Tip
For a detailed tutorial covering the GROUP and LOOP commands, see "Grouping
and looping" on page 1484.
VERIFY
Note
While you can initialize and define a variable inside a GROUP block, it is not
recommended. Variables initialized inside a GROUP may cause unexpected results
when used.
Inside a GROUP, you can evaluate variables using variable substitution. The value of the variable
remains the same as when the GROUP is entered.
You cannot define a variable inside a GROUP and then reference it using variable substitution:
System-defined variables
Certain commands such as TOTAL and STATISTICS generate system variables based on calcula-
tions that the commands perform. If you use a GROUP to execute these commands, any system
variables that result are numbered consecutively, starting at the line number of the command inside
the GROUP (excluding empty lines) and running to n. The value of n increases by 1 for each line
number in the GROUP.
Note
You must wait until the GROUP completes before using any system generated
variables created inside the GROUP. The command must run against each record in
the table before the variable is available. Use these variables after the closing
END keyword of the GROUP.
In the following example, the first TOTAL command generates the variable TOTAL2 and the second
generates TOTAL4. Both of these variables are available to use in subsequent commands once the
GROUP completes:
GROUP
TOTAL Discount IF Order_Priority = "Low"
ASSIGN v_var = "test"
TOTAL Discount IF Order_Priority = "High"
END
Syntax notes
l The multiline syntax listed for the GROUP command is required, and therefore the GROUP
command cannot be entered in the command line.
l Each GROUP command must be terminated with an END command.
l When you use the GROUP command in your scripts, you can improve the readability of the
command block by indenting the commands listed inside the group. However, indenting is not
required.
HB_API_DELETE command
Sends a DELETE request to the HighBond API.
Syntax
HB_API_DELETE HighBond_API_request_URL HEADERS header_information PASSWORD
num <TO response_file>
Parameters
Name Description
Note
If you explicitly specify host information, you must use the HTTPS
protocol to connect with the HighBond API. For example: https://apis-
us.highbond.com
'{"content-type": "application/vnd.api+json"}'
Name Description
tag.
num is the number of the password definition. For example, if two passwords have been
previously supplied or set in a script, or when scheduling an analytic script, PASSWORD 2
specifies that password #2 is used.
For more information about supplying or setting passwords, see:
o "PASSWORD command" on page 2036
o SET PASSWORD command
o PASSWORD analytic tag
The required password value is a HighBond access token. For more information, see
"Creating a password definition and specifying a password value" on the facing page.
Note
PASSWORD num may or may not be required, depending on the
environment in which the script runs:
Robots
TO response_file The name of the file that contains the request response.
optional Specify response_file as a quoted string with a *.json file extension. For example:
TO "response.json"
Remarks
Creating a password definition and specifying a
password value
When you run a script in Robots that sends a request to the HighBond API, you need to include a
password definition with the command that sends the request. The same requirement applies to
scripts run in Analytics if you used offline activation.
Regardless of which method you use to create a password definition, the required password value is
a HighBond access token, which you can generate in Launchpad. For more information, see
"Acquire a HighBond access token" on the next page.
Method Description
PASSWORD If you use the PASSWORD analytic tag to create the numbered password definition for connecting
analytic tag to HighBond, no password value is specified in the script. When you create a task to run the script
in Robots, an input field in the Task Designer allows you or another user to specify the actual
(For scripts that
password.
run in Robots)
For more information, see PASSWORD analytic tag.
PASSWORD If you use the PASSWORD command to create the numbered password definition for connecting to
command HighBond, no password value is specified in the script. A password prompt is displayed when the
script attempts to connect.
(For scripts that
run in Analytics, For more information, see "PASSWORD command" on page 2036.
offline
activation)
SET If you use the SET PASSWORD command to create the numbered password definition for
PASSWORD connecting to HighBond, a password value is specified in the script, so no password prompt is
command displayed. This approach is appropriate for scripts designed to run unattended, but it exposes an
actual password in clear text in the script, which may not be appropriate for your situation.
(For scripts that
run in Analytics, For more information, see SET PASSWORD command.
offline
activation)
l In the Script Editor, right-click and select Insert > HighBond Token.
The Manage API tokens page opens in your browser. You may be required to first sign in to
HighBond.
Tip
Access to the Manage API tokens page through Analytics is a convenience
feature. You can also sign in to HighBond and access the page through your
user profile without using Analytics.
want to use and enter your HighBond account password. The unmasked token is
displayed.
Tip
Use an existing token unless you have a reason for creating a new one. If the
existing token does not work, create a new one.
Using an existing token cuts down on the number of tokens you need to
manage.
l Create a new token – Click Create token > Analytics and enter your HighBond account
password.
A new Analytics token is created.
3. Click Copy to copy the token.
Tip
Do not close the dialog box containing the token until you have successfully
pasted the token.
4. Depending on which password definition method you are using, do one of the following:
l PASSWORD analytic tag – In the Task Designer in an ACL robot, paste the copied token
into a password parameter field.
l PASSWORD command – In Analytics, paste the copied token into a password prompt that
appears during script execution.
l SET PASSWORD command – In Analytics, paste the copied token at the appropriate point
in the SET PASSWORD command syntax in a script.
5. In Launchpad, close the dialog box containing the token.
If you created a new token, a partially masked version of the token is added to the top of your
list of tokens.
For more information, see Creating and managing HighBond access tokens.
HB_API_GET command
Sends a GET request to the HighBond API.
Syntax
HB_API_GET HighBond_API_request_URL HEADERS header_information PASSWORD num
TO response_file
Parameters
Name Description
Note
If you explicitly specify host information, you must use the HTTPS
protocol to connect with the HighBond API. For example: https://apis-
us.highbond.com
'{"content-type": "application/vnd.api+json"}'
Name Description
tag.
num is the number of the password definition. For example, if two passwords have been
previously supplied or set in a script, or when scheduling an analytic script, PASSWORD 2
specifies that password #2 is used.
For more information about supplying or setting passwords, see:
o "PASSWORD command" on page 2036
o SET PASSWORD command
o PASSWORD analytic tag
The required password value is a HighBond access token. For more information, see
"Creating a password definition and specifying a password value" on page 1862.
Note
PASSWORD num may or may not be required, depending on the
environment in which the script runs:
Robots
TO response_file The name of the file that contains the request response.
Specify response_file as a quoted string with a *.json file extension. For example:
TO "response.json"
Examples
The second example includes all default values in the HighBond API request, and saves the
response JSON file to a location other than the Analytics project folder:
In both examples above, the list of robots in the all_robots.json response file is identical.
For example:
{
"data": [
{
"id": "17504",
"type": "robots",
"attributes": {
"active_app_version": 4,
"app_versions_count": 5,
"name": "Concur T&E Data Integration",
"category": "acl",
"drive_system_user": "exYRZqYABvrjHCjV7E7j"
}
},
{
"id": "24202",
"type": "robots",
"attributes": {
"active_app_version": 2,
"app_versions_count": 2,
"name": "Test_Steele_Adverse_Media",
"category": "highbond",
"drive_system_user": "exYRZqYABvrjHCjV7E7j"
}
}
]
}
Remarks
Creating a password definition and specifying a
password value
When you run a script in Robots that sends a request to the HighBond API, you need to include a
password definition with the command that sends the request. The same requirement applies to
scripts run in Analytics if you used offline activation.
Regardless of which method you use to create a password definition, the required password value is
a HighBond access token, which you can generate in Launchpad. For more information, see
"Acquire a HighBond access token" on the next page.
Method Description
PASSWORD If you use the PASSWORD analytic tag to create the numbered password definition for connecting
analytic tag to HighBond, no password value is specified in the script. When you create a task to run the script
in Robots, an input field in the Task Designer allows you or another user to specify the actual
(For scripts that
password.
run in Robots)
For more information, see PASSWORD analytic tag.
PASSWORD If you use the PASSWORD command to create the numbered password definition for connecting to
command HighBond, no password value is specified in the script. A password prompt is displayed when the
script attempts to connect.
(For scripts that
run in Analytics, For more information, see "PASSWORD command" on page 2036.
offline
activation)
SET If you use the SET PASSWORD command to create the numbered password definition for
PASSWORD connecting to HighBond, a password value is specified in the script, so no password prompt is
command displayed. This approach is appropriate for scripts designed to run unattended, but it exposes an
actual password in clear text in the script, which may not be appropriate for your situation.
(For scripts that
run in Analytics, For more information, see SET PASSWORD command.
offline
activation)
l In the Script Editor, right-click and select Insert > HighBond Token.
The Manage API tokens page opens in your browser. You may be required to first sign in to
HighBond.
Tip
Access to the Manage API tokens page through Analytics is a convenience
feature. You can also sign in to HighBond and access the page through your
user profile without using Analytics.
want to use and enter your HighBond account password. The unmasked token is
displayed.
Tip
Use an existing token unless you have a reason for creating a new one. If the
existing token does not work, create a new one.
Using an existing token cuts down on the number of tokens you need to
manage.
l Create a new token – Click Create token > Analytics and enter your HighBond account
password.
A new Analytics token is created.
3. Click Copy to copy the token.
Tip
Do not close the dialog box containing the token until you have successfully
pasted the token.
4. Depending on which password definition method you are using, do one of the following:
l PASSWORD analytic tag – In the Task Designer in an ACL robot, paste the copied token
into a password parameter field.
l PASSWORD command – In Analytics, paste the copied token into a password prompt that
appears during script execution.
l SET PASSWORD command – In Analytics, paste the copied token at the appropriate point
in the SET PASSWORD command syntax in a script.
5. In Launchpad, close the dialog box containing the token.
If you created a new token, a partially masked version of the token is added to the top of your
list of tokens.
For more information, see Creating and managing HighBond access tokens.
HB_API_PATCH command
Sends a PATCH request to the HighBond API.
Syntax
HB_API_PATCH HighBond_API_request_URL HEADERS header_information DATA pay-
load_file PASSWORD num <TO response_file>
Parameters
Name Description
Note
If you explicitly specify host information, you must use the HTTPS
protocol to connect with the HighBond API. For example: https://apis-
us.highbond.com
'{"content-type": "application/vnd.api+json"}'
DATA payload_file The name of the file that contains the request payload.
The request payload is the data that you want to send to HighBond. You contain the data
in a JSON file and use DATA to reference the file in the HighBond API request. For
guidance on structuring the payload data for a specific HighBond resource, see the
Name Description
DATA "payload.json"
Note
For scripts that you intend to run in Robots, you must also specify a
//FILE tag in the analytic header that corresponds to the DATA payload_
file parameter. For example:
COMMENT
//ANALYTIC Test HB API commands
//FILE payload.json
END
Name Description
The required password value is a HighBond access token. For more information, see
"Creating a password definition and specifying a password value" on the facing page.
Note
PASSWORD num may or may not be required, depending on the
environment in which the script runs:
Robots
TO response_file The name of the file that contains the request response.
optional Specify response_file as a quoted string with a *.json file extension. For example:
TO "response.json"
Remarks
Creating a password definition and specifying a
password value
When you run a script in Robots that sends a request to the HighBond API, you need to include a
password definition with the command that sends the request. The same requirement applies to
scripts run in Analytics if you used offline activation.
Regardless of which method you use to create a password definition, the required password value is
a HighBond access token, which you can generate in Launchpad. For more information, see
"Acquire a HighBond access token" on the next page.
Method Description
PASSWORD If you use the PASSWORD analytic tag to create the numbered password definition for connecting
analytic tag to HighBond, no password value is specified in the script. When you create a task to run the script
in Robots, an input field in the Task Designer allows you or another user to specify the actual
(For scripts that
password.
run in Robots)
For more information, see PASSWORD analytic tag.
PASSWORD If you use the PASSWORD command to create the numbered password definition for connecting to
command HighBond, no password value is specified in the script. A password prompt is displayed when the
script attempts to connect.
(For scripts that
run in Analytics, For more information, see "PASSWORD command" on page 2036.
offline
activation)
SET If you use the SET PASSWORD command to create the numbered password definition for
PASSWORD connecting to HighBond, a password value is specified in the script, so no password prompt is
command displayed. This approach is appropriate for scripts designed to run unattended, but it exposes an
actual password in clear text in the script, which may not be appropriate for your situation.
(For scripts that
run in Analytics, For more information, see SET PASSWORD command.
offline
activation)
l In the Script Editor, right-click and select Insert > HighBond Token.
The Manage API tokens page opens in your browser. You may be required to first sign in to
HighBond.
Tip
Access to the Manage API tokens page through Analytics is a convenience
feature. You can also sign in to HighBond and access the page through your
user profile without using Analytics.
want to use and enter your HighBond account password. The unmasked token is
displayed.
Tip
Use an existing token unless you have a reason for creating a new one. If the
existing token does not work, create a new one.
Using an existing token cuts down on the number of tokens you need to
manage.
l Create a new token – Click Create token > Analytics and enter your HighBond account
password.
A new Analytics token is created.
3. Click Copy to copy the token.
Tip
Do not close the dialog box containing the token until you have successfully
pasted the token.
4. Depending on which password definition method you are using, do one of the following:
l PASSWORD analytic tag – In the Task Designer in an ACL robot, paste the copied token
into a password parameter field.
l PASSWORD command – In Analytics, paste the copied token into a password prompt that
appears during script execution.
l SET PASSWORD command – In Analytics, paste the copied token at the appropriate point
in the SET PASSWORD command syntax in a script.
5. In Launchpad, close the dialog box containing the token.
If you created a new token, a partially masked version of the token is added to the top of your
list of tokens.
For more information, see Creating and managing HighBond access tokens.
HB_API_POST command
Sends a POST request to the HighBond API.
Syntax
HB_API_POST HighBond_API_request_URL HEADERS header_information DATA pay-
load_file PASSWORD num <TO response_file>
Parameters
Name Description
Note
If you explicitly specify host information, you must use the HTTPS
protocol to connect with the HighBond API. For example: https://apis-
us.highbond.com
'{"content-type": "application/vnd.api+json"}'
DATA payload_file The name of the file that contains the request payload.
The request payload is the data that you want to send to HighBond. You contain the data
in a JSON file and use DATA to reference the file in the HighBond API request. For
guidance on structuring the payload data for a specific HighBond resource, see the
Name Description
DATA "payload.json"
Note
For scripts that you intend to run in Robots, you must also specify a
//FILE tag in the analytic header that corresponds to the DATA payload_
file parameter. For example:
COMMENT
//ANALYTIC Test HB API commands
//FILE payload.json
END
Name Description
The required password value is a HighBond access token. For more information, see
"Creating a password definition and specifying a password value" on the facing page.
Note
PASSWORD num may or may not be required, depending on the
environment in which the script runs:
Robots
TO response_file The name of the file that contains the request response.
optional Specify response_file as a quoted string with a *.json file extension. For example:
TO "response.json"
Examples
You build a request payload that uses JSON formatting and save the payload in a file named
create_issue.json. You then use the HB_API_POST command, and specify the payload file
in the command, to create an issue in the project with ID 19756.
Tip
To quickly build payload syntax, copy the appropriate payload syntax block
from the HighBond API Reference. After copying the payload block, you can
remove key-value pairs that you intend to leave empty.
Content of create_issue.json:
{
"data": {
"type": "issues",
"attributes": {
"description": "Description of issue",
"owner": "Jane Sleaman",
"deficiency_type": "Deficiency",
"title": "Data retention and backup",
"severity": "High",
"published": true,
"identified_at": "2021-11-01T18:15:30Z"
}
}
}
Remarks
Creating a password definition and specifying a
password value
When you run a script in Robots that sends a request to the HighBond API, you need to include a
password definition with the command that sends the request. The same requirement applies to
scripts run in Analytics if you used offline activation.
Regardless of which method you use to create a password definition, the required password value is
a HighBond access token, which you can generate in Launchpad. For more information, see
"Acquire a HighBond access token" on the next page.
Method Description
PASSWORD If you use the PASSWORD analytic tag to create the numbered password definition for connecting
analytic tag to HighBond, no password value is specified in the script. When you create a task to run the script
in Robots, an input field in the Task Designer allows you or another user to specify the actual
(For scripts that
password.
run in Robots)
For more information, see PASSWORD analytic tag.
PASSWORD If you use the PASSWORD command to create the numbered password definition for connecting to
command HighBond, no password value is specified in the script. A password prompt is displayed when the
script attempts to connect.
(For scripts that
run in Analytics, For more information, see "PASSWORD command" on page 2036.
offline
activation)
SET If you use the SET PASSWORD command to create the numbered password definition for
PASSWORD connecting to HighBond, a password value is specified in the script, so no password prompt is
command displayed. This approach is appropriate for scripts designed to run unattended, but it exposes an
actual password in clear text in the script, which may not be appropriate for your situation.
(For scripts that
run in Analytics, For more information, see SET PASSWORD command.
offline
activation)
l In the Script Editor, right-click and select Insert > HighBond Token.
The Manage API tokens page opens in your browser. You may be required to first sign in to
HighBond.
Tip
Access to the Manage API tokens page through Analytics is a convenience
feature. You can also sign in to HighBond and access the page through your
user profile without using Analytics.
want to use and enter your HighBond account password. The unmasked token is
displayed.
Tip
Use an existing token unless you have a reason for creating a new one. If the
existing token does not work, create a new one.
Using an existing token cuts down on the number of tokens you need to
manage.
l Create a new token – Click Create token > Analytics and enter your HighBond account
password.
A new Analytics token is created.
3. Click Copy to copy the token.
Tip
Do not close the dialog box containing the token until you have successfully
pasted the token.
4. Depending on which password definition method you are using, do one of the following:
l PASSWORD analytic tag – In the Task Designer in an ACL robot, paste the copied token
into a password parameter field.
l PASSWORD command – In Analytics, paste the copied token into a password prompt that
appears during script execution.
l SET PASSWORD command – In Analytics, paste the copied token at the appropriate point
in the SET PASSWORD command syntax in a script.
5. In Launchpad, close the dialog box containing the token.
If you created a new token, a partially masked version of the token is added to the top of your
list of tokens.
For more information, see Creating and managing HighBond access tokens.
HB_API_PUT command
Sends a PUT request to the HighBond API.
Syntax
HB_API_PUT HighBond_API_request_URL HEADERS header_information DATA payload_
file PASSWORD num <TO response_file>
Parameters
Name Description
Note
If you explicitly specify host information, you must use the HTTPS
protocol to connect with the HighBond API. For example: https://apis-
us.highbond.com
'{"content-type": "application/vnd.api+json"}'
DATA payload_file The name of the file that contains the request payload.
The request payload is the data that you want to send to HighBond. You contain the data
in a JSON file and use DATA to reference the file in the HighBond API request. For
guidance on structuring the payload data for a specific HighBond resource, see the
Name Description
DATA "payload.json"
Note
For scripts that you intend to run in Robots, you must also specify a
//FILE tag in the analytic header that corresponds to the DATA payload_
file parameter. For example:
COMMENT
//ANALYTIC Test HB API commands
//FILE payload.json
END
Name Description
The required password value is a HighBond access token. For more information, see
"Creating a password definition and specifying a password value" on the facing page.
Note
PASSWORD num may or may not be required, depending on the
environment in which the script runs:
Robots
TO response_file The name of the file that contains the request response.
optional Specify response_file as a quoted string with a *.json file extension. For example:
TO "response.json"
Remarks
Creating a password definition and specifying a
password value
When you run a script in Robots that sends a request to the HighBond API, you need to include a
password definition with the command that sends the request. The same requirement applies to
scripts run in Analytics if you used offline activation.
Regardless of which method you use to create a password definition, the required password value is
a HighBond access token, which you can generate in Launchpad. For more information, see
"Acquire a HighBond access token" on the next page.
Method Description
PASSWORD If you use the PASSWORD analytic tag to create the numbered password definition for connecting
analytic tag to HighBond, no password value is specified in the script. When you create a task to run the script
in Robots, an input field in the Task Designer allows you or another user to specify the actual
(For scripts that
password.
run in Robots)
For more information, see PASSWORD analytic tag.
PASSWORD If you use the PASSWORD command to create the numbered password definition for connecting to
command HighBond, no password value is specified in the script. A password prompt is displayed when the
script attempts to connect.
(For scripts that
run in Analytics, For more information, see "PASSWORD command" on page 2036.
offline
activation)
SET If you use the SET PASSWORD command to create the numbered password definition for
PASSWORD connecting to HighBond, a password value is specified in the script, so no password prompt is
command displayed. This approach is appropriate for scripts designed to run unattended, but it exposes an
actual password in clear text in the script, which may not be appropriate for your situation.
(For scripts that
run in Analytics, For more information, see SET PASSWORD command.
offline
activation)
l In the Script Editor, right-click and select Insert > HighBond Token.
The Manage API tokens page opens in your browser. You may be required to first sign in to
HighBond.
Tip
Access to the Manage API tokens page through Analytics is a convenience
feature. You can also sign in to HighBond and access the page through your
user profile without using Analytics.
want to use and enter your HighBond account password. The unmasked token is
displayed.
Tip
Use an existing token unless you have a reason for creating a new one. If the
existing token does not work, create a new one.
Using an existing token cuts down on the number of tokens you need to
manage.
l Create a new token – Click Create token > Analytics and enter your HighBond account
password.
A new Analytics token is created.
3. Click Copy to copy the token.
Tip
Do not close the dialog box containing the token until you have successfully
pasted the token.
4. Depending on which password definition method you are using, do one of the following:
l PASSWORD analytic tag – In the Task Designer in an ACL robot, paste the copied token
into a password parameter field.
l PASSWORD command – In Analytics, paste the copied token into a password prompt that
appears during script execution.
l SET PASSWORD command – In Analytics, paste the copied token at the appropriate point
in the SET PASSWORD command syntax in a script.
5. In Launchpad, close the dialog box containing the token.
If you created a new token, a partially masked version of the token is added to the top of your
list of tokens.
For more information, see Creating and managing HighBond access tokens.
HELP command
Launches the Analytics Help Docs in a browser.
Syntax
HELP
HISTOGRAM command
Groups records based on values in a character or numeric field, counts the number of records in
each group, and displays the groups and counts in a bar chart.
Syntax
HISTOGRAM {<ON> character_field|<ON> numeric_field MINIMUM value MAXIMUM
value {<INTERVALS number>|FREE interval_value <...n> last_interval}} <TO
{SCREEN|filename|GRAPH|PRINT}> <IF test> <WHILE test> <FIRST range|NEXT
range> <HEADER header_text> <FOOTER footer_text> <KEY break_field>
<SUPPRESS> <COLUMNS number> <APPEND> <OPEN>
Parameters
Name Description
MINIMUM value Applies to numeric fields only. The minimum value of the first numeric interval.
MINIMUM is optional if you are using FREE, otherwise it is required.
MAXIMUM value Applies to numeric fields only. The maximum value of the last numeric interval.
MAXIMUM is optional if you are using FREE, otherwise it is required.
Name Description
first interval and the end point of the last interval, and each interval_value creates an
additional interval within the range. The interval values you specify must be greater than
the MINIMUM value, and equal to or less than the MAXIMUM value.
Interval values must be in numeric sequence and cannot contain duplicate values:
TO SCREEN | filename | The location to send the results of the command to:
GRAPH | PRINT o SCREEN – displays the results in the Analytics display area
Tip
You can click any linked result value in the display area to drill down to
the associated record or records in the source table.
By default, the file is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the file to a different, existing folder:
l TO "C:\Output.TXT"
l TO "Results\Output.TXT"
o GRAPH – displays the results in a graph in the Analytics display area
o PRINT – sends the results to the default printer
Note
Histogram results output to a file appear as a textual representation of a
bar chart.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
Name Description
HEADER header_text The text to insert at the top of each page of a report.
optional header_text must be specified as a quoted string. The value overrides the Analytics
HEADER system variable.
FOOTER footer_text The text to insert at the bottom of each page of a report.
optional footer_text must be specified as a quoted string. The value overrides the Analytics
FOOTER system variable.
KEY break_field The field or expression that groups subtotal calculations. A subtotal is calculated each
time the value of break_field changes.
optional
break_field must be a character field or expression. You can specify only one field, but
you can use an expression that contains more than one field.
SUPPRESS Values above the MAXIMUM value and below the MINIMUM value are excluded from the
command output.
optional
COLUMNS number The length of the x-axis in the textual representation of the bar chart if you output
histogram results to a text file.
optional
The number value is the number of character spaces (text columns) to use for the x-axis
(and the y-axis labels). If you omit COLUMNS, the default of 78 character spaces is used.
APPEND Appends the command output to the end of an existing file instead of overwriting it.
optional
Note
You must ensure that the structure of the command output and the
existing file are identical:
l the same fields
l the same field order
l matching fields are the same length
l matching fields are the same data type
Analytics appends output to an existing file regardless of its structure. If
the structure of the output and the existing file do not match, jumbled,
missing, or inaccurate data can result.
OPEN Opens the table created by the command after the command executes. Only valid if the
command creates an output table.
optional
Examples
Remarks
For more information about how this command works, see "Creating histograms" on page 1356.
Related commands
Creating a histogram using a character field is similar to classifying. Creating a histogram using a
numeric field is similar to stratifying.
Unlike the other grouping operations in Analytics, histograms do not support subtotaling numeric
fields.
IF command
Specifies a condition that must evaluate to true in order to execute a command.
Syntax
IF test command
Parameters
Name Description
Examples
You use an IF test to determine the value of v_classify_checkbox, and if the value is True,
CLASSIFY executes:
Remarks
Tip
For detailed tutorials covering the IF command and the IF parameter, see "Making
decisions in scripts" on page 1460 and "Control structures" on page 1481.
Creates an Analytics table by defining and importing a Microsoft Access database file.
Note
You must have 32-bit Microsoft Access Database Engine installed for the IMPORT
ACCESS command to work. For more information, see "Exclude optional Microsoft
Access Database Engine" on page 2689.
Syntax
IMPORT ACCESS TO table <PASSWORD num> import_filename FROM source_filename
TABLE input_tablename CHARMAX max_field_length MEMOMAX max_field_length
Parameters
Name Description
TO table The name of the Analytics table to import the data into.
Note
Table names are limited to 64 alphanumeric characters. The name can
include the underscore character ( _ ), but no other special characters, or
any spaces. The name cannot start with a number.
Name Description
By default, the data file (.FIL) is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
o "C:\data\Invoices.FIL"
o "data\Invoices.FIL"
FROM source_filename The name of the source data file. source_filename must be a quoted string.
If the source data file is not located in the same directory as the Analytics project, you
must use an absolute path or a relative path to specify the file location:
o "C:\data\source_filename"
o "data\source_filename"
TABLE input_tablename The name of the table in the Microsoft Access database file to import.
CHARMAX max_field_ The maximum length in characters for any field in the Analytics table that originates as
length character data in the source from which you are importing.
You can specify from 1 to 255 characters.
The ability to truncate fields prevents occasional long values from expanding the overall
record length beyond what is supported by the import process:
o 32,767 characters (non-Unicode Analytics)
o 16,383 characters (Unicode Analytics)
MEMOMAX max_field_ The maximum length in characters for text, note, or memo fields you are importing.
length
You can specify from 1 to 32767 characters (non-Unicode Analytics), or 16383
characters (Unicode Analytics).
Examples
For more information about how this command works, see "Import a Microsoft Access database file"
on page 260.
The length of imported character or memo fields is set to the length of the longest value in the
field, or to the specified maximum number of characters, whichever is shorter:
Syntax
IMPORT DELIMITED TO table import_filename FROM source_filename <SERVER pro-
file_name> source_char_encoding SEPARATOR {char|TAB|SPACE} QUALIFIER
{char|NONE} <CONSECUTIVE> STARTLINE line_number <KEEPTITLE> <CRCLEAR>
<LFCLEAR> <REPLACENULL> <ALLCHAR> {ALLFIELDS|[field_syntax] <...n> <IGNORE
field_num> <...n>}
field_syntax ::=
FIELD name type AT start_position DEC value WID bytes PIC format AS display_
name
Parameters
Name Description
TO table The name of the Analytics table to import the data into.
Note
Table names are limited to 64 alphanumeric characters. The name can
include the underscore character ( _ ), but no other special characters, or
any spaces. The name cannot start with a number.
By default, the data file (.FIL) is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
o "C:\data\Invoices.FIL"
o "data\Invoices.FIL"
FROM source_filename The name of the source data file. source_filename must be a quoted string.
Name Description
If the source data file is not located in the same directory as the Analytics project, you
must use an absolute path or a relative path to specify the file location:
o "C:\data\source_filename"
o "data\source_filename"
SERVER profile_name The server profile name for the AX Server where the data you want to import is located.
optional
Unicode edition Unicode data that does not use UTF-16 LE encoding
SEPARATOR char The separator character (delimiter) used between fields in the source data. You must
| TAB | SPACE specify the character as a quoted string.
You can specify a tab or a space separator by typing the character between double
quotation marks, or by using a keyword:
o SEPARATOR " " or SEPARATOR TAB
o SEPARATOR " " or SEPARATOR SPACE
QUALIFIER char | NONE The text qualifier character used in the source data to wrap and identify field values. You
must specify the character as a quoted string.
To specify the double quotation mark character as the text qualifier, enclose the
character in single quotation marks: QUALIFIER '"'.
You can specify that there are no text qualifiers using either of these methods:
o QUALIFIER ""
o QUALIFIER NONE
STARTLINE line_number The line number on which to start reading the file.
Name Description
For example, if the first three lines of a file contain header information that you do not
want, specify STARTLINE 4 to start reading data on the fourth line.
KEEPTITLE o KEEPTITLE used with ALLFIELDS – Treat the line number specified by
STARTLINE as field names instead of data.
optional
If you omit KEEPTITLE, generic field names are used and the line number specified
by STARTLINE is treated as data.
o KEEPTITLE used with individual FIELD syntax – Do not import the line number
specified by STARTLINE. FIELD name specifies the field names.
If you omit KEEPTITLE, the line number specified by STARTLINE is treated as data.
FIELD name specifies the field names.
CRCLEAR Replaces any CR characters (carriage return) that occur between text qualifiers with
space characters. You must specify QUALIFIER with a char value to use CRCLEAR.
optional
If you use both CRCLEAR and LFCLEAR, CRCLEAR must come first.
LFCLEAR Replaces any LF characters (line feed) that occur between text qualifiers with space
characters. You must specify QUALIFIER with a char value to use LFCLEAR.
optional
If you use both CRCLEAR and LFCLEAR, CRCLEAR must come first.
REPLACENULL Replaces any NUL characters that occur in the delimited file with space characters. The
number of any replaced NUL characters is recorded in the log.
optional
ALLCHAR The Character data type is automatically assigned to all the imported fields.
optional
Tip
Assigning the Character data type to all the imported fields simplifies the
process of importing delimited text files.
Once the data is in Analytics, you can assign different data types, such
as Numeric or Datetime, to the fields, and specify format details.
ALLCHAR is useful if you are importing a table with identifier fields
automatically assigned the Numeric data type by Analytics when in fact
they should use the Character data type.
Note
If you specify ALLFIELDS, do not specify any individual FIELD syntax, or
IGNORE.
FIELD name type The individual fields to import from the source data file, including the name and data type
of the field. To exclude a field from being imported, do not specify it.
For information about type, see "Identifiers for field data types" on page 1900.
Name Description
Note
type is ignored if you specify ALLCHAR.
AT start_position The starting byte position of the field in the Analytics data file.
Note
Note
DEC is ignored if you specify ALLCHAR.
WID bytes The length in bytes of the field in the Analytics table layout.
Note
o numeric fields – the display format of numeric values in Analytics views and reports
o datetime fields – the physical format of datetime values in the source data (order of
date and time characters, separators, and so on)
Note
For datetime fields, format must exactly match the physical format in
the source data. For example, if the source data is 12/31/2014, you
must enter the format as "MM/DD/YYYY".
Note
PIC is ignored if you specify ALLCHAR.
AS display_name The display name (alternate column title) for the field in the view in the new Analytics
table.
Name Description
Specify display_name as a quoted string. Use a semi-colon (;) between words if you want
a line break in the column title.
AS is required when you are defining FIELD. To make the display name the same as the
field name, enter a blank display_name value using the following syntax: AS "". Make
sure there is no space between the two double quotation marks.
IGNORE field_num <...n> Excludes the field from the table layout.
optional field_num specifies the position of the excluded field in the source data file. For example,
IGNORE 5 excludes the fifth field in the source data file from the Analytics table layout.
Note
The data in the field is still imported, but it is undefined, and does not
appear in the new Analytics table. The data can be defined later, if
necessary, and added to the table.
To completely exclude a field from being imported, do not specify it when
you specify fields individually.
Examples
Remarks
For more information about how this command works, see "Import a delimited text file" on page 262.
Description of field values in the delimited file Examples Data type assigned
Values include a non-numeric character anywhere in the field, with the $995 Character
exception of commas and periods used as numeric separators, and
(995)
the negative sign (-)
Values include only numbers, numeric separators, or the negative 6,990.75 Numeric
sign
-6,990.75
995
Note
When you use the Data Definition Wizard to define a table that includes EBCDIC,
Unicode, or ASCII fields, the fields are automatically assigned the letter "C" (for the
CHARACTER type).
When you enter an IMPORT statement manually, or edit an existing IMPORT
statement, you can substitute the more specific letters "E" or "U" for EBCDIC or
Unicode fields.
A ACL
B BINARY
C CHARACTER
D DATETIME
E EBCDIC
F FLOAT
G ACCPAC
I IBMFLOAT
K UNSIGNED
L LOGICAL
N PRINT
P PACKED
Q BASIC
R MICRO
S CUSTOM
T PCASCII
U UNICODE
V VAXFLOAT
X NUMERIC
Y UNISYS
Z ZONED
Creates an Analytics table by defining and importing a Microsoft Excel worksheet or named range.
Note
You must have 32-bit Microsoft Access Database Engine installed for the IMPORT
EXCEL command to work with older Excel files (*.xls). For more information, see
"Exclude optional Microsoft Access Database Engine" on page 2689.
Syntax
IMPORT EXCEL TO table import_filename FROM source_filename TABLE input_work-
sheet_or_named_range <KEEPTITLE> <STARTLINE line_number> <ALLCHAR>
{ALLFIELDS|CHARMAX max_field_length|[field_syntax] <...n> <IGNORE field_num>
<...n>} <OPEN>
field_syntax ::=
FIELD import_name type {PIC format|WID characters DEC value} AS display_name
Note
You must specify the IMPORT EXCEL parameters in exactly the same order as
above, and in the table below.
Analytics cannot import from an Excel workbook if Protected View is active for the
workbook. You must first enable editing in the workbook, save and close the
workbook, and then perform the import.
Parameters
Name Description
TO table The name of the Analytics table to import the data into.
Note
Table names are limited to 64 alphanumeric characters. The name can
include the underscore character ( _ ), but no other special characters, or
any spaces. The name cannot start with a number.
Name Description
By default, the data file (.FIL) is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
o "C:\data\Invoices.FIL"
o "data\Invoices.FIL"
FROM source_filename The name of the source data file. source_filename must be a quoted string.
If the source data file is not located in the same directory as the Analytics project, you
must use an absolute path or a relative path to specify the file location:
o "C:\data\source_filename"
o "data\source_filename"
TABLE worksheet_or_ The worksheet or the named range to import from the Excel source data file.
named_range
Requirements:
o add a "$" sign at the end of a worksheet name
For example, TABLE "Corp_Credit_Cards$"
o specify a named range exactly as it appears in Excel
For example, TABLE "Employees_Sales"
o specify worksheet_or_named_range as a quoted string
KEEPTITLE o KEEPTITLE used with ALLFIELDS or CHARMAX – Treat the line number specified
by STARTLINE as field names instead of data.
optional
If you omit KEEPTITLE, generic field names are used and the line number specified
by STARTLINE is treated as data.
o KEEPTITLE used with individual FIELD syntax – Do not import the line number
specified by STARTLINE. FIELD name specifies the field names.
If you omit KEEPTITLE, the line number specified by STARTLINE is treated as data.
FIELD name specifies the field names.
STARTLINE line_number The line number on which to start reading the worksheet.
optional For example, if the first three lines of a worksheet contain header information that you do
not want, specify STARTLINE 4 to start reading data on the fourth line.
If you omit STARTLINE, the start line is the first line in the worksheet.
Note
The start line for a named range is always the first line in the named
range, regardless of the STARTLINE setting.
ALLCHAR The Character data type is automatically assigned to all the imported fields.
optional
Name Description
Tip
Assigning the Character data type to all the imported fields simplifies the
process of importing Excel files.
Once the data is in Analytics, you can assign different data types, such
as Numeric or Datetime, to the fields, and specify format details.
ALLCHAR is useful if you are importing a table with identifier fields
automatically assigned the Numeric data type by Analytics when in fact
they should use the Character data type.
Note
If you specify ALLFIELDS, do not specify any individual FIELD syntax,
CHARMAX, or IGNORE.
CHARMAX max_field_ The maximum length in characters for any field in the Analytics table that originates as
length character data in the Excel source data file.
Data in the Excel file that exceeds the maximum field length is truncated when imported
to Analytics.
All fields in the Excel file, regardless of data type, are imported.
Note
If you specify CHARMAX, do not specify any individual FIELD syntax,
ALLFIELDS, or IGNORE.
FIELD import_name type The individual fields to import from the source data file, including the name and data type
of the field.
import_name becomes the field name in the Analytics table. import_name does not need
to be the same as the field name in the source data file, although it can be.
Tip
You can additionally use AS to specify a display name that is different
from import_name.
type becomes the field date type in the Analytics table. type does not need to be the
same as the field data type in the source data file, although it can be. For more
information about type, see "Identifiers for field data types" on page 1910.
Note
If you specify ALLCHAR, type is ignored.
If you specify individual FIELD syntax, do not specify ALLFIELDS or
CHARMAX.
Excluding a field
To exclude a field from being imported, do not specify it. You must also specify IGNORE
for excluded fields.
Name Description
o numeric fields – the display format of numeric values in Analytics views and reports
o datetime fields – the physical format of datetime values in the source data (order of
date and time characters, separators, and so on)
Note
For datetime fields, format must exactly match the physical format in
the source data. For example, if the source data is 12/31/2014, you
must enter the format as "MM/DD/YYYY".
WID characters The length in characters of the field in the Analytics table layout.
AS display_name The display name (alternate column title) for the field in the view in the new Analytics
table.
Specify display_name as a quoted string. Use a semi-colon (;) between words if you want
a line break in the column title.
AS is required when you are defining FIELD. To make the display name the same as the
field name, enter a blank display_name value using the following syntax: AS "". Make
sure there is no space between the two double quotation marks.
IGNORE field_num <...n> Excludes the field from the table layout.
optional field_num specifies the position of the excluded field in the source data file. For example,
IGNORE 5 excludes the fifth field in the source data file from the Analytics table layout.
Note
Be careful to correctly align field_num with the position of excluded fields.
If you specify field_num for an included field (FIELD definition), or for a
field position that does not exist, the import does not work correctly.
The number of FIELD and IGNORE parameters combined must equal
the total number of fields in the source data table. If the total numbers do
not match, the import does not work correctly.
If you specify ALLFIELDS or CHARMAX, do not specify IGNORE.
OPEN Opens the table created by the command after the command executes. Only valid if the
command creates an output table.
optional
Examples
Remarks
For more information about how this command works, see "Import Microsoft Excel data" on
page 247.
Different combinations of parameters produce different results. The table below summarizes the
different possibilities.
Note
"Define" means manually specifying things like field name, data type, length,
datetime format, and so on.
o import all fields automatically with default definitions ALLFIELDS CHARMAX, FIELD
o if required, define fields post-import in Analytics
o import all fields automatically with default definitions CHARMAX ALLFIELDS, FIELD
o if required, define fields post-import in Analytics
o truncate long character fields
Note
When you use the Data Definition Wizard to define a table that includes EBCDIC,
Unicode, or ASCII fields, the fields are automatically assigned the letter "C" (for the
CHARACTER type).
When you enter an IMPORT statement manually, or edit an existing IMPORT
statement, you can substitute the more specific letters "E" or "U" for EBCDIC or
Unicode fields.
A ACL
B BINARY
C CHARACTER
D DATETIME
E EBCDIC
F FLOAT
G ACCPAC
I IBMFLOAT
K UNSIGNED
L LOGICAL
N PRINT
P PACKED
Q BASIC
R MICRO
S CUSTOM
T PCASCII
U UNICODE
V VAXFLOAT
X NUMERIC
Y UNISYS
Z ZONED
Syntax
IMPORT GRCPROJECT TO table import_filename PASSWORD num FROM org_id/type_id
<FIELD name AS display_name <...n>> <CHARMAX max_field_length>
Parameters
Name Description
TO table The name of the Analytics table to import the data into.
Note
Table names are limited to 64 alphanumeric characters. The name can
include the underscore character ( _ ), but no other special characters, or
any spaces. The name cannot start with a number.
By default, the data file (.FIL) is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
o "C:\data\Invoices.FIL"
o "data\Invoices.FIL"
Name Description
Note
PASSWORD num may or may not be required, depending on the
environment in which the script runs:
Robots
FROM org_id/type_id The organization and type of information that defines the data being imported:
o org_id – the HighBond organization that you are importing data from
o type_id – the type of information that you are importing
The org_id value and the type_id value must be separated by a slash, with no intervening
spaces:
FROM "125@-eu/audits"
Organization ID
org_id must include the organization ID number, and if you are importing from a data
center other than North America (US), the data center code. The organization ID number
and the data center code must be separated by the at sign ( @ ) and a hyphen ( - ):
FROM "125@-eu"
Note
If you specify the North America (US) data center code it uses a slightly
different format, without a hyphen:
FROM "125@us"
The data center code specifies which regional HighBond server you are importing the
data from.
o af – Africa (South Africa)
o ap – Asia Pacific (Singapore)
o au – Asia Pacific (Australia)
o ca – North America (Canada)
o eu – Europe (Germany)
o jp – Asia Pacific (Tokyo)
Name Description
You can use only the data center code or codes authorized for your organization's
instance of HighBond. The North America (US) data center is the default, so specifying
@us is optional.
If you do not know the organization ID number, use the Analytics user interface to import
a table from Projects. The organization ID number is contained in the command in the
log. For more information, see "Import HighBond Projects data" on page 760.
Type ID
type_id specifies the type of information you are importing. Information in Projects is
contained in a series of related tables.
For type_id, use one of the values listed below. Enter the value exactly as it appears and
include underscores, if applicable:
o audits - Projects
o control_test_plans - Control Test Plans
o control_tests - Control Test
o controls - Controls
o finding_actions - Actions
o findings - Issues
o mitigations - Risk Control Associations
o narratives - Narratives
o objectives- Objectives
o risks - Risks
o walkthroughs - Walkthroughs
Tip
For information about how the tables in Projects are related, and the key
fields that you can use to join the tables once you have imported them to
Analytics, see "Import HighBond Projects data" on page 760.
FIELD name AS display_ Individual fields in the source data to import. Specify the name.
name <...n>
If you omit FIELD, all fields are imported.
optional o name must exactly match the physical field name in the Projects table, including
matching the case
o display_name (alternate column title) is the display name for the field in the view in
the new Analytics table. You must specify a display name for each FIELD name.
Specify display_name as a quoted string.
Use a semi-colon (;) between words if you want a line break in the column title.
Unlike some other IMPORT commands in Analytics, you cannot specify a blank
display_name as a way of using the FIELD name as the display name.
Tip
To get the physical field names, use the Analytics user interface to import
the appropriate table from Projects. The physical field names are
contained in the command in the log.
Subsequent imports can be scripted.
Name Description
CHARMAX max_field_ The maximum length in characters for any field in the Analytics table that originates as
length character data in the Projects table.
optional Data in the Projects table that exceeds the maximum field length is truncated when
imported to Analytics.
The ability to truncate fields prevents occasional long values from expanding the overall
record length beyond what is supported by the import process:
o 32,767 characters (non-Unicode Analytics)
o 16,383 characters (Unicode Analytics)
Examples
In the resulting Analytics table, all fields that originate as character data in Projects are limited
to the specified length of 200 characters. Any field values that exceed the limit are truncated
to 200 characters.
Remarks
For more information about how this command works, see "Import HighBond Projects data" on
page 760.
Method Description
PASSWORD If you use the PASSWORD analytic tag to create the numbered password definition for connecting
analytic tag to HighBond, no password value is specified in the script. When you create a task to run the script
in Robots, an input field in the Task Designer allows you or another user to specify the actual
(For scripts that
password.
run in Robots)
For more information, see PASSWORD analytic tag.
PASSWORD If you use the PASSWORD command to create the numbered password definition for connecting to
command HighBond, no password value is specified in the script. A password prompt is displayed when the
script attempts to connect.
(For scripts that
run in Analytics, For more information, see "PASSWORD command" on page 2036.
offline
activation)
SET If you use the SET PASSWORD command to create the numbered password definition for
PASSWORD connecting to HighBond, a password value is specified in the script, so no password prompt is
command displayed. This approach is appropriate for scripts designed to run unattended, but it exposes an
actual password in clear text in the script, which may not be appropriate for your situation.
(For scripts that
run in Analytics, For more information, see SET PASSWORD command.
offline
activation)
l In the Script Editor, right-click and select Insert > HighBond Token.
The Manage API tokens page opens in your browser. You may be required to first sign in to
HighBond.
Tip
Access to the Manage API tokens page through Analytics is a convenience
feature. You can also sign in to HighBond and access the page through your
user profile without using Analytics.
want to use and enter your HighBond account password. The unmasked token is
displayed.
Tip
Use an existing token unless you have a reason for creating a new one. If the
existing token does not work, create a new one.
Using an existing token cuts down on the number of tokens you need to
manage.
l Create a new token – Click Create token > Analytics and enter your HighBond account
password.
A new Analytics token is created.
3. Click Copy to copy the token.
Tip
Do not close the dialog box containing the token until you have successfully
pasted the token.
4. Depending on which password definition method you are using, do one of the following:
l PASSWORD analytic tag – In the Task Designer in an ACL robot, paste the copied token
into a password parameter field.
l PASSWORD command – In Analytics, paste the copied token into a password prompt that
appears during script execution.
l SET PASSWORD command – In Analytics, paste the copied token at the appropriate point
in the SET PASSWORD command syntax in a script.
5. In Launchpad, close the dialog box containing the token.
If you created a new token, a partially masked version of the token is added to the top of your
list of tokens.
For more information, see Creating and managing HighBond access tokens.
Syntax
IMPORT GRCRESULTS TO table import_filename PASSWORD num FROM Results_
resource_path <FIELD name AS display_name <...n>> <CHARMAX max_field_length>
Parameters
Name Description
TO table The name of the Analytics table to import the data into.
Note
Table names are limited to 64 alphanumeric characters. The name can
include the underscore character ( _ ), but no other special characters, or
any spaces. The name cannot start with a number.
By default, the data file (.FIL) is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
o "C:\data\Invoices.FIL"
o "data\Invoices.FIL"
Name Description
Note
PASSWORD num may or may not be required, depending on the
environment in which the script runs:
Robots
Note
The form of the Results path is supplied by an API, and is subject to
change. The easiest and most reliable way to acquire the correct and
current syntax for the path is to perform a manual import of the target
data, and copy the path from the command log.
FIELD name AS display_ Individual fields in the source data to import. Specify the name.
name <...n>
If you omit FIELD, all fields are imported.
optional
Name
name must exactly match the physical field name in the Results table, including matching
the case. To view the physical field name, do one of the following:
o In Results, click a column header in the Table View. The physical field name appears
after Field Name.
o In Analytics, when you import a Results table, the physical field name appears in
parentheses after the display name in the dialog box that allows you to select fields.
Note
The Results physical field name is not the display name used for column
headers in the Table View.
Also see "Field name considerations when importing and exporting Results data" on
page 1926.
Name Description
Display name
display_name (alternate column title) is the display name for the field in the view in the
new Analytics table. You must specify a display name for each FIELD name. Specify
display_name as a quoted string.
Use a semi-colon (;) between words if you want a line break in the column title.
Unlike some other IMPORT commands in Analytics, you cannot specify a blank display_
name as a way of using the FIELD name as the display name.
CHARMAX max_field_ The maximum length in characters for any field in the Analytics table that originates as
length character data in the Results table or interpretation.
optional Data in the Results table or interpretation that exceeds the maximum field length is
truncated when imported to Analytics.
The ability to truncate fields prevents occasional long values from expanding the overall
record length beyond what is supported by the import process:
o 32,767 characters (non-Unicode Analytics)
o 16,383 characters (Unicode Analytics)
Examples
In the resulting Analytics table, all fields that originate as character data in Results are limited
to the specified length of 200 characters. Any field values that exceed the limit are truncated
to 200 characters.
Remarks
For more information about how this command works, see "Import HighBond Results data" on
page 765.
Results path
Note
The form of the Results path is supplied by an API, and is subject to change. The
easiest and most reliable way to acquire the correct and current syntax for the path
is to perform a manual import of the target data, and copy the path from the
command log.
The Results path in the FROM parameter takes the following general form:
For example:
FROM "results/api/orgs/11594/control_tests/4356/exceptions"
The org ID is displayed in the browser address bar when you log in to Launchpad. The control test
ID, and the interpretation ID, are displayed in the address bar when you are viewing those tables in
Results.
The table below provides variations of the Results path.
Control test
(table) data FROM "results/api/orgs/11594/control_tests/4356/exceptions"
Control test
(table) audit FROM "results/api/orgs/11594/control_tests/4356/audit_trail"
trail
Control test
(table) FROM "results/api/orgs/11594/control_tests/4356/comments"
comments
Interpretation
FROM "results/api/orgs/11594/control_tests/4356/in-
terpretations/1192/exceptions"
FROM "results-au/api/orgs/11594/control_tests/4356/exceptions"
FROM "results-ap/api/orgs/11594/control_tests/4356/exceptions"
FROM "results-jp/api/orgs/11594/control_tests/4356/exceptions"
o Europe (Germany)
FROM "results-eu/api/orgs/11594/control_tests/4356/exceptions"
FROM "results-ca/api/orgs/11594/control_tests/4356/exceptions"
FROM "results-sa/api/orgs/11594/control_tests/4356/exceptions"
You must specify the field names of the system-generated columns exactly as they appear below.
The default display names apply when you import from Results through the Analytics user interface.
You are free to change the display names if you are scripting the import process.
metadata.priority Priority
metadata.status Status
metadata.publish_date Published
metadata.assignee Assignee
metadata.group Group
metadata.updated_at Updated
metadata.closed_at Closed
extras.collection Collection
extras.record_id Record ID
Method Description
PASSWORD If you use the PASSWORD analytic tag to create the numbered password definition for connecting
analytic tag to HighBond, no password value is specified in the script. When you create a task to run the script
in Robots, an input field in the Task Designer allows you or another user to specify the actual
(For scripts that
password.
run in Robots)
For more information, see PASSWORD analytic tag.
PASSWORD If you use the PASSWORD command to create the numbered password definition for connecting to
command HighBond, no password value is specified in the script. A password prompt is displayed when the
script attempts to connect.
(For scripts that
run in Analytics, For more information, see "PASSWORD command" on page 2036.
offline
activation)
SET If you use the SET PASSWORD command to create the numbered password definition for
PASSWORD connecting to HighBond, a password value is specified in the script, so no password prompt is
command displayed. This approach is appropriate for scripts designed to run unattended, but it exposes an
actual password in clear text in the script, which may not be appropriate for your situation.
(For scripts that
run in Analytics, For more information, see SET PASSWORD command.
offline
activation)
l In the Script Editor, right-click and select Insert > HighBond Token.
The Manage API tokens page opens in your browser. You may be required to first sign in to
HighBond.
Tip
Access to the Manage API tokens page through Analytics is a convenience
feature. You can also sign in to HighBond and access the page through your
user profile without using Analytics.
want to use and enter your HighBond account password. The unmasked token is
displayed.
Tip
Use an existing token unless you have a reason for creating a new one. If the
existing token does not work, create a new one.
Using an existing token cuts down on the number of tokens you need to
manage.
l Create a new token – Click Create token > Analytics and enter your HighBond account
password.
A new Analytics token is created.
3. Click Copy to copy the token.
Tip
Do not close the dialog box containing the token until you have successfully
pasted the token.
4. Depending on which password definition method you are using, do one of the following:
l PASSWORD analytic tag – In the Task Designer in an ACL robot, paste the copied token
into a password parameter field.
l PASSWORD command – In Analytics, paste the copied token into a password prompt that
appears during script execution.
l SET PASSWORD command – In Analytics, paste the copied token at the appropriate point
in the SET PASSWORD command syntax in a script.
5. In Launchpad, close the dialog box containing the token.
If you created a new token, a partially masked version of the token is added to the top of your
list of tokens.
For more information, see Creating and managing HighBond access tokens.
Note
Prior to version 11 of Analytics, external table layout files used an .fmt file extension.
You can still import a table layout file with an .fmt extension by manually specifying
the extension.
Syntax
IMPORT LAYOUT external_layout_file TO table_layout_name
Parameters
Name Description
external_layout_file The name of the external table layout file. If the file name or path includes any spaces it
must be enclosed in quotation marks – for example, "Ap Trans.layout".
The .layout file extension is used by default and does not need to be specified. If
required, you can use another file extension, such as .fmt.
If the layout file is not located in the same folder as the Analytics project, you must use an
absolute path or a relative path to specify the file location – for example,
"C:\Saved layouts\Ap_Trans.layout" or "Saved layouts\Ap_Trans.layout".
TO table_layout_name The name of the imported table layout in the Analytics project – for example,
"Ap Trans May". You must specify the table_layout_name as a quoted string if it contains
any spaces. You can specify a table_layout_name that is different from the name of the
external_layout_file.
Example
You import an external table layout file called Ap_Trans.layout and create a new table layout
called Ap_Trans _May in the Analytics project:
Remarks
When to use IMPORT LAYOUT
Importing an external table layout file and associating it with a data file can save you the labor of
creating a new table layout from scratch:
l If the imported table layout specifies an association with a particular Analytics data file (.fil),
and a data file of the same name exists in the folder containing the project, the imported table
layout is automatically associated with the data file in the folder.
l If there is no data file with the same name in the project folder, you need to link the imported
table layout to a new data source.
IMPORT MULTIDELIMITED
command
Creates multiple Analytics tables by defining and importing multiple delimited files.
Syntax
IMPORT MULTIDELIMITED <TO import_folder> FROM {source_filename|source_
folder} source_char_encoding SEPARATOR {char|TAB|SPACE} QUALIFIER
{char|NONE} <CONSECUTIVE> STARTLINE line_number <KEEPTITLE> <CRCLEAR>
<LFCLEAR> <REPLACENULL> <ALLCHAR>
Note
You must specify the IMPORT MULTIDELIMITED parameters in exactly the same
order as above, and in the table below.
To import multiple delimited files cleanly, the structure of all the files must be
consistent before importing.
For more information, see "Consistent file structure required" on page 1938.
Parameters
Name Description
Example
Name Description
If you omit TO , the data is imported to the folder containing the Analytics project.
FROM source_ The name of the source data files, or the folder containing the source data files.
filename |
Specify source_filename or source_folder as a quoted string.
source_folder
The command supports importing four types of delimited file:
o *.csv
o *.dat
o *.del
o *.txt
Note
Any delimited file names that exceed 64 characters are truncated when imported
to Analytics. Analytics table names are limited to 64 alphanumeric characters, not
including the .FIL extension.
As well, any of the following characters in a delimited file name are replaced with
the underscore character ( _ ) in the Analytics table name:
l special characters other than the underscore character
l spaces
l a initial number
Example
FROM "Transactions_FY*.csv"
selects:
Transactions_FY18.csv
Transactions_FY17.csv
You can use a wildcard in more than one location in a file name, and in a file extension.
Example
Name Description
FROM "Transactions_FY*.*"
selects:
Transactions_FY18.txt
Transactions_FY17.csv
Example
Example
Name Description
Unicode edition Unicode data that does not use UTF-16 LE encoding
Note
If you do not specify a code, Non-Unicode Analytics automatically uses 0 , and
Unicode Analytics automatically uses 2 .
SEPARATOR The separator character (delimiter) used between fields in the source data. You must specify the
char character as a quoted string.
| TAB | SPACE
You can specify a tab or a space separator by typing the character between double quotation
marks, or by using a keyword:
o SEPARATOR " " or SEPARATOR TAB
o SEPARATOR " " or SEPARATOR SPACE
QUALIFIER The text qualifier character used in the source data to wrap and identify field values. You must
char | NONE specify the character as a quoted string.
To specify the double quotation mark character as the text qualifier, enclose the character in single
quotation marks: QUALIFIER '"'.
You can specify that there are no text qualifiers using either of these methods:
o QUALIFIER ""
o QUALIFIER NONE
Note
Ideally, the start line of the data should be the same in all the delimited files that
you import with a single execution of IMPORT MULTIDELIMITED.
If start lines are different, see "Consistent file structure required" on page 1938.
Name Description
KEEPTITLE Treat the line number specified by STARTLINE as field names instead of data. If you omit
KEEPTITLE, generic field names are used.
optional
Note
The field names must be on the same line number in all the delimited files that you
import with a single execution of IMPORT MULTIDELIMITED.
If field names are on different line numbers, see "Consistent file structure required"
on page 1938.
CRCLEAR Replaces any CR characters (carriage return) that occur between text qualifiers with space
characters. You must specify QUALIFIER with a char value to use CRCLEAR.
optional
If you use both CRCLEAR and LFCLEAR, CRCLEAR must come first.
LFCLEAR Replaces any LF characters (line feed) that occur between text qualifiers with space characters.
You must specify QUALIFIER with a char value to use LFCLEAR.
optional
If you use both CRCLEAR and LFCLEAR, CRCLEAR must come first.
REPLACENULL Replaces any NUL characters that occur in the delimited file with space characters. The number of
any replaced NUL characters is recorded in the log.
optional
ALLCHAR The Character data type is automatically assigned to all the imported fields.
optional
Tip
Assigning the Character data type to all the imported fields simplifies the process
of importing delimited text files. Once the data is in Analytics, you can assign
different data types, such as Numeric or Datetime, to the fields, and specify format
details.
ALLCHAR is useful if you are importing a table with identifier fields automatically
assigned the Numeric data type by Analytics when in fact they should use the
Character data type.
Examples
The examples below assume that you have monthly transaction data stored in 12 delimited files:
l Transactions_Jan.csv to Transactions_Dec.csv
Note
A separate Analytics table is created for each delimited file that you import.
You want to import all 12 delimited files. You use the wildcard symbol (*) where the month
occurs in each file name.
Analytics attempts to assign the appropriate data type to each field.
Remarks
Consistent file structure required
To import a group of delimited files cleanly using IMPORT MULTIDELIMITED, the structure of all the
files in the group must be consistent.
You can import inconsistently structured delimited files, and subsequently perform data cleansing
and standardizing in Analytics. However, this approach can be labor intensive. In many cases, it is
easier to make the delimited files consistent before importing.
To import multiple delimited files cleanly, the following items need to be consistent across all files:
ACLScript
Item keyword Problem Solution
The character numeric code (Unicode edition of Analytics only) Group source files by encoding type,
set and and do a separate import for each
Source delimited files use different
encoding of the group.
character encodings. For example,
source data
some files have ASCII encoding and
some files have Unicode encoding.
Text qualifier QUALIFIER Source delimited files use a Do one of the following:
character different text qualifier character to o Standardize the qualifier character
wrap and identify field values.
in the source files before importing
them.
o Group source files by qualifier
character, and do a separate
import for each group.
Start line of the STARTLINE Source delimited files have different Do one of the following:
data start lines for the data. o Standardize the start line in the
source files before importing them.
o Group source files that have the
ACLScript
Item keyword Problem Solution
Field names KEEPTITLE Source delimited files have field Do one of the following:
names on different line numbers. o Standardize the line number with
the field names in the source files
before importing them.
o Group source files that have field
names on the same line number,
and do a separate import for each
group.
Field names KEEPTITLE Some source delimited files have Do one of the following:
field names and some do not. o Add field names to the source files
that require them before importing
all files.
o Group source files that have field
names, and files that do not have
field names, and do a separate
import for each group.
o Omit KEEPTITLE to import all files
using generic field names. Once
the files have been imported to
Analytics tables, you can use the
"EXTRACT command" on
page 1818 to extract only the data
you want from any table.
Creates multiple Analytics tables by defining and importing multiple Microsoft Excel worksheets or
named ranges.
Syntax
IMPORT MULTIEXCEL <TO import_folder> FROM {source_filename|source_folder}
TABLE input_worksheets_or_named_ranges <PREFIX> <KEEPTITLE> <CHARMAX max_
field_length>
Note
You must specify the IMPORT MULTIEXCEL parameters in exactly the same order
as above, and in the table below.
Analytics cannot import from an Excel workbook if Protected View is active for the
workbook. You must first enable editing in the workbook, save and close the
workbook, and then perform the import.
Parameters
Name Description
Example
If you omit TO, the data is imported to the folder containing the Analytics project.
Name Description
FROM The name of the source data file or files, or the folder containing the source data file or files.
source_
Specify source_filename or source_folder as a quoted string.
filename |
source_
folder Source data file or files in the root Analytics project folder
o single Excel file
Specify the compete file name and extension.
Example
FROM "Transactions_FY18.xlsx"
Example
FROM "Transactions_FY*.xlsx"
selects:
Transactions_FY18.xlsx
Transactions_FY17.xlsx
You can use a wildcard in more than one location in a file name, and in a file extension.
Example
FROM "Transactions_FY*.*"
selects:
Transactions_FY18.xlsx
Name Description
Transactions_FY17.xls
Source data file or files not in the root Analytics project folder
If the source data file or files are not located in the same folder as the Analytics project, you must use
an absolute file path, or a file path relative to the folder containing the project, to specify the file
location.
Example
Example
Note
When you specify a folder, any worksheet in any Excel file in the folder is imported if
the worksheet name matches the TABLE value.
TABLE The name of the worksheets or named ranges to import. A separate Analytics table is created for each
input_ imported worksheet or named range.
worksheets_
Specify input_worksheets_or_named_ranges as a quoted string.
or_named_
Name Description
ranges Use a wildcard (*) in place of unique characters in the names of worksheets or ranges.
For example, "Trans_*$" selects the following worksheets:
o Trans_Jan
o Trans_Feb
o Trans_Mar
o and so on
Note
The wildcard character (*) stands for zero (0) or more occurrences of any letter,
number, or special character.
You can use a wildcard in more than one location. For example, *Trans*$ selects:
l Trans_Jan
l Jan_Trans
PREFIX Prepend the Excel file name to the name of the Analytics tables.
optional
Tip
If worksheets in different files have the same name, prepending the Excel file name
allows you to avoid table name conflicts.
KEEPTITLE Treat the first row of data as field names instead of data. If omitted, generic field names are used.
optional
Note
All first rows in the worksheets and named ranges that you import should use a
consistent approach. First rows should be either field names, or data, across all data
sets. Avoid mixing the two approaches in a single import operation.
If the data sets have an inconsistent approach to first rows, use two separate import
operations.
CHARMAX The maximum length in characters for any field in an Analytics table that originates as character data
max_field_ in an Excel source data file.
length
Data in an Excel file that exceeds the maximum field length is truncated when imported to Analytics.
optional
The ability to truncate fields prevents occasional long values from expanding the overall record length
beyond what is supported by the import process:
Name Description
Examples
The examples below assume that you have monthly transaction data for three years stored in three
Excel files:
l Transactions_FY18.xlsx
l Transactions_FY17.xlsx
l Transactions_FY16.xlsx
Each Excel file has 12 worksheets – one for each month of the year. The worksheets also include
some named ranges identifying various subsets of transactions.
Note
A separate Analytics table is created for each worksheet or named range that you
import.
Import worksheets
This example is the same as the one above, but you want to keep the field names from the
Excel files, and also limit the length of character fields.
l you include KEEPTITLE to use the first row of Excel data as the field names
l you include CHARMAX 50 so that fields that originate as character data in the Excel file
are limited to 50 characters in the resulting Analytics table
Manage directories
Remarks
Multiple IMPORT EXCEL commands
The IMPORT MULTIEXCEL command actually performs multiple individual
IMPORT EXCEL commands – one for each worksheet imported. If you double-click the
IMPORT MULTIEXCEL entry in the log, the individual IMPORT EXCEL commands are displayed in
the display area.
Syntax
IMPORT ODBC SOURCE source_name TABLE table_name <QUALIFIER data_qualifier>
<OWNER user_name> <USERID user_id> <PASSWORD num> <WHERE where_clause>
<TO table_name> <WIDTH max_field_length> <MAXIMUM max_field_length>
<FIELDS field <,...n>>
Parameters
Name Description
SOURCE source_name The data source name (DSN) of the ODBC data source to connect to. The DSN must
already exist and be correctly configured.
Note
You are limited to data sources that use the Windows ODBC drivers that
are installed on your computer. The Analytics native data connectors that
can be used with the ACCESSDATA command may not be available with
IMPORT ODBC.
TABLE table_name The table name in the ODBC data source to import data from.
table_name usually refers to a database table in the source data, but it can refer to
anything Analytics imports as a table. For example, if you use the Microsoft Text Driver,
table_name refers to the text file you want to import data from.
QUALIFIER data_qualifier The character to use as the text qualifier to wrap and identify field values. You must
specify the character as a quoted string.
optional
Use single quotation marks to specify the double quotation character: '"'.
OWNER user_name The name of the database user account that owns the table you are connecting to.
optional
Name Description
optional You do not use PASSWORD num to prompt for, or specify, an actual password. The
password definition refers to a password previously supplied or set using the
PASSWORD command, the SET PASSWORD command, or the PASSWORD analytic
tag.
num is the number of the password definition. For example, if two passwords have been
previously supplied or set in a script, or when scheduling an analytic script, PASSWORD 2
specifies that password #2 is used.
For more information about supplying or setting passwords, see:
o "PASSWORD command" on page 2036
o SET PASSWORD command
o PASSWORD analytic tag
WHERE where_clause An SQL WHERE clause that limits the records returned based on a criteria you specify.
Must be a valid SQL statement and must be entered as a quoted string:
optional
By default, the table data file (.FIL) is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
o TO "C:\data\Invoices.FIL"
o TO "data\Invoices.FIL"
Note
Analytics table names are limited to 64 alphanumeric characters, not
including the .FIL extension. The name can include the underscore
character ( _ ), but no other special characters, or any spaces. The name
cannot start with a number.
WIDTH max_field_length The maximum length in characters for any field in the Analytics table that originates as
character data in the source from which you are importing.
optional
You can enter any value between 1 and 254. The default value is 50. Data that exceeds
the maximum field length is truncated when imported to Analytics.
MAXIMUM max_field_ The maximum length in characters for text, note, or memo fields you are importing.
length
You can enter any value between 1 and 1100. The default value is 100. Data that
optional exceeds the maximum field length is truncated when imported to Analytics.
FIELDS field <,...n> Individual fields in the source data to import. Specify the name.
optional If you specify multiple fields, each field must be separated by a comma. If you omit
FIELDS, all fields are imported.
Enclosing the field names in quotation marks makes them case-sensitive. If you use
quotation marks, the case of field names must exactly match between FIELDS and the
Name Description
ODBC data source. If you use quotation marks and the case of the field names does not
match, the fields are not imported.
Note
FIELDS must be positioned last among the IMPORT ODBC parameters.
If FIELDS is not positioned last, the command fails.
Examples
Remarks
Older method of connecting to ODBC data sources
The IMPORT ODBC command is the older method of connecting to ODBC-compliant data sources
from Analytics. The new method of connecting to ODBC data sources uses the Data Access window
and the ACCESSDATA command.
You can continue to use IMPORT ODBC in Analytics. However, this method of connecting is now
available only in scripts and from the Analytics command line. You can no longer access this
connection method in the Data Definition Wizard.
For more information, see the "SET SUPPRESSTIME" section in "SET command" on page 2102.
Syntax
IMPORT PDF TO table <PASSWORD num> import_filename FROM source_filename
<SERVER profile_name> skip_length <PARSER "VPDF"> <PAGES page_range>
{[record_syntax] [field_syntax] <...n>} <...n>
record_syntax ::=
RECORD record_name record_type lines_in_record transparent [test_syntax]
<...n>
test_syntax ::=
TEST include_exclude match_type AT start_line,start_position,range logic
text
field_syntax ::=
FIELD name type AT start_line,start_position SIZE length,lines_in_field DEC
value WID bytes PIC format AS display_name
Parameters
General parameters
Name Description
TO table The name of the Analytics table to import the data into.
Note
Table names are limited to 64 alphanumeric characters. The name can
include the underscore character ( _ ), but no other special characters, or
any spaces. The name cannot start with a number.
Name Description
By default, the data file (.FIL) is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
o "C:\data\Invoices.FIL"
o "data\Invoices.FIL"
FROM source_filename The name of the source data file. source_filename must be a quoted string.
If the source data file is not located in the same directory as the Analytics project, you
must use an absolute path or a relative path to specify the file location:
o "C:\data\source_filename"
o "data\source_filename"
SERVER profile_name The profile name for the server that contains the data that you want to import.
optional
Note
For Unicode data, specify an even number of bytes only. Specifying an
odd number of bytes can cause problems with subsequent processing of
the imported data.
PARSER "VPDF" Use the VeryPDF parser to parse the PDF file during the file definition process.
optional If you omit PARSER, the default Xpdf parser is used.
If you are importing the PDF file for the first time, and you have no reason to do
otherwise, use the default Xpdf parser. If you have already encountered data alignment
Name Description
issues when using Xpdf, use the VeryPDF parser to see if the parsing results are better.
PAGES page_range The pages to include if you do not want to import all of the pages in the PDF file. page_
range must be specified as a quoted string.
optional
You can specify:
o individual pages separated by commas (1,3,5)
o page ranges (2-7)
o a combination of pages and ranges (1, 3, 5-7, 11)
If you omit PAGES, all pages in the PDF file are imported.
RECORD parameter
General record definition information.
Note
Some of the record definition information is specified using numeric codes that map
to options in the Data Definition Wizard.
In scripts, specify the numeric code, not the option name.
Name Description
RECORD record_name The name of the record in the Data Definition Wizard.
Specifying record_name is required in the IMPORT PDF command, but the record_name
value does not appear in the resulting Analytics table.
In the Data Definition Wizard, Analytics provides default names based on the type of
record:
o Detail
o Headern
o Footern
record_type The three possible record types when defining a PDF file:
o 0 – detail
o 1 – header
o 2 – footer
Note
You can define multiple sets of header and footer records in a single
execution of IMPORT PDF, but only one set of detail records.
Name Description
Note
Applies to header records only.
o 0 – not transparent
o 1 – transparent
TEST parameter
The criteria for defining a set of records in the PDF file. You can have one or more occurrences of
TEST (up to 8) for each occurrence of RECORD.
Note
Some of the criteria are specified using numeric codes that map to options in the
Data Definition Wizard (option names are shown in parentheses below).
In scripts, specify the numeric code, not the option name.
Name Description
Name Description
o 10 – (Custom Map) matching records must contain characters that match the
specified character pattern, in the specified start line, starting at the specified position
AT start_line, start_ o start_line – the line of a record that the criteria apply to
position, range
For example, if you create a custom map to match zip codes, and the zip codes
appear on the third line of a three-line address record, you must specify 3 in start_line.
Note
For single-line records, the start_line value is always 1.
o start_position – the starting byte position in the PDF file for the comparison against
the criteria
o range – the number of bytes from the starting byte position in the PDF file to use in the
comparison against the criteria
If you are using starting byte position only, without a range, specify 0 for range.
Note
the current group and the next group are related with a logical AND
o 5 – (New Group > Or) the current criterion is the last in a group of logical criteria, and
the current group and the next group are related with a logical OR
o 7 – (End) the current criterion is the last in a group of logical criteria
FIELD parameters
Field definition information.
Name Description
FIELD name type The individual fields to import from the source data file, including the name and data type
of the field. To exclude a field from being imported, do not specify it.
For information about type, see "Identifiers for field data types" on page 1960.
AT start_line, start_ o start_line – the start line of the field in the record in the PDF file
position
For multiline records in a PDF file, start_line allows you to start a field at any line of
the record. start_line is always 1 if lines_in_record is 1.
o start_position – the starting byte position of the field in the PDF file
Note
SIZE length, lines_in_field o length – the length in bytes of the field in the Analytics table layout
Note
o lines_in_field – the number of lines occupied by a single field value in the PDF file
You can define single-line or multiline fields to match the data in the file.
Note
The number of lines specified for a field cannot exceed the number of
lines specified for the record containing the field.
o numeric fields – the display format of numeric values in Analytics views and reports
Name Description
o datetime fields – the physical format of datetime values in the source data (order of
date and time characters, separators, and so on)
Note
For datetime fields, format must exactly match the physical format in
the source data. For example, if the source data is 12/31/2014, you
must enter the format as "MM/DD/YYYY".
AS display_name The display name (alternate column title) for the field in the view in the new Analytics
table.
Specify display_name as a quoted string. Use a semi-colon (;) between words if you want
a line break in the column title.
AS is required when you are defining FIELD. To make the display name the same as the
field name, enter a blank display_name value using the following syntax: AS "". Make
sure there is no space between the two double quotation marks.
Examples
Remarks
For more information about how this command works, see "Defining and importing print image
(report) files and PDF files" on page 275.
Note
When you use the Data Definition Wizard to define a table that includes EBCDIC,
Unicode, or ASCII fields, the fields are automatically assigned the letter "C" (for the
CHARACTER type).
When you enter an IMPORT statement manually, or edit an existing IMPORT
statement, you can substitute the more specific letters "E" or "U" for EBCDIC or
Unicode fields.
A ACL
B BINARY
C CHARACTER
D DATETIME
E EBCDIC
F FLOAT
G ACCPAC
I IBMFLOAT
K UNSIGNED
L LOGICAL
N PRINT
P PACKED
Q BASIC
R MICRO
S CUSTOM
T PCASCII
U UNICODE
V VAXFLOAT
X NUMERIC
Y UNISYS
Z ZONED
Creates an Analytics table by defining and importing a Print Image (Report) file.
Syntax
IMPORT PRINT TO table import_filename FROM source_filename <SERVER profile_
name> character_set_value <code_page_number> {[record_syntax] [field_syntax]
<...n>} <...n>
record_syntax ::=
RECORD record_name record_type lines_in_record transparent [test_syntax]
<...n>
test_syntax ::=
TEST include_exclude match_type AT start_line,start_position,range logic
text
field_syntax ::=
FIELD name type AT start_line,start_position SIZE length,lines_in_field DEC
value WID bytes PIC format AS display_name
Parameters
General parameters
Name Description
TO table The name of the Analytics table to import the data into.
Note
Table names are limited to 64 alphanumeric characters. The name can
include the underscore character ( _ ), but no other special characters, or
any spaces. The name cannot start with a number.
Name Description
By default, the data file (.FIL) is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
o "C:\data\Invoices.FIL"
o "data\Invoices.FIL"
FROM source_filename The name of the source data file. source_filename must be a quoted string.
If the source data file is not located in the same directory as the Analytics project, you
must use an absolute path or a relative path to specify the file location:
o "C:\data\source_filename"
o "data\source_filename"
SERVER profile_name The profile name for the server that contains the data that you want to import.
optional
character_set_value The character set used to encode the Print Image (Report) file. The following values are
supported:
o 0 – ASCII
o 1 – EBCDIC
o 2 – Unicode
o 3 – Encoded text
code_page_number If you specified 3 (Encoded text) for character_set_value, you must also enter a code
page number.
optional
RECORD parameter
General record definition information.
Note
Some of the record definition information is specified using numeric codes that map
to options in the Data Definition Wizard.
In scripts, specify the numeric code, not the option name.
Name Description
RECORD record_name The name of the record in the Data Definition Wizard.
Specifying record_name is required in the IMPORT PRINT command, but the record_
name value does not appear in the resulting Analytics table.
In the Data Definition Wizard, Analytics provides default names based on the type of
Name Description
record:
o Detail
o Headern
o Footern
record_type The three possible record types when defining a Print Image file:
o 0 – detail
o 1 – header
o 2 – footer
Note
You can define multiple sets of header and footer records in a single
execution of IMPORT PRINT, but only one set of detail records.
lines_in_record The number of lines occupied by a record in the Print Image file.
You can define single-line or multiline records to match the data in the file.
Note
Applies to header records only.
o 0 – not transparent
o 1 – transparent
TEST parameter
The criteria for defining a set of records in the Print Image file. You can have one or more
occurrences of TEST (up to 8) for each occurrence of RECORD.
Note
Some of the criteria are specified using numeric codes that map to options in the
Data Definition Wizard (option names are shown in parentheses below).
In scripts, specify the numeric code, not the option name.
Name Description
Name Description
AT start_line, start_ o start_line – the line of a record that the criteria apply to
position, range
For example, if you create a custom map to match zip codes, and the zip codes
appear on the third line of a three-line address record, you must specify 3 in start_line.
Note
For single-line records, the start_line value is always 1.
o start_position – the starting byte position in the Print Image file for the comparison
against the criteria
o range – the number of bytes from the starting byte position in the Print Image file to
use in the comparison against the criteria
If you are using starting byte position only, without a range, specify 0 for range.
Note
Name Description
o 0 – (And) the current and the next criteria are related with a logical AND
o 1 – (Or) the current and the next criteria are related with a logical OR
o 4 – (New Group > And) the current criterion is the last in a group of logical criteria, and
the current group and the next group are related with a logical AND
o 5 – (New Group > Or) the current criterion is the last in a group of logical criteria, and
the current group and the next group are related with a logical OR
o 7 – (End) the current criterion is the last in a group of logical criteria
FIELD parameters
Field definition information.
Name Description
FIELD name type The individual fields to import from the source data file, including the name and data type
of the field. To exclude a field from being imported, do not specify it.
For information about type, see "Identifiers for field data types" on page 1968.
AT start_line, start_ o start_line – the start line of the field in the record in the Print Image file
position
For multiline records in a Print Image file, start_line allows you to start a field at any
line of the record. start_line is always 1 if lines_in_record is 1.
o start_position – the starting byte position of the field in the Print Image file
Note
SIZE length, lines_in_field o length – the length in bytes of the field in the Analytics table layout
Name Description
Note
o lines_in_field – the number of lines occupied by a single field value in the Print Image
file
You can define single-line or multiline fields to match the data in the file.
Note
The number of lines specified for a field cannot exceed the number of
lines specified for the record containing the field.
o numeric fields – the display format of numeric values in Analytics views and reports
o datetime fields – the physical format of datetime values in the source data (order of
date and time characters, separators, and so on)
Note
For datetime fields, format must exactly match the physical format in
the source data. For example, if the source data is 12/31/2014, you
must enter the format as "MM/DD/YYYY".
AS display_name The display name (alternate column title) for the field in the view in the new Analytics
table.
Specify display_name as a quoted string. Use a semi-colon (;) between words if you want
a line break in the column title.
AS is required when you are defining FIELD. To make the display name the same as the
field name, enter a blank display_name value using the following syntax: AS "". Make
sure there is no space between the two double quotation marks.
Examples
Remarks
For more information about how this command works, see "Defining and importing print image
(report) files and PDF files" on page 275.
Note
When you use the Data Definition Wizard to define a table that includes EBCDIC,
Unicode, or ASCII fields, the fields are automatically assigned the letter "C" (for the
CHARACTER type).
When you enter an IMPORT statement manually, or edit an existing IMPORT
statement, you can substitute the more specific letters "E" or "U" for EBCDIC or
Unicode fields.
A ACL
B BINARY
C CHARACTER
D DATETIME
E EBCDIC
F FLOAT
G ACCPAC
I IBMFLOAT
K UNSIGNED
L LOGICAL
N PRINT
P PACKED
Q BASIC
R MICRO
S CUSTOM
T PCASCII
U UNICODE
V VAXFLOAT
X NUMERIC
Y UNISYS
Z ZONED
Note
The IMPORT SAP command is only supported if Direct Link is installed and
configured on your local computer and on your organization's SAP system.
Syntax
IMPORT SAP PASSWORD num TO table_name SAP SOURCE "SAP AGENT" import_details
Parameters
Name Description
Note
The password is used to access the SAP system.
TO table_name The name of the Analytics table to import the data into.
Note
Table names are limited to 64 alphanumeric characters. The name can
include the underscore character ( _ ), but no other special characters, or
any spaces. The name cannot start with a number.
SAP SOURCE Required for importing SAP data. "SAP AGENT" is the only available option.
"SAP AGENT"
Name Description
import_details The details of the query. Must be enclosed by the <q></q> tags, and uses the tags listed
in "Direct Link query tags" on page 1974 to define the query.
The physical size of this value can be up to 16 KB.
Examples
Note
To assist readability, this example is formatted using multiple lines. In your
script, the command and the query string must be entered without any line
breaks.
Tip
The syntax of an IMPORT SAP query string is typically complex. The best way
to add IMPORT SAP commands with query strings to your scripts is to copy
an existing IMPORT SAP command from the Log tab in Analytics, then edit
the query tags as necessary.
<r>500</r>
<ar>0</ar>
<e>500</e>
<ts>
<t>
<n>EKKO</n>
<a>T00001</a>
<td>Purchasing Document Header</td>
<fs>
<f>EBELN</f>
<f>BUKRS</f>
<f>BSTYP</f>
<f>BSART</f>
<f>STATU</f>
<f>WKURS</f>
</fs>
<wc>
<w>
<f>BUKRS</f>
<o>0</o>
<l>1000</l>
<h></h>
</w>
</wc>
</t>
<t>
<n>EKPO</n>
<a>T00002</a>
<td>Purchasing Document Item</td>
<fs>
<f>EBELP</f>
<f>WERKS</f>
<f>MENGE</f>
<f>BRTWR</f>
</fs>
<wc></wc>
</t>
</ts>
<js>
<jc>
<pt>
<pa>T00001</pa>
<pf>EBELN</pf>
</pt>
<ct>
<ca>T00002</ca>
<cf>EBELN</cf>
</ct>
</jc>
</js>
</q>
Remarks
The table in "Direct Link query tags" below lists the tags that can be included in the import_details
parameter. The Required column uses the following values to indicate when tags must be present:
l Y – Required
l N – Optional
l M – Required for multi-table queries only
l B – Required, but no value should be passed
l W – Optional when filters are used
l S – Required when scheduled mode is specified
Table Alias <a> M The alias that uniquely identifies the table within the query. This
allows the same table to be used more than once.
The maximum length is 6 characters.
All Rows <ar> Y Indicates that all matching rows should be returned as part of
the query's result set.
Valid values are:
1 – Overrides the number of records specified in the <r> tag
(Maximum Rows)
0 – Returns the number of records specified in the <r> tag
(Maximum Rows)
This tag always appears after the <r></r> tag.
Child Table Field <cf> M The field in the child table that the join condition is based on.
Client Filename <cf> Y Identifies the target file on the client system where the results of
the query will be stored.
Data Length <dl> B The number of characters in each row, including carriage return
and line feed characters indicating the end of the record
(CR+LF, or the hexadecimal characters 0D+0A).
Date <dt> S Required when using scheduled mode. Specifies the time to run
the SAP job.
Must be formatted as YYYYMMDD. For example, December 31,
2014 must be specified as 20141231.
Expected Rows <e> B The expected number of rows the query will return.
Filter Field <f> W The native field name that the filter applies to.
Fields <fs> Y The list of fields in the table that will be returned as part of the
query results.
High Value <h> W Contains the high value when using the Between operator.
Ignored when using any other operator.
Job Count <jcount> B Used internally by SAP to identify a Background mode query.
Job Name <jname> B Used internally by SAP to identify a Background mode query.
Join Relationships <js> Y The list of join conditions that link tables within the query.
Join Switch <jw> N Numeric equivalent of the join switch enumerated type.
Valid values are:
0 – Inner Join
1 – Left Outer Join
Low Value <l> W Contains either the lowest value when using the Between
operator or the value when using any other operator.
Language <lg> Y Language identifier used to determine the locale of fields in the
SAP database.
0 – Extract Now
1 – Background
2 – Scheduled
Parent Table Field <pf> M The field in the parent table the join condition is based on.
Maximum Rows <r> Y The maximum number of rows the query should return.
Selected <s> Y If the <s> tag appears below the <f> tag, it indicates whether the
field will be returned as part of the query's result set.
System <s> Y If the <s> tag appears below the <q> tag, it identifies the type of
system this query is used against (currently only SAP is
supported).
Server Filename <sf> B Identifies the file on the server that holds the results of a
Background mode query.
Server Group <sg> N The name of the server group. Maximum 20 characters.
Name
Table Description <td> Y The table description from the SAP data dictionary. It should
Time <tm> S Required when using scheduled mode. Specifies the time to run
the SAP job.
Must be formatted as hhmmss. For example, 2:30 pm must be
specified as 143000.
Tables <ts> Y The list of tables from which the query will extract data.
Filters <wc> W The list of filters that will be applied to the data contained within
the table.
Filter Switch <ws> N Numeric equivalent of the filter switch enumerated type.
Valid values are:
0 – (Or) And (Or)
1 – (And) Or (And)
Syntax
IMPORT XBRL TO table import_filename FROM source_filename CONTEXT context_
name <...n> [field_syntax] <...n> <IGNORE field_num> <...n>
field_syntax ::=
FIELD name type AT start_position DEC value WID bytes PIC format AS display_
name
Parameters
Name Description
TO table The name of the Analytics table to import the data into.
Note
Table names are limited to 64 alphanumeric characters. The name can
include the underscore character ( _ ), but no other special characters, or
any spaces. The name cannot start with a number.
By default, the data file (.FIL) is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
o "C:\data\Invoices.FIL"
o "data\Invoices.FIL"
FROM source_filename The name of the source data file. source_filename must be a quoted string.
If the source data file is not located in the same directory as the Analytics project, you
must use an absolute path or a relative path to specify the file location:
o "C:\data\source_filename"
Name Description
o "data\source_filename"
CONTEXT context_name The XBRL context to define the table from. If you specify more than one context, all
contexts must be of the same type (instant, period, or forever).
FIELD name type The individual fields to import from the source data file, including the name and data type
of the field. To exclude a field from being imported, do not specify it.
For information about type, see "Identifiers for field data types" on the facing page.
AT start_position The starting byte position of the field in the Analytics data file.
Note
WID bytes The length in bytes of the field in the Analytics table layout.
Note
o numeric fields – the display format of numeric values in Analytics views and reports
o datetime fields – the physical format of datetime values in the source data (order of
date and time characters, separators, and so on)
Note
For datetime fields, format must exactly match the physical format in
the source data. For example, if the source data is 12/31/2014, you
must enter the format as "MM/DD/YYYY".
AS display_name The display name (alternate column title) for the field in the view in the new Analytics
table.
Name Description
Specify display_name as a quoted string. Use a semi-colon (;) between words if you want
a line break in the column title.
AS is required when you are defining FIELD. To make the display name the same as the
field name, enter a blank display_name value using the following syntax: AS "". Make
sure there is no space between the two double quotation marks.
Examples
Remarks
For more information about how this command works, see "Import an XBRL file" on page 348.
Note
When you use the Data Definition Wizard to define a table that includes EBCDIC,
Unicode, or ASCII fields, the fields are automatically assigned the letter "C" (for the
CHARACTER type).
When you enter an IMPORT statement manually, or edit an existing IMPORT
statement, you can substitute the more specific letters "E" or "U" for EBCDIC or
Unicode fields.
A ACL
B BINARY
C CHARACTER
D DATETIME
E EBCDIC
F FLOAT
G ACCPAC
I IBMFLOAT
K UNSIGNED
L LOGICAL
N PRINT
P PACKED
Q BASIC
R MICRO
S CUSTOM
T PCASCII
U UNICODE
V VAXFLOAT
X NUMERIC
Y UNISYS
Z ZONED
Syntax
IMPORT XML TO table import_filename FROM source_filename [field_syntax]
<...n>
field_syntax ::=
FIELD name type AT start_position DEC value WID bytes PIC format AS display_
name RULE xpath_expression
Parameters
Name Description
TO table The name of the Analytics table to import the data into.
Note
Table names are limited to 64 alphanumeric characters. The name can
include the underscore character ( _ ), but no other special characters, or
any spaces. The name cannot start with a number.
By default, the data file (.FIL) is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
o "C:\data\Invoices.FIL"
o "data\Invoices.FIL"
FROM source_filename The name of the source data file. source_filename must be a quoted string.
If the source data file is not located in the same directory as the Analytics project, you
must use an absolute path or a relative path to specify the file location:
o "C:\data\source_filename"
Name Description
o "data\source_filename"
FIELD name type The individual fields to import from the source data file, including the name and data type
of the field. To exclude a field from being imported, do not specify it.
For information about type, see "Identifiers for field data types" on the next page.
AT start_position The starting byte position of the field in the Analytics data file.
Note
WID bytes The length in bytes of the field in the Analytics table layout.
Note
o numeric fields – the display format of numeric values in Analytics views and reports
o datetime fields – the physical format of datetime values in the source data (order of
date and time characters, separators, and so on)
Note
For datetime fields, format must exactly match the physical format in
the source data. For example, if the source data is 12/31/2014, you
must enter the format as "MM/DD/YYYY".
AS display_name The display name (alternate column title) for the field in the view in the new Analytics
table.
Specify display_name as a quoted string. Use a semi-colon (;) between words if you want
a line break in the column title.
AS is required when you are defining FIELD. To make the display name the same as the
Name Description
field name, enter a blank display_name value using the following syntax: AS "". Make
sure there is no space between the two double quotation marks.
RULE xpath_expression The XPath expression used to select the field contents from the XML file.
XPath is a standard way of accessing data from XML files. For example,
acct/title/text() retrieves the text within the <title> tag in the XML file.
Examples
Remarks
For more information about how this command works, see "Import an XML file" on page 339.
Note
When you use the Data Definition Wizard to define a table that includes EBCDIC,
Unicode, or ASCII fields, the fields are automatically assigned the letter "C" (for the
CHARACTER type).
When you enter an IMPORT statement manually, or edit an existing IMPORT
statement, you can substitute the more specific letters "E" or "U" for EBCDIC or
Unicode fields.
A ACL
B BINARY
C CHARACTER
D DATETIME
E EBCDIC
F FLOAT
G ACCPAC
I IBMFLOAT
K UNSIGNED
L LOGICAL
N PRINT
P PACKED
Q BASIC
R MICRO
S CUSTOM
T PCASCII
U UNICODE
V VAXFLOAT
X NUMERIC
Y UNISYS
Z ZONED
INDEX command
Creates an index for an Analytics table that allows access to the records in a sequential order rather
than a physical order.
Syntax
INDEX {<ON> key_field <D> <...n>|<ON> ALL <EXCLUDE field_name <...n>>} TO
file_name <IF test> <WHILE test> <FIRST range|NEXT range> <OPEN> <ISOLOCALE
locale_code>
Parameters
Name Description
ON key_field D <...n> | ON The key field or fields, or the expression, to use for indexing.
ALL
You can index by any type of field, including computed fields and ad hoc expressions,
regardless of data type.
o ON key_field – use the specified field or fields
If you index by more than one field, you create nested indexing in the table. The order
of nesting follows the order in which you specify the fields.
Include D to index the key field in descending order. The default index order is
ascending.
o ON ALL – use all fields in the table
If you index by all the fields in a table you create nested indexing. The order of nesting
follows the order in which the fields appear in the table layout.
An ascending index order is the only option for ON ALL.
TO file_name The name of the index and the associated index file. The index file is created with an .INX
extension.
Name Description
Note
In the Analytics user interface, index names are limited to 64 alphanu-
meric characters. The name can include the underscore character ( _ ),
but no other special characters, or any spaces. The name cannot start
with a number.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
OPEN Open the table and apply the index to the table.
optional
The system locale in the format language_country. For example, to use Canadian
French, enter fr_ca.
Use the following codes:
o language – ISO 639 standard language code
o country – ISO 3166 standard country code
If you do not specify a country code, the default country for the language is used.
If you do not use ISOLOCALE, the default system locale is used.
Examples
OPEN Vendor
INDEX ON Vendor_City to "CityIndex" OPEN
OPEN Vendor
INDEX ON Vendor_City to "CityIndex"
.
.
.
SET INDEX TO "CityIndex"
Remarks
For more information about how this command works, see "Indexing records" on page 1208.
Analytics
Edition Sort Order default Associated sort sequence
Analytics
Edition Sort Order default Associated sort sequence
(ASCII)
0, 1, 2... A, B, C... a, b, c...
Case sensitivity
INDEX is case sensitive. Depending on which edition of Analytics you are using (non-Unicode or
Unicode), casing in strings may affect indexing.
You can use the UPPER( ) function in conjunction with INDEX if you do not want case to affect
indexing:
JOIN command
Combines fields from two Analytics tables into a new, single Analytics table.
Note
To use fuzzy matching to join tables, see "FUZZYJOIN command" on page 1835.
Syntax
JOIN {PKEY primary_key_fields|PKEY ALL <EXCLUDE field_name <...n>>} {FIELDS
primary_fields|FIELDS ALL <EXCLUDE field_name <...n>>} {SKEY secondary_key_
fields|SKEY ALL <EXCLUDE field_name <...n>>} <WITH secondary_fields|WITH ALL
<EXCLUDE field_name <...n>>> {no_
keyword|MANY|UNMATCHED|PRIMARY|SECONDARY|PRIMARY SECONDARY} <IF test> TO
table_name <LOCAL> <OPEN> <WHILE test> <FIRST range|NEXT range> <APPEND>
<PRESORT> <SECSORT> <ISOLOCALE locale_code>
Parameters
Name Description
PKEY primary_key_fields | The key field or fields, or expression, in the primary table.
PKEY ALL o PKEY primary_key_fields – use the specified field or fields
Fields are used in the order that you list them.
o PKEY ALL – use all fields in the table
Fields are used in the order that they appear in the table layout.
EXCLUDE field_name Only valid when performing a join using PKEY ALL.
optional The field or fields to exclude from the command. EXCLUDE allows you to fine-tune PKEY
ALL, by excluding the specified fields.
EXCLUDE must immediately follow PKEY ALL. For example:
FIELDS primary_fields | The fields or expressions from the primary table to include in the joined output table.
FIELDS ALL o FIELDS primary_fields – include the specified field or fields
Name Description
Note
You must explicitly specify the primary key field or fields if you want to
include them in the joined table. Specifying FIELDS ALL also includes
them.
EXCLUDE primary_fields Only valid when performing a join using FIELDS ALL.
optional The field or fields to exclude from the command. EXCLUDE allows you to fine-tune
FIELDS ALL, by excluding the specified fields.
EXCLUDE must immediately follow FIELDS ALL. For example:
SKEY secondary_key_ The key field or fields, or expression, in the secondary table.
fields | SKEY ALL o SKEY secondary_key_fields – use the specified field or fields
Fields are used in the order that you list them.
o SKEY ALL – use all fields in the table
Fields are used in the order that they appear in the table layout.
EXCLUDE field_name Only valid when performing a join using SKEY ALL.
optional The field or fields to exclude from the command. EXCLUDE allows you to fine-tune SKEY
ALL, by excluding the specified fields.
EXCLUDE must immediately follow SKEY ALL. For example:
WITH secondary_fields | The fields or expressions from the secondary table to include in the joined output table.
WITH ALL o WITH secondary_fields – include the specified field or fields
optional
Fields are included in the order that you list them.
o WITH ALL – include all fields from the table
Fields are included in the order that they appear in the table layout.
Note
You must explicitly specify the secondary key field or fields if you want to
include them in the joined table. Specifying WITH ALL also includes
them.
You cannot specify WITH if you are using the UNMATCHED join type.
EXCLUDE field_name Only valid when performing a join using WITH ALL.
Name Description
optional The field or fields to exclude from the command. EXCLUDE allows you to fine-tune
WITH ALL, by excluding the specified fields.
EXCLUDE must immediately follow WITH ALL. For example:
The joined output table contains: Corresponding option in the Join dialog box
o all matched primary records and the first Matched primary and secondary
matched secondary record
(1st secondary match)
MANY
The joined output table contains: Corresponding option in the Join dialog box
o all matched primary records and all matched Matched primary and secondary
secondary records
o one record for each match between the (all secondary matches)
primary and secondary tables
UNMATCHED
The joined output table contains: Corresponding option in the Join dialog box
PRIMARY
Name Description
The joined output table contains: Corresponding option in the Join dialog box
o all primary records (matched and unmatched) All primary and matched secondary
and the first matched secondary record
Note
The keyword BOTH is the same as specifying PRIMARY.
SECONDARY
The joined output table contains: Corresponding option in the Join dialog box
o all secondary records (matched and All secondary and matched primary
unmatched) and all matched primary records
PRIMARY SECONDARY
The joined output table contains: Corresponding option in the Join dialog box
o all primary and all secondary records, All primary and secondary
matched and unmatched
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
Name Description
Note
For most join types, an IF condition applies only to the primary table.
The one exception is a many-to-many join, in which the IF condition can
also reference the secondary table. To reference the secondary table you
must specify a fully qualified field name (table_name.field_name). For
example:
IF Customer.State="NY"
By default, the table data file (.FIL) is saved to the folder containing the
Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
l TO "C:\Output.FIL"
l TO "Results\Output.FIL"
Note
Table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _
), but no other special characters, or any spaces. The name cannot
start with a number.
LOCAL Saves the output file in the same location as the Analytics project.
optional
Note
Applicable only when running the command against a server table with
an output file that is an Analytics table.
The LOCAL parameter must immediately follow the TO parameter.
OPEN Opens the table created by the command after the command executes. Only valid if the
command creates an output table.
optional
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
Name Description
optional reached
o NEXT – start processing from the currently selected record until the specified number
of records is reached
Use range to specify the number of records to process.
If you omit FIRST and NEXT, all records are processed by default.
APPEND Appends the command output to the end of an existing file instead of overwriting it.
optional
Note
You must ensure that the structure of the command output and the
existing file are identical:
l the same fields
l the same field order
l matching fields are the same length
l matching fields are the same data type
Analytics appends output to an existing file regardless of its structure. If
the structure of the output and the existing file do not match, jumbled,
missing, or inaccurate data can result.
PRESORT Sorts the primary table on the primary key field before executing the command.
optional
Note
You cannot use PRESORT inside the GROUP command.
SECSORT Sorts the secondary table on the secondary key field before executing the command.
optional
Note
You cannot use SECSORT inside the GROUP command.
The system locale in the format language_country. For example, to use Canadian
Name Description
Examples
This version of the JOIN command includes all fields from the primary and secondary tables
in the joined output table.
This version of the JOIN command uses an IF condition to restrict the joined output table to
employees and vendors with addresses in California.
Note that the join type is MANY, which is required if you want an IF condition to reference a
secondary table. The name of the field in the secondary table must be fully qualified (
Vendor.Vendor_State ).
OPEN Ar PRIMARY
OPEN Customer SECONDARY
JOIN PKEY CustNo FIELDS CustNo Due Amount SKEY CustNo UNMATCHED TO
"CustomerNotFound.fil" OPEN PRESORT SECSORT
Remarks
For more information about how this command works, see "Joining tables" on page 963.
LIST command
Outputs the data in one or more fields in an Analytics table to a display formatted in columns.
Syntax
LIST {FIELDS field_name <AS display_name> <...n>|FIELDS ALL} <LINE number
field_list> <TO {SCREEN|filename|PRINT}> <UNFORMATTED> <IF test> <WHILE
test> <FIRST range|NEXT range> <HEADER header_text> <FOOTER footer_text>
<SKIP lines> <EOF> <APPEND>
Parameters
Name Description
LINE number field_list More than one line is used in the output for each record:
optional o number – the line number, must be between 2 and 60 inclusive
o field_list – the fields to include on that line
Name Description
Specify filename as a quoted string with the appropriate file extension. For example:
TO "Output.TXT"
By default, the file is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the file to a different, existing folder:
l TO "C:\Output.TXT"
l TO "Results\Output.TXT"
o PRINT – sends the results to the default printer
UNFORMATTED The output is displayed as unformatted text. Output is identical to that created by the
EXPORT ASCII command. Unformatted data can be output to a file for further
optional
processing by other software programs.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
HEADER header_text The text to insert at the top of each page of a report.
optional header_text must be specified as a quoted string. The value overrides the Analytics
HEADER system variable.
FOOTER footer_text The text to insert at the bottom of each page of a report.
optional footer_text must be specified as a quoted string. The value overrides the Analytics
FOOTER system variable.
SKIP lines Inserts the specified number of blank lines between each record in the list. For example,
LIST ALL SKIP 1 produces a double spaced list (one blank line between each record).
optional
Name Description
EOF Execute the command one more time after the end of the file has been reached.
optional This ensures that the final record in the table is processed when inside a GROUP
command. Only use EOF if all fields are computed fields referring to earlier records.
APPEND Appends the command output to the end of an existing file instead of overwriting it.
optional
Examples
Remarks
When to use LIST
Use LIST to print data, display data on screen, or export it to a text file.
LOCATE command
Searches for the first record that matches the specified value or condition, or moves to the specified
record number.
Syntax
LOCATE {IF test <WHILE test> <FIRST range|NEXT range>|RECORD num}
Parameters
Name Description
IF test The value or condition to search for. You must enclose character literal values in
quotation marks, and datetime values in backquotes.
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
Examples
LOCATE RECORD 50
Remarks
For more information about how this command works, see "Selecting the first matching record" on
page 1239.
How it works
Use the LOCATE command to move directly to the first record in a table matching the specified
value or condition.
If the specified value or condition is found, the first matching record in the table is selected. If the
specified value or condition is not found, the table is positioned at the first record.
You can also use LOCATE to move directly to a specific record number
or or
Deselect: Exact Character Comparisons in the Options Select: Exact Character Comparisons in the Options
dialog box (Tools > Options > Table) dialog box (Tools > Options > Table)
Result: The search value can be contained by a longer Result: The search value must exactly match a value in a
value in the field or fields being searched. The search field to constitute a match.
value must appear at the start of a field to constitute a
match.
For more information about SET EXACT, see "SET command" on page 2102.
For more information about the Exact Character Comparisons option, see "Table options" on
page 125.
LOOP command
Executes a series of ACLScript commands repeatedly on a record while a specified condition
evaluates to true.
Note
The LOOP command must be enclosed inside the GROUP command.
Syntax
LOOP WHILE test
command
<...n>
END
Parameters
Name Description
WHILE test The test that must evaluate to true for the commands inside the LOOP command to be
executed. If the test evaluates to true the commands are executed repeatedly until the
test evaluates to false.
Examples
COMMENT
Use GROUP to count commas in each department code field as a way of
identifying how many departments are associated with the record
"LOOP" over each record for each code in the field, with each iter-
ation of the loop extracting the record with a single code to the res-
ult1 table
END
GROUP
v_department_count = OCCURS(Dept_Code,',')
v_counter = 0
LOOP WHILE v_counter <= v_department_count
v_dept = SPLIT(Dept_Code, ',', (v_counter + 1))
EXTRACT FIELDS Invoice_Number, Amount, v_dept AS "Department" TO
result1
v_counter = v_counter + 1
END
END
Remarks
Tip
For detailed tutorials covering the LOOP and GROUP commands, see "Control
structures" on page 1481 and "Grouping and looping" on page 1484.
How it works
Each LOOP command must specify a WHILE condition to test, and be closed with an END
statement. The commands between LOOP and END are executed repeatedly for the current record
MERGE command
Combines records from two sorted Analytics tables with an identical structure into a new Analytics
table that uses the same sort order as the original tables.
Syntax
MERGE {{ON key_fields|ON ALL <EXCLUDE field_name <...n>>}|{PKEY primary_key_
fields|PKEY ALL <EXCLUDE field_name <...n>>} {SKEY secondary_key_
fields|SKEY ALL <EXCLUDE field_name <...n>>}} <IF test> TO table_name
<LOCAL> <OPEN> <WHILE test> <FIRST range|NEXT range> <APPEND> <PRESORT>
<ISOLOCALE locale_code>
Note
Only character fields, or character computed fields, can be used as key fields in
MERGE.
The key fields in the primary and secondary tables must both be sorted in ascending
order. If one or both key fields are unsorted, or sorted in descending order, the
MERGE command fails.
You can use PRESORT to sort the primary key field. If the secondary key field is
unsorted, you must first sort it in a separate sort operation before performing the
merge.
The primary and secondary tables can be indexed instead of sorted. With large
tables, indexing instead of sorting may reduce the time required to merge the tables.
Parameters
Name Description
The key field or fields in both the primary and the secondary tables.
o ON key_fields – use the specified field or fields
Name Description
PKEY primary_key_fields | The key field or fields, or expression, in the primary table.
PKEY ALL o PKEY primary_key_fields – use the specified field or fields
Fields are used in the order that you list them.
o PKEY ALL – use all fields in the table
Fields are used in the order that they appear in the table layout.
SKEY secondary_key_ The key field or fields, or expression, in the secondary table.
fields | SKEY ALL o SKEY secondary_key_fields – use the specified field or fields
Fields are used in the order that you list them.
o SKEY ALL – use all fields in the table
Fields are used in the order that they appear in the table layout.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Name Description
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
By default, the table data file (.FIL) is saved to the folder containing the
Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
l TO "C:\Output.FIL"
l TO "Results\Output.FIL"
Note
Table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _
), but no other special characters, or any spaces. The name cannot
start with a number.
LOCAL Saves the output file in the same location as the Analytics project.
optional
Note
Applicable only when running the command against a server table with
an output file that is an Analytics table.
The LOCAL parameter must immediately follow the TO parameter.
OPEN Opens the table created by the command after the command executes. Only valid if the
command creates an output table.
optional
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
Name Description
APPEND Appends the command output to the end of an existing file instead of overwriting it.
optional
Note
You must ensure that the structure of the command output and the
existing file are identical:
l the same fields
l the same field order
l matching fields are the same length
l matching fields are the same data type
Analytics appends output to an existing file regardless of its structure. If
the structure of the output and the existing file do not match, jumbled,
missing, or inaccurate data can result.
PRESORT Sorts the primary table on the primary key field before executing the command.
optional
Note
You cannot use PRESORT inside the GROUP command.
Omit PRESORT:
o If the primary key field is already sorted
o If you are merging two tables using an indexed common key field
The system locale in the format language_country. For example, to use Canadian
French, enter fr_ca.
Use the following codes:
o language – ISO 639 standard language code
o country – ISO 3166 standard country code
If you do not specify a country code, the default country for the language is used.
If you do not use ISOLOCALE, the default system locale is used.
Examples
Remarks
For more information about how this command works, see "Merging tables" on page 954.
Alternatives to merging
Merging can be tricky to perform correctly. You can get the same result by appending, or by
extracting and appending, and then sorting.
For more information, see "APPEND command" on page 1668, and "EXTRACT command" on
page 1818.
If the two source tables are already sorted, merging is more efficient and can execute more quickly.
NOTES command
Creates, modifies, or removes a note associated with an individual record in an Analytics table.
Syntax
NOTES <IF test> <TEXT note_text> <APPEND> <CLEAR>
Parameters
Name Description
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
o If you do not specify an IF test, the note text is added to each record in the table
o If you specify an IF test and CLEAR, the notes for those records that meet the
condition are deleted
TEXT note_text The text to add as a note. note_text must be either a string enclosed in quotation marks,
or a character expression.
optional
APPEND The note text is added to the end of any existing notes. If omitted, any existing notes are
overwritten.
optional
CLEAR Notes are deleted. Even if all record notes in a table are deleted, the auto-generated
RecordNote field is not deleted from the table layout.
optional
Examples
NOTES CLEAR
Remarks
Deleting the RecordNote field
To delete the RecordNote field from the table layout, and all notes in the table, use the DELETE
NOTES command without any of the options specified.
NOTIFY command
Submits an outgoing email notification message to an SMTP mail server to be relayed to recipients.
Syntax
Authenticated command syntax
NOTIFY SMTP SMTPUSER SMTP_account_name PORT port_number <ENABLESSL> USER
sender_email PASSWORD encrypted_password MAILBOX SMTP_server_name ADDRESS
recipient_email <CC cc_recipient_email> <BCC bcc_recipient_email> SUBJECT
subject_line MESSAGE message_text <ATTACHMENT file_path>
Parameters
Name Description
SMTP Specifies making an authenticated submission to an SMTP server (Simple Mail Transfer
Protocol server).
o Specify SMTP – your SMTP server requires authenticated connections
o Do not specify SMTP – you are using an open SMTP server and connecting using port
25, or a local mail system that does not require authentication
Name Description
Note
Virtually all modern email systems using SMTP require authentication.
SMTPUSER SMTP_ The name of the user account to authenticate against and access the SMTP server.
account_name
If you omit SMTPUSER, the sender email address specified by USER is used to access
a local mail system, or an SMTP mail server that does not require authentication.
PORT port_number The port number to use to access the SMTP server.
You may need to contact your IT department to find out which port you should use.
Common port numbers for SMTP servers are:
o 587
o 2525
o 465
You must use PORT if you use SMTPUSER. If you omit SMTPUSER you can omit
PORT and the default port 25 is used.
ENABLESSL Specifies accessing the SMTP server using a secure SMTP/SSL connection.
optional You may need to contact your IT department to find out if your SMTP server requires an
SSL connection. Or send test emails with and without ENABLESSL specified.
USER sender_email Defines a sender email address for the email notifications sent via the SMTP server.
Note
Depending on how your SMTP server is configured, USER and
SMTPUSER may or may not be the same account.
PASSWORD encrypted_ The user account password for the SMTP server. The password must be provided as an
password encrypted string.
For more information, see "Generating an encrypted password" on page 2021.
A password may not be required to access a local mail system, or an SMTP mail server
that does not require authentication.
MAILBOX SMTP_server_ The domain name of the SMTP server to use to send the email message. For example:
name
MAILBOX "smtp.example.com"
Name Description
optional Separate multiple email addresses with a comma. Enter a maximum of 1000 characters.
BCC bcc_recipient_email The email address of one or more blind carbon copy recipients.
optional Separate multiple email addresses with a comma.
ATTACHMENT file_path The path and file name of one or more attachments.
optional You do not have to specify a path if the file is located in the same folder as the Analytics
project.
Enclose the path and file name in quotation marks. Specify multiple attachments by
entering a comma-separated list of files for file_path:
ATTACHMENT "result1.csv,result2.csv"
Note
In a comma-separated list, make sure there are no spaces after the
commas.
Examples
Note
Authenticated command syntax.
You are running a script, and you want to send a notification email if the script fails. Using
NOTIFY, you define the email message and include two attachments:
l the log file
l a .fil file containing recorded errors
Note
Non-authenticated command syntax.
You are running a script, and you want to send a notification email if the script fails. Using
NOTIFY, you define the email message and include two attachments:
l the log file
l a .fil file containing recorded errors
Remarks
Recipients and attachments
You can use the NOTIFY command to send email notification messages to one or more recipients.
Messages can include attached data files and Analytics projects.
A common use of the NOTIFY command is to alert the appropriate personnel when a script fails
unexpectedly.
In general, be aware that successfully using NOTIFY to submit outgoing emails to an SMTP server
requires a compatible configuration on the Analytics side, and also on the SMTP server side. If
NOTIFY is failing to connect and successfully send emails, work with your IT department to make
sure a compatible connection configuration exists between Analytics and the server.
You need to provide an encrypted password value with the PASSWORD parameter in the
NOTIFY command. To appropriately encrypt a password for use with NOTIFY, you must enter the
password in the Notify dialog box in the Analytics user interface.
1. Optional. In Analytics, in the command line, enter SET NOTIFYRETRYATTEMPTS TO 0
Temporarily turning off NOTIFY retry attempts will speed up generating the encrypted
password.
2. From the Analytics main menu, select Tools > Notify by Email.
3. In the Notify dialog box, complete the required fields, and any optional fields as needed:
Password The user account password, in clear text, for the SMTP server. Required
Note
If the password exceeds 30 characters, the NOTIFY
command will fail.
To recipient_email Required
Cc cc_recipient_email Optional
4. Click OK.
If you are attempting to connect to an SMTP server that requires authentication, the
connection attempt will fail (as expected), even if the NOTIFY command appears successful.
5. Copy the NOTIFY command from the log and paste it into a script.
The NOTIFY command now includes an encrypted value for PASSWORD.
6. In the script, add the following parameters to the copied NOTIFY command and provide
appropriate parameter values.
You can insert the parameters immediately after the NOTIFY keyword.
l SMTP
l SMTPUSER SMTP_account_name
l PORT port_number
l ENABLESSL (if required)
7. If you previously set the number of NOTIFY retry attempts to 0 , enter SET
NOTIFYRETRYATTEMPTS TO 5 in the command line.
If you originally had a different number of retry attempts specified, instead of 5 , enter the
appropriate number.
8. Run the script to test the NOTIFY command.
If all required values are correctly configured to work with the SMTP mail server, the NOTIFY
command should now succeed.
SET
NOTIFYRETRYATTEMPTS SET NOTIFYRETRYATTEMPTS TO 10
<TO> num
Specifies the number of times the NOTIFY command will attempt to send an email if
the initial attempt is unsuccessful. Enter a number from 0 to 255. If you enter 0, no
additional attempts are made after an initial failure.
One possible reason for the NOTIFY command failing to send an email is that the
email server is unavailable.
SET
NOTIFYRETRYINTERVAL SET NOTIFYRETRYINTERVAL TO 30
<TO> seconds
Note
An invalid email recipient is not considered a failure of the NOTIFY
command and does not cause a script to stop regardless of the
NOTIFYFAILSTOP setting.
OPEN command
Opens an Analytics table and the associated data file.
Syntax
OPEN {table_name|data_file <FORMAT layout_name>} <BUFFERLENGTH length>
<CRLF> <DBASE> <INDEX index_file> <PRIMARY|SECONDARY> <SKIP bytes> <RELATION
key_field>
Parameters
Name Description
data_file The data file to associate with the table specified by FORMAT layout_name.
Analytics assumes a file extension of .fil if no extension is specified. To open a file with no
extension, insert a period (.) at the end of the file name.
FORMAT layout_name The Analytics table layout to apply to the data file that you open as a table.
optional
BUFFERLENGTH n The length in bytes of the input buffer area to be allocated to the table. The default value
is 33,000 bytes.
optional
Larger buffer areas may improve processing speed at the expense of RAM available for
storing Analytics commands.
If any IBM variable length blocks are read which exceed the buffer length, Analytics
displays an error message and stops processing. The default value is set in the Buffer
Size field in the Table tab in the Options dialog box.
You will seldom need to change BUFFERLENGTH n, because the default is sufficient to
handle almost all situations.
CRLF Specifies that a variable length ASCII file is to be read. Analytics automatically adjusts for
the varying record lengths.
optional
By default, files are assumed to be fixed-length files.
DBASE Specifies that the data source is a dBASE file. Analytics recognizes the type of dBASE
file and automatically creates a table from the file description. Can be omitted for dBASE
optional
files with a .dbf extension.
INDEX index_file The index file to apply to the table when it is opened.
Name Description
optional The file extension for the index file name is assumed to be .inx when none is specified.
You can specify INDEX with either primary or secondary tables.
PRIMARY | SECONDARY Specifies that a table is opened as either a primary table or a secondary table. If omitted,
the table is opened as a primary table.
optional
SKIP bytes The number of bytes to bypass at the physical start of the table.
optional SKIP can be used to ignore table header records or leading portions of the table that do
not follow the layout of the remainder of the table. If omitted, the table is read starting at
the first byte.
Note
RELATION key_field Specifies that the table is to be opened as an ad hoc related table. Analytics does not
retain this relation when the table is closed.
optional
You must also specify the INDEX parameter when you use RELATION. key_field is the
key field or expression used to create the relation between two tables.
Examples
OPEN Inventory
OUTLIERS command
Identifies statistical outliers in a numeric field. Outliers can be identified for the field as a whole, or for
separate groups based on identical values in one or more character, numeric, or datetime key fields.
Syntax
OUTLIERS {AVERAGE|MEDIAN} {PKEY key_field <...n>|PKEY ALL <EXCLUDE field_
name <...n>>|NOKEY} ON numeric_field <OTHER field <...n>|OTHER ALL <EXCLUDE
field_name <...n>>> NUMSTDEV number_of_std_devs <IF test> <TO {SCREEN|table_
name}> <PRESORT> <WHILE test> <FIRST range|NEXT range> <OPEN>
Note
You cannot run the OUTLIERS command locally against a server table.
You must specify the OUTLIERS command name in full. You cannot abbreviate it.
Parameters
Name Description
AVERAGE | MEDIAN The method for calculating the center point of the values in numeric_field (the outlier
field).
o AVERAGE – calculate the average (mean) of the values
o MEDIAN – calculate the median of the values
The center point is calculated for either:
o the numeric field as a whole
o the numeric values for each key field group
The center point is subsequently used in calculating the standard deviation of the
numeric field, or of each group.
Note
If you specify MEDIAN, numeric_field must be sorted. Use PRESORT if
numeric_field is not already sorted.
Tip
If the data you are examining for outliers is significantly skewed, MEDIAN
might produce results that are more representative of the bulk of the
data.
Name Description
PKEY key_field <...n> | One or more character, numeric, or datetime fields to use for grouping the data in the
PKEY ALL | NOKEY table.
If you specify NOKEY, the data is not grouped, and outliers are identified at the field
level.
Note
Key fields must be sorted. Use PRESORT if one or more fields are not
already sorted.
o PKEY key_field – use the specified field or fields to group the data in the table
Multiple fields must be separated by spaces, and can be different data types.
If you specify more than one field, you created nested groups in the output table. The
nesting follows the order in which you specify the fields.
For each group, a standard deviation is calculated for the group's numeric values in
numeric_field. The group standard deviation is used as the basis for identifying group
outliers.
o PKEY ALL – use all fields in the table to group the data in the table
If you specify all fields, you create nested groups in the output table. The nesting
follows the order in which the fields appear in the table layout.
For each group, a standard deviation is calculated for the group's numeric values in
numeric_field. The group standard deviation is used as the basis for identifying group
outliers.
Note
Grouping by all fields includes numeric_field, which may not make
sense. You can use EXCLUDE to exclude numeric_field from
grouping.
EXCLUDE field_name Only valid when grouping table data using PKEY ALL.
optional The field or fields to exclude from the command. EXCLUDE allows you to fine-tune PKEY
ALL, by excluding the specified fields.
EXCLUDE must immediately follow PKEY ALL. For example:
ON numeric_field The numeric field to examine for outliers. You can examine only one field at a time.
Outliers are values that fall outside the upper and lower boundaries established by the
field or group standard deviation, or by a specified multiple of the standard deviation.
OTHER field <...n> | One or more additional fields to include in the output.
OTHER ALL o OTHER field <...n> – include the specified field or fields
Name Description
optional Fields are included in the order that you list them.
o OTHER ALL – include all fields in the table that are not specified as key fields or the
outlier field
Fields are included in the order that they appear in the table layout.
Note
Key fields and the outlier field are automatically included in the output
table, and do not need to be specified using OTHER.
NUMSTDEV number_of_ In numeric_field, the number of standard deviations from the mean or the median to the
std_devs upper and lower outlier boundaries. You can specify any positive integer or decimal
numeral (0.5, 1, 1.5, 2 . . . )
The formula for creating outlier boundaries is:
mean/median ± (number_of_std_devs * standard deviation)
Note
Standard deviation is a measure of the dispersion of a data set – that is,
how spread out the values are. The outliers calculation uses population
standard deviation.
NUMSTDEV 2
Any value greater than the upper boundary, or less than the lower boundary, is
included as an outlier in the output results.
Name Description
Note
For the same set of data, as you increase the value in number_of_std_
devs you potentially decrease the number of outliers returned.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
TO SCREEN | table_name The location to send the results of the command to:
optional o SCREEN – displays the results in the Analytics display area
Tip
You can click any linked result value in the display area to drill down to
the associated record or records in the source table.
By default, the table data file (.FIL) is saved to the folder containing the
Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
l TO "C:\Output.FIL"
l TO "Results\Output.FIL"
Note
Table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _
), but no other special characters, or any spaces. The name cannot
start with a number.
Name Description
Note
Sorting a computed numeric_
field is an internal, technical
requirement of Analytics.
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
OPEN Opens the table created by the command after the command executes. Only valid if the
command creates an output table.
optional
Examples
You decide to set the outlier boundaries at 3 times the standard deviation of the Amount field.
The test returns 16 outliers in the table of 772 records.
OPEN Ar
OUTLIERS AVERAGE NOKEY ON Amount NUMSTDEV 3 PRESORT TO "Outliers_AR.-
fil" OPEN
You repeat the test, but increase the standard deviation multiple to 3.5. The test now returns
only 6 outliers because the outlier boundaries are farther away from the center point of the
values in the Amount field.
OPEN Ar
OUTLIERS AVERAGE NOKEY ON Amount NUMSTDEV 3.5 PRESORT TO "Outliers_AR.-
fil" OPEN
OPEN Ar
OUTLIERS AVERAGE PKEY No ON Amount NUMSTDEV 3 PRESORT TO "Outliers_Cus-
tomer_AR.fil" OPEN
The test returns 7 outliers. The standard deviation and the average are reported for each
customer's group of transactions:
Cust Number
(No) Trans Amount STDEV AVERAGE Group Number
Cust Number
(No) Trans Amount STDEV AVERAGE Group Number
438.81 ± (3 * 772.44)
= 438.81 ± 2,317.32
= (1,878.51) (lower boundary)
= 2,756.13 (upper boundary)
OPEN Ar
OUTLIERS MEDIAN PKEY No ON Amount NUMSTDEV 3 PRESORT TO "Outliers_Cus-
tomer_AR_Median.fil" OPEN
The test returns 10 outliers instead of the 7 that are returned in the previous test. Depending
on the nature of the data, MEDIAN and AVERAGE can return somewhat different results:
Cust Number
(No) Trans Amount STDEV MEDIAN Group Number
Remarks
For more information about how this command works, see "Identifying outliers" on page 1171.
For number_of_std_devs, substitute the actual standard deviation multiple you used.
l
If you used median as a center point rather than average, substitute MEDIAN for
l
AVERAGE.
3. Paste this expression into the Analytics command line, edit it as required, and press Enter:
l For number_of_std_devs, substitute the actual standard deviation multiple you used.
l If you used median as a center point rather than average, substitute MEDIAN for
AVERAGE.
4. Right-click the view and select Add Columns.
5. From the Available Fields list, double-click Lower_Boundary and Upper_Boundary to add
them to the Selected Fields list.
6. Click OK.
7. Optional. Reposition the added fields by dragging the column headers.
PASSWORD command
Creates a password definition, without a password value, that prompts users for a password while a
script is running.
Syntax
PASSWORD num <prompt>
Parameters
Name Description
prompt A valid character expression to display in the dialog box used to prompt for the password.
Enclose literal strings in quotation marks.
optional
If prompt is omitted, a default dialog box with no message is displayed.
Examples
PASSWORD 1 "Password:"
REFRESH Abc PASSWORD 1
Remarks
When to use PASSWORD
Use the PASSWORD command to prompt a user to enter password information before a script
accesses, imports, or refreshes password-protected data.
You can create up to ten different password definitions in a script.
PASSWORD is useful if:
l you want to avoid typing an actual password in a script, which the SET PASSWORD
command requires
l individual users need to enter distinct passwords
PAUSE command
Pauses a script, and displays information in a dialog box for users.
Syntax
PAUSE message <IF test>
Parameters
Name Description
message A message to display in the dialog box. The maximum length is 199 characters.
message must be enclosed in quotation marks. If the message contains double quotation
marks, enclose it in single quotation marks.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
Examples
Remarks
When to use PAUSE
Use PAUSE to display read-only messages on screen in the course of running a script. You can
display error messages or information such as the result of an analytic operation.
How it works
While the message dialog box is displayed, execution of the script is halted and only resumes once
the user clicks OK to close the message dialog box. For this reason, you cannot use PAUSE in
scripts or analytics that must run unattended.
Limitations
PAUSE has the following limitations:
l cannot be included inside the GROUP command
l cannot be used in analytics run in Robots
PREDICT command
Applies a predictive model to an unlabeled data set to predict classes or numeric values associated
with individual records.
Note
The PREDICT command is not supported if you are running Analytics on a 32-bit
computer. The computation required by the command is processor-intensive and
better suited to 64-bit computers.
Syntax
PREDICT MODEL model_name TO table_name <IF test> <WHILE test> <FIRST
range|NEXT range>
Parameters
Name Description
MODEL model_name The name of the model file to use for predicting classes or values. You use a model file
previously generated by the TRAIN command.
You must specify the *.model file extension. For example:
MODEL "Loan_default_prediction.model"
Note
The model file must have been trained on a data set with the same fields
as the unlabeled data set – or substantially the same fields.
You cannot use a model file trained in version 14.1 of Analytics. Version
14.1 model files are not compatible with subsequent versions of
Analytics. Train a new predictive model to use with the
PREDICT command.
TO table_name The name of the Analytics table output by the prediction process.
The table contains the key fields you specified during the training process, and either one
or two fields generated by the prediction process:
o Predicted – the predicted classes or numeric values associated with each record in
the unlabeled data set
Name Description
By default, the table data file (.FIL) is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
o TO "C:\Loan_applicants_default_predicted.FIL"
o TO "ML Predict output\Loan_applicants_default_predicted.FIL"
Note
Table names are limited to 64 alphanumeric characters, not including the
.FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
number.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
Examples
You input a classification model to the PREDICT command to make predictions about which
current loan applicants will default if given a loan.
You previously produced the classification model using the TRAIN command with a set of
historical loan data, including loan default information.
OPEN "Loan_applicants_current"
PREDICT MODEL "Loan_default_prediction.model" TO "Loan_applicants_
default_predicted.FIL"
OPEN "House_price_evaluation"
PREDICT MODEL "House_price_prediction.model" TO "House_prices_pre-
dicted.FIL"
Remarks
For more information about how this command works, see "Predicting classes and numeric values"
on page 1362.
PRINT command
Prints a text file, an Analytics log file, or an Analytics project item that has been exported as an
external file – a script (.aclscript), a table layout (.layout), or a workspace (.wsp). You can also print a
graph that has been generated by a command.
Syntax
PRINT {file_name|GRAPH}
Parameters
Name Description
If the path or file name includes spaces you must enclose file_name in quotation
marks.
o GRAPH – the graph previously output as the result of a command
Examples
Printing a graph
To print the graph produced from the BENFORD command, specify the following commands:
OPEN Metaphor_APTrans_2002
BENFORD ON Invoice_Amount LEADING 1 TO GRAPH
PRINT GRAPH
Remarks
Selecting a printer
The printer used is the default printer configured in Microsoft Windows. To change the printer you
need to change the default printer in Windows.
Related commands
To print the contents of an Analytics table in a project, use the DO REPORT command.
PROFILE command
Generates summary statistics for one or more numeric fields, or numeric expressions, in an
Analytics table.
Syntax
PROFILE {<FIELDS> numeric_field <...n>|<FIELDS> ALL <EXCLUDE numeric_field
<...n>>} <IF test> <WHILE test> <FIRST range|NEXT range>
Parameters
Name Description
FIELDS numeric_field Specify individual fields to profile, or specify ALL to profile all numeric fields in the
<...n> | FIELDS ALL Analytics table.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
Name Description
Examples
OPEN Employee_Payroll
PROFILE FIELDS Salary
Remarks
Statistics displayed in output
The following statistics are displayed for each numeric field or numeric expression specified for the
command:
l total value
l absolute value
l minimum value
l maximum value
QUIT command
Ends the current session and closes Analytics.
Note
To exit a script without closing Analytics, see "ESCAPE command" on page 1786.
Syntax
QUIT
Examples
IF FILESIZE("Inventory.csv") = -1 QUIT
OPEN Inventory
SUMMARIZE ON Location ProdCls SUBTOTAL Value TO "Inventory_value_by_
location_class.FIL" PRESORT CPERCENT
QUIT
Remarks
Changes are saved
When QUIT executes, any Analytics tables that are open are saved and closed before quitting.
If you modified the active view or a script and did not save the changes, Analytics prompts you to
save the changes before quitting.
RANDOM command
Syntax
RANDOM NUMBER n <SEED seed_value> MINIMUM min_value MAXIMUM max_value
<COLUMNS n> <UNIQUE> <SORTED> <TO {SCREEN|filename}> <APPEND>
Parameters
Name Description
SEED seed_value The value used to initialize the random number generator.
optional If you specify a seed value, it can be any number. Each unique seed value results in a
different set of random numbers. If you respecify the same seed value, the same set of
random numbers is generated. Regenerating the same set of random numbers can be
required if you need to replicate analysis.
o Seed value – explicitly specify a seed value, and save the value, if you want the option
of replicating a particular set of random numbers.
o No seed value – enter a seed value of ‘0’, or leave the seed value blank, if you want
Analytics to randomly select a seed value.
MINIMUM min_value The smallest possible number in the set of random numbers. Any valid numeric value or
expression is allowed.
MAXIMUM max_value The greatest possible number in the set of random numbers. Any valid numeric value or
expression is allowed.
COLUMNS n The number of columns used to display the set of random numbers.
optional If you omit COLUMNS, the default is 6 columns.
Name Description
Note
Do not specify UNIQUE when the specified size of the set of random
numbers exceeds 75 percent of the range between MINIMUM and
MAXIMUM. Doing so can result in too many random number selections
being discarded.
TO SCREEN | filename The location to send the results of the command to:
optional o SCREEN – displays the results in the Analytics display area
Tip
You can click any linked result value in the display area to drill down to
the associated record or records in the source table.
By default, the file is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the file to a different, existing folder:
l TO "C:\Output.TXT"
l TO "Results\Output.TXT"
APPEND Appends the command output to the end of an existing file instead of overwriting it.
optional
Note
You must ensure that the structure of the command output and the
existing file are identical:
l the same fields
l the same field order
l matching fields are the same length
l matching fields are the same data type
Analytics appends output to an existing file regardless of its structure. If
the structure of the output and the existing file do not match, jumbled,
missing, or inaccurate data can result.
Examples
RANDOM NUMBER 100 SEED 45387 MINIMUM 10000 MAXIMUM 20000 COLUMNS 10
UNIQUE SORTED TO "Random_Numbers.txt"
Remarks
For more information about how this command works, see "Generating random numbers" on
page 232.
RCOMMAND command
Passes an Analytics table to an external R script as a data frame and creates a new table in the
Analytics project using output from the external R script.
Syntax
RCOMMAND FIELDS field <...n> RSCRIPT path_to_script TO table_name <IF test>
<WHILE test> <FIRST range|NEXT range> <KEEPTITLE> <SEPARATOR character>
<QUALIFIER character> <OPEN>
Parameters
Name Description
FIELDS field_name <...n> The fields from the source Analytics table, or the expressions, to include in the data
frame that is sent to the R script.
Depending on the edition of Analytics that you are using, you may encounter errors when
sending data containing some special characters to R:
o non-Unicode – "\"
o Unicode – "ÿ" or "Ŝ"
o Both – box drawing characters such as blocks, black squares, and vertical broken
bars
Note
Mixed language data is also not supported, for example a table
containing both Japanese and Chinese characters.
RSCRIPT path_to_script The full or relative path to the R script on the file system. Enclose path_to_script in
quotation marks.
By default, the table data file (.FIL) is saved to the folder containing the
Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
Name Description
l TO "C:\Output.FIL"
l TO "Results\Output.FIL"
Note
Table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _
), but no other special characters, or any spaces. The name cannot
start with a number.
The output table is created from the data frame or matrix that the R script returns.
IF test A condition that must be met to process the current record. The data frame passed to the
R script contains only those records that meet the condition.
optional
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
Caution
There is a known issue in the current version with NEXT when running
the RCOMMAND. Avoid using this option as the record reference may
reset to the first record regardless of which record is selected.
KEEPTITLE Treat the first row of data as field names instead of data. If omitted, generic field names
are used.
optional
This option is required if you want to retrieve data using column names in the R script.
SEPARATOR character The character to use as the separator between fields. You must specify the character as
a quoted string.
optional
The default character is a comma.
Note
Avoid using any characters that appear in the input fields. If the
SEPARATOR character appears in the input data, the results may be
affected.
Name Description
QUALIFIER character The character to use as the text qualifier to wrap and identify field values. You must
specify the character as a quoted string.
optional
The default character is a double quotation mark.
Note
Avoid using any characters that appear in the input fields. If the
QUALIFIER character appears in the input data, the results may be
affected.
OPEN Opens the table created by the command after the command executes. Only valid if the
command creates an output table.
optional
Examples
Analytics command
R script (analysis.r)
srcTable<-acl.readData()
Analytics command
R script (analysis.r)
Analytics command
R script (analysis.r)
Analytics command
R script (analysis.r)
Analytics command
R script (analysis.r)
Remarks
For more information about how this command works, see "Running R scripts" on page 1393.
# stores the Analytics table in a data frame called myTable that can be ref-
erenced throughout the script
myTable<-acl.readData()
To retrieve data from a cell in the data frame, you can use one of the following approaches:
l Using row and column coordinates:
# Retrieves the value in the first row and second column of the data
frame
myTable[1,2]
Note
Coordinates are based on the order of fields specified in the command, not the
table layout or view that is currently open.
You must specify the KEEPTITLE option of the command to use column names.
Rows are named "1", "2", "3", and increment accordingly. You may also use a combination of
names and coordinates.
Note
You must return a data frame or a matrix to Analytics when the R script terminates.
Ensure the columns in the data frame or matrix contain only atomic values and not
lists, matrices, arrays, or non-atomic objects. If the values cannot be translated into
Analytics data types, the command fails.
Logical Logical
Numeric Numeric
Character Character
R log file
Analytics logs R language messages to an aclrlang.log file in the project folder. Use this log file
for debugging R errors.
REFRESH command
Updates the data in an Analytics table from its associated data source.
Syntax
REFRESH <table_name> <PASSWORD num>
Parameters
Name Description
table_name The name of the Analytics table to refresh. If you do not specify a table_name, the open
table is refreshed.
optional
Note
The password is used to access the original source data system.
You cannot use REFRESH with a password for file-based data sources,
with the exception of PDFs.
Examples
REFRESH Invoices
If you are refreshing a table originally imported from a password-protected data source using
the ACCESSDATA command, the password prompt is automatic and does not need to be
separately specified:
REFRESH Invoices
The disadvantage of this method is that the password appears as clear text in the script.
Remarks
For more information about how this command works, see "Updating data in Analytics tables" on
page 782.
How it works
The REFRESH command updates the contents of a table by re-running the IMPORT command, or
the ACCESSDATA command, initially used to define and import the table.
Note
You must have 32-bit Microsoft Access Database Engine installed for the
REFRESH command to work with older Excel files (*.xls) and Microsoft Access
files (*.mdb). For more information, see "Exclude optional Microsoft Access
Database Engine" on page 2689.
RENAME command
Renames an Analytics project item or a file.
Syntax
RENAME item_type name <AS|TO> new_name <OK>
Parameters
Name Description
item_type name The type and name of the project item or file that you want to rename.
Note
In most cases, you cannot rename an item or file if it is active, open, or in
use.
Note
Length limitations apply to most Analytics project item names. For more
information, see "Character and size limits in Analytics" on page 1428.
Examples
Renaming a field
You need to rename the ProdNo field to ProdNum. You use OK to perform the action without
additional confirmation:
OPEN Inventory
RENAME FIELD ProdNo AS ProdNum OK
REPORT command
Syntax
REPORT <ON break_field <PAGE> <NODUPS> <WIDTH characters> <AS display_name>>
<...n> FIELD other_fields <WIDTH characters> <AS display_name> <...n>
<SUPPRESS> <NOZEROS> <LINE n other_fields> <PRESORT <sort_field>> <...n>
<SUMMARIZED> <SKIP n> <EOF> <TO {SCREEN|PRINT|filename <HTML>}> <IF test>
<WHILE test> <FIRST range|NEXT range> <HEADER header_text> <FOOTER footer_
text> <APPEND>
Parameters
Name Description
ON break_field PAGE The character field or fields used to break the report into sections.
NODUPS WIDTH
A new report section and subtotal is created each time the value in break_field changes.
characters AS display_
Breaking reports into sections can make them easier to scan.
name <...n>
o break_field – the field to use as a break field
optional
To run a report based on a view (DO REPORT), the break field must be the leftmost
character field in the view.
o PAGE – inserts a page break when the break field value changes
o NODUPS – suppresses duplicate display values in the break field
For example, if the customer name is listed for each invoice record, you can make the
report more readable by listing only the first instance of each customer name.
o WIDTH characters – the output length of the field in characters
o AS display_name – the display name (alternate column title) for the field in the report
Specify display_name as a quoted string. Use a semi-colon (;) between words if you
want a line break in the column title. If you want the display name to be the same as
the field name, or an existing display name in the source table, do not use AS.
Note
You must specify ON to use break_field , PAGE, NODUPS, or
PRESORT.
Name Description
name <...n> o WIDTH characters – the output length of the field in characters
o AS display_name – the display name (alternate column title) for the field in the report
Specify display_name as a quoted string. Use a semi-colon (;) between words if you
want a line break in the column title. If you want the display name to be the same as
the field name, or an existing display name in the source table, do not use AS.
The SUBTOTAL and ACCUMULATE keywords are synonyms for FIELD, and have been
deprecated. All numeric fields are automatically subtotaled.
Note
Break fields are automatically included in the report and do not need to
be specified as other_fields.
LINE n other_fields Specifies the number of output lines in the column and the fields to appear on the line
number n.
optional
If no value is specified, the column defaults to a single line. The value of n must be
between 2 and 60 inclusive.
Column headings on the report are determined solely by the fields on the first line. other_
fields specifies appropriate fields or expressions for the report.
PRESORT sort_field o Sorts break_field , if one or more break fields are specified.
<...n> o Sorts sort_field, if one or more sort fields are specified.
optional PRESORT does not sort the fields listed as other_fields unless they are also listed as
sort_field.
SUMMARIZED Produces a report with subtotals and totals only, and no detail lines.
optional Subtotals are generated for the unique break field values. If SUMMARIZED is not
specified, Analytics produces a report that includes detail lines, as well as subtotals for
each of the specified key break fields.
EOF Execute the command one more time after the end of the file has been reached.
optional This ensures that the final record in the table is processed when inside a GROUP
command. Only use EOF if all fields are computed fields referring to earlier records.
TO SCREEN | PRINT| The location to send the results of the command to:
filename <HTML> o SCREEN – displays the results in the Analytics display area
optional
Name Description
Tip
You can click any linked result value in the display area to drill down to
the associated record or records in the source table.
By default, the file is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the file to a different, existing folder:
l TO "C:\Output.TXT"
l TO "Results\Output.TXT"
o PRINT – sends the results to the default printer
By default, reports output to a file are saved as ASCII text files. Specify HTML if you want
to output the report as an HTML file (.htm).
If you omit TO, the report is output to screen.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
HEADER header_text The text to insert at the top of each page of a report.
optional header_text must be specified as a quoted string. The value overrides the Analytics
HEADER system variable.
FOOTER footer_text The text to insert at the bottom of each page of a report.
optional footer_text must be specified as a quoted string. The value overrides the Analytics
Name Description
APPEND Appends the command output to the end of an existing file instead of overwriting it.
optional
Note
You must ensure that the structure of the command output and the
existing file are identical:
l the same fields
l the same field order
l matching fields are the same length
l matching fields are the same data type
Analytics appends output to an existing file regardless of its structure. If
the structure of the output and the existing file do not match, jumbled,
missing, or inaccurate data can result.
Examples
OPEN Ar
REPORT ON No FIELD Due Type Amount TO "C:\Reports\AR.htm" HTML
RETRIEVE command
Retrieves the result of a Direct Link query submitted for background processing.
Note
The RETRIEVE command is only supported if Direct Link is installed and configured
on your local computer and on your organization's SAP system.
Syntax
RETRIEVE table_name PASSWORD num
Parameters
Name Description
table_name The name of the table originally created in Analytics by the Direct Link query.
The table must already exist before you use RETRIEVE.
Note
The password is used to access the SAP system.
Examples
SAMPLE command
Draws a sample of records using either the record sampling or monetary unit sampling method.
Record samplingMonetary unit sampling
Syntax
Note
The syntax does not include filtering (IF statements) or scope parameters because
applying these options compromises the validity of a sample.
Parameters
Note
Do not include thousands separators when you specify values.
Name Description
The seed value to use to initialize the random number generator in Analytics.
If you specify a value of zero ('0'), or omit RANDOM, Analytics randomly selects the seed
value.
ORDER Note
optional Random selection method only.
You can only use ORDER when specify FIELDS.
Name Description
RECORD | FIELDS field_ o RECORD – the entire record is included in the output table
name <...n> | FIELDS ALL
Fields are included in the order that they appear in the source table layout.
o FIELDS field_name – individual fields, rather than the entire record, are included in
the output table
Specify the field(s) or expressions to include. If you specify multiple fields, they must
be separated by spaces.
Fields are included in the order that you list them.
o FIELDS ALL – all fields are included in the output table
Fields are included in the order that they appear in the source table layout.
By default, the table data file (.FIL) is saved to the folder containing the
Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
l TO "C:\Output.FIL"
l TO "Results\Output.FIL"
Note
Table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _
), but no other special characters, or any spaces. The name cannot
start with a number.
LOCAL Saves the output file in the same location as the Analytics project.
optional
Note
Applicable only when running the command against a server table with
an output file that is an Analytics table.
The LOCAL parameter must immediately follow the TO parameter.
OPEN Opens the table created by the command after the command executes. Only valid if the
command creates an output table.
optional
Name Description
APPEND Appends the command output to the end of an existing file instead of overwriting it.
optional
Note
You must ensure that the structure of the command output and the
existing file are identical:
l the same fields
l the same field order
l matching fields are the same length
l matching fields are the same data type
Analytics appends output to an existing file regardless of its structure. If
the structure of the output and the existing file do not match, jumbled,
missing, or inaccurate data can result.
MERSENNE_TWISTER Note
optional Cell and random selection methods only.
Note
You should only use the default Analytics algorithm if you require
backward compatibility with Analytics scripts or sampling results created
prior to Analytics version 12.
Examples
Remarks
For more information about how this command works, see "Performing record sampling" on
page 1057.
Syntax
Note
The syntax does not include filtering (IF statements) or scope parameters because
applying these options compromises the validity of a sample.
Parameters
Note
Do not include thousands separators when you specify values.
Name Description
Name Description
The seed value to use to initialize the random number generator in Analytics.
If you specify a value of zero ('0'), or omit RANDOM, Analytics randomly selects the seed
value.
SUBSAMPLE Note
optional You can only use SUBSAMPLE when specify FIELDS.
NOREPLACEMENT The same record is not selected more than once. As a result, the sample may contain
fewer records than calculated by the SIZE command.
optional
If NOREPLACEMENT is omitted, or if you specify REPLACEMENT, records can be
selected more than once.
ORDER Note
optional Random selection method only.
You can only use ORDER when specify FIELDS.
RECORD | FIELDS field_ o RECORD – the entire record is included in the output table
name <...n> | FIELDS ALL
Fields are included in the order that they appear in the source table layout.
o FIELDS field_name – individual fields, rather than the entire record, are included in
the output table
Specify the field(s) or expressions to include. If you specify multiple fields, they must
be separated by spaces.
Fields are included in the order that you list them.
o FIELDS ALL – all fields are included in the output table
Fields are included in the order that they appear in the source table layout.
Name Description
By default, the table data file (.FIL) is saved to the folder containing the
Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
l TO "C:\Output.FIL"
l TO "Results\Output.FIL"
Note
Table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _
), but no other special characters, or any spaces. The name cannot
start with a number.
LOCAL Saves the output file in the same location as the Analytics project.
optional
Note
Applicable only when running the command against a server table with
an output file that is an Analytics table.
The LOCAL parameter must immediately follow the TO parameter.
OPEN Opens the table created by the command after the command executes. Only valid if the
command creates an output table.
optional
APPEND Appends the command output to the end of an existing file instead of overwriting it.
optional
Note
You must ensure that the structure of the command output and the
existing file are identical:
l the same fields
l the same field order
l matching fields are the same length
l matching fields are the same data type
Analytics appends output to an existing file regardless of its structure. If
the structure of the output and the existing file do not match, jumbled,
missing, or inaccurate data can result.
MERSENNE_TWISTER Note
optional Cell and random selection methods only.
Name Description
Note
You should only use the default Analytics algorithm if you require
backward compatibility with Analytics scripts or sampling results created
prior to Analytics version 12.
Examples
Remarks
For more information about how this command works, see "Performing monetary unit sampling" on
page 1087.
SAVE command
Copies an Analytics table and saves it with a different name, or saves an Analytics project.
Syntax
To create a copy of an Analytics table and save it with a different name:
SAVE
Parameters
Name Description
new_table The name of the new Analytics table to create and save.
Note
Table names are limited to 64 alphanumeric characters. The name can
include the underscore character ( _ ), but no other special characters, or
any spaces. The name cannot start with a number.
FORMAT ACL_table The name of the existing Analytics table. Use the name of the table layout, not the name
of an associated data file.
Examples
Remarks
How it works
SAVE FORMAT produces a result similar to copying and pasting an Analytics table in the Overview
tab in the Navigator. A new Analytics table is created and associated to the same data file or data
source as the original table.
If required, you can link the newly created table to a different data source.
Note
Prior to version 11 of Analytics, external table layout files used an .fmt file extension.
You can still save a table layout file with an .fmt extension by manually specifying the
extension.
Syntax
SAVE LAYOUT {FILE|TABLE} TO {file_name|table_name}
Parameters
Name Description
FILE | TABLE o FILE – save an Analytics table layout to an external table layout file (.layout)
o TABLE – save table layout metadata to an Analytics table (.fil)
TO file_name | table_ The name of the output file, and the output location:
name o filename – the name of the .layout file
Specify the filename as a quoted string. For example: TO "Ap_Trans.layout".
The .layout file extension is used by default, so specifying it is optional.
By default, the file is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the file to a different, existing folder:
l TO "C:\Ap_Trans.layout"
l TO "Table Layouts\Ap_Trans.layout"
Note
Limit the table layout name to 64 alphanumeric characters, not
including the .layout extension, to ensure that the name is not
truncated when the table layout is imported back into Analytics.
The name can include the underscore character ( _ ), but no other
special characters, or any spaces. The name cannot start with a
number.
Name Description
metadata.fil".
Note
Table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _
), but no other special characters, or any spaces. The name cannot
start with a number.
Examples
The following examples save a copy of the metadata in the table layout used by the open
table to a new Analytics table called Ap_Trans_layout_metadata.
Here, the new Analytics table is saved in the Analytics project folder:
Remarks
SAVE LAYOUT file vs table
The SAVE LAYOUT command is used for two different purposes:
l FILE – saves the table layout of the open Analytics table to an external table layout file with a
.layout extension
l TABLE – extracts the metadata from the table layout of the open Analytics table and saves it
to a new Analytics table
and April source data files is identical. Used in this manner, .layout files can save you the labor of
creating a new table layout from scratch.
For more information about the structure of Analytics tables, see the "Structuring data with table
layouts" on page 769.
Note
The field names in the new table are always generated in English regardless of
which localized version of Analytics you are using.
decimals The number of decimal places in the field (numeric fields only)
format The format of the field (datetime and numeric fields only)
Additional details
Computed fields Computed fields are included in the extracted metadata, but the expression used by the
computed field, and any conditions, are not recorded. Start position, field length, and
decimal places are also not recorded for computed fields.
Related fields Related fields are not included because they are not part of the table layout.
Field-level filters Field-level filters and field notes are not included.
Field notes
Alternate column title The values recorded for alternate column title and column width are the ones specified in
the table layout, not the view-level values that can be specified for columns.
Column width
Syntax
SAVE LOG <SESSION> AS filename {<ASCII>|HTML} <OK>
Parameters
Name Description
SESSION Only log entries for the current Analytics session are saved.
optional
OK If a file with the same name as filename already exists, it is overwritten without confirm-
ation.
optional
Examples
You have performed data analysis on the March payables file and you want to save the
associated command log as part of your working papers.
The following example saves the entries from the current Analytics session to an HTML file. If
a file with the same name already exists it is overwritten without confirmation:
Syntax
SAVE TABLELIST {FILE|TABLE} TO {table_name|file_name}
Parameters
Name Description
FILE | TABLE o FILE – saves the table list to a CSV file (.csv)
o TABLE – saves the table list to an Analytics table
Note
Analytics table names are limited to 64 alphanumeric characters. The
name can include the underscore character ( _ ), but no other special
characters, or any spaces. The name cannot start with a number.
Examples
Remarks
Output columns
The output Analytics table or CSV file contains three columns:
l table_name – the name of the Analytics table layout
l type – an indication whether the Analytics table is a local table or a server table
l Data_file_Path – the full path to the source data file
Syntax
SAVE WORKSPACE workspace_name {field_name <...n>}
Parameters
Name Description
workspace_name The name of the workspace to create and add to the current Analytics project.
field_name <...n> The name of the field to add to the workspace. You can include multiple field names
separated by spaces.
Example
Activating a workspace
You create a workspace called Inventory_margin with two computed fields from the
Metaphor_Inventory_2002 table. Then you activate the workspace so that the fields are
available in the Inventory table:
OPEN Metaphor_Inventory_2002
SAVE WORKSPACE Inventory_margin Gross_unit_margin Percent_unit_margin
OPEN Inventory
ACTIVATE WORKSPACE Inventory_margin OK
Remarks
Field names used to create computed fields must match
The names of any fields used in expressions that create a computed field that is saved in a
workspace must match the names of the fields in the table that uses the workspace.
For example, if a workspace contains the computed field Value=Sale_price*Quantity, the active
table must also contain fields called Sale_price and Quantity.
SEEK command
Searches an indexed character field for the first value that matches the specified character
expression or character string.
Syntax
SEEK search_expression
Parameters
Name Description
Examples
Remarks
For more information about how this command works, see "Selecting the first matching record" on
page 1239.
How it works
Use the SEEK command to move directly to the first record in a table containing the specified
search_expression in the indexed character field.
l If the search_expression is found – the first matching record in the table is selected.
l If the search expression is not found – the message "No index matched key" is displayed,
and the table is positioned at the first record with a greater value than the search expression.
If there are no values in the indexed field greater than the search expression, the table is
positioned at the first record.
Index required
To use SEEK to search a character field, you must first index the field in ascending order. If multiple
character fields are indexed in ascending order, only the first field specified in the index is searched.
SEEK cannot be used to search non-character index fields, or character fields indexed in
descending order.
SEQUENCE command
Determines if one or more fields in an Analytics table are in sequential order, and identifies out-of-
sequence items.
Syntax
SEQUENCE <ON> {<FIELDS> key_field <D> <...n>|<FIELDS> ALL <EXCLUDE field_
name <...n>>} <UNFORMATTED> <ERRORLIMIT n> <IF test> <WHILE test> <FIRST
range|NEXT range> <TO {SCREEN|filename|PRINT}> <APPEND> <HEADER header_text>
<FOOTER footer_text> <PRESORT> <ISOLOCALE locale_code>
Parameters
Name Description
ON FIELDS key_field D One or more character, numeric, or datetime fields to test for sequential order.
<...n> | FIELDS ALL o FIELDS key_field – test the specified field or fields
Multiple fields must be separated by spaces, and can be different data types.
If you test by more than one field, fields are tested in the order that you list them.
Include D to test key field values in descending order. The default test order is
ascending.
o FIELDS ALL – test all fields in the table
If you test by all fields, fields are tested in the order that they appear in the table
layout.
Testing key field values in ascending order is the only option for FIELDS ALL.
Note
When you test by more than one field, you are testing for a nested
sequential order in the source table. Valid use of SEQUENCE requires
that you specify test fields in the same order as the existing nested
sequential order in the source table. Multiple test fields are tested as a
nested group. They are not tested independently of one another.
EXCLUDE field_name Only valid when testing for sequential order using FIELDS ALL.
optional The field or fields to exclude from the command. EXCLUDE allows you to fine-tune
FIELDS ALL, by excluding the specified fields.
EXCLUDE must immediately follow FIELDS ALL. For example:
Name Description
UNFORMATTED Suppresses page headings and page breaks when the results are output to a file.
optional
ERRORLIMIT n The number of errors allowed before the command is terminated. The default value is 10.
optional
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
TO SCREEN | filename | The location to send the results of the command to:
PRINT o SCREEN – displays the results in the Analytics display area
optional
Tip
You can click any linked result value in the display area to drill down to
the associated record or records in the source table.
By default, the file is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the file to a different, existing folder:
l TO "C:\Output.TXT"
Name Description
l TO "Results\Output.TXT"
o PRINT – sends the results to the default printer
APPEND Appends the command output to the end of an existing file instead of overwriting it.
optional
Note
You must ensure that the structure of the command output and the
existing file are identical:
l the same fields
l the same field order
l matching fields are the same length
l matching fields are the same data type
Analytics appends output to an existing file regardless of its structure. If
the structure of the output and the existing file do not match, jumbled,
missing, or inaccurate data can result.
HEADER header_text The text to insert at the top of each page of a report.
optional header_text must be specified as a quoted string. The value overrides the Analytics
HEADER system variable.
FOOTER footer_text The text to insert at the bottom of each page of a report.
optional footer_text must be specified as a quoted string. The value overrides the Analytics
FOOTER system variable.
PRESORT Sorts the table on the key field before executing the command.
optional
Note
You cannot use PRESORT inside the GROUP command.
The system locale in the format language_country. For example, to use Canadian
French, enter fr_ca.
Use the following codes:
o language – ISO 639 standard language code
o country – ISO 3166 standard country code
If you do not specify a country code, the default country for the language is used.
If you do not use ISOLOCALE, the default system locale is used.
Examples
Remarks
For more information about how this command works, see "Testing sequential order" on page 1260.
SET command
Sets a configurable Analytics option.
Note
The SET command sets an Analytics option for the duration of the Analytics session
only. This behavior applies whether you use the SET command in the Analytics
command line or in an Analytics script.
To set Analytics options so that they persist between Analytics sessions, you must
use the Options dialog box. Only a subset of options are available in the Options
dialog box. For more information, see "Configuring Analytics options" on page 121.
Syntax
Syntax Examples and remarks
Default setting: 0
Specifies the number of beeps to sound when command processing is completed.
The value parameter must be between 0 and 255. Specifying 0 turns off the beep.
Options dialog box: "Interface options" on page 123
Default setting: 40
Specifies the start-of-century year for two-digit years.
The value parameter must be from 0 to 99.
Setting the start-of-century value to 40 means that two-digit years 40 to 99 are
interpreted as 1940 to 1999, and two-digit years 00 to 39 are interpreted as 2000 to
2039.
Options dialog box: "Date and Time options" on page 136
When this option is turned on, Analytics replaces invalid character data with blanks
and invalid numeric data with zeros.
Caution
Use caution when turning this option on. It may be an original data file
that is deleted along with the table.
Data files are deleted outright. They are not sent to the Windows
Recycle Bin.
The value parameter is a quoted string that specifies the label to display at the top of
each printed page.
Options dialog box: "View options" on page 130
Controls whether commands and results in scripts are saved to the Analytics
command log.
o ON – Commands and results in scripts are saved to the command log.
o NONE – Commands and results in scripts are not saved to the command log.
Note
The SET ECHO command applies only to the logging of commands
and results in scripts. Commands performed through the Analytics user
interface or issued from the command line, and any results they
produce, are always logged, regardless of how ECHO is set.
Specifying SET ECHO, without any parameter, in the command line displays whether
the logging of commands and results in scripts is currently on or off.
Note
Blank spaces are treated like characters.
Creates a global filter (view filter) on the open table, and specifies either a logical test,
or the name of an existing saved filter.
Specifying SET FILTER, without any parameter, removes any filter from the open
table.
Specifies the Analytics project folder in the Overview tab for command output. The
default output folder is the folder containing the active table.
This a DOS-style path using the format /foldername/subfoldername, in which the
initial slash (/) indicates the root level in the Overview tab. You must specify a full file
path.
o SET FOLDER /Tables/Results sets the output folder to the Results subfolder. If the
Results subfolder does not exist, it is created.
o SET FOLDER / sets the output folder to the root level in the Overview tab
o SET FOLDER sets the output folder to the default (the folder containing the active
table)
The output folder remains as whatever you set it – until you reset it, or close the project.
Upon opening the project, the output folder reverts to the default of the active table
folder.
SET FUZZYGROUPSIZE
<TO> num SET FUZZYGROUPSIZE TO 10
Specifies the graph type to use for all subsequently generated graphs. The commands
run must be compatible with the specified graph type. For example, the BENFORD
command cannot produce a PIE2D or PIE3D chart. If an incompatible graph type is
specified the default graph type is used (BAR3D).
The type parameter must be one of the following:
o PIE2D
o PIE3D
o BAR2D
o BAR3D – This is the default graph type.
o STACKED2D
o STACKED3D
o LAYERED
o LINE
o BENFORD – Combines 2D bar graph and 2D line graph.
Specifies the maximum number of table history entries to retain. The value parameter
must be between 1 and 100.
Specifies the name of the script file that the Script Recorder uses to record
commands.
SET LOCKAUTOSAVEFILE
{ON | OFF} SET LOCKAUTOSAVEFILE ON
Note
Specifying ON may cause Analytics to run slower. Use this option
only if you have issues with log file corruption.
o OFF – Log data is saved to a write buffer before being saved to disk.
The write buffer is an temporary data storage location that provides faster access
than the hard disk drive and therefore overall faster execution of Analytics scripts.
The first command switches logging to the specified log. If the specified log does not
exist, it is created.
The second command restores logging to the original Analytics command log.
Note
The maximum length of an Analytics project path and log name is 259
characters, which includes the file path, the log name, and the file
extension (.log).
For records processed by the LOOP command, specifies the maximum number of
commands that can be executed for any single record.
The num range is 0 to 32767. Specifying 0 turns off the limit on command executions
per record.
Caution
If you specify 0 you risk a script entering an infinite loop. A best practice
is to always specify a SET LOOP limit.
Tip
To understand how the total number of commands for a record are
calculated, you can manually count the commands, line by line, in a
GROUP-LOOP block. Start with the GROUP command and finish with
the END command that terminates the GROUP command.
When you get to the LOOP command, you need to account for the
number of times that the loop iterates for a particular record. See the
command breakdown below for details.
Remember that variable assignments are commands. The optional
ASSIGN command keyword is often omitted.
Comments are also commands (COMMENT).
ELSE IF and ELSE statements 1 for each occurrence preceding the ELSE IF
or ELSE block in which the record is
processed
Each command inside GROUP . . . END, or inside Equal to the number of commands in the
the ELSE IF or ELSE block in which the record is group, or in the ELSE IF or ELSE block, not
processed including the loop
(LOOP command + the number of commands Equal to the product of the loop commands
inside LOOP . . . END) x (the number of loop times the number of loop iterations for the
iterations for the record) record
Note
You cannot use SET MATH while an Analytics table is open.
Specifies the default three-character abbreviations for month names. The string
parameter is the list of month abbreviations separated by commas.
Options dialog box: "Date and Time options" on page 136
SET
NOTIFYRETRYATTEMPTS SET NOTIFYRETRYATTEMPTS TO 10
<TO> num
SET
NOTIFYRETRYINTERVAL SET NOTIFYRETRYINTERVAL TO 30
<TO> seconds
SET ORDER
Default setting: ON
Controls script behavior if a numeric overflow occurs.
o ON – Script processing stops, with a message to the log, if a numeric overflow
occurs.
o OFF – Script processing continues even if a numeric overflow occurs.
Options dialog box: "Numeric options" on page 144
Creates a password definition, and specifies a password value, for unattended script
execution.
The num parameter uniquely identifies the password definition and must be a value
from 1 to 10. Specify the password value as a quoted string.
Caution
The SET PASSWORD command exposes an actual password in clear
text in a script, which may not be appropriate for your situation. As a
more secure alternative, you can use the "PASSWORD command" on
page 2036 to prompt for a password at the beginning of script
execution, and temporarily and securely stored the password value in
memory.
Note
SET RETRYIMPORT is retained for backward compatibility.
SET RETRYIMPORT and SET RETRY perform identical actions.
Default: ON
Controls whether a confirmation dialog box appears before overwriting any of the
following items:
o fields in table layouts
o Analytics tables
o files, including Analytics data files (*.fil)
o ON – A confirmation dialog box appears and you must specifically confirm
overwriting.
o OFF – No confirmation dialog box appears and overwriting is performed automat-
ically.
Specifying SET SAFETY, without any parameter, in the command line displays
whether SAFETY is currently on or off.
Options dialog box: "Interface options" on page 123
Specifies the default decimal, thousands, and list separators used by Analytics. The
SET SEPARATORS values must be three valid separator characters in the following
order:
o decimal (period, comma, or space)
o thousands (period, comma, or space)
o list (semi-colon, comma, or space)
Among the three separators, the decimal separator must be unique. You must specify
all three separators when you use the command. The list separator is used primarily to
separate function parameters.
Options dialog box: "Numeric options" on page 144
Creates a new session in the Analytics command log. The session is identified by the
current timestamp.
The optional session_name allows you to add up to 30 characters of additional
identifying information. Quotation marks are permitted but not required.
Default setting: 0
Specifies the maximum amount of memory allocated for sorting and indexing
processes. The num parameter must be a value from 0 to 2000 megabytes (MB), to be
entered in 20MB increments. If the sort memory is set to 0, Analytics uses the memory
currently available.
Options dialog box: "Table options" on page 125
Note
This setting is only for use when defining an Analytics table that uses
an ODBC data source (IMPORT ODBC command), or direct database
access (DEFINE TABLE DB command).
o ON – When defining the table, Analytics suppresses the time portion of datetime
values. For example, 20141231 235959 is read, displayed in views, and
Default setting: ON
Controls whether the results of IF, WHILE, FOR, and NEXT tests associated with
GROUP commands are recorded in the log.
o ON – The results are recorded in the log.
o OFF – The results are not recorded in the log.
Options dialog box: "Command options" on page 132
When using the SET TIME command to specify time formats, you must use 'h' for
Hour, 'm' for Minute, and 's' for Second, even if you have specified different time format
characters in the Options dialog box. For example:
Default setting: ON
Controls the display of time data that includes a UTC offset. UTC is Coordinated
Universal Time, the time at zero degrees longitude.
o ON – Time data with a UTC offset displays as the UTC equivalent of the time.
o OFF – Time data with a UTC offset displays without conversion to UTC.
For example:
o 01 Jan 2015 04:59:59 ( SET UTCZONE ON )
o 31 Dec 2014 23:59:59-05:00 ( SET UTCZONE OFF )
Note
Conversion of times to UTC is for display purposes only, and does not
affect the source data. You can change back and forth between the two
different display modes whenever you want to.
Default setting: 12
Specifies the default display width in characters for numeric computed fields or ad hoc
numeric expressions when Analytics cannot determine the maximum width.
Options dialog box: "Numeric options" on page 144
SIZE command
Calculates a statistically valid sample size, and sample interval, for record sampling or monetary
unit sampling.
Record samplingMonetary unit sampling
Syntax
SIZE RECORD CONFIDENCE confidence_level POPULATION population_size PRECISION
tolerable_rate <ERRORLIMIT expected_rate> <TO {SCREEN|filename}>
Parameters
Note
Do not include thousands separators, or percentage signs, when you specify values.
Name Description
CONFIDENCE The desired confidence level that the resulting sample is representative of the entire
confidence_level population.
For example, specifying 95 means that you want to be confident that 95% of the time the
sample will in fact be representative. Confidence is the complement of "sampling risk". A
95% confidence level is the same as a 5% sampling risk.
PRECISION tolerable_ The tolerable deviation rate, which is the maximum rate of deviation from a prescribed
rate control that can occur and you still consider the control effective.
For example, specifying 5 means that the deviation rate must be greater than 5% for you
to consider the control not effective.
ERRORLIMIT expected_ The expected population deviation rate. This is the rate of deviation from a prescribed
rate control that you expect to find.
optional For example, specifying 1 means that you expect the deviation rate to be 1%.
Name Description
TO SCREEN | filename The location to send the results of the command to:
o SCREEN – displays the results in the Analytics display area
Tip
You can click any linked result value in the display area to drill down to
the associated record or records in the source table.
By default, the file is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the file to a different, existing folder:
l TO "C:\Output.TXT"
l TO "Results\Output.TXT"
Examples
Using your specified confidence level, the example below calculates a sample size of 95, and
a sample interval value of 8.12, to use when drawing a record sample:
Remarks
For more information about how this command works, see "Calculating sample size for a record
sample" on page 1050.
Syntax
SIZE MONETARY CONFIDENCE confidence_level POPULATION population_size
MATERIALITY tolerable_misstatement <ERRORLIMIT expected_misstatement> <TO
{SCREEN|filename}>
Parameters
Note
Do not include thousands separators, or percentage signs, when you specify values.
Name Description
CONFIDENCE The desired confidence level that the resulting sample is representative of the entire
confidence_level population.
For example, specifying 95 means that you want to be confident that 95% of the time the
sample will in fact be representative. Confidence is the complement of "sampling risk". A
95% confidence level is the same as a 5% sampling risk.
MATERIALITY tolerable_ The tolerable misstatement, which is the maximum total amount of misstatement that can
misstatement occur in the sample field without being considered a material misstatement.
For example, specifying 29000 means that the total amount of misstatement must be
greater than $29,000 to be considered a material misstatement.
Name Description
ERRORLIMIT expected_ The expected misstatement. This is the total amount of misstatement that you expect the
misstatement sample field to contain.
optional For example, specifying 5800 means that you expect the total amount of misstatement to
be $5,800.
If you omit this parameter, an expected misstatement of $0.00 is used.
TO SCREEN | filename The location to send the results of the command to:
o SCREEN – displays the results in the Analytics display area
Tip
You can click any linked result value in the display area to drill down to
the associated record or records in the source table.
By default, the file is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the file to a different, existing folder:
l TO "C:\Output.TXT"
l TO "Results\Output.TXT"
Examples
Before drawing the sample, you must first calculate the statistically valid sample size and
sample interval.
You want to be confident that 95% of the time the sample drawn by Analytics will be represent-
ative of the population as a whole.
Using your specified confidence level, the example below calculates a sample size of 93, and
a sample interval value of 6,283.33, to use when drawing a monetary unit sample:
Remarks
For more information about how this command works, see "Calculating sample size for a monetary
unit sample" on page 1079.
SORT command
Sorts records in an Analytics table into an ascending or descending sequential order, based on a
specified key field or fields. The results are output to a new, physically reordered Analytics table.
Syntax
SORT {<ON> key_field <D> <...n>|<ON> ALL <EXCLUDE field_name <...n>>}
<FIELDS field_name <AS display_name> <...n>|FIELDS ALL <EXCLUDE field_name
<...n>>> TO tablename <LOCAL> <IF test> <WHILE test> <FIRST range|NEXT
range> <APPEND> <OPEN> <ISOLOCALE locale_code>
Parameters
Name Description
ON key_field D <...n> | ON The key field or fields, or the expression, to use for sorting.
ALL
You can sort by any type of field, including computed fields and ad hoc expressions,
regardless of data type.
o ON key_field – use the specified field or fields
If you sort by more than one field, you create a nested sort in the output table. The
order of nesting follows the order in which you specify the fields.
Include D to sort a key field in descending order. The default sort order is ascending.
o ON ALL – use all fields in the table
If you sort by all the fields in a table you create a nested sort in the output table. The
order of nesting follows the order in which the fields appear in the table layout.
An ascending sort order is the only option for ON ALL.
Name Description
Tip
If you need only a portion of the data contained in a record, do not include
all fields, or the entire record, in the sorted output table. Select only the
fields you need, which in most cases speeds up the sorting process.
Note
AS works only when outputting to a new table. If you are appending to an
existing table, the alternate column titles in the existing table take
precedence.
Name Description
By default, the table data file (.FIL) is saved to the folder containing the
Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
l TO "C:\Output.FIL"
l TO "Results\Output.FIL"
Note
Table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _
), but no other special characters, or any spaces. The name cannot
start with a number.
LOCAL Saves the output file in the same location as the Analytics project.
optional
Note
Applicable only when running the command against a server table with
an output file that is an Analytics table.
The LOCAL parameter must immediately follow the TO parameter.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
Name Description
of records is reached
Use range to specify the number of records to process.
If you omit FIRST and NEXT, all records are processed by default.
APPEND Appends the command output to the end of an existing file instead of overwriting it.
optional
Note
You must ensure that the structure of the command output and the
existing file are identical:
l the same fields
l the same field order
l matching fields are the same length
l matching fields are the same data type
Analytics appends output to an existing file regardless of its structure. If
the structure of the output and the existing file do not match, jumbled,
missing, or inaccurate data can result.
OPEN Open the table and apply the index to the table.
optional
The system locale in the format language_country. For example, to use Canadian
French, enter fr_ca.
Use the following codes:
o language – ISO 639 standard language code
o country – ISO 3166 standard country code
If you do not specify a country code, the default country for the language is used.
If you do not use ISOLOCALE, the default system locale is used.
Examples
To switch from the default ascending sort order to a descending sort order, you add D after
the key field name:
Remarks
For more information about how this command works, see "Sorting records" on page 1200.
Analytics
Edition Sort Order default Associated sort sequence
Analytics
Edition Sort Order default Associated sort sequence
Case sensitivity
SORT is case sensitive. Depending on which edition of Analytics you are using (non-Unicode or
Unicode), casing in strings may affect sorting.
You can use the UPPER( ) function in conjunction with SORT if you do not want case to affect
sorting:
STATISTICS command
Calculates statistics for one or more numeric or datetime fields in an Analytics table.
Syntax
STATISTICS {<ON> field_name <...n>|<ON> ALL <EXCLUDE field_name <...n>>}
<STD> <MODMEDQ> <NUMBER n> <TO {SCREEN|filename|PRINT}> <IF test> <WHILE
test> <FIRST range|NEXT range> <APPEND>
Parameters
Name Description
ON field_name <...n> | Specify one or more numeric or datetime fields to generate statistics for, or specify
ON ALL ON ALL to generate statistics for all numeric and datetime fields in the Analytics table.
STD Calculates the standard deviation of the fields specified, in addition to the other statistics.
optional
MODMEDQ Calculates the mode, median, first quartile, and third quartile values of the fields
specified, in addition to the other statistics.
optional
NUMBER n The number of high and low values to retain during processing. The default value is 5.
optional
TO SCREEN | filename | The location to send the results of the command to:
PRINT o SCREEN – displays the results in the Analytics display area
optional
Name Description
Tip
You can click any linked result value in the display area to drill down to
the associated record or records in the source table.
By default, the file is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the file to a different, existing folder:
l TO "C:\Output.TXT"
l TO "Results\Output.TXT"
o PRINT – sends the results to the default printer
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
APPEND Appends the command output to the end of an existing file instead of overwriting it.
optional
Name Description
Note
You must ensure that the structure of the command output and the
existing file are identical:
l the same fields
l the same field order
l matching fields are the same length
l matching fields are the same data type
Analytics appends output to an existing file regardless of its structure. If
the structure of the output and the existing file do not match, jumbled,
missing, or inaccurate data can result.
Name Contains
Note
When Analytics identifies the highest value, duplicate values are not
factored out. For example, if values in descending order are 100, 100, 99,
98, the 3rd highest value is 99, not 98.
Name Contains
Note
When Analytics identifies the lowest value, duplicate values are not
factored out. For example, if values in ascending order are 1, 1, 2, 3, the
3rd lowest value is 2, not 3.
Q25n The first quartile value (lower quartile value) calculated by the command.
Q75n The third quartile value (upper quartile value) calculated by the command.
RANGEn The difference between the maximum and minimum values calculated by the command.
Examples
STRATIFY command
Groups records into numeric intervals based on values in a numeric field. Counts the number of
records in each interval, and also subtotals specified numeric fields for each interval.
Syntax
STRATIFY <ON> numeric_field MINIMUM value MAXIMUM value {<INTERVALS
number>|FREE interval_value <...n> last_interval} <SUPPRESS>
<SUBTOTAL numeric_field <...n>|SUBTOTAL ALL <EXCLUDE numeric_field <...n>>>
<KEY break_field> <TO {SCREEN|table_name|filename|GRAPH|PRINT}> <LOCAL> <IF
test> <FIRST range|NEXT range> <WHILE test> <APPEND> <OPEN> <HEADER header_
text> <FOOTER footer_text> <STATISTICS>
Parameters
Name Description
MINIMUM value Applies to numeric fields only. The minimum value of the first numeric interval.
MINIMUM is optional if you are using FREE, otherwise it is required.
MAXIMUM value Applies to numeric fields only. The maximum value of the last numeric interval.
MAXIMUM is optional if you are using FREE, otherwise it is required.
Name Description
the MINIMUM value, and equal to or less than the MAXIMUM value.
Interval values must be in numeric sequence and cannot contain duplicate values:
SUPPRESS Values above the MAXIMUM value and below the MINIMUM value are excluded from the
command output.
optional
SUBTOTAL numeric_field One or more numeric fields or expressions to subtotal for each group.
<...n> | SUBTOTAL ALL
Multiple fields must be separated by spaces. Specify ALL to subtotal all the numeric
optional fields in the table.
If you do not select a subtotal field, the field you are stratifying on is automatically
subtotaled.
You must explicitly specify the stratify field if you want to subtotal it along with one or
more other fields, or if you want to include statistics for the subtotaled stratify field.
KEY break_field The field or expression that groups subtotal calculations. A subtotal is calculated each
time the value of break_field changes.
optional
break_field must be a character field or expression. You can specify only one field, but
you can use an expression that contains more than one field.
TO SCREEN table_name | The location to send the results of the command to:
filename | GRAPH | PRINT o SCREEN – displays the results in the Analytics display area
Tip
You can click any linked result value in the display area to drill down to
the associated record or records in the source table.
By default, the table data file (.FIL) is saved to the folder containing the
Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
Name Description
folder:
l TO "C:\Output.FIL"
l TO "Results\Output.FIL"
Note
Table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _
), but no other special characters, or any spaces. The name cannot
start with a number.
By default, the file is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the file to a different, existing folder:
l TO "C:\Output.TXT"
l TO "Results\Output.TXT"
o GRAPH – displays the results in a graph in the Analytics display area
o PRINT – sends the results to the default printer
LOCAL Saves the output file in the same location as the Analytics project.
optional
Note
Applicable only when running the command against a server table with
an output file that is an Analytics table.
The LOCAL parameter must immediately follow the TO parameter.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Name Description
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
APPEND Appends the command output to the end of an existing file instead of overwriting it.
optional
Note
You must ensure that the structure of the command output and the
existing file are identical:
l the same fields
l the same field order
l matching fields are the same length
l matching fields are the same data type
Analytics appends output to an existing file regardless of its structure. If
the structure of the output and the existing file do not match, jumbled,
missing, or inaccurate data can result.
OPEN Opens the table created by the command after the command executes. Only valid if the
command creates an output table.
optional
HEADER header_text The text to insert at the top of each page of a report.
optional header_text must be specified as a quoted string. The value overrides the Analytics
HEADER system variable.
FOOTER footer_text The text to insert at the bottom of each page of a report.
optional footer_text must be specified as a quoted string. The value overrides the Analytics
FOOTER system variable.
STATISTICS Note
optional Cannot be used unless SUBTOTAL is also specified.
Calculates average, minimum, and maximum values for all SUBTOTAL fields.
Examples
l from $0 to $999.99
l from $1,000 to $1,999.99
l so on
The total invoice amount is included for each interval.
OPEN Ar
STRATIFY ON Invoice_Amount MINIMUM 0 MAXIMUM 10000 INTERVALS 10 TO
"Stratified_invoices.FIL"
Remarks
For more information about how this command works, see "Stratifying data" on page 1315.
How it works
STRATIFY groups records into equal-sized, or custom-sized, numeric intervals based on values in a
numeric field.
The output contains a single record for each interval, with a count of the number of records in the
source table that fall into each interval.
Subtotal field subtotaled field name in source Total + subtotaled alternate column title in source
table table
Average field a_subtotaled field name in Average + subtotaled alternate column title in
source table source table
Minimum field m_subtotaled field name in Minimum + subtotaled alternate column title in
source table source table
Maximum field x_subtotaled field name in Maximum + subtotaled alternate column title in
source table source table
SUMMARIZE command
Groups records based on identical values in one or more character, numeric, or datetime fields.
Counts the number of records in each group, and also subtotals specified numeric fields for each
group.
Syntax
SUMMARIZE {ON key_field <...n>|ON ALL <EXCLUDE field_name <...n>>}
<SUBTOTAL numeric_field <...n>|SUBTOTAL ALL <EXCLUDE numeric_field <...n>>>
<OTHER field <...n>|OTHER ALL <EXCLUDE field_name <...n>>> <TO
{SCREEN|table_name|PRINT}> <LOCAL> <IF test> <WHILE test> <FIRST range|NEXT
range> <PRESORT> <APPEND> <OPEN> <HEADER header_text> <FOOTER footer_text>
<STATISTICS> <MODMEDQ> <STDEV> <CPERCENT> <ISOLOCALE locale_code>
Parameters
Name Description
Name Description
SUBTOTAL numeric_field One or more numeric fields or expressions to subtotal for each group.
<...n> | SUBTOTAL ALL
Multiple fields must be separated by spaces. Specify ALL to subtotal all the numeric
optional fields in the table.
OTHER field <...n> | One or more additional fields to include in the output.
OTHER ALL o OTHER field <...n> – include the specified field or fields
optional o OTHER ALL – include all fields in the table that are not specified as key fields or
subtotal fields
Use OTHER only with fields that contain the same value for all records in each
summarized group. If you specify a field that contains values that are different for a
summarized group, only the value for the first record in the group is displayed, which is
not meaningful.
For example:
o summarize a table on customer number – an appropriate "other field" is Customer
Name. Typically, the customer name is identical for all records with the same
customer number.
o summarize a vendor table by state – an inappropriate "other field" is City. Only the
first city listed for each state appears in the output. In this instance, the better
approach is to summarize using both state and city as key fields, in that order.
TO SCREEN table_name | The location to send the results of the command to:
PRINT o SCREEN – displays the results in the Analytics display area
Tip
You can click any linked result value in the display area to drill down to
the associated record or records in the source table.
Name Description
By default, the table data file (.FIL) is saved to the folder containing the
Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
l TO "C:\Output.FIL"
l TO "Results\Output.FIL"
Note
Table names are limited to 64 alphanumeric characters, not including
the .FIL extension. The name can include the underscore character ( _
), but no other special characters, or any spaces. The name cannot
start with a number.
LOCAL Saves the output file in the same location as the Analytics project.
optional
Note
Applicable only when running the command against a server table with
an output file that is an Analytics table.
The LOCAL parameter must immediately follow the TO parameter.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
PRESORT Sorts the table on the key field before executing the command.
Name Description
optional Note
You cannot use PRESORT inside the GROUP command.
Tip
If the input table is already sorted, you can save processing time by not
specifying PRESORT.
Note
Depending on the context, more than one group for each set of identical
values, or identical combination of values, can defeat the purpose of
summarizing.
APPEND Appends the command output to the end of an existing file instead of overwriting it.
optional
Note
You must ensure that the structure of the command output and the
existing file are identical:
l the same fields
l the same field order
l matching fields are the same length
l matching fields are the same data type
Analytics appends output to an existing file regardless of its structure. If
the structure of the output and the existing file do not match, jumbled,
missing, or inaccurate data can result.
OPEN Opens the table created by the command after the command executes. Only valid if the
command creates an output table.
optional
HEADER header_text The text to insert at the top of each page of a report.
optional header_text must be specified as a quoted string. The value overrides the Analytics
HEADER system variable.
FOOTER footer_text The text to insert at the bottom of each page of a report.
optional footer_text must be specified as a quoted string. The value overrides the Analytics
FOOTER system variable.
Name Description
STATISTICS Note
optional Cannot be used unless SUBTOTAL is also specified.
Calculates average, minimum, and maximum values for all SUBTOTAL fields.
MODMEDQ Note
optional Cannot be used unless SUBTOTAL is also specified.
Calculates mode, median, first quartile, and third quartile values for all SUBTOTAL fields.
STDEV Note
optional Cannot be used unless SUBTOTAL is also specified.
Calculates standard deviation and percentage of total for all SUBTOTAL fields.
ISOLOCALE Note
optional Applicable in the Unicode edition of Analytics only.
The system locale in the format language_country. For example, to use Canadian
French, enter fr_ca.
Use the following codes:
o language – ISO 639 standard language code
o country – ISO 3166 standard country code
If you do not specify a country code, the default country for the language is used.
If you do not use ISOLOCALE, the default system locale is used.
Examples
OPEN Ar
SUMMARIZE ON Customer_Number SUBTOTAL Trans_Amount TO "Customer_
total.FIL" PRESORT
OPEN Ar
SUMMARIZE ON Customer_Number Trans_Date SUBTOTAL Trans_Amount TO "Cus-
tomer_total_by_date.FIL" PRESORT
OPEN Ar
SUMMARIZE ON Customer_Number Trans_Date SUBTOTAL Trans_Amount TO "Cus-
tomer_stats_by_date.FIL" PRESORT STATISTICS
The output is grouped by date, and within date by amount. You can use the associated count
to identify transactions with identical amounts and identical dates:
OPEN CC_Trans
SUMMARIZE ON Trans_Date Trans_Amount TO "Transactions_by_date_amoun-
t.FIL" OPEN PRESORT
SET FILTER TO COUNT > 1
Remarks
For more information about how this command works, see "Summarizing data" on page 1338.
How it works
SUMMARIZE groups records that have the same value in a field, or the same combination of values
across multiple fields. The output results contain a single record for each group, with a count of the
number of records in the source table that belong to the group.
Median + subtotaled c_subtotaled field name The median value for each
alternate column title group
o Odd-numbered sets of
MODMEDQ values: the middle
value
o Even-numbered sets of
values: the average of
the two values at the
middle
Q25 + subtotaled alternate q_subtotaled field name The first quartile value for
column title each group (lower quartile
value)
o The result is an
interpolated value
based on an Analytics
algorithm
o Produces the same
result as the
QUARTILE and
QUARTILE.INC
functions in Microsoft
Excel
Q75 + subtotaled alternate p_subtotaled field name The third quartile value for
column title each group (upper quartile
value)
o The result is an
interpolated value
based on an Analytics
algorithm
o Produces the same
result as the
QUARTILE and
QUARTILE.INC
functions in Microsoft
Excel
Note
Does not
require a
CPERCENT subtotal field
TOP command
Moves to the first record in an Analytics table.
Syntax
TOP
Parameters
This command does not have any parameters.
Remarks
When to use TOP
Use TOP to move to the first record in a table if a previous command, such as FIND, selected
another record in the table.
TOTAL command
Syntax
TOTAL {<FIELDS> numeric_field <...n>|<FIELDS> ALL <EXCLUDE numeric_field
<...n>>} <IF test> <WHILE test> <FIRST range|NEXT range>
Parameters
Name Description
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
Name Description
Name Contains
Examples
Remarks
When to use TOTAL
Use TOTAL to verify the completeness and accuracy of the source data and to produce control
totals. The command calculates the arithmetic sum of the specified fields or expressions.
TRAIN command
Uses automated machine learning to create an optimum predictive model using a training data set.
Note
The TRAIN command is not supported if you are running Analytics on a 32-bit
computer. The computation required by the command is processor-intensive and
better suited to 64-bit computers.
Syntax
TRAIN {CLASSIFIER|REGRESSOR} <ON> key_field <...n> TARGET labeled_field
SCORER {ACCURACY|AUC|F1|LOGLOSS|PRECISION|RECALL|MAE|MSE|R2} SEARCHTIME
minutes MAXEVALTIME minutes MODEL model_name TO table_name <IF test> <WHILE
test> <FIRST range|NEXT range> FOLDS number_of_folds <SEED seed_value>
<LINEAR> <NOFP>
Note
The maximum supported size of the data set used with the TRAIN command is 1
GB.
Parameters
Name Description
Name Description
Note
Character fields must be "categorical". That is, they must identify
categories or classes, and contain a maximum number of unique values.
The maximum is specified by the Maximum Categories option (Tools
> Options > Command).
TARGET labeled_field The field that the model is being trained to predict based on the training input fields.
The different prediction types (classification or regression) work with different field data
types:
SCORER ACCURACY | The metric to use when scoring (tuning and ranking) the generated models.
AUC | F1 | LOGLOSS |
The generated model with the best value for this metric is kept, and the rest of the models
PRECISION | RECALL |
are discarded.
MAE | MSE | R2
A different subset of metrics is valid depending on the prediction type you are using
(classification or regression):
Note
The classification metric AUC is only valid when labeled_field contains
binary data – that is, two classes, such as Yes/No, or True/False.
SEARCHTIME minutes The total time in minutes to spend training and optimizing a predictive model.
Training and optimizing involves searching across different pipeline configurations
(different model, preprocessor, and hyperparameter combinations).
Note
Total runtime of the TRAIN command is SEARCHTIME plus up to twice
MAXEVALTIME.
Tip
Specify a SEARCHTIME that is at least 10x the MAXEVALTIME
This time allotment strikes a reasonable balance between processing
time and allowing a variety of model types to be evaluated.
Tip
Allot 45 minutes for every 100 MB of training data.
This time allotment strikes a reasonable balance between processing
time and allowing a variety of model types to be evaluated.
Name Description
MODEL model_name The name of the model file output by the training process.
The model file contains the model best fitted to the training data set. You will input the
model to the PREDICT command to generate predictions about a new, unseen data set.
Specify model_name as a quoted string. For example: TO "Loan_default_prediction"
You can specify the *.model file extension, or let Analytics automatically specify it.
By default, the model file is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the model file to a different, existing
folder:
o TO "C:\Loan_default_prediction"
o TO "ML Train output\Loan_default_prediction.model"
TO table_name The name of the model evaluation table output by the training process.
The model evaluation table contains two distinct types of information:
o Scorer/Metric – for the classification or regression metrics, quantitative estimates of
the predictive performance of the model file output by the training process
Different metrics provide different types of estimates. Scorer identifies the metric you
specified with SCORER. Metric identifies the metrics you did not specify.
o Importance/Coefficient – in descending order, values indicating how much each
feature (predictor) contributes to the predictions made by the model
Specify table_name as a quoted string with a .FIL file extension. For example: TO
"Model_evaluation.FIL"
By default, the table data file (.FIL) is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the data file to a different, existing
folder:
o TO "C:\Model_evaluation.FIL"
o TO "ML Train output\Model_evaluation.FIL"
Note
Table names are limited to 64 alphanumeric characters, not including the
.FIL extension. The name can include the underscore character ( _ ), but
no other special characters, or any spaces. The name cannot start with a
number.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Name Description
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
FOLDS number_of_folds The number of cross-validation folds to use when evaluating and optimizing the model.
Folds are subdivisions of the training data set, and are used in a cross-validation
process.
Typically, using from 5 to 10 folds yields good results when training a model. The
minimum number of folds allowed is 2, and the maximum number is 10.
Tip
Increasing the number of folds can produce a better estimate of the
predictive performance of a model, but it also increases overall runtime.
SEED seed_value The seed value to use to initialize the random number generator in Analytics.
optional If you omit SEED, Analytics randomly selects the seed value.
Explicitly specify a seed value, and record it, if you want to replicate the training process
with the same data set in the future.
Note
With larger data sets, the training process typically completes more
quickly if you include only linear models.
Including only linear models guarantees coefficients in the output.
NOFP Exclude feature selection and data preprocessing from the training process.
optional Feature selection is the automated selection of the fields in the training data set that are
the most useful in optimizing the predictive model. Automated selection can improve
predictive performance, and reduce the amount of data involved in model optimization.
Data preprocessing performs transformations such as scaling and standardizing on the
training data set to make it better suited for the training algorithms.
Caution
You should only exclude feature selection and data preprocessing if you
have a reason for doing so.
Examples
OPEN "Loan_applicants_historical"
TRAIN CLASSIFIER ON Age Job_Category Salary Account_Balance Loan_
Amount Loan_Period Refinanced Credit_Score TARGET Default SCORER
LOGLOSS SEARCHTIME 960 MAXEVALTIME 90 MODEL "Loan_default_pre-
diction.model" TO "Model_evaluation.FIL" FOLDS 5
OPEN "House_sales"
TRAIN REGRESSOR ON Lot_Size Bedrooms Bathrooms Stories Driveway Rec-
room Full_Basement Gas_HW Air_conditioning Garage_Places Preferred_
Area TARGET Price SCORER MSE SEARCHTIME 960 MAXEVALTIME 90 MODEL
"House_price_prediction.model" TO "Model_evaluation.FIL" FOLDS 5
Remarks
For more information about how this command works, see "Predicting classes and numeric values"
on page 1362.
VERIFY command
Checks for data validity errors in one or more fields in an Analytics table by verifying that the data is
consistent with the field definitions in the table layout.
Syntax
VERIFY {<FIELDS> field_name <...n>|<FIELDS> ALL <EXCLUDE field_name <...n>>}
<IF test> <WHILE test> <FIRST range|NEXT range> <ERRORLIMIT n> <TO
{SCREEN|filename|PRINT}> <APPEND>
Parameters
Name Description
FIELDS field_name <...n> The fields or expressions to verify. Specify ALL to verify all fields in the table.
| FIELDS ALL
Note
By definition, computed fields, ad hoc expressions, and binary fields are
always valid.
IF test A conditional expression that must be true in order to process each record. The
command is executed on only those records that satisfy the condition.
optional
Note
The IF parameter is evaluated against only the records remaining in a
table after any scope parameters have been applied (WHILE, FIRST,
NEXT).
WHILE test A conditional expression that must be true in order to process each record. The
command is executed until the condition evaluates as false, or the end of the table is
optional
reached.
Name Description
Note
If you use WHILE in conjunction with FIRST or NEXT, record processing
stops as soon as one limit is reached.
ERRORLIMIT n The number of errors allowed before the command is terminated. The default value is 10.
optional
TO SCREEN | filename | The location to send the results of the command to:
PRINT o SCREEN – displays the results in the Analytics display area
optional
Tip
You can click any linked result value in the display area to drill down to
the associated record or records in the source table.
By default, the file is saved to the folder containing the Analytics project.
Use either an absolute or relative file path to save the file to a different, existing folder:
l TO "C:\Output.TXT"
l TO "Results\Output.TXT"
o PRINT – sends the results to the default printer
APPEND Appends the command output to the end of an existing file instead of overwriting it.
optional
Note
You must ensure that the structure of the command output and the
existing file are identical:
l the same fields
l the same field order
l matching fields are the same length
l matching fields are the same data type
Analytics appends output to an existing file regardless of its structure. If
the structure of the output and the existing file do not match, jumbled,
missing, or inaccurate data can result.
WRITEn The total number of data validity errors in all fields verified by the command.
Examples
Remarks
How it works
VERIFY compares the values in one or more fields to the data type specified for each of the fields in
the table layout and reports any errors. The command ensures the following:
l character fields – contain only valid characters, and that no unprintable characters are
present
l numeric fields – contain only valid numeric data. In addition to numbers, numeric fields can
contain one preceding plus sign or minus sign and one decimal point
l datetime fields – contain valid dates, datetimes, or times
For each error that is identified, the record number and field name are output, along with the invalid
value in hexadecimal format.
Functions overview
An ACLScript function is a computerized routine in Analytics, narrow in scope, that performs a
specific task or calculation and returns a value.
For example, the ALLTRIM( ) function removes any leading or trailing spaces from the text values in
a field.
A full list of functions available in Analytics, organized by category, appears on subsequent pages:
l "Search, replace" on page 2167
l "Comparison" on page 2168
l "Conversion" on page 2168
l "Text" on page 2170
l "Math" on page 2171
l "Date and time" on page 2173
l "Financial" on page 2175
l "Field and record" on page 2176
l "Table, file, and project" on page 2176
l "Variable testing" on page 2177
l "Python" on page 2177
l "R" on page 2178
l "Bit and character encoding" on page 2179
ALLTRIM(Vendor_Name)
o The opening parenthesis must immediately follow the function name with no
intervening space:
ALLTRIM(Vendor_Name)
not:
ALLTRIM (Vendor_Name)
Convention Description
RECNO( )
SUBSTRING(Product_ID,5,12)
Tip
For improved readability you can use both a blank space and one of the
other separator characters:
SUBSTRING(Product_ID, 5, 12)
qualifiers o Single or double quotation marks are required around literal character values:
EXCLUDE(Product_ID, "#-")
AGE(Due_date, `20141231`)
ABS(-7.2)
LEVDIST(Vendor_Name, Vendor_Name_2, F)
ALLTRIM(Vendor_Name)
literal datetime format o Literal date values must be entered in YYYYMMDD or YYMMDD format:
l `20141231`
Convention Description
l `141231`
o Literal time values must be entered in hhmmss or hhmm format, and preceded by a
space, T, or t:
l `t235959`
l `20141231 2359`
When specifying functions in computed fields, expressions, or scripts, you can abbreviate their
names. You must include enough leading characters from a function name to uniquely identify the
function among all Analytics functions.
For example:
l MAX uniquely identifies the MAXIMUM function and therefore is a valid abbreviation.
l MA does not uniquely identify the MAXIMUM function and generates an error message.
You can make an abbreviation as short as you want, provided that it still uniquely identifies the
function.
For example, all the following abbreviations are valid for the ALLTRIM function:
l ALLTR
l ALLT
l ALL
l AL
Note
As abbreviations get shorter they become harder for other users to recognize.
Note
Throughout Analytics documentation, function names are presented in
uppercase, which is simply a formatting convention. Analytics does not require
that functions are entered in uppercase.
| Separates syntax items enclosed in brackets or braces. You can use only one of the items.
(vertical bar)
<,...n> Indicates the preceding item can be repeated n number of times. The occurrences are
separated by commas.
Character Any field name, expression, or variable that belongs to the Analytics Character (C) category, or
a string literal
Numeric Any field name, expression, or variable that belongs to the Analytics Numeric (N) data
category, or a numeric value
Datetime Any field name, expression, or variable that belongs to the Analytics Datetime (D) category, or
a datetime literal
Logical Any field name, expression, or variable that belongs to the Analytics Logical (L) category, or a
logical value
Search, replace
Search functions let you perform different types of searches. You can search data for specific words
or sequences of characters, values within a range, blank values, and values matching a pattern.
Replace functions give you different options for searching and replacing data.
Tip
For numerous examples of using functions to perform powerful and effective
searching and filtering of data in tables, see "Search and filter using Analytics
functions" on page 1245.
Function descriptions
Function Description
AT( ) Returns a number specifying the starting location of a particular occurrence of a substring
within a character value.
BETWEEN( ) Returns a logical value indicating whether the specified value falls within a range.
CLEAN( ) Replaces the first invalid character in a string, and all subsequent characters, with blanks.
FIND( ) Returns a logical value indicating whether the specified string is present in a particular field, or
anywhere in an entire record.
FINDMULTI( ) Returns a logical value indicating whether any string in a set of one or more specified strings
is present in a particular field, or anywhere in an entire record.
ISBLANK( ) Returns a logical value indicating whether the input value is blank.
MAP( ) Returns a logical value indicating if a character string matches a specified format string
containing wildcard characters, literal characters, or both.
MATCH( ) Returns a logical value indicating whether the specified value matches any of the values it is
compared against.
OCCURS( ) Returns a count of the number of times a substring occurs in a specified character value.
REGEXFIND( ) Returns a logical value indicating whether the pattern specified by a regular expression
occurs in a string.
Function Description
REGEXREPLACE( ) Replaces all instances of strings matching a regular expression with a new string.
REPLACE( ) Replaces all instances of a specified character string with a new character string.
TEST( ) Returns a logical value indicating whether a specified string occurs at a specific byte position
in a record.
Comparison
Comparison functions provide different ways to find text values that are identical, or nearly identical,
to a specified value.
Tip
If you want to find identical text values only, you can also use this simple method:
field_name = "text value"
For example: last_name = "Smith"
The text value is case-sensitive.
Function descriptions
Function Description
DICECOEFFICIENT( ) Returns the Dice's coefficient of two specified strings, which is a measurement of how
similar the two strings are.
ISFUZZYDUP( ) Returns a logical value indicating whether a string is a fuzzy duplicate of a comparison
string.
LEVDIST( ) Returns the Levenshtein distance between two specified strings, which is a measurement
of how much the two strings differ.
SOUNDEX( ) Returns the soundex code for the specified string, which can be used for phonetic
comparisons with other strings.
SOUNDSLIKE( ) Returns a logical value indicating whether a string phonetically matches a comparison
string.
Conversion
Conversion functions allow you to convert between data types. One important use of these functions
is to prepare fields for Analytics commands that require input of a specific data type.
Function descriptions
Function Description
BINTOSTR( ) Returns Unicode character data converted from ZONED or EBCDIC character data. Abbrevi-
ation for "Binary to String".
CTOD( ) Converts a character or numeric date value to a date. Can also extract the date from a
character or numeric datetime value and return it as a date. Abbreviation for "Character to
Date".
CTODT( ) Converts a character or numeric datetime value to a datetime. Abbreviation for "Character to
Datetime".
CTOT( ) Converts a character or numeric time value to a time. Can also extract the time from a
character or numeric datetime value and return it as a time. Abbreviation for "Character to
Time".
DATE( ) Extracts the date from a specified date or datetime and returns it as a character string. Can
also return the current operating system date.
DATETIME( ) Converts a datetime to a character string. Can also return the current operating system
datetime.
DTOU( ) Converts an Analytics date value to a Unicode string in the specified language and locale
format. Abbreviation for "Date to Unicode".
EBCDIC( ) Returns a string that has been converted to EBCDIC character encoding.
HASH( ) Returns a salted cryptographic hash value based on the input value.
STOD( ) Converts a serial date – that is, a date expressed as an integer – to a date value. Abbreviation
for "Serial to Date".
STODT( ) Converts a serial datetime – that is, a datetime expressed as an integer, and a fractional
portion of 24 hours – to a datetime value. Abbreviation for "Serial to Datetime".
STOT( ) Converts a serial time – that is, a time expressed as a fractional portion of 24 hours, with 24
hours equaling 1 – to a time value. Abbreviation for "Serial to Time".
TIME( ) Extracts the time from a specified time or datetime and returns it as a character string. Can
also return the current operating system time.
Function Description
UTOD( ) Converts a Unicode string containing a formatted date to an Analytics date value. Abbreviation
for "Unicode to Date".
ZONED( ) Converts numeric data to character data and adds leading zeros to the output.
Text
Text functions let you perform a variety of different tasks with character data.
For example, you can remove leading or trailing spaces, exclude or include specific characters,
isolate just a portion of a character string, or standardize upper or lowercase.
Function descriptions
Function Description
ALLTRIM( ) Returns a string with leading and trailing spaces removed from the input string.
BINTOSTR( ) Returns Unicode character data converted from ZONED or EBCDIC character data. Abbrevi-
ation for "Binary to String".
DATETIME( ) Converts a datetime to a character string. Can also return the current operating system
datetime.
DTOU( ) Converts an Analytics date value to a Unicode string in the specified language and locale
format. Abbreviation for "Date to Unicode".
EBCDIC( ) Returns a string that has been converted to EBCDIC character encoding.
INSERT( ) Returns the original string with specified text inserted at a specific byte location.
Function Description
LTRIM( ) Returns a string with leading spaces removed from the input string.
PROPER( ) Returns a string with the first character of each word set to uppercase and the remaining
characters set to lowercase.
RJUSTIFY( ) Returns a right-justified string the same length as a specified string, with any trailing spaces
moved to the left of the string.
TRANSFORM( ) Reverses the display order of bi-directional text within a specified string.
TRIM( ) Returns a string with trailing spaces removed from the input string.
ZONED( ) Converts numeric data to character data and adds leading zeros to the output.
Math
Math functions perform a variety of different mathematical calculations.
Function descriptions
Function Description
ABS( ) Returns the absolute value of a numeric expression. The absolute value of a number is the
number without its sign.
Function Description
COS( ) Returns the cosine of an angle expressed in radians, with a precision of 15 decimal places.
DEC( ) Returns a value, or the result of a numeric expression, with the specified number of decimal
places.
EXP( ) Returns the exponential value (base 10) of a numeric expression with a specified number of
decimal places.
FREQUENCY( ) Returns the expected Benford frequency for sequential leading positive numeric digits to a
precision of eight decimal places.
LOG( ) Returns the logarithm (base 10) of a numeric expression or field value with a specified number
of decimal places.
MAXIMUM( ) Returns the maximum value in a set of numeric values, or the most recent value in a set of
datetime values.
MINIMUM( ) Returns the minimum value in a set of numeric values, or the oldest value in a set of datetime
values.
NORMDIST( ) Returns the probability that a random variable from a normally distributed data set is less than
or equal to a specified value, or exactly equal to a specified value.
NORMSINV( ) Returns the z-score associated with a specified probability in a standard normal distribution.
The z-score is the number of standard deviations a value is from the mean of a standard
normal distribution.
SIN( ) Returns the sine of an angle expressed in radians, with a precision of 15 decimal places.
TAN( ) Returns the tangent of an angle expressed in radians, with a precision of 15 decimal places.
ZONED( ) Converts numeric data to character data and adds leading zeros to the output.
Function descriptions
Function Description
AGE( ) Returns the number of elapsed days (the age) between a specified date and a specified cutoff
date, or the current operating system date, or the number of elapsed days between any two
dates.
CDOW( ) Returns the name of the day of the week for a specified date or datetime. Abbreviation for
"Character Day of Week".
CMOY( ) Returns the name of the month of the year for a specified date or datetime. Abbreviation for
"Character Month of Year".
CTOD( ) Converts a character or numeric date value to a date. Can also extract the date from a
character or numeric datetime value and return it as a date. Abbreviation for "Character to
Date".
CTODT( ) Converts a character or numeric datetime value to a datetime. Abbreviation for "Character to
Datetime".
CTOT( ) Converts a character or numeric time value to a time. Can also extract the time from a
character or numeric datetime value and return it as a time. Abbreviation for "Character to
Time".
DATE( ) Extracts the date from a specified date or datetime and returns it as a character string. Can also
return the current operating system date.
DATETIME( ) Converts a datetime to a character string. Can also return the current operating system
datetime.
Function Description
DAY( ) Extracts the day of the month from a specified date or datetime and returns it as a numeric
value (1 to 31).
DOW( ) Returns a numeric value (1 to 7) representing the day of the week for a specified date or
datetime. Abbreviation for "Day of Week".
EOMONTH( ) Returns the date of the last day of the month that is the specified number of months before or
after a specified date.
GOMONTH( ) Returns the date that is the specified number of months before or after a specified date.
HOUR( ) Extracts the hour from a specified time or datetime and returns it as a numeric value using the
24-hour clock.
MAXIMUM( ) Returns the maximum value in a set of numeric values, or the most recent value in a set of
datetime values.
MINIMUM( ) Returns the minimum value in a set of numeric values, or the oldest value in a set of datetime
values.
MINUTE( ) Extracts the minutes from a specified time or datetime and returns it as a numeric value.
MONTH( ) Extracts the month from a specified date or datetime and returns it as a numeric value (1 to 12).
NOW( ) Returns the current operating system time as a Datetime data type.
SECOND( ) Extracts the seconds from a specified time or datetime and returns it as a numeric value.
STOD( ) Converts a serial date – that is, a date expressed as an integer – to a date value. Abbreviation
for "Serial to Date".
STODT( ) Converts a serial datetime – that is, a datetime expressed as an integer, and a fractional portion
of 24 hours – to a datetime value. Abbreviation for "Serial to Datetime".
STOT( ) Converts a serial time – that is, a time expressed as a fractional portion of 24 hours, with 24
hours equaling 1 – to a time value. Abbreviation for "Serial to Time".
TIME( ) Extracts the time from a specified time or datetime and returns it as a character string. Can also
return the current operating system time.
TODAY( ) Returns the current operating system date as a Datetime data type.
UTOD( ) Converts a Unicode string containing a formatted date to an Analytics date value. Abbreviation
for "Unicode to Date".
YEAR( ) Extracts the year from a specified date or datetime and returns it as a numeric value using the
YYYY format.
Financial
Financial functions perform a variety of different calculations associated with annuities, loans,
investments, principal, interest, and payments.
Note
Beginning with Analytics 12.0, a change made by Microsoft to its Visual C++
Redistributable Package, an Analytics prerequisite, causes the results of some
Analytics financial functions to differ slightly from the results in previous versions of
Analytics.
The Visual C++ change was made by Microsoft to improve computational precision.
As a result, rounding in Analytics functions such as PMT( ) and FVSCHEDULE( )
now behaves differently.
Function descriptions
Function Description
CUMIPMT( ) Returns the cumulative interest paid on a loan during a range of periods.
CUMPRINC( ) Returns the cumulative principal paid on a loan during a range of periods.
FVANNUITY( ) Returns the future value of a series of payments calculated using a constant interest rate.
Future value is the sum of the payments plus the accumulated compound interest.
FVLUMPSUM( ) Returns the future value of a current lump sum calculated using a constant interest rate.
FVSCHEDULE( ) Returns the future value of a current lump sum calculated using a series of interest rates.
PMT( ) Returns the amount of the periodic payment (principal + interest) required to pay off a loan.
PVANNUITY( ) Returns the present value of a series of future payments calculated using a constant interest
rate. Present value is the current, lump-sum value.
PVLUMPSUM( ) Returns the present value required to generate a specific future lump sum calculated using a
constant interest rate. Present value is the current, lump-sum value.
Function Description
Function descriptions
Function Description
FTYPE( ) Returns a character identifying the data category of a field or variable, or the type of an
Analytics project item.
HASH( ) Returns a salted cryptographic hash value based on the input value.
ISDEFINED( ) Returns T (true) if the specified field or variable is defined, and F (false) otherwise.
OFFSET( ) Returns the value of a field with the starting position offset by a specified number of bytes.
RECOFFSET( ) Returns a field value from a record that is a specified number of records from the current
record.
VERIFY( ) Returns a logical value indicating whether the data in a physical data field is valid.
Function descriptions
Function Description
FILESIZE( ) Returns the size of the specified file in bytes or -1 if the file does not exist.
FTYPE( ) Returns a character identifying the data category of a field or variable, or the type of an
Analytics project item.
GETOPTIONS( ) Returns the current setting for the specified Analytics option (Options dialog box setting).
PROPERTIES( ) Returns properties information for the specified Analytics project item.
Variable testing
The variable testing functions tell you the data type of a variable, and whether a variable exists.
Function descriptions
Function Description
FTYPE( ) Returns a character identifying the data category of a field or variable, or the type of an
Analytics project item.
ISDEFINED( ) Returns T (true) if the specified field or variable is defined, and F (false) otherwise.
Python
ACLScript's Python functions incorporate the result of a calculation performed using the Python
programming language into an Analytics script.
To use ACLScript's Python functions, you must install and configure a compatible version of Python
on the computer where the Analytics script will run. For more information, see "Configuring Python
for use with Analytics" on page 2723.
Function descriptions
Function Description
PYDATE( ) Returns a date value calculated by a function in a external Python script. Data processing in
Python is external to Analytics.
Function Description
PYDATETIME( ) Returns a datetime value calculated by a function in an external Python script. Data processing
in Python is external to Analytics.
PYLOGICAL( ) Returns a logical value calculated by a function in an external Python script. Data processing in
Python is external to Analytics.
PYNUMERIC( ) Returns a numeric value calculated by a function in an external Python script. Data processing
in Python is external to Analytics.
PYSTRING( ) Returns a character value calculated by a function in an external Python script. Data
processing in Python is external to Analytics.
PYTIME( ) Returns a time value calculated by a function in an external Python script. Data processing in
Python is external to Analytics.
R
ACLScript's R functions incorporate the result of a calculation performed using the R programming
language into an Analytics script.
To use ACLScript's R functions, you must install a compatible version of R on the computer where
the Analytics script will run. For more information, see "ACL for Windows system requirements" on
page 2733.
Function descriptions
Function Description
RDATE( ) Returns a date value calculated by an R function or script. Data processing in R is external to
Analytics.
RDATETIME( ) Returns a datetime value calculated by an R function or script. Data processing in R is external
to Analytics.
RLOGICAL( ) Returns a logical value calculated by an R function or script. Data processing in R is external to
Analytics.
RNUMERIC( ) Returns a numeric value calculated by an R function or script. Data processing in R is external
to Analytics.
RSTRING( ) Returns a string value calculated by an R function or script. Data processing in R is external to
Analytics.
RTIME( ) Returns a time value calculated by an R function or script. Data processing in R is external to
Analytics.
Function descriptions
Function Description
BIT( ) Returns the binary representation for the specified byte position in the current record as an
eight character string.
BYTE( ) Returns the character stored in the specified byte position in the current record.
CHR( ) Returns the character associated with the specified ASCII code.
DBYTE( ) Returns the Unicode character located at the specified byte position in a record.
DIGIT( ) Returns the upper or lower digit of a specified Packed data type byte.
HTOU( ) Converts a hexadecimal string to a Unicode string. Abbreviation for "Hexadecimal to Unicode".
MASK( ) Performs a bitwise AND operation on the first bytes of two character strings.
SHIFT( ) Returns a single character string with the bits in the first character of the input value shifted to
the left or right.
ABS( ) function
Returns the absolute value of a numeric expression. The absolute value of a number is the number
without its sign.
Syntax
ABS(number)
Parameters
Name Type Description
Output
Numeric.
Examples
Basic examples
Returns 7.2:
ABS(7.2)
Returns 7.2:
ABS(-7.2)
AGE( ) function
Returns the number of elapsed days (the age) between a specified date and a specified cutoff date,
or the current operating system date, or the number of elapsed days between any two dates.
Syntax
AGE(date/datetime/string <,cutoff_date>)
Parameters
Name Type Description
Note
date/datetime/string and cutoff_date can both accept a datetime value. You cannot
use AGE( ) with time values alone.
For more information, see "Using AGE( ) with datetime data" on page 2185.
Output
Numeric.
Examples
Basic examples
No cutoff date
Returns the number of days between 31 Dec 2014 and the current date:
l If a positive value is returned, it is equal to the number of days in the past December 31, 2014
occurred
l If a negative value is returned, it is equal to the number of days in the future December 31,
2014 occurs
l If 0 is returned, December 31, 2014 is the current date
AGE(`20141231`)
Returns the number of days between each date in the Due_date field and the current date:
AGE(Due_date)
AGE(`20130731`,`20141231`)
AGE("20130731","20141231")
AGE(`20130731`,"20141231")
AGE(`20130731 235959`,`20141231`)
l Dates prior to the cutoff date return a positive value equal to the number of days before the
cutoff day they occur
l Dates after the cutoff date return a negative value equal to the number of days after the cutoff
day they occur
AGE(Due_date, `20141231`)
Returns the number of days between December 31, 2014 and each date in the Due_date field.
Results are the same as the example immediately above, but the sign of the returned values
(positive or negative) is reversed:
AGE(`20141231`, Due_date)
AGE(Payment_date, Due_date)
Returns the number of days between each date in the Payment_date field and a corresponding
date in the Due_date field plus a grace period of 15 days.
l Payment dates prior to due dates, or up to 15 days after due dates, return a positive value
l Payment dates more than 15 days after due dates return a negative value, indicating late
payment outside the grace period
AGE(Payment_date, Due_date+15)
Advanced examples
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
l "Using datetimes in expressions" on page 887
l "Serial datetimes" on page 900
l "How UTC offsets affect datetime expressions" on page 903
l "Date and Time options" on page 136
How it works
The AGE( ) function calculates the number of days between two dates.
AGE(`20141231`, `20130731`)
If you want the elapsed number of days between two dates to always be a positive number,
regardless of which date is more recent, nest the AGE( ) function inside the ABS( ) function.
Returns 518:
ABS(AGE(`20141231`, `20130731`))
AGE(Payment_date, Due_date)
Using the AGE( ) function in this manner is equivalent to calculating the difference between two date
fields by subtracting them in an expression.
For example:
Due_date – Payment_date
Parameter details
A datetime field specified for date/datetime/string or cutoff_date can use any date or datetime
format, as long as the field definition correctly defines the format.
YYYYMMDD `20141231`
"20141231"
YYMMDD `141231`
"141231"
YYMMDDthhmm `141231t2359`
"141231t2359"
YYYYMMDDThh `20141231T23`
"20141231T23"
Note
Do not use hh alone in the main time
format with data that has a UTC offset.
For example, avoid: hh+hhmm. Results
can be unreliable.
ALLTRIM( ) function
Returns a string with leading and trailing spaces removed from the input string.
Syntax
ALLTRIM(string)
Parameters
Name Type Description
string character The field, expression, or literal value to remove leading and trailing
spaces from.
Output
Character.
Examples
Basic examples
Returns "Vancouver":
Advanced examples
The REPLACE( ) function replaces any non-breaking spaces with regular spaces, and then
ALLTRIM( ) removes any leading or trailing regular spaces.
Remarks
How it works
The ALLTRIM( ) function removes the leading and trailing spaces from a string. Spaces inside the
string are not removed.
Related functions
Use the LTRIM( ) function if you want to remove only leading spaces from a string, or the TRIM( )
function if you want to remove only trailing spaces.
ASCII( ) function
Returns the ASCII code for a specified character.
Syntax
ASCII(character)
Parameters
Name Type Description
Output
Numeric.
Examples
Basic examples
Returns 65:
ASCII("A")
Returns 49:
ASCII("1")
Advanced examples
Remarks
Testing for non-printable characters
You can use ASCII( ) to test for non-printable characters such as:
l Nul – ASCII "0"
l Tab – ASCII "9"
l Line Feed (LF) – ASCII "10"
l Carriage Return (CR) – ASCII "13"
Related functions
ASCII( ) is the inverse of the CHR( ) function.
AT( ) function
Returns a number specifying the starting location of a particular occurrence of a substring within a
character value.
Syntax
AT(occurrence_num, search_for_string, within_text)
Parameters
Name Type Description
search_for_string character The substring to search for in within_text. This value is case-sensitive.
If search_for_string includes double quotation marks, you need to
enclose the value in single quotation marks:
AT(1,'"test"', Description)
AT(1,'"test"', Description+Summary)
Output
Numeric. Returns the starting byte position of the specified occurrence of the search_for_string
value, or 0 if no matches are found.
Examples
Basic examples
Occurrences found
Returns 4:
Returns 8:
Groups of characters
Returns 5:
Searching a field
Returns the byte position of the first hyphen in each value in the Invoice_Number field:
Advanced examples
Remarks
When to use AT( )
Use this function to retrieve the following starting positions within a character value:
l the starting position of a substring
l the starting position of a subsequent occurrence of the substring
If you only want to confirm multiple occurrences of the same substring in a field, the OCCURS( )
function is a better alternative. For more information, see "OCCURS( ) function" on page 2408.
BETWEEN( ) function
Returns a logical value indicating whether the specified value falls within a range.
Syntax
BETWEEN(value, min, max)
Parameters
Name Type Description
Note
The range evaluating to T (true) includes the min and max values.
For information regarding character ranges, see "SET EXACT behavior" on
page 2196.
Output
Logical. Returns T (true) if value is greater than or equal to the min value, and less than or equal to
the max value. Returns F (false) otherwise.
Examples
Basic examples
Numeric input
Returns T:
BETWEEN(500,400,700)
Returns F:
BETWEEN(100,400,700)
Character input
Returns T:
BETWEEN("B","A","C")
Returns F, because the character comparison is case-sensitive, and lowercase "b" does not fall
between uppercase "A" and "C":
BETWEEN("b","A","C")
Datetime input
Returns T:
BETWEEN(`141230`,`141229`,`141231`)
Returns T for all values in the Login_time field from 07:00:00 AM to 09:00:00 AM, inclusive, and F
otherwise:
BETWEEN(Login_time,`t070000`,`t090000`)
Returns T for all values in the Last_Name field that begin with the letters from "C" to "J", inclusive,
and F otherwise (SET EXACT must be ON). Also returns T for the single letter "K":
Field input
Returns T for all values in the Invoice_Date field from 30 Sep 2014 to 30 Oct 2014, inclusive, and F
otherwise:
Returns T for all records in which the invoice date does not fall between the PO date and the paid
date, inclusive, and F otherwise:
Returns T for all values in the Invoice_Amount field from $1000 to $5000, inclusive, and F
otherwise:
Advanced examples
OPEN Employee_List
SET FILTER TO BETWEEN(Salary, 40000.00, 50000.00)
OPEN Joined_expense_data
SET FILTER TO BETWEEN(T_E_date, Arrival_date-2, Arrival_date+2) OR
BETWEEN(T_E_date, Departure_date-2, Departure_date+2)
Remarks
Supported data types
Inputs to the BETWEEN( ) function can be numeric, character, or datetime data. You cannot mix
data types. All three inputs must belong to the same data category.
is equivalent to
Returns F, because 1.23 is less than 1.234 once the third decimal place is considered:
Character data
Case sensitivity
The BETWEEN( ) function is case-sensitive when used with character data. When it compares
characters, "a" is not equivalent to "A".
Returns F:
BETWEEN("B","a","C")
If you are working with data that includes inconsistent case, you can use the UPPER( ) function to
convert the values to consistent case before using BETWEEN( ).
Returns T:
Partial matching
Partial matching is supported for character comparisons.
value can be contained by min.
Returns T, even though value "AB" appears to be less than min "ABC":
Note
The shorter value in the character comparison must appear at the start of the longer
value to constitute a match.
Datetime parameters
A date, datetime, or time field specified as a function input can use any date, datetime, or time
format, as long as the field definition correctly defines the format.
BETWEEN(`20141231`,`20141229`,`20141231`)
Returns F, even though 12:00 PM on 31 December 2014 appears to fall within the range specified
by min and max:
BETWEEN(`20141231 120000`,`20141229`,`20141231`)
If we look at the serial number equivalent of these two expressions, we can see why the second one
evaluates to false.
Returns T, because the serial number value is equal to the serial number max:
Returns F, because the serial number value is greater than the serial number max:
The serial number 42003.500000 is greater than 42003.000000 and therefore is out of range, even
though the two dates are identical. 0.500000 is the serial number equivalent of 12:00 PM.
For example, this expression, which uses the same initial values as the second example above,
returns T rather than F:
BETWEEN(CTOD(DATE(`20141231
120000`,"YYYYMMDD"),"YYYYMMDD"),`20141229`,`20141231`)
YYYYMMDD `20141231`
YYMMDD `141231`
YYMMDDthhmm `141231t2359`
YYYYMMDDThh `20141231T23`
thhmmss `t235959`
Thhmm `T2359`
Note
Do not use hh alone in the main time
format with data that has a UTC offset.
For example, avoid: hh+hhmm. Results
can be unreliable.
BINTOSTR( ) function
Returns Unicode character data converted from ZONED or EBCDIC character data. Abbreviation
for "Binary to String".
Note
This function is specific to the Unicode edition of Analytics. It is not a supported
function in the non-Unicode edition.
Syntax
BINTOSTR(string, string_type)
Parameters
Name Type Description
string character The ZONED or EBCDIC value that you want to convert to Unicode
character encoding.
string_type character The format to convert from. You must specify one of the following
values:
o "A" – convert from ZONED (ASCII) data
o "E" – convert from EBCDIC data
Output
Character.
Examples
Basic examples
The expression ZONED(-6448,4) converts the value -6448 to the character format "644Q", however
the Unicode edition of Analytics requires that you convert the output of ZONED( ) to Unicode
characters using BINTOSTR( ).
BINTOSTR(ZONED(-6448,4), "A")
Remarks
When to use BINTOSTR( )
Use this function to convert return values from the ZONED( ) and EBCDIC( ) functions to a Unicode
value.
Note
If this function is not applied to the return values of ZONED( ) and EBCDIC( ) in
Unicode editions of Analytics, then they are displayed incorrectly because the
encoding is not interpreted correctly.
BIT( ) function
Returns the binary representation for the specified byte position in the current record as an eight
character string.
Syntax
BIT(byte_location)
Parameters
Name Type Description
Output
Character.
Examples
Basic examples
Returns "00110001" if the eighth byte contains "1":
BIT(8)
BIT(9)
BIT(17)
Advanced examples
In this example, the SUBSTRING( ) function is used to extract the value of the third bit.
Remarks
How it works
BIT( ) converts the byte at the specified byte position into an eight character string of ones and
zeros.
Related functions
If you want to retrieve the character at the specified byte location, use the BYTE( ) function.
BLANKS( ) function
Returns a string containing a specified number of blank spaces.
Syntax
BLANKS(count)
Parameters
Name Type Description
Output
Character.
Examples
Basic examples
Returns " ":
BLANKS(5)
Remarks
When to use BLANKS( )
Use the BLANKS( ) function to harmonize fields, to initialize variables in scripts, or to insert blank
spaces when formatting fields or concatenating strings.
BYTE( ) function
Returns the character stored in the specified byte position in the current record.
Syntax
BYTE(byte_location)
Parameters
Name Type Description
Output
Character.
Examples
Basic examples
Returns "1" from a record that begins with an ID field containing "1":
byte(112)
Advanced examples
Remarks
When to use BYTE( )
Use BYTE( ) to examine the contents of a position in a record, without having to define a field for the
purpose.
Related functions
If you want to retrieve the binary representation for specified byte location, use the BIT( ) function.
CDOW( ) function
Returns the name of the day of the week for a specified date or datetime. Abbreviation for
"Character Day of Week".
Syntax
CDOW(date/datetime, length)
Parameters
Name Type Description
date/datetime datetime The field, expression, or literal value to return the day name for.
length numeric A value between 1 and 9 that specifies the length of the output string.
To display abbreviated day names, specify a smaller value.
Output
Character.
Examples
Basic examples
Returns "Wednesday" because December 31, 2014 falls on a Wednesday, and length is 9:
CDOW(`20141231`, 9)
Returns "Wed" because December 31, 2014 falls on a Wednesday, and length is 3:
CDOW(`20141231 235959`, 3)
Returns the full day name for each value in the Invoice_date field:
CDOW(Invoice_date, 9)
Returns the abbreviated day name for each value in the Receipt_timestamp field:
CDOW(Receipt_timestamp, 3)
Advanced examples
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
Parameter details
A field specified for date/datetime can use any date or datetime format, as long as the field definition
correctly defines the format.
If the length parameter is shorter than the day name, the day name is truncated to the specified
length. If the length parameter is longer than the day name, the day name is padded with blank
spaces.
YYYYMMDD `20141231`
YYMMDD `141231`
YYMMDDthhmm `141231t2359`
YYYYMMDDThh `20141231T23`
Note
Do not use hh alone in the main time
format with data that has a UTC offset.
For example, avoid: hh+hhmm. Results
can be unreliable.
Related functions
If you need to return the day of the week as a number (1 to 7), use DOW( ) instead of CDOW( ).
CHR( ) function
Returns the character associated with the specified ASCII code.
Syntax
CHR(number)
Parameters
Name Type Description
Output
Character.
Examples
Basic examples
Returns "A":
CHR(65)
Returns "1":
CHR(49)
Advanced examples
Remarks
When to use CHR( )
Use the CHR( ) function to return the character associated with any ASCII code, including those
characters that cannot be entered directly from a keyboard or displayed on screen. With CHR( ), you
can search fields or records for the existence of these specific characters.
Referencing NUL
Referencing the ASCII NUL (null) character, CHR(0), may produce unpredictable results because it
is used by Analytics as a text qualifier, and should be avoided if possible.
Related functions
CHR( ) is the inverse of the ASCII( ) function.
CLEAN( ) function
Replaces the first invalid character in a string, and all subsequent characters, with blanks.
Syntax
CLEAN(string <,extra_invalid_characters>)
Parameters
Name Type Description
string character The value from which to remove default and any extra invalid
characters.
extra_invalid_ character Invalid characters you want to remove from string in addition to the
characters default invalid characters. You may specify more than one extra
invalid character:
optional
" ,;\"
Tab characters, null characters, and carriage return and line feed
characters are default invalid characters that are automatically
removed and do not need to be specified.
To specify the double quotation mark as an extra invalid character,
enclose extra_invalid_characters in single quotation marks:
'"'
Output
Character.
Examples
Basic examples
Returns "ABC " ("ABC" followed by four blank spaces):
CLEAN("ABC%DEF","%")
CLEAN("1234.56,111,2", ",")
Remarks
When to use CLEAN( )
Use this function to ensure that fields containing invalid data are printed correctly. You can also use
this function to isolate parts of a field, such as the last name in a customer field that includes both the
first and last name of the customer.
Automatic CLEAN( )
In an Analytics script, you can apply the CLEAN( ) function automatically to all character fields by
adding SET CLEAN ON to the script. You cannot specify extra individual characters using this option.
CMOY( ) function
Returns the name of the month of the year for a specified date or datetime. Abbreviation for
"Character Month of Year".
Syntax
CMOY(date/datetime, length)
Parameters
Name Type Description
date/datetime datetime The field, expression, or literal value to return the month name for.
length numeric A value between 1 and 9 that specifies the length of the output string.
To display abbreviated month names, specify a smaller value.
Output
Character.
Examples
Basic examples
Returns "December":
CMOY(`20141231`, 9)
Returns "Dec":
CMOY(`20141231 235959`, 3)
Returns the abbreviated month name for each value in the Receipt_timestamp field:
CMOY(Receipt_timestamp, 3)
Returns the full month name for each value in the Invoice_date field:
CMOY(Invoice_date, 9)
Returns the full name of the month 15 days after each value in the Invoice_date field:
CMOY(Invoice_date + 15, 9)
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
l "Using datetimes in expressions" on page 887
l "Serial datetimes" on page 900
l "How UTC offsets affect datetime expressions" on page 903
l "Date and Time options" on page 136
Parameter details
A field specified for date/datetime can use any date or datetime format, as long as the field definition
correctly defines the format.
If the length parameter is shorter than the month name, the month name is truncated to the specified
length. If the length parameter is longer than the month name, the month name is padded with blank
spaces.
between the two. Valid separators are a single blank space, the letter 't', or the letter 'T'.
l Time values – you must specify times using the 24-hour clock. Offsets from Coordinated
Universal Time (UTC) must be prefaced by a plus sign (+) or a minus sign (-).
YYYYMMDD `20141231`
YYMMDD `141231`
YYMMDDthhmm `141231t2359`
YYYYMMDDThh `20141231T23`
Note
Do not use hh alone in the main time
format with data that has a UTC offset.
For example, avoid: hh+hhmm. Results
can be unreliable.
Related functions
If you need to return the month of the year as a number (1 to 12), use MONTH( ) instead of CMOY( ).
COS( ) function
Returns the cosine of an angle expressed in radians, with a precision of 15 decimal places.
Syntax
COS(radians)
Parameters
Name Type Description
Output
Numeric.
Examples
Basic examples
Returns 0.500000000000000 (the specified number of radians):
COS(1.047197551196598)
Advanced examples
Remarks
Performing the Mantissa Arc Test
The three trigonometric functions in Analytics – SIN( ), COS( ), and TAN( ) – support performing the
Mantissa Arc Test associated with Benford's Law.
CTOD( ) function
Converts a character or numeric date value to a date. Can also extract the date from a character or
numeric datetime value and return it as a date. Abbreviation for "Character to Date".
Syntax
CTOD(string/number <,format>)
Parameters
Name Type Description
string/number character The field, expression, or literal value to convert to a date, or from
which to extract the date.
numeric
format character The date format of string/number. The format is required for values
that use any date format other than YYYYMMDD or YYMMDD, for
optional
example "DD/MM/YYYY".
Note
If you use the CTOD function with a datetime value that
requires the format parameter, specify only the date
portion of the format, and not the time portion. For
example:
CTOD("31/12/2014 23:59:59",
"DD/MM/YYYY")
Output
Datetime. The date value is output using the current Analytics date display format.
Examples
Basic examples
Character literal input
Returns `20141231` displayed as 31 Dec 2014 assuming a current Analytics date display format of
DD MMM YYYY:
CTOD("20141231")
CTOD("31/12/2014", "DD/MM/YYYY")
CTOD("20141231 235959")
CTOD(20141231)
CTOD(31122014, "DDMMYYYY")
CTOD(20141231.235959)
CTOD(Invoice_date, "DD/MM/YYYY")
CTOD(Receipt_timestamp)
CTOD(Due_date, "DDMMYYYY")
CTOD(Payment_timestamp)
Advanced examples
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
l "Using datetimes in expressions" on page 887
l "Serial datetimes" on page 900
l "How UTC offsets affect datetime expressions" on page 903
l "Date and Time options" on page 136
Dates, or the date portion of datetime values, can use any date format supported by Analytics, and
valid for the data type, as long as formats other than YYYYMMDD or YYMMDD are correctly defined
by format.
Character fields
+/-hhmm
+/-hh:mm
(UTC offset)
+/-hh
(UTC offset)
Note
Do not use hh alone in the main
time format with data that has a
UTC offset. For example, avoid:
hh+hhmm. Results can be
unreliable.
Numeric fields
YYMMDD hhmm
CTODT( ) Converts a character or numeric datetime value to a datetime. Abbreviation for "Character to
Datetime".
CTOT( ) Converts a character or numeric time value to a time. Can also extract the time from a
character or numeric datetime value and return it as a time. Abbreviation for "Character to
Time".
DATE( ) Extracts the date from a specified date or datetime and returns it as a character string. Can also
return the current operating system date.
DATETIME( ) Converts a datetime to a character string. Can also return the current operating system
datetime.
TIME( ) Extracts the time from a specified time or datetime and returns it as a character string. Can also
return the current operating system time.
STOD( ) Converts a serial date – that is, a date expressed as an integer – to a date value. Abbreviation
for "Serial to Date".
STODT( ) Converts a serial datetime – that is, a datetime expressed as an integer, and a fractional portion
of 24 hours – to a datetime value. Abbreviation for "Serial to Datetime".
STOT( ) Converts a serial time – that is, a time expressed as a fractional portion of 24 hours, with 24
hours equaling 1 – to a time value. Abbreviation for "Serial to Time".
CTODT( ) function
Converts a character or numeric datetime value to a datetime. Abbreviation for "Character to
Datetime".
Syntax
CTODT(string/number <,format>)
Parameters
Name Type Description
format character The date format of string/number. The format is required for values
that use any date format other than YYYYMMDD or YYMMDD for the
optional
date portion of the value, for example "DD/MM/YYYY".
Output
Datetime. The datetime value is output using the current Analytics date and time display formats.
Examples
Basic examples
Character literal input
Returns `20141231t235959` displayed as 31 Dec 2014 23:59:59 assuming a current Analytics date
and time display formats of DD MMM YYYY and hh:mm:ss:
CTODT("20141231 235959")
CTODT(20141231.235959)
CTODT(31122014.235959, "DDMMYYYY.hhmmss")
Advanced examples
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
l "Using datetimes in expressions" on page 887
l "Serial datetimes" on page 900
l "How UTC offsets affect datetime expressions" on page 903
l "Date and Time options" on page 136
Character fields
+/-hhmm
+/-hh:mm
(UTC offset)
+/-hh
(UTC offset)
Note
Do not use hh alone in the main
time format with data that has a
UTC offset. For example, avoid:
hh+hhmm. Results can be
unreliable.
Numeric fields
YYMMDD hhmm
CTOD( ) Converts a character or numeric date value to a date. Can also extract the date from a
character or numeric datetime value and return it as a date. Abbreviation for "Character to
Date".
CTOT( ) Converts a character or numeric time value to a time. Can also extract the time from a
character or numeric datetime value and return it as a time. Abbreviation for "Character to
Time".
DATE( ) Extracts the date from a specified date or datetime and returns it as a character string. Can also
return the current operating system date.
DATETIME( ) Converts a datetime to a character string. Can also return the current operating system
datetime.
Function Description
TIME( ) Extracts the time from a specified time or datetime and returns it as a character string. Can also
return the current operating system time.
STOD( ) Converts a serial date – that is, a date expressed as an integer – to a date value. Abbreviation
for "Serial to Date".
STODT( ) Converts a serial datetime – that is, a datetime expressed as an integer, and a fractional portion
of 24 hours – to a datetime value. Abbreviation for "Serial to Datetime".
STOT( ) Converts a serial time – that is, a time expressed as a fractional portion of 24 hours, with 24
hours equaling 1 – to a time value. Abbreviation for "Serial to Time".
CTOT( ) function
Converts a character or numeric time value to a time. Can also extract the time from a character or
numeric datetime value and return it as a time. Abbreviation for "Character to Time".
Syntax
CTOT(string/number)
Parameters
Name Type Description
string/number character The field, expression, or literal value to convert to a time, or from
which to extract the time.
numeric
Output
Datetime. The time value is output using the current Analytics time display format.
Examples
Basic examples
Character literal input
Returns `t235959` displayed as 23:59:59 assuming a current Analytics time display format of
hh:mm:ss:
CTOT("t235959")
CTOT("23:59:59")
CTOT("20141231 235959")
CTOT(.235959)
CTOT(0.235959)
CTOT(20141231.235959)
CTOT(Login_time)
CTOT(Payment_datetime)
Advanced examples
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
l "Using datetimes in expressions" on page 887
l "Serial datetimes" on page 900
l "How UTC offsets affect datetime expressions" on page 903
l "Date and Time options" on page 136
Character fields
+/-hhmm
+/-hh:mm
(UTC offset)
+/-hh
(UTC offset)
Note
Do not use hh alone in
the main time format
with data that has a
UTC offset. For
example, avoid:
hh+hhmm. Results can
be unreliable.)
Numeric fields
YYMMDD hhmm
hh
CTOD( ) Converts a character or numeric date value to a date. Can also extract the date from a
character or numeric datetime value and return it as a date. Abbreviation for "Character to
Date".
CTODT( ) Converts a character or numeric datetime value to a datetime. Abbreviation for "Character to
Datetime".
DATE( ) Extracts the date from a specified date or datetime and returns it as a character string. Can also
return the current operating system date.
Function Description
DATETIME( ) Converts a datetime to a character string. Can also return the current operating system
datetime.
TIME( ) Extracts the time from a specified time or datetime and returns it as a character string. Can also
return the current operating system time.
STOD( ) Converts a serial date – that is, a date expressed as an integer – to a date value. Abbreviation
for "Serial to Date".
STODT( ) Converts a serial datetime – that is, a datetime expressed as an integer, and a fractional portion
of 24 hours – to a datetime value. Abbreviation for "Serial to Datetime".
STOT( ) Converts a serial time – that is, a time expressed as a fractional portion of 24 hours, with 24
hours equaling 1 – to a time value. Abbreviation for "Serial to Time".
CUMIPMT( ) function
Returns the cumulative interest paid on a loan during a range of periods.
Syntax
CUMIPMT(rate, periods, amount, start_period, end_period <,type>)
Parameters
Name Type Description
Note
You must use consistent time periods when specifying rate and periods to ensure
that you are specifying interest rate per period.
For example:
l for monthly payments on a two-year loan or investment with interest of 5% per
annum, specify 0.05/12 for rate and 2 * 12 for periods
l for annual payments on the same loan or investment, specify 0.05 for rate and
2 for periods
Output
Numeric.
Examples
Basic examples
Returns 17437.23, the total amount of interest paid in the second year of a twenty-five year,
$275,000 loan at 6.5% per annum, with payments due at the end of the month:
Returns 17741.31, the total amount of interest paid on the same loan in the first year of the loan:
Remarks
Related functions
The CUMPRINC( ) function is the complement of the CUMIPMT( ) function.
The IPMT( ) function calculates interest paid for a single period.
CUMPRINC( ) function
Returns the cumulative principal paid on a loan during a range of periods.
Syntax
CUMPRINC(rate, periods, amount, start_period, end_period <,type>)
Parameters
Name Type Description
Note
You must use consistent time periods when specifying rate and periods to ensure
that you are specifying interest rate per period.
For example:
l for monthly payments on a two-year loan or investment with interest of 5% per
annum, specify 0.05/12 for rate and 2 * 12 for periods
l for annual payments on the same loan or investment, specify 0.05 for rate and
2 for periods
Output
Numeric.
Examples
Basic examples
Returns 4844.61, the total amount of principal paid in the second year of a twenty-five year,
$275,000 loan at 6.5% per annum, with payments due at the end of the month:
Returns 367.24, the amount of principal paid on the same loan in the first month of the loan:
Remarks
Related functions
The CUMIPMT( ) function is the complement of the CUMPRINC( ) function.
The PPMT( ) function calculates principal paid for a single period.
DATE( ) function
Extracts the date from a specified date or datetime and returns it as a character string. Can also
return the current operating system date.
Syntax
DATE(<date/datetime> <,format>)
Parameters
Name Type Description
date/datetime datetime The field, expression, or literal value to extract the date from. If
omitted, the current operating system date is returned.
optional
format character The format to apply to the output string, for example "DD/MM/YYYY". If
omitted, the current Analytics date display format is used. You cannot
optional
specify a format if you have omitted date/datetime.
Output
Character.
Examples
Basic examples
Returns "20141231" in the current Analytics date display format:
DATE(`20141231 235959`)
Returns "31-Dec-2014":
Returns the current operating system date as a character string, using the current Analytics date
display format:
DATE()
Returns each value in the Receipt_timestamp field as a character string using the current Analytics
date display format:
DATE(Receipt_timestamp)
Returns each value in the Receipt_timestamp field as a character string using the specified date
display format:
DATE(Receipt_timestamp, "DD/MM/YYYY")
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
l "Using datetimes in expressions" on page 887
l "Serial datetimes" on page 900
l "How UTC offsets affect datetime expressions" on page 903
l "Date and Time options" on page 136
Parameter details
A field specified for date/datetime can use any date or datetime format, as long as the field definition
correctly defines the format.
If you use format to control how the output string is displayed, you can use any supported Analytics
date display format. For example:
l DD/MM/YYYY
l MM-DD-YY
l DD MMM YYYY
format must be specified using single or double quotation marks – for example, "DD MMM YYYY".
YYYYMMDD `20141231`
YYMMDD `141231`
YYMMDDthhmm `141231t2359`
YYYYMMDDThh `20141231T23`
Note
Do not use hh alone in the main time
format with data that has a UTC offset.
For example, avoid: hh+hhmm. Results
can be unreliable.
Related functions
If you need to return the current operating system date as a datetime value, use TODAY( ) instead of
DATE( ).
DATETIME( ) Converts a datetime to a character string. Can also return the current operating system
datetime.
TIME( ) Extracts the time from a specified time or datetime and returns it as a character string. Can also
return the current operating system time.
CTOD( ) Converts a character or numeric date value to a date. Can also extract the date from a
character or numeric datetime value and return it as a date. Abbreviation for "Character to
Date".
CTODT( ) Converts a character or numeric datetime value to a datetime. Abbreviation for "Character to
Datetime".
CTOT( ) Converts a character or numeric time value to a time. Can also extract the time from a
character or numeric datetime value and return it as a time. Abbreviation for "Character to
Time".
STOD( ) Converts a serial date – that is, a date expressed as an integer – to a date value. Abbreviation
for "Serial to Date".
STODT( ) Converts a serial datetime – that is, a datetime expressed as an integer, and a fractional portion
of 24 hours – to a datetime value. Abbreviation for "Serial to Datetime".
Function Description
STOT( ) Converts a serial time – that is, a time expressed as a fractional portion of 24 hours, with 24
hours equaling 1 – to a time value. Abbreviation for "Serial to Time".
DATETIME( ) function
Converts a datetime to a character string. Can also return the current operating system datetime.
Syntax
DATETIME(<datetime> <,format>)
Parameters
Name Type Description
datetime datetime The field, expression, or literal value to convert. If omitted, the current
operating system date is returned.
optional
format character The format to apply to the output string, for example "DD/MM/YYYY". If
omitted, the current Analytics date display format is used. You cannot
optional
specify a format if you have omitted date/datetime.
Output
Character.
Examples
Basic examples
Literal datetime input
Returns "20141231 235959" in the current Analytics date and time display formats:
DATETIME(`20141231 235959`)
Returns the current operating system date and time as a character string, using the current Analytics
date and time display formats:
DATETIME()
Field input
Returns each value in the Receipt_timestamp field as a character string using the current Analytics
date and time display formats:
DATETIME(Receipt_timestamp)
Returns each value in the Receipt_timestamp field as a character string using the specified date
and time display formats:
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
l "Using datetimes in expressions" on page 887
l "Serial datetimes" on page 900
l "How UTC offsets affect datetime expressions" on page 903
l "Date and Time options" on page 136
Parameter details
A field specified for datetime can use any datetime format, as long as the field definition correctly
defines the format.
If you use format to control how the output string is displayed, you are restricted to the formats in the
table below.
l You can use any combination of date, time, and AM/PM formats.
l The date must precede the time. Placing a separator between the two is not required as
Analytics automatically uses a single space as a separator in the output string.
l The AM/PM format is optional, and is placed last.
l format must be specified using single or double quotation marks.
For example: "DD-MMM-YYYY hh:mm:ss AM"
all supported Analytics date display formats hh:mm:ss none "DD/MM/YYYY hh:mm:ss"
24-hour clock
hhmm
hh
YYMMDDthhmm `141231t2359`
YYYYMMDDThh `20141231T23`
Note
Do not use hh alone in the main time
format with data that has a UTC offset.
For example, avoid: hh+hhmm. Results
can be unreliable.
DATE( ) Extracts the date from a specified date or datetime and returns it as a character string. Can also
return the current operating system date.
TIME( ) Extracts the time from a specified time or datetime and returns it as a character string. Can also
return the current operating system time.
CTOD( ) Converts a character or numeric date value to a date. Can also extract the date from a
character or numeric datetime value and return it as a date. Abbreviation for "Character to
Date".
CTODT( ) Converts a character or numeric datetime value to a datetime. Abbreviation for "Character to
Datetime".
CTOT( ) Converts a character or numeric time value to a time. Can also extract the time from a
character or numeric datetime value and return it as a time. Abbreviation for "Character to
Time".
STOD( ) Converts a serial date – that is, a date expressed as an integer – to a date value. Abbreviation
for "Serial to Date".
STODT( ) Converts a serial datetime – that is, a datetime expressed as an integer, and a fractional portion
of 24 hours – to a datetime value. Abbreviation for "Serial to Datetime".
STOT( ) Converts a serial time – that is, a time expressed as a fractional portion of 24 hours, with 24
hours equaling 1 – to a time value. Abbreviation for "Serial to Time".
DAY( ) function
Extracts the day of the month from a specified date or datetime and returns it as a numeric value (1
to 31).
Syntax
DAY(date/datetime)
Parameters
Name Type Description
date/datetime datetime The field, expression, or literal value to extract the day from.
Output
Numeric.
Examples
Basic examples
Returns 31:
DAY(`20141231`)
DAY(`20141231 235959`)
Returns the day of the month for each value in the Invoice_date field:
DAY(Invoice_date)
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
l "Using datetimes in expressions" on page 887
l "Serial datetimes" on page 900
l "How UTC offsets affect datetime expressions" on page 903
l "Date and Time options" on page 136
Parameter details
A field specified for date/datetime can use any date or datetime format, as long as the field definition
correctly defines the format.
YYYYMMDD `20141231`
YYMMDD `141231`
YYMMDDthhmm `141231t2359`
YYYYMMDDThh `20141231T23`
(UTC offset)
Note
Do not use hh alone in the main time
format with data that has a UTC offset.
For example, avoid: hh+hhmm. Results
can be unreliable.
Related functions
If you need to return:
l the day of the week as a number (1 to 7), use DOW( ) instead of DAY( )
l the name of the day of the week, use CDOW( ) instead of DAY( )
DBYTE( ) function
Returns the Unicode character located at the specified byte position in a record.
Note
This function is specific to the Unicode edition of Analytics. It is not a supported
function in the non-Unicode edition.
Syntax
DBYTE(byte_location)
Parameters
Name Type Description
Output
Character.
Examples
Basic examples
The examples illustrate the behavior of the function when applied to the following Unicode value,
which contains 11 characters (22 bytes) 美 丽 10072DOE:
Returns "丽":
DBYTE(3)
Returns "D":
DBYTE(17)
Returns "E":
DBYTE(21)
Remarks
When to use DBYTE( )
Use DBYTE( ) to examine the contents of a position in a record, without having to define a field for
this purpose.
DEC( ) function
Returns a value, or the result of a numeric expression, with the specified number of decimal places.
Syntax
DEC(number, decimals)
Parameters
Name Type Description
number numeric The value or result to adjust the number of decimal places for.
o integers – decimal places are added to the end of number as
trailing zeros.
o fractional numbers – If the number of decimal places is reduced,
number is rounded, not truncated. If the number of decimal places
is increased, trailing zeros are added to the end of number.
decimals numeric The number of decimal places to use in the return value.
Note
You cannot use DEC( ) to increase the decimal
precision of results.
For information about how to increase decimal
precision, see "Controlling rounding and decimal
precision in numeric expressions" on page 876.
Output
Numeric.
Examples
Basic examples
Returns 7.00:
DEC(7, 2)
Returns 7.565:
DEC(7.5647, 3)
Returns 7.56470:
DEC(7.5647, 5)
Advanced examples
DEC(Annual_rate, 6) / 365
Remarks
When to use DEC( )
Use this function to adjust the number of decimal places in a field, or when you want to round a value
or a result to a specified number of decimal places.
Example
Fixed-point rounding means that the result of 1.1 * 1.1 is 1.2, not 1.21, which is the
unrounded result. Using DEC( ) to specify a two-decimal-place result does not create two-
decimal-place precision. Instead, it adds a trailing zero to create the specified number of
decimal places, without increasing precision.
For information about how to increase decimal precision, see "Controlling rounding and
decimal precision in numeric expressions" on page 876.
Related functions
If you want to round a value to the nearest whole number, use the "ROUND( ) function" on
page 2506.
DHEX( ) function
Converts a Unicode string to a hexadecimal string.
Note
This function is specific to the Unicode edition of Analytics. It is not a supported
function in the non-Unicode edition.
Syntax
DHEX(field)
Parameters
Name Type Description
Output
Character.
Examples
Basic examples
Returns "004100420043003100320033":
DHEX("ABC123")
Remarks
How it works
DHEX( ) displays each double-byte character using big-endian format, with the most significant
double-byte stored first.
Each character is represented by a four-character code. The output string is four times as long as
the field value, and includes the digits between 0 and 9 and letters between A and F that make up
the hexadecimal values.
Related functions
DHEX( ) is the inverse of the HTOU( ) function, which converts a hexadecimal string to a Unicode
string.
DICECOEFFICIENT( ) function
Returns the Dice's coefficient of two specified strings, which is a measurement of how similar the
two strings are.
Syntax
DICECOEFFICIENT(string1, string2 <,ngram>)
Parameters
Name Type Description
Output
Numeric. The value is the Dice's coefficient of the two strings, which represents the percentage of
the total number of n-grams in the two strings that are identical. The range is 0.0000 to 1.0000,
inclusive.
Examples
Basic examples
How the n-gram length affects the result
The three examples below compare the same two strings. The degree of similarity returned varies
depending on the specified n-gram length.
Returns 0.9167 (using the default n-gram length (2), the n-grams in the two strings are 92%
identical):
Returns 1.0000 (using an n-gram length of 1, the n-grams in the two strings are 100% identical):
Returns 0.8261 (using an n-gram length of 3, the n-grams in the two strings are 83% identical):
Field input
Returns the Dice's coefficient of each value in the Address field when compared to the string "125
SW 39TH ST, Suite 100" (based on the default n-gram length of 2):
Advanced examples
Returns 0.7368 (using the default n-gram length (2), the n-grams in the two strings are 74%
identical):
Returns 1.0000 (by excluding the comma between last name and first name, and by using an
n-gram length of 1, the n-grams in the two strings are 100% identical):
Add the computed field Dice_Co to the view, and then quick sort it in descending order, to
rank all values in the Address field based on their similarity to "125 SW 39TH ST, Suite 100".
Changing the number in the expression allows you to adjust the degree of similarity in the
filtered values.
Remarks
When to use DICECOEFFICIENT( )
Use the DICECOEFFICIENT( ) function to find nearly identical values (fuzzy duplicates). You can
also use DICECOEFFICIENT( ) to find values with identical or near-identical content, but
transposed elements. For example:
l telephone numbers, or social security numbers, with transposed digits
l versions of the same address, formatted differently
How it works
DICECOEFFICIENT( ) returns the Dice's coefficient of the two evaluated strings, which is a
measurement of the degree of similarity between the strings, on a scale from 0.0000 to 1.0000. The
greater the returned value the more similar the two strings:
l 1.0000 – means that each string is composed of an identical set of characters, although the
characters may be in a different order, and may use different case.
l 0.7500 – means the n-grams in the two strings are 75% identical.
l 0.0000 – means the two strings have no shared n-grams (explained below), or the specified
length of the n-gram used in the calculation is longer than the shorter of the two strings being
compared.
Usage tips
l Filtering or sorting – Filtering or sorting the values in a field based on their Dice's coefficient
identifies those values that are most similar to the comparison string.
l Case-sensitivity – The function is not case-sensitive, so "SMITH" is equivalent to "smith."
l Leading and trailing blanks – The function automatically trims leading and trailing blanks in
fields, so there is no need to use the TRIM( ) or ALLTRIM( ) functions when specifying a field
as a parameter.
n-gram
length "John Smith" n-grams "Smith, John D." n-grams
2 Jo | oh | hn | n_ | _S | Sm | mi | it | th Sm | mi | it | th | h, | ,_ | _J | Jo | oh | hn | n_ | _D | D.
3 Joh | ohn | hn_ | n_S | _Sm | Smi | mit | Smi | mit | ith | th, | h,_ | ,_J | _Jo | Joh | ohn | hn_ | n_D | _
ith D.
Tip
If you are specifically looking for transposition, use an n-gram length of 1.
2 Jo | oh | hn | n_ | _S | Sm | Sm | mi | it | th | h, | ,_ | _J | Jo | oh | hn | 8 2x8 / (9+13) =
mi | it | th n_ | _D | D. 0.7273
(default)
(9 n-grams) (13 n-grams)
3 Joh | ohn | hn_ | n_S | _Sm Smi | mit | ith | th, | h,_ | ,_J | _Jo | Joh | 6 2x6 / (8+12) =
| Smi | mit | ith ohn | hn_ | n_D | _D. 0.6000
(8 n-grams) (12 n-grams)
4 John | ohn_ | hn_S | n_Sm Smit | mith | ith, | th,_ | h,_J | ,_Jo | _Joh 4 2x4 / (7+11) =
| _Smi | Smit | mith | John | ohn_ | hn_D | n_D. 0.4444
(7 n-grams) (11 n-grams)
Dice's coefficient
Address pair (default n-gram of 2) Levenshtein distance
Dice's coefficient
Corporation name pair (default n-gram of 2) Levenshtein distance
DIGIT( ) function
Returns the upper or lower digit of a specified Packed data type byte.
Syntax
DIGIT(byte_location, position)
Parameters
Name Type Description
Output
Numeric.
Examples
Basic examples
A packed field with the value 123.45 (00 12 34 5C), containing two decimals, and starting in byte
position 10, appears in the data record in the following format:
UPPER(1) 0 1 3 5
LOWER(2) 0 2 4 C
Returns 3 (finds the digit that appears in the 12th position in the upper half of the byte):
DIGIT(12, 1)
Returns 4 (finds digit that appears in the 12th position in the lower half of the byte):
DIGIT(12, 2)
Remarks
How it works
DIGIT( ) separates individual halves of a byte, and returns the value of the byte specified in the
position parameter as a digit between 0 and 15.
DOW( ) function
Returns a numeric value (1 to 7) representing the day of the week for a specified date or datetime.
Abbreviation for "Day of Week".
Syntax
DOW(date/datetime)
Parameters
Name Type Description
date/datetime datetime The field, expression, or literal value to extract the numeric day of the
week from.
Output
Numeric.
Examples
Basic examples
Returns 4, because December 31, 2014 falls on a Wednesday, the 4th day of the week:
DOW(`20141231`)
DOW(`20141231 235959`)
Returns the numeric day of the week for each value in the Invoice_date field:
DOW(Invoice_date)
Advanced examples
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
l "Using datetimes in expressions" on page 887
l "Serial datetimes" on page 900
l "How UTC offsets affect datetime expressions" on page 903
l "Date and Time options" on page 136
Parameter details
A field specified for date/datetime can use any date or datetime format, as long as the field definition
correctly defines the format.
YYYYMMDD `20141231`
YYMMDD `141231`
YYMMDDthhmm `141231t2359`
YYYYMMDDThh `20141231T23`
Note
Do not use hh alone in the main time
format with data that has a UTC offset.
For example, avoid: hh+hhmm. Results
can be unreliable.
Related functions
If you need to return:
l the name of the day of the week, use CDOW( ) instead of DOW( )
l the day of the month as a number (1 to 31), use DAY( ) instead of DOW( )
DTOU( ) function
Converts an Analytics date value to a Unicode string in the specified language and locale format.
Abbreviation for "Date to Unicode".
Note
This function is specific to the Unicode edition of Analytics. It is not a supported
function in the non-Unicode edition.
Syntax
DTOU(<date> <,locale> <,style>)
Parameters
Name Type Description
date datetime The field, expression, or literal value to convert to a Unicode string. If
omitted, the current operating system date is used.
optional
The date can contain a datetime value, but the time portion of the
value is ignored. Standalone time values are not supported.
You can specify a field or a literal date value:
o Field – can use any date format, as long as the field definition
correctly defines the format
o Literal – must use one of the YYYYMMDD or YYMMDD formats, for
example `20141231`
The minimum supported date value is 31 December 1969.
locale character The locale code that specifies the language of the output string, and
optionally the version of the language associated with a particular
optional
country or region.
For example, "zh" specifies Chinese, and "pt_BR" specifies Brazilian
Portuguese.
If omitted, the default locale for your computer is used. If a language is
specified, but no country is specified, the default country for the
language is used.
You cannot specify locale if you have not specified date.
For information about locale codes, see www.unicode.org.
style numeric The date format style to use for the Unicode string. The format style
Output
Character.
Examples
Basic examples
Literal input values
Returns "31 de dezembro de 2014":
DTOU(`20141231`, "pt_BR", 1)
DTOU(`20141231`, "pl", 1)
DTOU(Invoice_date, "zh", 1)
DTOU(`20141231`, "zh", 0)
DTOU(`20141231`, "zh_CN", 0)
DTOU(`20141231`, "zh", 1)
DTOU(`20141231`, "zh_CN", 1)
Remarks
Related functions
DTOU( ) is the inverse of the UTOD( ) function, which converts a Unicode string to a date.
EBCDIC( ) function
Returns a string that has been converted to EBCDIC character encoding.
Syntax
EBCDIC(string)
Parameters
Name Type Description
Output
Character.
Examples
Basic examples
Returns "ñòó@Æ '…@â£K":
Advanced examples
To create a field containing the EBCDIC encoded value of a Name field for export to an
application that requires EBCDIC encoding, specify the following:
Remarks
When to use EBCDIC( )
Use this function to convert data to the Extended Binary Coded Decimal Interchange Code
(EBCDIC) character encoding. EBCDIC character encoding is used primarily on IBM mainframe
operating systems, such as z/OS.
EFFECTIVE( ) function
Returns the effective annual interest rate on a loan.
Syntax
EFFECTIVE(nominal_rate, periods)
Parameters
Name Type Description
Note
Specify an integer. If you specified a decimal portion, it
is truncated.
Output
Numeric. The rate is calculated to eight decimals places.
Examples
Basic examples
Returns 0.19561817 (19.56%), the effective annual rate of interest on the unpaid balance of a credit
card that charges 18% per annum, compounded monthly:
EFFECTIVE(0.18, 12)
Remarks
What is the effective annual interest rate?
The effective annual interest rate on a loan is the actual annual rate of interest paid, taking into
account interest on the remaining balance, compounded monthly or daily.
Related functions
The NOMINAL( ) function is the inverse of the EFFECTIVE( ) function.
EOMONTH( ) function
Returns the date of the last day of the month that is the specified number of months before or after a
specified date.
Syntax
EOMONTH(<date/datetime> <,months>)
Parameters
Name Type Description
date/datetime datetime The field, expression, or literal value from which to calculate the end-
of-month date. If omitted, the end-of-month date is calculated from the
optional
current operating system date.
Note
You can specify a datetime value for date/datetime but
the time portion of the value is ignored.
months numeric The number of months before or after date/datetime. If omitted, the
default of 0 (zero) is used.
optional
You cannot specify months if you have omitted date/datetime.
Output
Datetime. The date value is output using the current Analytics date display format.
Examples
Basic examples
No input
Returns the last day of the month for the current operating system date:
EOMONTH()
EOMONTH(`20140115`)
Returns `20140430` displayed as 30 Apr 2014 assuming a current Analytics date display format of
DD MMM YYYY:
EOMONTH(`20140115`, 3)
Returns `20131031` displayed as 31 Oct 2013 assuming a current Analytics date display format of
DD MMM YYYY:
EOMONTH(`20140115`, -3)
EOMONTH(Invoice_date, 3)
Returns the last day of the month that falls three months after each date in the Invoice_date field
plus a grace period of 15 days:
EOMONTH(Invoice_date + 15, 3)
Returns the first day of the month in which the invoice date falls:
EOMONTH(Invoice_date, -1) + 1
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
l "Using datetimes in expressions" on page 887
l "Serial datetimes" on page 900
l "How UTC offsets affect datetime expressions" on page 903
l "Date and Time options" on page 136
Datetime formats
A field specified for date/datetime can use any date or datetime format, as long as the field definition
correctly defines the format.
A literal date value must use one of the following formats:
l YYYYMMDD
l YYMMDD
You must enclose literal date values in backquotes. For example: `20141231`
EOMONTH(`20140115`) + 1
Related functions
Use the GOMONTH( ) function if you want to return the exact date, rather than the date of the last
day of the month, that is the specified number of months before or after a specified date.
EXCLUDE( ) function
Returns a string that excludes the specified characters.
Syntax
EXCLUDE(string, characters_to_exclude)
Parameters
Name Type Description
string character The field, expression, or literal value from which to exclude characters.
Output
Character.
Examples
Basic examples
Returns " Alberni Street", which is the input string with all numbers excluded:
Returns all the values in the Product_Number field with the forward slash and number sign
excluded:
EXCLUDE(Product_Number, "/#")
Remarks
How it works
The EXCLUDE( ) function compares each character in string with the characters listed in
characters_to_exclude. If a match occurs, the character is excluded from the output string.
For example, the output for EXCLUDE("123-45-4536", "-") is "123454536".
No matching characters
If there are no matches between string and characters_to_exclude, then string and the output of the
function are the same.
For example, the output for EXCLUDE("ABC", "D") is "ABC".
Case sensitivity
The EXCLUDE( ) function is case-sensitive. If you specify "ID" in characters_to_exclude, these
characters are not excluded from "id#94022". If there is a chance the case may be mixed, use the
UPPER( ) function to convert string to uppercase.
For example:
EXCLUDE(UPPER("id#94022"), "ID#")
Usage tip
Use EXCLUDE( ) if the set of characters you want to exclude is small, and the set you want to
include is large.
Related functions
The EXCLUDE( ) function is the opposite of the INCLUDE( ) function.
EXP( ) function
Returns the exponential value (base 10) of a numeric expression with a specified number of decimal
places.
Syntax
EXP(number, decimals)
Parameters
Name Type Description
number numeric The numeric field, expression, or value to return the exponential value
of.
Output
Numeric.
Examples
Basic examples
Returns 1000.00:
EXP(3, 2)
Returns 72443.596007:
EXP(4.86, 6)
Advanced examples
Tip
You can determine the nth root by dividing the log of the value by n and taking
the exponential of the result.
Remarks
How it works
This function returns the exponential value (base 10) of a numeric expression, which is defined as
10 raised to the nth power. For example, the exponential value of 3 is 103, or 1000.
Related functions
The inverse of an exponent is its logarithm, so EXP( ) is the opposite of the LOG( ) function.
FILESIZE( ) function
Returns the size of the specified file in bytes or -1 if the file does not exist.
Syntax
FILESIZE(filename)
Parameters
Name Type Description
Note
You need to specify the physical data file name (.fil) for
Analytics tables, not the table name.
Output
Numeric.
Examples
Basic examples
Returns 14744:
FILESIZE("Inventory.fil")
If the file you are checking is not in the same folder as the Analytics project, you must specify either
the relative path or absolute path to the file.
Returns 6018:
Advanced examples
CALCULATE FILESIZE("Metaphor_Inventory_2002.fil")
FIND( ) function
Returns a logical value indicating whether the specified string is present in a particular field, or
anywhere in an entire record.
Note
The FIND( ) function and the "FIND command" on page 1827 are two separate
Analytics features with significant differences.
Syntax
FIND(string <,field_to_search_in>)
Parameters
Name Type Description
string character The character string to search for. This search is not case-sensitive.
field_to_search_in character The field, or variable, to search in. If omitted, the entire record is
searched, including any undefined portion of the record.
optional
Output
Logical. Returns T (true) if the specified string value is found, and F (false) otherwise.
Examples
Basic examples
Searching an entire record
Returns T for all records that contain the string "New York" in any field, across any field boundaries,
and in any undefined portion of the record. Returns F otherwise:
FIND("New York")
Returns T for all records that contain the string "Ne" in the City field. Returns F otherwise:
FIND("Ne", City)
Returns T for all records that contain the string "New York" preceded by one or more spaces in the
City field. Returns F otherwise:
Returns T for all records that have a value in the Description field that matches, or contains, the
value in the v_search_term variable. Returns F otherwise:
FIND(v_search_term, Description)
Returns T for all records that contain the string "New York" in either the City or the City_2 fields.
Returns F otherwise:
FIND(ALLTRIM(Last_Name), Last_Name_2)
Remarks
When to use FIND( )
Use the FIND( ) function to test for the presence of the specified string in a field, two or more fields,
or an entire record.
Note
When you search an entire record, the physical record is searched. Any computed
fields or related fields are not searched.
The concatenated fields are treated like a single field that includes leading and trailing spaces from
the individual fields, unless you use the ALLTRIM( ) function to remove spaces.
You can also build an expression that searches each field individually:
If string includes a leading space, search results from the two approaches can differ.
Note
Using the FIND( ) function to search datetime or numeric data is not recommended
because it can be difficult to do successfully.
FINDMULTI( ) function
Returns a logical value indicating whether any string in a set of one or more specified strings is
present in a particular field, or anywhere in an entire record.
Syntax
FINDMULTI({search_in|RECORD}, string_1 <,...n>)
Parameters
Name Type Description
Field_1+Field_2+Field_3
string_1 <,...n> character One or more character strings to search for. Separate multiple search
strings with commas:
Output
Logical. Returns T (true) if any of the specified string values are found, and F (false) otherwise.
Examples
Basic examples
Searching an entire record
Returns T for all records that contain "New York" or "Chicago" in any field, across any field
boundaries, and in any undefined portion of the record. Returns F otherwise:
Returns T for all records that contain the string "Ne" or "Chi" in the City field. Returns F otherwise:
Returns T for all records that contain "New York" or "Chicago" preceded by one or more spaces in
the City field. Returns F otherwise:
Returns T for all records that have a value in the Description field that matches, or contains, any of
the values in the v_search_term variables . Returns F otherwise:
Returns T for all records that contain the string "New York" or "Chicago" in either the City or the
City_2 fields. Returns F otherwise:
Remarks
When to use FINDMULTI( )
Use the FINDMULTI( ) function to test for the presence of any of the specified strings in a field, two
or more fields, or an entire record.
Note
When you search an entire record, the physical record is searched. Any computed
fields or related fields are not searched.
The concatenated fields are treated like a single field that includes leading and trailing spaces from
the individual fields, unless you use the ALLTRIM( ) function to remove spaces.
You can also build an expression that searches each field individually:
If a string value includes a leading space, search results from the two approaches can differ.
Note
Using the FINDMULTI( ) function to search datetime or numeric data is not
recommended because it can be difficult to do successfully.
FREQUENCY( ) function
Returns the expected Benford frequency for sequential leading positive numeric digits to a precision
of eight decimal places.
Syntax
FREQUENCY(digit_string)
Parameters
Name Type Description
digit_string character A character string containing digits (0-9) to identify the frequency for.
digit_string must be a positive number, and leading zeros are ignored.
Output
Numeric.
Examples
Basic examples
Returns 0.00998422:
FREQUENCY("43")
Returns 0.00000000:
FREQUENCY("87654321")
Note
The result is 0.00000000495, but because Analytics computes to a precision of eight
decimal places, a zero value is returned.
Remarks
How it works
FREQUENCY( ) returns the expected Benford frequency for sequential leading positive numeric
digits to a precision of eight digits. It lets you perform limited Benford tests for specific situations.
FTYPE( ) function
Returns a character identifying the data category of a field or variable, or the type of an Analytics
project item.
Syntax
FTYPE(field_name_string)
Parameters
Name Type Description
field_name_string character A field name, variable name, or Analytics project item name.
Enclose field_name_string in quotation marks:
FTYPE("Amount")
Output
Character. This function returns one of the following characters, which indicates the field, variable,
or Analytics project item type:
l "C" – Character field
l "N" – Numeric field
l "D" – Datetime field
l "L" – Logical field
l "c" – Character variable
l "n" – Numeric variable
l "d" – Datetime variable
l "l" – Logical variable
l "b" – Analytics script
l "y" – Analytics table layout
l "w" – Analytics workspace
l "i" – Analytics index
l "r" – Analytics report
l "a" – Analytics log file
l "U" – Undefined
Examples
Basic examples
The following example assigns a value of 4 to the num variable and then checks the type.
Returns "n":
ASSIGN num = 4
FTYPE("num")
Advanced examples
OPEN Invoices
DO Script_1 IF FTYPE("Amount") = "N"
FVANNUITY( ) function
Returns the future value of a series of payments calculated using a constant interest rate. Future
value is the sum of the payments plus the accumulated compound interest.
Syntax
FVANNUITY(rate, periods, payment <,type>)
Parameters
Name Type Description
Note
You must use consistent time periods when specifying rate, periods, and payment to
ensure that you are specifying interest rate per period.
For example:
l for a monthly payment on a two-year loan or investment with interest of 5%
per annum, specify 0.05/12 for rate and 2 * 12 for periods
l for an annual payment on the same loan or investment, specify 0.05 for rate
and 2 for periods
Output
Numeric. The result is calculated to two decimal places.
Examples
Basic examples
Monthly payments
Returns 27243.20, the future value of $1,000 paid at the beginning of each month for 2 years at 1%
per month, compounded monthly:
Returns 12809.33, the future value of the same annuity after the first year:
Annual payments
Returns 25440.00, the future value of $12,000 paid at the end of each year for 2 years at 12% per
annum, compounded annually:
FVANNUITY(0.12, 2, 12000, 0)
Advanced examples
Annuity calculations
Annuity calculations involve four variables:
l present value, or future value – $21,243.39 and $ 26,973.46 in the examples below
l payment amount per period – $1,000.00 in the examples below
l interest rate per period – 1% per month in the examples below
l number of periods – 24 months in the examples below
If you know the value of three of the variables, you can use an Analytics function to calculate
the fourth.
PVANNUITY( )
Returns 21243.39:
FVANNUITY( )
Returns 26973.46:
PMT( )
Returns 1000:
RATE( )
Returns 0.00999999 (1%):
NPER( )
Returns 24.00:
Annuity formulas
The formula for calculating the present value of an ordinary annuity (payment at the end of a
period):
The formula for calculating the future value of an ordinary annuity (payment at the end of a
period):
Remarks
Related functions
The PVANNUITY( ) function is the inverse of the FVANNUITY( ) function.
FVLUMPSUM( ) function
Returns the future value of a current lump sum calculated using a constant interest rate.
Syntax
FVLUMPSUM(rate, periods, amount)
Parameters
Name Type Description
amount numeric The investment made at the start of the first period.
Note
You must use consistent time periods when specifying rate and periods to ensure
that you are specifying interest rate per period.
For example:
l for monthly payments on a two-year loan or investment with interest of 5% per
annum, specify 0.05/12 for rate and 2 * 12 for periods
l for annual payments on the same loan or investment, specify 0.05 for rate and
2 for periods
Output
Numeric. The result is calculated to two decimal places.
Examples
Basic examples
Interest compounded monthly
Returns 1269.73, the future value of a lump sum of $1,000 invested for 2 years at 1% per month,
compounded monthly:
Returns 1126.83, the future value of the same investment after the first year:
Returns 27243.20, the future value of $21,455.82 invested for 2 years at 1% per month,
compounded monthly:
FVLUMPSUM(0.12, 2, 1000)
Remarks
What is future value?
The future value of an invested lump sum is the initial investment principal plus the accumulated
compound interest.
Related functions
The PVLUMPSUM( ) function is the inverse of the FVLUMPSUM( ) function.
FVSCHEDULE( ) function
Returns the future value of a current lump sum calculated using a series of interest rates.
Syntax
FVSCHEDULE(principal, rate1 <,rate2...>)
Parameters
Name Type Description
Note
The periods can represent months or years, or some
other time period, as long as the type of time period is
consistent.
You must specify the interest rates per period. So, if one
of the interest rates is 5% per annum and the periods
are months, specify 0.05/12.
Output
Numeric. The result is calculated to two decimal places.
Examples
Basic examples
Returns 1282.93, the future value of a lump sum of $1000 invested for 3 years at 10% for the first
year, 9% for the second year, and 7% for the third year, compounded annually:
Remarks
The future value of an invested lump sum is the initial investment principal plus the accumulated
compound interest.
GETOPTIONS( ) function
Returns the current setting for the specified Analytics option (Options dialog box setting).
Syntax
GETOPTIONS(option)
Parameters
Name Type Description
Note
Currently, "separators" is the only option that can be
specified for the GETOPTIONS( ) function.
Output
Character.
Examples
Basic examples
Returns the current settings for the three Analytics separator characters. For example, ".,,":
GETOPTIONS("separators")
Advanced examples
Remarks
The three Analytics separator characters are specified in the following options in the Options dialog
box:
l Decimal Place Symbol
l Thousands Separator
l List Separator
GOMONTH( ) function
Returns the date that is the specified number of months before or after a specified date.
Syntax
GOMONTH(date/datetime, months)
Parameters
Name Type Description
date/datetime datetime The field, expression, or literal value from which to calculate the output
date.
Note
You can specify a datetime value for date/datetime but
the time portion of the value is ignored.
Output
Datetime. The date value is output using the current Analytics date display format.
Examples
Basic examples
Literal input values
Returns `20140415` displayed as 15 Apr 2014 assuming a current Analytics date display format of
DD MMM YYYY:
GOMONTH(`20140115`, 3)
Returns `20131015` displayed as 15 Oct 2013 assuming a current Analytics date display format of
DD MMM YYYY:
GOMONTH(`20140115`, -3)
Returns `20140430` displayed as 30 Apr 2014 assuming a current Analytics date display format of
DD MMM YYYY (date rounding prevents returning 31 Apr 2014, which is an invalid date):
GOMONTH(`20140330`, 1)
GOMONTH(`20140331`, 1)
Returns `20140501` displayed as 01 May 2014 assuming a current Analytics date display format of
DD MMM YYYY:
GOMONTH(`20140401`, 1)
GOMONTH(Invoice_date, 3)
Returns the date three months after each date in the Invoice_date field plus a grace period of 15
days:
GOMONTH(Invoice_date + 15, 3)
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
l "Using datetimes in expressions" on page 887
l "Serial datetimes" on page 900
l "How UTC offsets affect datetime expressions" on page 903
l "Date and Time options" on page 136
Datetime formats
A field specified for date/datetime can use any date or datetime format, as long as the field definition
correctly defines the format.
A literal date value must use one of the following formats:
l YYYYMMDD
l YYMMDD
You must enclose literal date values in backquotes. For example: `20141231`
GOMONTH(`20140331`,1)
Related functions
Use the EOMONTH( ) function if you want to return the date of the last day of the month, rather than
the exact date, that is the specified number of months before or after a specified date.
HASH( ) function
Returns a salted cryptographic hash value based on the input value.
Syntax
HASH(field <,salt_value>)
Parameters
Name Type Description
salt_value character The salt value to use. You can specify a PASSWORD identifier number
from 1 to 10, or a character string.
optional numeric
If omitted, the Analytics default salt value is used.
The salt value is limited to 128 characters, and is automatically
truncated to 128 characters if you specify a longer salt value.
For more information, see "The salt value" on page 2322.
Output
Character.
Examples
Basic examples
With the Analytics default salt value
Returns "819A974BB91215D58E7753FD5A42226150100A0763087CA7DECD93F3C3090405":
HASH("555-44-3322")
Returns the hash value for each number in the Credit_card_num field:
HASH(Credit_card_num)
Advanced examples
HASH("John Smith")
Returns
"3E12EABB5940B7A2AD90A6B0710237B935FAB68E629907927A65B3AA7BE6781D":
HASH("JOHN SMITH")
By using the UPPER( ) function to standardize case, an identical hash value results.
Returns
"3E12EABB5940B7A2AD90A6B0710237B935FAB68E629907927A65B3AA7BE6781D":
HASH(UPPER("John Smith"))
If the comment fields are in separate tables, create a computed HASH( ) field in each table
and then use the computed fields as a common key field to do an unmatched join of the two
tables. The records in the joined output table represent text blocks that are not identical.
Remarks
When to use HASH( )
Use the HASH( ) function to protect sensitive data, such as credit card numbers, salary information,
or social security numbers.
How it works
HASH( ) provides one-way encoding. Data in clear text can be used to produce a hash value,
however the hash value cannot subsequently be unencoded or decrypted.
A specific clear text value always produces the same hash value, so you can search a field of
hashed credit card numbers for duplicates, or join two fields of hashed credit card numbers, and the
results are the same as if you had performed the operation on the equivalent clear text fields.
once you have the results, refer back to the original table if you need to see the clear text version of
any of the hashed data.
If storing sensitive data locally, beyond initial use, is prohibited, you can delete the original table
after you have created the new table with the hashed values, and refer to the original source system
for the clear text values.
Note
The PASSWORD salt value must be entered before the field in the HASH
( ) function can be extracted.
The benefit of using a PASSWORD identifier number with HASH( ) is that you do not have to
expose a clear text salt value.
For more information, see "PASSWORD command" on page 2036.
HEX( ) function
Converts an ASCII string to a hexadecimal string.
Syntax
HEX(field)
Parameters
Name Type Description
Output
Character.
Examples
Basic examples
Returns "3132333435":
HEX("12345")
HEX(Count)
Remarks
How it works
This function returns the hexadecimal string that is equivalent to the field value or expression you
specify. You can use the function when you need to identify the exact contents of a field, including
characters that cannot be displayed on screen, such as CR (carriage return), LF (line feed), and
NUL (null).
HOUR( ) function
Extracts the hour from a specified time or datetime and returns it as a numeric value using the 24-
hour clock.
Syntax
HOUR(time/datetime)
Parameters
Name Type Description
time/datetime datetime The field, expression, or literal value to extract the hour from.
Output
Numeric.
Examples
Basic examples
Returns 23:
HOUR(`t235959`)
HOUR(`20141231 235959`)
HOUR(Call_start_time)
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
l "Using datetimes in expressions" on page 887
l "Serial datetimes" on page 900
l "How UTC offsets affect datetime expressions" on page 903
l "Date and Time options" on page 136
Parameter details
A field specified for time/datetime can use any time or datetime format, as long as the field definition
correctly defines the format.
Specifying a literal time or datetime value
When specifying a literal time or datetime value for time/datetime, you are restricted to the formats in
the table below, and you must enclose the value in backquotes – for example, `20141231 235959`.
Do not use any separators such as slashes (/) or colons (:) between the individual components of
dates or times.
l Time values – you can use any of the time formats listed in the table below. You must use a
separator before a standalone time value for the function to operate correctly. Valid
separators are the letter 't', or the letter 'T'. You must specify times using the 24-hour clock.
Offsets from Coordinated Universal Time (UTC) must be prefaced by a plus sign (+) or a
minus sign (-).
l Datetime values – you can use any combination of the date, separator, and time formats
listed in the table below. The date must precede the time, and you must use a separator
between the two. Valid separators are a single blank space, the letter 't', or the letter 'T'.
thhmmss `t235959`
Thhmm `T2359`
YYMMDDthhmm `141231t2359`
YYYYMMDDThh `20141231T23`
Note
Do not use hh alone in the main time
format with data that has a UTC offset.
For example, avoid: hh+hhmm. Results
can be unreliable.
HTOU( ) function
Converts a hexadecimal string to a Unicode string. Abbreviation for "Hexadecimal to Unicode".
Note
This function is specific to the Unicode edition of Analytics. It is not a supported
function in the non-Unicode edition.
Syntax
HTOU(hex_string)
Parameters
Name Type Description
hex_string character The hexadecimal string to convert to a Unicode string. The string can
only contain hexadecimal values, for example "20AC".
Output
Character.
Examples
Basic examples
Returns "ABC123":
HTOU("004100420043003100320033")
Advanced examples
When the EXTRACT command runs, HTOU( ) returns the Euro symbol "€" and concatenates
it with the Amount value that STRING( ) converts to a character. If the original value of
Amount was 2000, then the value in Currency_Amount is "€2000".
Remarks
Related functions
HTOU( ) is the inverse of the DHEX( ) function, which converts a Unicode string to a hexadecimal
string.
INCLUDE( ) function
Returns a string that includes only the specified characters.
Syntax
INCLUDE(string, characters_to_include)
Parameters
Name Type Description
string character The field, expression, or literal value to restrict to included characters.
Note
If a character you specify to include does not appear in
string, it is not included in the return value.
Output
Character.
Examples
Basic examples
Returns "123", which is the input string with only numbers included:
Returns "1231234", which is the input string with only numbers included:
INCLUDE("123-123-4", "1243")
Returns "" (nothing), because the input string does not contain "D":
INCLUDE("ABC", "D")
Remarks
How it works
The INCLUDE( ) function compares each character in string with the characters listed in characters_
to_include. If a match occurs, the character is included in the output string.
No matching characters
If there are no matches between string and characters_to_include the output of the function is blank.
Case sensitivity
The INCLUDE( ) function is case-sensitive. If you specify "ID" in characters_to_include, these
characters are not included in "id#94022". If there is a chance the case may be mixed, use the
UPPER( ) function to convert string to uppercase.
For example:
INCLUDE(UPPER("id#94022"), "ID0123456789")
Usage tip
Use INCLUDE( ) if the set of characters you want to include is small, and the set you want to exclude
is large.
Related functions
The INCLUDE( ) function is the opposite of the EXCLUDE( ) function.
INSERT( ) function
Returns the original string with specified text inserted at a specific byte location.
Syntax
INSERT(string, insert_text, location)
Parameters
Name Type Description
string character The field, expression, or literal value to insert the text into.
location numeric The character position at which to insert insert_text into the string.
Output
Character.
Examples
Basic examples
Returns "aXXXbcde":
INSERT("abcde", "XXX", 2)
Returns "XXXabcde":
INSERT("abcde", "XXX", 0)
Returns "abcdeXXX", with "XXX" inserted at byte position 6 instead of 8, because "abcde" is only 5
bytes long::
INSERT("abcde", "XXX", 8)
Remarks
How it works
The INSERT( ) function inserts specified characters or spaces into a character string, beginning at a
specified position in the string.
Location guidelines
l If the location value is greater than the length of string, the insert_text value is inserted at the
end of the string.
l If location is 0 or 1, insert_text is inserted at the beginning of the string.
INT( ) function
Returns the integer value of a numeric expression or field value.
Syntax
INT(number)
Parameters
Name Type Description
number numeric The field or numeric expression to convert to an integer. If the value
specified includes decimals, the decimals are truncated without
rounding.
Output
Numeric.
Examples
Basic examples
Returns 7:
INT(7.9)
Returns -7:
INT(-7.9)
IPMT( ) function
Returns the interest paid on a loan for a single period.
Syntax
IPMT(rate, specified_period, periods, amount <,type>)
Parameters
Name Type Description
specified_period numeric The period for which you want to find the interest payment.
Note
You must use consistent time periods when specifying rate and periods to ensure
that you are specifying interest rate per period.
For example:
l for monthly payments on a two-year loan or investment with interest of 5% per
annum, specify 0.05/12 for rate and 2 * 12 for periods
l for annual payments on the same loan or investment, specify 0.05 for rate and
2 for periods
Output
Numeric.
Examples
Basic examples
Returns 1489.58, the interest paid in the first month of a twenty-five year, $275,000 loan at 6.5% per
annum, with payments due at the end of the month:
Returns 10.00, the interest paid on the same loan in the last month of the loan:
Remarks
Related functions
The PPMT( ) function is the complement of the IPMT( ) function.
The CUMIPMT( ) function calculates interest paid during a range of periods.
ISBLANK( ) function
Returns a logical value indicating whether the input value is blank.
Syntax
ISBLANK(string)
Parameters
Name Type Description
Output
Logical. Returns T (true) if the string parameter value is blank, and F (false) otherwise.
Examples
Basic examples
Returns F:
ISBLANK(" A")
Returns T:
ISBLANK(" ")
ISBLANK("")
Returns T for all values in the Address field that are blank, and F otherwise:
ISBLANK(Address)
Remarks
When to use ISBLANK( )
Use ISBLANK( ) during the data integrity phase of an analysis project to identify fields with missing
data, which may indicate issues with the source data.
Null characters
ISBLANK( ) may not return useful results when used with character fields that contain null
characters. Analytics uses the null character to indicate the end of a string, and for this reason the
ISBLANK( ) function will not read any character data that follows a null character, including blanks.
ISDEFINED( ) function
Returns T (true) if the specified field or variable is defined, and F (false) otherwise.
Syntax
ISDEFINED(string)
Parameters
Name Type Description
string character The name of the field or variable to check for the existence of. The
value must be entered as a quoted string:
ISDEFINED("v_numeric_limit")
Output
Logical.
Examples
Basic examples
Returns T if v_numeric_limit is defined as a variable or field, otherwise returns F:
ISDEFINED("v_numeric_limit")
Advanced examples
OPEN Metaphor_Employees_US
IF ISDEFINED("Limit") EXTRACT RECORD IF Limit > 50000 TO "HighLim-
it.fil"
ISFUZZYDUP( ) function
Returns a logical value indicating whether a string is a fuzzy duplicate of a comparison string.
Syntax
ISFUZZYDUP(string1, string2, levdist <,diffpct>)
Parameters
Name Type Description
levdist numeric The maximum allowable Levenshtein distance between the two
strings for them to be identified as fuzzy duplicates.
The levdist value cannot be less than 1 or greater than 10.
Increasing the levdist value increases the number of results by
including values with a greater degree of fuzziness – that is, values
that are more different from each other.
Output
Logical. Returns T (true) if string values are fuzzy duplicates, and F (false) otherwise.
Examples
Basic examples
Returns F, because two edits are required to transform "Smith" into "Smythe", but the levdist value is
only 1:
ISFUZZYDUP("Smith","Smythe", 1, 99)
Returns T, because two edits are required to transform "Smith" into "Smythe", and the levdist value
is 2:
ISFUZZYDUP("Smith","Smythe", 2, 99)
Returns T, because zero edits are required to transform "SMITH" into "smith", and the levdist value
is 1 (the ISFUZZYDUP( ) function is not case-sensitive):
ISFUZZYDUP("SMITH","smith", 1, 99)
Returns a logical value (T or F) indicating whether individual values in the Last_Name field are fuzzy
duplicates for the string "Smith":
ISFUZZYDUP(Last_Name,"Smith", 3, 99)
Advanced examples
ISFUZZYDUP("abc", "Smith", 5)
diffpct specified
Returns F, even though "abc" is within the specified Levenshtein distance of "Smith",
because 5 edits/a string length of 3 results in a difference percentage of 167%, which
exceeds the specified diffpct of 99%:
Changing the levdist or diffpct values allows you to adjust the amount of difference in the
filtered values.
Improve the effectiveness of the filter by using additional functions with the ISFUZZYDUP( )
function.
Using ISFUZZYDUP( ) with OMIT( ) returns:
l Pacific Lighting and Electrical Supply, Inc.
l Pacific Lighting and Electrical Supply
l Pacific Lighting & Electrical Supply, Inc.
Remarks
When to use ISFUZZYDUP( )
Use the ISFUZZYDUP( ) function to find nearly identical values (fuzzy duplicates) or locate
inconsistent spelling in manually entered data.
How it works
The ISFUZZYDUP( ) function calculates the Levenshtein distance between two strings, and
calculates the difference percentage.
ISFUZZYDUP( ) evaluates to T (true) if:
l The Levenshtein distance is less than or equal to the levdist value.
l The difference percentage is less than or equal to the diffpct value (if specified).
Levenshtein distance
The Levenshtein distance is a value representing the minimum number of single character edits
required to make one string identical to the other string.
For more information, see "LEVDIST( ) function" on page 2358.
Difference percentage
The difference percentage is the percentage of the shorter of the two evaluated strings that is
different.
The difference percentage is the result of the following internal Analytics calculation, which uses the
Levenshtein distance between the two strings:
Levenshtein distance / number of characters in the shorter string × 100 = difference percentage
Using the optional difference percentage helps reduce the number of false positives returned by
ISFUZZYDUP( ):
l The upper threshold for diffpct is 99%, which prevents the entire replacement of a string in
order to make it identical.
l Strings that require a large number of edits in relation to their length are excluded.
Usage tips
l Case-sensitivity – The function is not case-sensitive, so "SMITH" is equivalent to "smith."
l Trailing blanks – The function automatically trims trailing blanks in fields, so there is no need
to use the TRIM( ) function when specifying a field as a parameter.
l Sorting elements – The SORTWORDS( ) function can improve the effectiveness of the
ISFUZZYDUP( ) function by sorting individual elements in field values into a sequential order.
Sorting elements, such as the components of an address, can make two strings with the same
information, but a different format, more closely resemble each other. A closer resemblance
improves the chances that a pair of strings are selected as fuzzy duplicates of each other.
l Removing generic elements – The OMIT( ) and EXCLUDE( ) functions can improve the
effectiveness of the ISFUZZYDUP( ) function by removing generic elements such as
"Corporation" or "Inc.", or characters such as commas, periods, and ampersands (&), from
field values.
Removal of generic elements and punctuation focuses the ISFUZZYDUP( ) string comparison
on just the portion of the strings where a meaningful difference may occur.
The ISFUZZYDUP( ) function generates a single, exhaustive list of fuzzy duplicates for a specific
character value.
The command and the function both identify exact duplicates. Unlike the command, you cannot
exclude exact duplicates when using the function.
Related functions
l LEVDIST( ) – provides an alternate method for comparing strings based on Levenshtein
distance.
Unlike ISFUZZYDUP( ), LEVDIST( ) is case-sensitive by default.
l DICECOEFFICIENT( ) – de-emphasizes or completely ignores the relative position of
characters or character blocks when comparing strings.
l SOUNDSLIKE( ) and SOUNDEX( ) – compare strings based on a phonetic comparison
(sound) rather than on an orthographic comparison (spelling).
LAST( ) function
Returns a specified number of characters from the end of a string.
Syntax
LAST(string, length)
Parameters
Name Type Description
string character The field, expression, or literal value to return the characters from.
Output
Character.
Examples
Basic examples
Returns "Savings":
Returns "efghi":
LAST("abcdefghi", 5)
LAST("abcdefghi ", 5)
Returns " abc", because the string value is shorter than the specified length of 6, so leading spaces
are added to the output:
LAST("abc", 6)
Remarks
Blank results caused by trailing spaces
Trailing spaces in string can cause the results produced by the LAST( ) function to be blank.
For example, the output for LAST("6483-30384 ", 3) is " ".
You can use the ALLTRIM( ) function in conjunction with LAST( ) to remove any trailing spaces in
string.
For example, LAST(ALLTRIM("6483-30384 "), 3) returns "384".
LEADING( ) function
Returns a string containing a specified number of leading digits.
Syntax
LEADING(number, leading_digits)
Parameters
Name Type Description
Output
Character.
Examples
Basic examples
Literal numeric input
Returns 623:
LEADING(6234.56, 3)
Returns 62345:
LEADING(-6234.56, 5)
LEADING(0.00, 3)
Returns 00000:
LEADING(0.00, 5)
Returns 35500:
LEADING(3.55, 5)
Remarks
Use LEADING( ) to extract digits from a numeric field as a string, and filter out non-digit elements
such as decimals or dollar signs.
LEADINGZEROS( ) function
Adds leading zeros to a character string or a number.
Syntax
LEADINGZEROS(string/number, length)
Parameters
Name Type Description
string/number character The field, expression, or literal value to add leading zeros to.
numeric Leading and trailing spaces are automatically trimmed from character
values, and from the result of character expressions, before the
leading zeros are added.
Note
Any value in string/number longer than length is
truncated from the left.
Output
Character.
Examples
Basic examples
Character input
Returns "000235", because length is greater than the number of characters in string/number so
three leading zeros are added to the result:
LEADINGZEROS("235", 6)
Returns "35", because length is less than the number of characters in string/number so the result is
truncated from the left:
LEADINGZEROS("235", 2)
Integer input
Returns "235":
LEADINGZEROS(235, 3)
Returns "00235", because length is greater than the number of digits in string/number so two
leading zeros are added to the result:
LEADINGZEROS(235, 5)
Decimal input
Returns "023585", because LEADINGZEROS( ) removes the decimal point:
LEADINGZEROS(235.85, 6)
Negative input
Returns "0644894", because LEADINGZEROS( ) removes the negative sign:
LEADINGZEROS(-6448.94, 7)
Advanced examples
The Employee_Number field contains the value "254879". You need to convert the value to a
10-digit string with leading zeros.
To harmonize the fields when relating, you create a computed field in the Ar table that uses
the LEADINGZEROS( ) function. You then relate using the computed field:
OPEN Customer
INDEX ON CustNo TO Customer_on_CustNo
OPEN Ar
COMMENT Create the computed field CustNum_Zeros that converts the
CustNum field to the character data type and adds leading zeros.
DEFINE FIELD CustNum_Zeros COMPUTED LEADINGZEROS(CustNum,6)
COMMENT Relate the Ar table using the newly created CustNum_Zeros com-
puted field.
DEFINE RELATION CustNum_Zeros WITH Customer INDEX Customer_on_CustNo
Remarks
How it works
This function adds leading zeros to the output if the output length you specify is greater than the
length of an input value. The function accepts various kinds of character and numeric input and
outputs a character string. The function works the same way in the Unicode and non-Unicode
editions of Analytics.
The function is commonly used to normalize fields that require leading zeros, for example, check
number, purchase order number, and invoice number fields.
Numeric LEADINGZEROS( ) removes the negative sign, the thousands separator, and
the decimal point from numeric input values.
The removed symbols are not included in the length of the input value.
Character LEADINGZEROS( ) does not remove the negative sign, the thousands
separator, or the decimal point from character input values.
The removed symbols are included in the length of the input value.
LENGTH( ) function
Returns the number of characters in a string.
Syntax
LENGTH(string)
Parameters
Name Type Description
string character The field, expression, or literal value to find the length of.
Output
Numeric.
Examples
Basic examples
Returns 15:
LENGTH("ABC Corporation")
Returns the length in characters of the Description field in the table layout:
LENGTH(Description)
Advanced examples
Remarks
How it works
The LENGTH( ) function counts the number of characters in string, including any spaces, and
returns the number.
Trailing spaces
Trailing spaces are counted as characters. If you do not want trailing spaces to be counted, use the
TRIM( ) or ALLTRIM( ) functions to remove them. For example:
LENGTH(TRIM(Vendor_Street))
If you create a computed field to display the length of the values in a field, and you do not remove
trailing spaces, the maximum length of the field is displayed for each value.
LEVDIST( ) function
Returns the Levenshtein distance between two specified strings, which is a measurement of how
much the two strings differ.
Syntax
LEVDIST(string1, string2 <,case_sensitive>)
Parameters
Name Type Description
Output
Numeric. The value is the Levenshtein distance between two strings.
Examples
Basic examples
Returns 3, because two substitutions and one insertion are required to transform "smith" into
"Smythe":
LEVDIST("smith","Smythe")
Returns 2, because case is ignored, so only two substitutions are required to transform "smith's" into
"Smythes":
LEVDIST("smith's","Smythes",F)
Returns the Levenshtein distance between each value in the Last_Name field and the string
"Smith":
LEVDIST(TRIM(Last_Name),"Smith")
Advanced examples
Add the computed field Lev_Dist to the view, and then quick sort it in ascending order, to rank
all values in the Last_Name field by their amount of difference from "Smith".
Changing the number in the expression allows you to adjust the amount of Levenshtein
distance in the filtered values.
Remarks
When to use LEVDIST( )
Use the LEVDIST( ) function to find nearly identical values (fuzzy duplicates) or locate inconsistent
spelling in manually entered data. LEVDIST( ) also identifies exact duplicates.
How it works
The LEVDIST( ) function returns the Levenshtein distance between the two evaluated strings, which
is a value representing the minimum number of single character edits required to make one string
identical to the other string.
Each required edit increments the value of the Levenshtein distance by 1. The greater the
Levenshtein distance, the greater the difference between the two strings. A distance of zero (0)
means the strings are identical.
Types of edits
The edits can be of three types:
l insertion
l deletion
l substitution
Transpositions (two adjacent letters reversed) are not recognized by the Levenshtein algorithm, and
count as two edits – specifically, two substitutions.
Non-alphanumeric characters
Punctuation marks, special characters, and blanks are treated as single characters, just like letters
and numbers.
LEVDIST("abc", "dec")
Returns 3:
LEVDIST("abc", "cde")
Related functions
l ISFUZZYDUP( ) – provides an alternate method for comparing strings based on Levenshtein
distance.
Unlike the default behavior of LEVDIST( ), ISFUZZYDUP( ) is not case-sensitive.
l DICECOEFFICIENT( ) – de-emphasizes or completely ignores the relative position of
characters or character blocks when comparing strings.
l SOUNDSLIKE( ) and SOUNDEX( ) – compare strings based on a phonetic comparison
(sound) rather than on an orthographic comparison (spelling).
LOG( ) function
Returns the logarithm (base 10) of a numeric expression or field value with a specified number of
decimal places.
Syntax
LOG(number, decimals)
Parameters
Name Type Description
decimals numeric The number of decimal places for the return value.
Output
Numeric.
Examples
Basic examples
Returns 3.0000:
LOG(1000, 4)
Returns 4.86:
LOG(72443, 2)
Advanced examples
Note
You determine the nth root by dividing the log of the value by n and taking the
exponential value of the result.
Remarks
How it works
The logarithm of a number is the exponent (or power) of 10 needed to generate that number.
Therefore, the logarithm of 1000 is 3.
Related functions
The LOG( ) function is the inverse of the EXP( ) function.
LOWER( ) function
Returns a string with alphabetic characters converted to lowercase.
Syntax
LOWER(string)
Parameters
Name Type Description
Output
Character.
Examples
Basic examples
Returns "abc":
LOWER("ABC")
LOWER("AbCd 12")
LOWER(Last_Name)
Remarks
How it works
The LOWER( ) function converts all alphabetic characters in string to lowercase. All non-alphabetic
characters are left unchanged.
LTRIM( ) function
Returns a string with leading spaces removed from the input string.
Syntax
LTRIM(string)
Parameters
Name Type Description
string character The field, expression, or literal value to remove leading spaces from.
Output
Character.
Examples
Basic examples
Note that in both examples the trailing spaces are not removed by the LTRIM( ) function.
Returns "Vancouver ":
Advanced examples
The REPLACE( ) function replaces any non-breaking spaces with regular spaces, and then
LTRIM( ) removes any leading regular spaces.
Remarks
How it works
The LTRIM( ) function removes leading spaces only. Spaces inside the string, and trailing spaces,
are not removed.
Related functions
LTRIM( ) is related to the TRIM( ) function, which removes any trailing spaces from a string, and to
the ALLTRIM( ) function, which removes both leading and trailing spaces.
MAP( ) function
Returns a logical value indicating if a character string matches a specified format string containing
wildcard characters, literal characters, or both.
Syntax
MAP(string, format)
Parameters
Name Type Description
string character The field, expression, or literal value to test for matches.
format character The data pattern, or character string, you want to compare with string.
format can contain wildcard characters, literal characters, or a
combination of the two:
"\9\9\9-999-9999"
Output
Logical. Returns T (true) if a match is found, and F (false) otherwise.
Examples
Basic examples
Simple search patterns
Returns T:
MAP("045", "9999")
Escaping a wildcard
If the goal is to return T for only those values that start with the literal character "X", followed by any
second letter, the format parameter "\XX" ensures that the first "X" in the parameter is interpreted
literally and not as a wildcard.
Returns T:
MAP("XA-123", "XX")
MAP("GC-123", "XX")
MAP("XA-123", "\XX")
Returns F:
MAP("GC-123", "\XX")
MAP(Invoice_Number, "XX99999")
Returns T for all records with invoice numbers that are exactly "AB12345", or that start with
"AB12345". Returns F otherwise:
MAP(Invoice_Number, "AB12345")
Returns T for all records with invoice numbers that consist of, or that start with, "AB" followed by five
numbers. Returns F otherwise:
MAP(Invoice_Number, "AB99999")
Returns T for all records that do not match the standard format of social security numbers in the SSN
field. Returns F otherwise:
Advanced examples
Remarks
When to use MAP( )
Use the MAP( ) function to search for patterns or particular formats in alpha-numeric data. The
patterns or formats can be made up of wildcard characters, literal characters, or a combination of
both.
Case sensitivity
The MAP( ) function is case-sensitive when comparing two literal characters. For example, "a" is not
equivalent to "A".
If string includes character data with inconsistent case, you can use the UPPER( ) function to
convert the values to consistent case before using MAP( ).
For example:
MAP(UPPER(Invoice_Number), "AB99999")
Partial matching
MAP( ) supports partial matching in one situation but not in the other.
Partial matching in MAP( ) is not affected by the Exact Character Comparisons option (SET
EXACT ON/OFF).
MAP("AB1234567", "AB99999")
Note
To return True, the format value must appear at the start of the string value.
MAP("AB1234", "AB99999")
l match blanks literally, by including blanks in the format value at the appropriate position
l use the wildcard "?" , which matches any character, including blanks
If required, you can use the TRIM( ), LTRIM( ), or ALLTRIM( ) functions to remove leading or trailing
blanks from string, which ensures that only text characters and any internal blanks are compared.
Concatenating fields
You can concatenate two or more fields in string if you want to search in more than one field in a
table. The concatenated fields are treated like a single field that includes leading and trailing blanks
from the individual fields, unless you use the ALLTRIM( ) function to remove them.
MASK( ) function
Performs a bitwise AND operation on the first bytes of two character strings.
Syntax
MASK(character_value, character_mask)
Parameters
Name Type Description
character_mask character The string with the byte to test against (the mask value).
Output
Character. The output is the character representation of the binary result of the bitwise
AND operation.
Examples
Basic examples
Returns "2" (00110010), the result of a bitwise AND of 3 (00110011) and 6 (00110110):
MASK("3", "6")
Remarks
When to use MASK( )
Use MASK( ) to identify specific bit patterns in a byte of data, including whether or not a particular bit
is set to 1.
How it works
The MASK( ) function performs a bitwise AND operation on the binary representations of the first
characters of character_value and character_mask. The two comparison bytes are compared one
bit at a time, resulting in a third binary value.
The result of each comparison of corresponding bits is either 1 or 0:
0 0 0
0 1 0
1 0 0
1 1 1
MATCH( ) function
Returns a logical value indicating whether the specified value matches any of the values it is
compared against.
Syntax
MATCH(comparison_value, test <,...n>)
Parameters
Name Type Description
comparison_value character The field, expression, or literal value to test for matches.
numeric
datetime
test <,...n> character Any field, expression, or literal value you want to compare with
comparison_value.
numeric
You can specify as many test values as necessary, but all specified
datetime
values must be of the same data type:
Note
Inputs to the MATCH( ) function can be character, numeric, or datetime data. You
cannot mix data types. All inputs must belong to the same data category.
Output
Logical. Returns T (true) if at least one match is found, and F (false) otherwise.
Examples
Basic examples
Note
Return values for character comparisons assume that SET EXACT is OFF (the
default setting), except where noted.
Returns F:
Testing a field
Returns T for all records that contain "Phoenix", "Austin", or "Los Angeles" in the Vendor_City field.
Returns F otherwise:
Returns T for all records that do not contain "Phoenix", "Austin", or "Los Angeles" in the Vendor_
City field. Returns F otherwise:
Returns T for all records that contain "PHOENIX", "AUSTIN", or "LOS ANGELES" in the Vendor_
City field, regardless of the case of any of the characters in the field. Returns F otherwise:
Values in the Vendor_City field are converted to uppercase before being compared with the
uppercase city names.
Returns T for all records that have one-character product codes "A", "D", or "F" in the Product_Code
field. Returns F otherwise (SET EXACT must be ON):
MATCH(Vendor_Address, Employee_Address)
Comparing dates
Returns T for all records with an invoice date of 30 Sep 2014 or 30 Oct 2014. Returns F otherwise:
Advanced examples
Remarks
Use MATCH( ) instead of the OR operator
You can use the MATCH( ) function instead of expressions that use the OR operator.
For example:
is equivalent to
Returns F, because 1.23 does not equal 1.234 once the third decimal place is considered:
Character parameters
Case sensitivity
The MATCH( ) function is case-sensitive when used with character data. When it compares
characters, "a" is not equivalent to "A".
Returns F:
MATCH("a","A","B","C")
If you are working with data that includes inconsistent case, you can use the UPPER( ) function to
convert the values to consistent case before using MATCH( ).
Returns T:
Partial matching
Partial matching is supported for character comparisons. Either value being compared can be
contained by the other value and be considered a match.
Both of these examples return T:
MATCH("AB", "ABC")
MATCH("ABC", "AB")
Note
The shorter value must appear at the start of the longer value to constitute a match.
Datetime parameters
A date, datetime, or time field specified as a function input can use any date, datetime, or time
format, as long as the field definition correctly defines the format.
MATCH(`20141231`,`20141229`,`20141231`)
Returns F, even though the comparison_value and the second test value have an identical date of
31 December 2014:
MATCH(`20141231 120000`,`20141229`,`20141231`)
If we look at the serial number equivalent of these two expressions, we can see why the second one
evaluates to false.
Returns T, because the serial number comparison_value is equal to the second serial number test:
Returns F, because the serial number comparison_value does not equal any of the test values:
The date portion of the serial numbers 42003.500000 and 42003.000000 match, but the time portions
do not. 0.500000 is the serial number equivalent of 12:00 PM.
MATCH(CTOD(DATE(`20141231 120000`,"YYYYMMDD"),"YYYYMMDD"),`20141229`,
`20141231`)
l Time values – you must specify times using the 24-hour clock. Offsets from Coordinated
Universal Time (UTC) must be prefaced by a plus sign (+) or a minus sign (-).
YYYYMMDD `20141231`
YYMMDD `141231`
YYMMDDthhmm `141231t2359`
YYYYMMDDThh `20141231T23`
thhmmss `t235959`
Thhmm `T2359`
Note
Do not use hh alone in the main time
format with data that has a UTC offset.
For example, avoid: hh+hhmm. Results
can be unreliable.
MAXIMUM( ) function
Returns the maximum value in a set of numeric values, or the most recent value in a set of datetime
values.
Syntax
MAXIMUM(value_1, value_2 <,...n>)
Parameters
Name Type Description
Output
Numeric or Datetime.
Examples
Basic examples
Literal numeric input
Returns 7:
MAXIMUM(4, 7)
Returns 8:
MAXIMUM(4, 7, 3, 8)
Returns 8.00:
MAXIMUM(4, 7.25, 3, 8)
Returns `23:59:59`:
Field input
Returns the most recent date among the three fields for each record:
Advanced examples
If the balance multiplied by the interest rate is less than one dollar, MAXIMUM( ) returns 1.
Otherwise, MAXIMUM( ) returns the calculated interest amount.
Remarks
How decimal places work in sets of numeric values
If the numeric values being compared do not have the same number of decimal places, the result is
adjusted to the largest number of decimal places.
Returns 20.400:
You can use the DECIMALS( ) function to adjust the number of decimals for value parameters.
Returns 20.40:
MINIMUM( ) function
Returns the minimum value in a set of numeric values, or the oldest value in a set of datetime
values.
Syntax
MINIMUM(value_1, value_2 <,...n>)
Parameters
Name Type Description
Output
Numeric or Datetime.
Examples
Basic examples
Literal numeric input
Returns 4:
MINIMUM(4, 7)
Returns 3:
MINIMUM(4, 7, 3, 8)
Returns 3.00:
MINIMUM(4, 7.25, 3, 8)
Returns `23:59:57`:
Field input
Returns the oldest date among the three fields for each record:
Advanced examples
Remarks
How decimal places work in sets of numeric values
If the numeric values being compared do not have the same number of decimal places, the result is
adjusted to the largest number of decimal places.
Returns 3.600:
MINIMUM(3.6,10.88, 20.482)
You can use the DECIMALS( ) function to adjust the number of decimals for value parameters.
Returns 3.60:
names.
MIN( ) could also be an abbreviation for MINUTE( ), however Analytics reserves the abbreviation
MIN( ) for the MINIMUM( ) function.
MINUTE( ) function
Extracts the minutes from a specified time or datetime and returns it as a numeric value.
Syntax
MINUTE(time/datetime)
Parameters
Name Type Description
time/datetime datetime The field, expression, or literal value to extract the minutes from.
Output
Numeric.
Examples
Basic examples
Returns 59:
MINUTE(`t235930`)
MINUTE(`20141231 235930`)
MINUTE(Call_start_time)
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
l "Using datetimes in expressions" on page 887
l "Serial datetimes" on page 900
l "How UTC offsets affect datetime expressions" on page 903
l "Date and Time options" on page 136
Parameter details
A field specified for time/datetime can use any time or datetime format, as long as the field definition
correctly defines the format.
Specifying a literal time or datetime value
When specifying a literal time or datetime value for time/datetime, you are restricted to the formats in
the table below, and you must enclose the value in backquotes – for example, `20141231 235959`.
Do not use any separators such as slashes (/) or colons (:) between the individual components of
dates or times.
l Time values – you can use any of the time formats listed in the table below. You must use a
separator before a standalone time value for the function to operate correctly. Valid
separators are the letter 't', or the letter 'T'. You must specify times using the 24-hour clock.
Offsets from Coordinated Universal Time (UTC) must be prefaced by a plus sign (+) or a
minus sign (-).
l Datetime values – you can use any combination of the date, separator, and time formats
listed in the table below. The date must precede the time, and you must use a separator
between the two. Valid separators are a single blank space, the letter 't', or the letter 'T'.
thhmmss `t235959`
Thhmm `T2359`
YYMMDDthhmm `141231t2359`
YYYYMMDDThh `20141231T23`
Note
Do not use hh alone in the main time
format with data that has a UTC offset.
For example, avoid: hh+hhmm. Results
can be unreliable.
MOD( ) function
Returns the remainder from dividing two numbers.
Syntax
MOD(number, divisor_number)
Parameters
Name Type Description
Output
Numeric.
Examples
Basic examples
Returns 3:
MOD(93, 10)
Returns 2.0:
MOD(66, 16.00)
Returns 3.45:
MOD(53.45, 10)
Advanced examples
Remarks
When to use MOD( )
Use the MOD( ) function to test whether two numbers divide evenly, or to isolate the remainder of a
division calculation. This function divides one number by another and returns the remainder.
MONTH( ) function
Extracts the month from a specified date or datetime and returns it as a numeric value (1 to 12).
Syntax
MONTH(date/datetime)
Parameters
Name Type Description
date/datetime datetime The field, expression, or literal value to extract the month from.
Output
Numeric.
Examples
Basic examples
Returns 12:
MONTH(`20141231`)
MONTH(`20141231 235959`)
MONTH(Invoice_date)
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
l "Using datetimes in expressions" on page 887
l "Serial datetimes" on page 900
l "How UTC offsets affect datetime expressions" on page 903
l "Date and Time options" on page 136
Parameter details
A field specified for date/datetime can use any date or datetime format, as long as the field definition
correctly defines the format.
YYYYMMDD `20141231`
YYMMDD `141231`
YYMMDDthhmm `141231t2359`
YYYYMMDDThh `20141231T23`
(UTC offset)
Note
Do not use hh alone in the main time
format with data that has a UTC offset.
For example, avoid: hh+hhmm. Results
can be unreliable.
Related functions
If you need to return the name of the month of the year, use CMOY( ) instead of MONTH( ).
NOMINAL( ) function
Returns the nominal annual interest rate on a loan.
Syntax
NOMINAL(effective_rate, periods)
Parameters
Name Type Description
Note
Specify an integer. If you specified a decimal portion, it
is truncated.
Output
Numeric. The rate is calculated to eight decimals places.
Examples
Basic examples
Returns 0.17998457 (18%), the nominal annual rate of interest on the unpaid balance of a credit
card that charges an effective annual rate of 19.56%:
NOMINAL(0.1956, 12)
Remarks
What is the nominal interest rate?
The nominal annual interest rate on a loan is the stated or posted rate of interest, without taking into
account interest on the remaining balance, compounded monthly or daily.
Related functions
The EFFECTIVE( ) function is the inverse of the NOMINAL( ) function.
NORMDIST( ) function
Returns the probability that a random variable from a normally distributed data set is less than or
equal to a specified value, or exactly equal to a specified value.
Syntax
NORMDIST(x, mean, standard_deviation, cumulative)
Parameters
Name Type Description
x numeric The value for which you want to calculate the probability.
standard_deviation numeric The standard deviation of the data set. The standard_deviation value
must be greater than 0.
cumulative logical Specify T to calculate the probability that a random variable is less
than or equal to x (cumulative probability), or F to calculate the
probability that a random variable is exactly equal to x (simple
probability).
Output
Numeric.
Examples
Basic examples
Returns 0.908788780274132:
Returns 0.109340049783996:
NORMSINV( ) function
Returns the z-score associated with a specified probability in a standard normal distribution. The z-
score is the number of standard deviations a value is from the mean of a standard normal
distribution.
Syntax
NORMSINV(probability)
Parameters
Name Type Description
probability numeric The probability for which you want to calculate the z-score.
Output
Numeric.
Examples
Basic examples
Returns 1.333401745213610:
NORMSINV(0.9088)
NOW( ) function
Returns the current operating system time as a Datetime data type.
Syntax
NOW()
Parameters
This function does not have any parameters.
Output
Datetime.
Examples
Basic examples
Returns the current operating system time as a datetime value, for example, `t235959`, displayed
using the current Analytics time display format:
NOW()
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
l "Using datetimes in expressions" on page 887
l "Serial datetimes" on page 900
Related functions
If you need to return the current operating system time as a character string, use TIME( ) instead of
NOW( ).
NPER( ) function
Returns the number of periods required to pay off a loan.
Syntax
NPER(rate, payment, amount <,type>)
Parameters
Name Type Description
Output
Numeric.
Examples
Basic examples
Returns 300.00, the number of months required to pay off a $275,000 loan at 6.5% per annum, with
payments of $1,856.82 due at the end of each month:
Returns 252.81, the number of months required to pay off the same loan, with payments of $2,000
due at the end of each month:
Returns 249.92, the number of months required to pay off the same loan, with payments of $2,000
due at the beginning of each month:
Advanced examples
Annuity calculations
Annuity calculations involve four variables:
l present value, or future value – $21,243.39 and $ 26,973.46 in the examples below
l payment amount per period – $1,000.00 in the examples below
l interest rate per period – 1% per month in the examples below
l number of periods – 24 months in the examples below
If you know the value of three of the variables, you can use an Analytics function to calculate
the fourth.
PVANNUITY( )
Returns 21243.39:
FVANNUITY( )
Returns 26973.46:
PMT( )
Payment amount per period Returns 1000:
RATE( )
Returns 0.00999999 (1%):
NPER( )
Returns 24.00:
Annuity formulas
The formula for calculating the present value of an ordinary annuity (payment at the end of a
period):
The formula for calculating the future value of an ordinary annuity (payment at the end of a
period):
OCCURS( ) function
Returns a count of the number of times a substring occurs in a specified character value.
Syntax
OCCURS(string, search_for)
Parameters
Name Type Description
OCCURS(First_Name+Last_Name,"John")
Output
Numeric.
Examples
Basic examples
Returns 2:
OCCURS("abc/abc/a","ab")
Returns 3:
OCCURS("abc/abc/a","a")
Returns the number of times a hyphen occurs in each value in the Invoice_Number field:
OCCURS(Invoice_Number, "-")
Advanced examples
Including the ALLTRIM( ) function in the expression removes any leading or trailing spaces
from the Last_Name field, ensuring that only text values are compared.
The following expression isolates all records that contain the name "UNITED EQUIPMENT",
in uppercase, in the Vendor_Name field, while ignoring occurrences of "United Equipment".
If you want to find all occurrences of "United Equipment" regardless of casing, use the
UPPER( ) function to convert the search field values to uppercase:
OFFSET( ) function
Returns the value of a field with the starting position offset by a specified number of bytes.
Syntax
OFFSET(field, number_of_bytes)
Parameters
Name Type Description
Output
The return value is the same data type as the input field parameter.
Examples
Basic examples
If you have a field called "Number" that contains the value "1234567890" and you define an
overlapping field called "Offset_Number" that has a starting position of 1, a length of 3, and no
decimals places, you can use the OFFSET( ) function to shift the numbers in the field.
Returns 123:
OFFSET(Offset_Number,0)
Returns 234:
OFFSET(Offset_Number,1)
Returns 789:
OFFSET(Offset_Number,6)
Remarks
You can use this function to temporarily offset the starting position of a field. This is useful when you
are processing data where the field starting position is variable.
If you use the OFFSET( ) function with conditional computed fields, any fields referenced in the IF
test will also be offset.
OMIT( ) function
Returns a string with one or more specified substrings removed.
Syntax
OMIT(string1, string2 <,case_sensitive>)
Parameters
Name Type Description
string1 character The field, expression, or literal value to remove one or more
substrings from.
Output
Character.
Examples
Basic examples
Literal character input
Returns "Intercity Couriers":
Note
The Levenshtein distance between the returned values in the first two examples is 1.
If the generic elements are not removed, the distance between the two examples is
8, which could allow the values to escape detection as fuzzy duplicates of each
other.
Field input
Returns all the values in the Vendor_Name field with generic elements such as "Corporation" and
"Inc." removed:
Returns all the values in the Vendor_Name field with generic elements such as "Corporation" and
"Inc." removed:
OMIT(Vendor_Name," ,.,Corporation,Corp,Inc,Ltd")
Note
The two preceding examples both return the same results but the syntax for the
second example is more efficient.
Returns all the values in the Vendor_Name field with "Corporation" and "Corp" removed, and all
commas removed:
Remarks
OMIT( ) can remove substrings as units
The OMIT( ) function removes one or more substrings from a string. It differs from functions such as
CLEAN( ), EXCLUDE( ), INCLUDE( ), and REMOVE( ) because it matches and removes characters
on a substring basis rather than on a character-by-character basis. Substring removal allows you to
remove specific words, abbreviations, or repeated sequences of characters from a string without
affecting the remainder of the string.
variations you subsequently need to specify. Compare the third and fourth examples above. They
both return the same results, but the fourth example is more efficient.
PACKED( ) function
Returns numeric data converted to the Packed data type.
Syntax
PACKED(number, length_of_result)
Parameters
Name Type Description
Output
Numeric.
Examples
Basic examples
Integer and decimal input
Returns 00075C:
PACKED(75, 3)
PACKED(7.5, 3)
PACKED(-12.456, 6)
Returns 456D:
PACKED(-12.456, 2)
Advanced examples
Remarks
What is Packed data?
The Packed data type is used by mainframe operating systems to store numeric values in a format
that uses minimal storage space. The Packed data type stores two digits in each byte, and the last
byte indicates whether the value is positive or negative.
PI( ) function
Returns the value of pi to 15 decimal places.
Syntax
PI( )
Parameters
This function does not have any parameters.
Output
Numeric.
Examples
Basic examples
Returns 3.141592653589793 (the value of pi to 15 decimal places):
PI( )
60 * PI( )/180
Advanced examples
Remarks
When to use PI( )
Use PI( ) to convert degrees to radians: (degrees * PI( )/180) = radians. Radians are the required
input for three of Analytics's math functions: SIN( ), COS( ), and TAN( ).
PMT( ) function
Returns the amount of the periodic payment (principal + interest) required to pay off a loan.
Syntax
PMT(rate, periods, amount <,type>)
Parameters
Name Type Description
Note
You must use consistent time periods when specifying rate and periods to ensure
that you are specifying interest rate per period.
For example:
l for monthly payments on a two-year loan or investment with interest of 5% per
annum, specify 0.05/12 for rate and 2 * 12 for periods
l for annual payments on the same loan or investment, specify 0.05 for rate and
2 for periods
Output
Numeric.
Examples
Basic examples
Returns 1856.82, the monthly payment (principal + interest) required to pay off a twenty-five year,
$275,000 loan at 6.5% per annum, with payments due at the end of the month:
Returns 1846.82, the monthly payment (principal + interest) required to pay off the same loan, with
payments due at the beginning of the month:
Advanced examples
Annuity calculations
Annuity calculations involve four variables:
l present value, or future value – $21,243.39 and $ 26,973.46 in the examples below
l payment amount per period – $1,000.00 in the examples below
l interest rate per period – 1% per month in the examples below
l number of periods – 24 months in the examples below
If you know the value of three of the variables, you can use an Analytics function to calculate
the fourth.
PVANNUITY( )
Returns 21243.39:
FVANNUITY( )
Future value Returns 26973.46:
PMT( )
Returns 1000:
RATE( )
Returns 0.00999999 (1%):
NPER( )
Returns 24.00:
Annuity formulas
The formula for calculating the present value of an ordinary annuity (payment at the end of a
period):
The formula for calculating the future value of an ordinary annuity (payment at the end of a
period):
PPMT( ) function
Returns the principal paid on a loan for a single period.
Syntax
PPMT(rate, specified_period, periods, amount <,type>)
Parameters
Name Type Description
specified_period numeric The period for which you want to find the principal payment.
Note
You must use consistent time periods when specifying rate and periods to ensure
that you are specifying interest rate per period.
For example:
l for monthly payments on a two-year loan or investment with interest of 5% per
annum, specify 0.05/12 for rate and 2 * 12 for periods
l for annual payments on the same loan or investment, specify 0.05 for rate and
2 for periods
Output
Numeric.
Examples
Basic examples
Returns 367.24, the principal paid in the first month of a twenty-five year, $275,000 loan at 6.5% per
annum, with payments due at the end of the month:
Returns 1846.82, the principal paid on the same loan in the last month of the loan:
Remarks
Related functions
The IPMT( ) function is the complement of the PPMT( ) function.
The CUMPRINC( ) function calculates principal paid during a range of periods.
PROPER( ) function
Returns a string with the first character of each word set to uppercase and the remaining characters
set to lowercase.
Syntax
PROPER(string)
Parameters
Name Type Description
string character The field, expression, or literal value to convert to proper case.
Output
Character.
Examples
Basic examples
Returns "John Doe":
PROPER("JOHN DOE")
PROPER("john doe")
PROPER("BILL O'HARA")
Returns all the values in the Company_Name field converted to proper case:
PROPER(Company_Name)
Remarks
How it works
The PROPER( ) function converts the first character in string, and any subsequent character
preceded by a blank, to uppercase.
Subsequent characters preceded by a hyphen, an apostrophe, an ampersand (&), and several other
punctuation marks and special characters are also converted to uppercase. All other alphabetic
characters are converted to lowercase.
PROPERTIES( ) function
Returns properties information for the specified Analytics project item.
Syntax
PROPERTIES(name, obj_type, info_type)
Parameters
Name Type Description
name character The name of the Analytics project item you want information about.
name is not case-sensitive.
If the project item is an Analytics table, specify the table layout name,
not the data file name. For example: "Invoices", not "january_
invoices.fil"
If you are using the PROPERTIES( ) function to return the name of the
active table, specify the name "activetable"
Note
Currently, "table" is the only type of project item
supported.
info_type character The type of information you want about the Analytics project item.
For more information, see "Types of properties information" on
page 2431.
Output
Character. The maximum length of the output string is 260 characters. If properties information
cannot be found, an empty string is returned.
Examples
Basic examples
Information about the Analytics data file (.fil)
Returns "Ap_Trans.fil":
Returns "EXCEL":
Remarks
File information
Information types starting with "file" provide information about the Analytics data file (.fil) associated
with an Analytics table.
Source information
Information types starting with "source" provide information about external data sources that can be
associated with an Analytics table. Only those external data sources that support refreshing an
Analytics table can be reported on using the PROPERTIES( ) function:
l Microsoft Excel
l Microsoft Access
l Delimited text
l Adobe Acrobat (PDF)
l Print Image (Report)
l SAP private file format/DART
l XML
l XBRL
l ODBC data sources
"table" "filename" The name of the data file associated with the Analytics table.
"filepath" The path of the data file associated with the Analytics table.
"filesize" The size, in KB, of the data file associated with the Analytics table.
"filemodifiedat" The time and date that the data file associated with the Analytics table was
last modified.
"sourcename" The name of the data source associated with the Analytics table.
Data sources can be external files such as Excel, Access, PDF, XML, or
delimited text files, or ODBC data sources.
"sourcepath" The path of the data source associated with the Analytics table.
"sourcetype" The type of the data source associated with the Analytics table.
"sourcesize" The size, in KB, of the data source associated with the Analytics table.
Not supported for ODBC data sources.
"sourcemodifiedat" The time and date that the data source associated with the Analytics table
was last modified.
Not supported for ODBC data sources.
Note
Multiple Analytics tables can be open at the same time, but in
the user interface only one table at a time can be active.
PVANNUITY( ) function
Returns the present value of a series of future payments calculated using a constant interest rate.
Present value is the current, lump-sum value.
Syntax
PVANNUITY(rate, periods, payment <,type>)
Parameters
Name Type Description
Note
You must use consistent time periods when specifying rate, periods, and payment to
ensure that you are specifying interest rate per period.
For example:
l for a monthly payment on a two-year loan or investment with interest of 5%
per annum, specify 0.05/12 for rate and 2 * 12 for periods
l for an annual payment on the same loan or investment, specify 0.05 for rate
and 2 for periods
Output
Numeric. The result is calculated to two decimal places.
Examples
Basic examples
Monthly payments
Returns 21455.82, the present value of $1,000 paid at the beginning of each month for 2 years at
1% per month, compounded monthly:
Annual payments
Returns 20280.61, the present value of $12,000 paid at the end of each year for 2 years at 12% per
annum, compounded annually:
PVANNUITY(0.12, 2, 12000, 0)
Advanced examples
Annuity calculations
Annuity calculations involve four variables:
l present value, or future value – $21,243.39 and $ 26,973.46 in the examples below
l payment amount per period – $1,000.00 in the examples below
l interest rate per period – 1% per month in the examples below
l number of periods – 24 months in the examples below
If you know the value of three of the variables, you can use an Analytics function to calculate
the fourth.
PVANNUITY( )
Present value Returns 21243.39:
FVANNUITY( )
Returns 26973.46:
PMT( )
Returns 1000:
RATE( )
Returns 0.00999999 (1%):
NPER( )
Returns 24.00:
Annuity formulas
The formula for calculating the present value of an ordinary annuity (payment at the end of a
period):
The formula for calculating the future value of an ordinary annuity (payment at the end of a
period):
Remarks
Related functions
The FVANNUITY( ) function is the inverse of the PVANNUITY( ) function.
PVLUMPSUM( ) function
Returns the present value required to generate a specific future lump sum calculated using a
constant interest rate. Present value is the current, lump-sum value.
Syntax
PVLUMPSUM(rate, periods, amount)
Parameters
Name Type Description
amount numeric The value of the future lump sum at the end of the last period.
Note
You must use consistent time periods when specifying rate and periods to ensure
that you are specifying interest rate per period.
For example:
l for monthly payments on a two-year loan or investment with interest of 5% per
annum, specify 0.05/12 for rate and 2 * 12 for periods
l for annual payments on the same loan or investment, specify 0.05 for rate and
2 for periods
Output
Numeric. The result is calculated to two decimal places.
Examples
Basic examples
Interest compounded monthly
Returns 1000.00, the initial investment principal required to generate a future lump sum of
$1,269.73, when invested for 2 years at 1% per month, compounded monthly:
Returns 787.57, the initial investment principal required to generate a future lump sum of $1,000,
when invested for 2 years at 1% per month, compounded monthly:
Returns 21455.82, the initial investment principal required to generate a future lump sum of
$27,243.20, when invested for 2 years at 1% per month, compounded monthly:
PVLUMPSUM(0.12, 2, 1000)
Remarks
What is present value?
The present value of an invested lump sum is the initial principal required to generate a specific
future lump sum, within a particular time frame. The future value is the principal plus the
accumulated compound interest.
Related functions
The FVLUMPSUM( ) function is the inverse of the PVLUMPSUM( ) function.
PYDATE( ) function
Returns a date value calculated by a function in a external Python script. Data processing in Python
is external to Analytics.
Syntax
PYDATE("PyFile,PyFunction" <, field|value <,...n>>)
Parameters
Name Type Description
PyFile,PyFunction character The name of the Python script to run followed by a comma and then
the name of the function that returns the value:
"myScript,myFunction"
When specifying the Python script, omit the file extension. The
function you call may call other functions within the script or within
other scripts, however all scripts that run must be placed inside a
folder in the PYTHONPATH system environment variable prior to
running.
For more information, see "Configuring Python for use with Analytics"
on page 2723.
Note
Your PyFunction must return a Python datetime.date
object.
field |value <,...n> character This list of fields, expressions, or literal values to use as arguments
for the Python function. The values are passed into the function you
optional numeric
call in the order you specify them.
datetime
You may include as many arguments as necessary to satisfy the
logical function definition in the Python script.
Note
Use the ALLTRIM() function to remove any leading or
trailing spaces from character input: ALLTRIM(str). For
more information, see "ALLTRIM( ) function" on
page 2187.
Output
Datetime.
Examples
Basic examples
Returns `20160630`:
External Python script that accepts a date and a grace period as a number of days and calculates
the date the invoice is due. For an invoice date of 2016-05-31 and a period of 30 days: "2016-06-
30":
#! python
from datetime import timedelta
Advanced examples
OPEN Ap_Trans
DEFINE FIELD due_date COMPUTED
WIDTH 27
PYDATE( "hello,due_date" ,Invoice_Date, Pay_Period)
PYDATETIME( ) function
Returns a datetime value calculated by a function in an external Python script. Data processing in
Python is external to Analytics.
Syntax
PYDATETIME("PyFile,PyFunction" <, field|value <,...n>>)
Parameters
Name Type Description
PyFile,PyFunction character The name of the Python script to run followed by a comma and then
the name of the function that returns the value:
"myScript,myFunction"
When specifying the Python script, omit the file extension. The
function you call may call other functions within the script or within
other scripts, however all scripts that run must be placed inside a
folder in the PYTHONPATH system environment variable prior to
running.
For more information, see "Configuring Python for use with Analytics"
on page 2723.
Note
Your PyFunction must return a Python datetime object.
field |value <,...n> character This list of fields, expressions, or literal values to use as arguments
for the Python function. The values are passed into the function you
optional numeric
call in the order you specify them.
datetime
You may include as many arguments as necessary to satisfy the
logical function definition in the Python script.
Note
Use the ALLTRIM() function to remove any leading or
trailing spaces from character input: ALLTRIM(str). For
more information, see "ALLTRIM( ) function" on
page 2187.
Output
Datetime.
Examples
Basic examples
Returns `20170101t0500`:
External Python script that accepts a date argument and a time argument and returns a combined
Datetime object:
# hello.py content
from datetime import datetime
def combine_date_time(d,t):
return datetime.combine(d,t)
Advanced examples
External Python script that accepts a datetime and a time and adds the time to the datetime:
2016-01-01 15:00:00 + 7 hours, 30 minutes, 00 seconds = 2016-01-01 22:30:00.
# hello.py content
from datetime import timedelta
from datetime import datetime
PYLOGICAL( ) function
Returns a logical value calculated by a function in an external Python script. Data processing in
Python is external to Analytics.
Syntax
PYLOGICAL("PyFile,PyFunction" <, field|value <,...n>>)
Parameters
Name Type Description
PyFile,PyFunction character The name of the Python script to run followed by a comma and then
the name of the function that returns the value:
"myScript,myFunction"
When specifying the Python script, omit the file extension. The
function you call may call other functions within the script or within
other scripts, however all scripts that run must be placed inside a
folder in the PYTHONPATH system environment variable prior to
running.
For more information, see "Configuring Python for use with Analytics"
on page 2723.
Note
Your PyFunction must return a Python truth value.
field |value <,...n> character This list of fields, expressions, or literal values to use as arguments
for the Python function. The values are passed into the function you
optional numeric
call in the order you specify them.
datetime
You may include as many arguments as necessary to satisfy the
logical function definition in the Python script.
Note
Use the ALLTRIM() function to remove any leading or
trailing spaces from character input: ALLTRIM(str). For
more information, see "ALLTRIM( ) function" on
page 2187.
Output
Logical.
Examples
Basic examples
Returns F:
External Python script that compares str1 and str2 using the count of the character that is passed in
as char:
# hello.py content
def str_compare(str1, str2, char):
return str1.count(char) > str2.count(char)
Advanced examples
Using fields
Returns a truth value when comparing Vendor_Name and Vendor_City:
External Python script that compares str1 and str2 using the count of the character that is
passed in as char:
# hello.py content
def str_compare(str1, str2, char):
return str1.count(char) > str2.count(char)
PYNUMERIC( ) function
Returns a numeric value calculated by a function in an external Python script. Data processing in
Python is external to Analytics.
Syntax
PYNUMERIC(PyFile,PyFunction, decimal <, field|value <,...n>>)
Parameters
Name Type Description
PyFile,PyFunction character The name of the Python script to run followed by a comma and then
the name of the function that returns the value:
"myScript,myFunction"
When specifying the Python script, omit the file extension. The
function you call may call other functions within the script or within
other scripts, however all scripts that run must be placed inside a
folder in the PYTHONPATH system environment variable prior to
running.
For more information, see "Configuring Python for use with Analytics"
on page 2723.
Note
Your PyFunction must return a Python numeric type.
decimal numeric The number of decimal places to include in the return value. Must be
a positive integer.
field |value <,...n> character This list of fields, expressions, or literal values to use as arguments
for the Python function. The values are passed into the function you
optional numeric
call in the order you specify them.
datetime
You may include as many arguments as necessary to satisfy the
logical function definition in the Python script.
Note
Use the ALLTRIM() function to remove any leading or
trailing spaces from character input: ALLTRIM(str). For
more information, see "ALLTRIM( ) function" on
page 2187.
Output
Numeric.
Examples
Basic examples
Returns 35.00:
External Python script that returns the value at the requested percentile from a dynamically sized list
of values:
# hello.py content
from math import ceil
def get_nth_percent(percentage, *values):
input_length = len(values)
position = ceil((percentage/100.00) * input_length)
return values[position-1]
PYSTRING( ) function
Returns a character value calculated by a function in an external Python script. Data processing in
Python is external to Analytics.
Syntax
PYSTRING("PyFile,PyFunction", length <,field|value <,...n>>)
PyFile,PyFunction character The name of the Python script to run followed by a comma and then
the name of the function that returns the value:
"myScript,myFunction"
When specifying the Python script, omit the file extension. The
function you call may call other functions within the script or within
other scripts, however all scripts that run must be placed inside a
folder in the PYTHONPATH system environment variable prior to
running.
For more information, see "Configuring Python for use with Analytics"
on page 2723.
Note
Your PyFunction must return a Python string object.
field |value <,...n> character This list of fields, expressions, or literal values to use as arguments
for the Python function. The values are passed into the function you
optional numeric
call in the order you specify them.
datetime
You may include as many arguments as necessary to satisfy the
logical function definition in the Python script.
Note
Use the ALLTRIM() function to remove any leading or
trailing spaces from character input: ALLTRIM(str). For
more information, see "ALLTRIM( ) function" on
page 2187.
Output
Character.
Examples
Basic examples
Returns "my test":
External Python script that accepts a string and concatenates " test" to the string:
#! python
# hello.py content
def main(str):
str2 = str + ' test'
return(str2)
Advanced examples
Returning a substring
This example removes the last two characters from the Vendor Name field and returns the
substring:
External Python script that accepts a string, a string length, and two character positions. The
function returns a substring between position one and position two:
#hello.py content
def sub_set(str, length, p1, p2):
PYTIME( ) function
Returns a time value calculated by a function in an external Python script. Data processing in
Python is external to Analytics.
Syntax
PYTIME("PyFile,PyFunction" <, field|value <,...n>>)
Parameters
Name Type Description
PyFile,PyFunction character The name of the Python script to run followed by a comma and then
the name of the function that returns the value:
"myScript,myFunction"
When specifying the Python script, omit the file extension. The
function you call may call other functions within the script or within
other scripts, however all scripts that run must be placed inside a
folder in the PYTHONPATH system environment variable prior to
running.
For more information, see "Configuring Python for use with Analytics"
on page 2723.
Note
Your PyFunction must return a Python datetime.time
object.
field |value <,...n> character This list of fields, expressions, or literal values to use as arguments
for the Python function. The values are passed into the function you
optional numeric
call in the order you specify them.
datetime
You may include as many arguments as necessary to satisfy the
logical function definition in the Python script.
Note
Use the ALLTRIM() function to remove any leading or
trailing spaces from character input: ALLTRIM(str). For
more information, see "ALLTRIM( ) function" on
page 2187.
Output
Datetime.
Examples
Basic examples
Returns `t2122`:
# hello.py content
from datetime import time
from datetime import date
def get_time(timestamp):
return timestamp.time();
RAND( ) function
Returns a random number that falls within a specified boundary.
Syntax
RAND(number)
Parameters
Name Type Description
RAND(100)
RAND(-100)
Output
Numeric.
Examples
Basic examples
Returns 278.61:
RAND(1000.00)
Returns 3781:
RAND(10000)
Note
The return value will differ with each execution of the function.
Remarks
RAND( ) cannot replicate results
If you use the RAND( ) function consecutively with the same number value, it produces different
results. Unlike the RANDOM command, the RAND( ) function has no seed value.
RATE( ) function
Returns the interest rate per period.
Syntax
RATE(periods, payment, amount)
Parameters
Name Type Description
Note
The RATE( ) function assumes that payments are made at the end of each period.
Output
Numeric. The rate is calculated to eight decimals places.
Examples
Basic examples
Returns 0.00541667 (0.54%), the monthly interest rate implied by a twenty-five year, $275,000 loan
with monthly payments of $1,856.82:
Returns 0.06500004 (6.5%), the annual interest rate implied by the same loan:
Advanced examples
Annuity calculations
Annuity calculations involve four variables:
l present value, or future value – $21,243.39 and $ 26,973.46 in the examples below
l payment amount per period – $1,000.00 in the examples below
l interest rate per period – 1% per month in the examples below
l number of periods – 24 months in the examples below
If you know the value of three of the variables, you can use an Analytics function to calculate
the fourth.
PVANNUITY( )
Returns 21243.39:
FVANNUITY( )
Returns 26973.46:
PMT( )
Returns 1000:
RATE( )
Returns 0.00999999 (1%):
NPER( )
Returns 24.00:
Annuity formulas
The formula for calculating the present value of an ordinary annuity (payment at the end of a
period):
The formula for calculating the future value of an ordinary annuity (payment at the end of a
period):
RDATE( ) function
Returns a date value calculated by an R function or script. Data processing in R is external to
Analytics.
Syntax
RDATE(rScript|rCode <,field|value <,...n>>)
Parameters
Name Type Description
rScript | rCode character The full or relative path to the R script, or a snippet of R code to run.
If you enter R code directly rather than use an external file, you cannot
use the enclosing quotation character in your code, even if you escape
it:
o valid – 'var <- "\"test\"" '
o invalid – 'var <- "\'test\'" '
field | value <,...n> character The list of fields, expressions, or literal values to use as arguments for
the R script or code snippet.
optional numeric
The values are passed into the function you call in the order you
datetime
specify them, and you reference them using value1, value2 ...
logical valueN in the R code.
Note
Use the ALLTRIM() function to remove any leading or
trailing spaces from character input: ALLTRIM(str). For
more information, see "ALLTRIM( ) function" on
page 2187.
Output
Datetime.
Examples
Basic examples
Returns `20160530`:
RDATE("as.Date(value1,'%m-%d-%Y')", "05-30-16")
Advanced examples
RDATE("a<-source('c:\\scripts\\r_scripts\\sample.r');a[[1]]",
dateText)
Remarks
Returning data from R
When calling R scripts, use the source function and assign the return object to a variable. You can
then access the value returned from your R function from the return object:
# 'a' holds the response object and a[[1]] access the data value
"a<-source('c:\\scripts\\r_scripts\\sample.r');a[[1]]"
R log file
Analytics logs R language messages to an aclrlang.log file in the project folder. Use this log file
for debugging R errors.
RDATETIME( ) function
Returns a datetime value calculated by an R function or script. Data processing in R is external to
Analytics.
Syntax
RDATETIME(rScript|rCode <,field|value <,...n>>)
Parameters
Name Type Description
rScript | rCode character The full or relative path to the R script, or a snippet of R code to run.
If you enter R code directly rather than use an external file, you cannot
use the enclosing quotation character in your code, even if you escape
it:
o valid – 'var <- "\"test\"" '
o invalid – 'var <- "\'test\'" '
field | value <,...n> character The list of fields, expressions, or literal values to use as arguments for
the R script or code snippet.
optional numeric
The values are passed into the function you call in the order you
datetime
specify them, and you reference them using value1, value2 ...
logical valueN in the R code.
Note
Use the ALLTRIM() function to remove any leading or
trailing spaces from character input: ALLTRIM(str). For
more information, see "ALLTRIM( ) function" on
page 2187.
Output
Datetime.
Examples
Basic examples
Adds 45 minutes to the current date and time:
RDATETIME("Sys.time() + value1",2700)
Advanced examples
Remarks
Returning data from R
When calling R scripts, use the source function and assign the return object to a variable. You can
then access the value returned from your R function from the return object:
# 'a' holds the response object and a[[1]] access the data value
"a<-source('c:\\scripts\\r_scripts\\sample.r');a[[1]]"
R log file
Analytics logs R language messages to an aclrlang.log file in the project folder. Use this log file
for debugging R errors.
RECLEN( ) function
Returns the length of the current record.
Syntax
RECLEN( )
Parameters
This function does not have any parameters.
Output
Numeric.
Examples
Basic examples
The following example extracts all records where the length is exactly 110:
Remarks
You can use the RECLEN( ) function to identify to records of a particular length, or to test for shorter
than expected records. This function is useful if you are working with Print Image (Report) files
because it provides an easy way to examine the record lengths:
l For fixed-length records, the return value is a constant value (the record length).
l For variable-length records, the return value changes for each record.
RECNO( ) function
Returns the current record number.
Syntax
RECNO( )
Parameters
This function does not have any parameters.
Output
Numeric.
Examples
Basic examples
The following example extracts records numbered 10 through 20 to a new Analytics table:
Remarks
You can use the RECNO( ) function to output record numbers to a table, or to determine the relative
location of a particular record within a table.
l If the table is not indexed, RECNO( ) starts with a value of 1 and increases by one for each
record in the table. The logical and physical record numbers are identical.
l If the table is indexed, RECNO( ) behaves similarly, but counts the records using the logical,
not physical order.
Reordering records
When you reorder the records in a table, the record numbers generated by RECNO( ) are not
reordered. To keep the record numbers with the records that they were originally associated with,
extract the data to a new table using the Fields option before you reorder the records.
RECOFFSET( ) function
Returns a field value from a record that is a specified number of records from the current record.
Syntax
RECOFFSET(field, number_of_records)
Parameters
Name Type Description
field character The name of the field to retrieve the value from.
numeric
datetime
number_of_records numeric The number of records from the current record. A positive number
specifies a record after the current record, and a negative number
specifies a record before the current record.
Output
Character, Numeric, or Datetime. The return value belongs to the same data category as the input
field parameter.
Examples
Basic examples
Returns an Amount value from the next record:
RECOFFSET(Amount,1)
RECOFFSET(Amount, -1)
Advanced examples
Next_Amount is the value of the next record's Amount field only if the customer number in the
next record is the same as the customer number in the current record. Otherwise, Next_
Amount is assigned a value of zero.
Remarks
The RECOFFSET( ) function returns a field value from a record that is a specified number of records
above or below the current record.
REGEXFIND( ) function
Returns a logical value indicating whether the pattern specified by a regular expression occurs in a
string.
Syntax
REGEXFIND(string, pattern)
Parameters
Name Type Description
string character The field, expression, or literal value to test for a matching pattern.
Output
Logical. Returns T (true) if the specified pattern value is found, and F (false) otherwise.
Examples
Basic examples
Alpha character patterns
Returns T for all records that contain "Phoenix", "Austin", or "Los Angeles" in the Vendor_City field.
Returns F otherwise:
Returns T for all last names that start with "John" or "Jon". For example: John, Jon, Johnson,
Johnston, Jonson, Jonston, Jones, and so on. Returns F otherwise:
REGEXFIND(Last_Name,"^Joh?n")
Returns T for only those last names that are "John" or "Jon". Returns F otherwise:
REGEXFIND(Last_Name,"^Joh?n\b")
REGEXFIND(Invoice_Number, "98")
Returns T for all records with invoice numbers that begin with "98". Returns F otherwise:
REGEXFIND(Invoice_Number, "\b98")
Returns T for all records with invoice numbers that end with "98". Returns F otherwise:
REGEXFIND(Invoice_Number, "98\b")
Returns T for all records with invoice numbers that contain "98" in the 5th and 6th positions. Returns
F otherwise:
REGEXFIND(Invoice_Number, "\b\d\d\d\d98")
REGEXFIND(Invoice_Number, "\b\d{4}98")
REGEXFIND(Product_Code, "\b\d{3}-[a-zA-Z]{6}\b")
Returns T for all records with product codes that start with 3 or more numbers, followed by a hyphen
and 6 or more letters. Returns F otherwise:
REGEXFIND(Product_Code, "\b\d{3,}-[a-zA-Z]{6}")
Returns T for all records with alphanumeric invoice identifiers that contain "98" in the 5th and 6th
positions. Returns F otherwise:
REGEXFIND(Invoice_Number, "\b\w{4}98")
Returns T for all records with invoice identifiers that contain both of the following, otherwise returns
F:
l any character in the first four positions
l "98" in the 5th and 6th positions
REGEXFIND(Invoice_Number, "\b.{4}98")
Returns T for all records with invoice identifiers that contain "98" preceded by 1 to 4 initial
characters. Returns F otherwise:
REGEXFIND(Invoice_Number, "\b.{1,4}98")
Returns 'T' for all records with invoice identifiers that contain all of the following, otherwise returns F:
l any character in the first three positions
l "5" or "6" in the 4th position
l "98" in the 5th and 6th positions
REGEXFIND(Invoice_Number, "\b.{3}[56]98")
Returns T for all records with invoice identifiers that contain all of the following, otherwise returns F:
l any character in the first two positions
l "55" or "56" in the 3rd and 4th positions
l "98" in the 5th and 6th positions
REGEXFIND(Invoice_Number, "\b.{2}(55|56)98")
Remarks
How it works
The REGEXFIND( ) function uses a regular expression to search data in Analytics.
Regular expressions are powerful and flexible search strings that combine literal characters and
metacharacters, which are special characters that perform a wide variety of search operations.
For example:
REGEXFIND(Last_Name,"Sm(i|y)the{0,1}")
uses the group ( ) , alternation | , and quantifier { } metacharacters to create a regular expression
that finds "Smith", "Smyth", "Smithe", or "Smythe" in the Last_Name field.
Concatenating fields
You can concatenate two or more fields in string if you want to search across multiple fields simultan-
eously.
For example:
REGEXFIND(Vendor_Name+Vendor_Street,"Hardware.*Main")
searches both the Vendor_Name and the Vendor_Street fields for the words "Hardware" and
"Main" separated by zero or more characters.
A business with the word "Hardware" in its name, located on a street called "Main", matches the
regular expression. So does a business called "Hardware on Main".
The concatenated fields are treated like a single field that includes leading and trailing spaces from
the individual fields, unless you use the ALLTRIM( ) function to remove spaces.
Note
The current implementation of regular expressions in Analytics does not fully
support searching languages other than English.
Metacharacter Description
Metacharacter Description
{} Matches the specified number of occurrences of the immediately preceding literal, metachar-
acter, or element. You can specify an exact number, a range, or an open-ended range.
For example:
o a{3} matches "aaa"
o X{0,2}L matches "L", "XL", and "XXL"
o AB-\d{2,}-YZ matches any alphanumeric identifier with the prefix "AB-", the suffix "-YZ", and
two or more numbers in the body of the identifier
() Creates a group that defines a sequence or block of characters, which can then be treated as a
single unit.
For example:
o S(ch)?mid?th? matches "Smith" or "Schmidt"
o (56A.*){2} matches any alphanumeric identifier in which the sequence "56A" occurs at least
twice
o (56A).*-.*\1 matches any alphanumeric identifier in which the sequence "56A" occurs at least
twice, with a hyphen located between two of the occurrences
\ An escape character that specifies that the character immediately following is a literal. Use the
escape character if you want to literally match metacharacters. For example, \( finds a left
parenthesis, and \\ finds a backslash.
Use the escape character if you want to literally match any of the following characters:
^$.*+?=!:|\()[]{}
Other punctuation characters such as the ampersand (&) or the 'at sign' (@) do not require the
escape character.
\int Specifies that a group, previously defined with parentheses ( ), recurs. int is an integer that
identifies the sequential position of the previously defined group in relation to any other groups.
This metacharacter can be used in the pattern parameter in both REGEXFIND( ) and
REGEXREPLACE( ).
For example:
o (123).*\1 matches any identifier in which the group of digits "123" occurs at least twice
Metacharacter Description
$int Specifies that a group found in a target string is used in a replacement string. int is an integer that
identifies the sequential position of the group in the target string in relation to any other groups.
This metacharacter can only be used in the new_string parameter in REGEXREPLACE( ).
For example:
o If the pattern (\d{3})[ -]?(\d{3})[ -]?(\d{4}) is used to match a variety of different telephone
number formats, the new_string($1)-$2-$3 can be used to replace the numbers with
themselves, and standardize the formatting. 999 123-4567 and 9991234567 both become
(999)-123-4567.
| Matches the character, block of characters, or expression before or after the pipe (|)
For example:
o a|b matches a or b
o abc|def matches "abc" or "def"
o Sm(i|y)th matches Smith or Smyth
o [a-c]|[Q-S]|[x-z] matches any of the following letters: a, b, c, Q, R, S, x, y, z
o \s|- matches a space or a hyphen
Metacharacter Description
Tip
In addition to spaces, word boundaries can result from commas, periods, and
other non-word characters.
For example, the following expression evaluates to True:
REGEXFIND("[email protected]", "\bexample\b")
Related functions
If you want to find and replace matching patterns, use the "REGEXREPLACE( ) function" on the
facing page.
REGEXREPLACE( ) function
Replaces all instances of strings matching a regular expression with a new string.
Syntax
REGEXREPLACE(string, pattern, new_string)
Parameters
Name Type Description
string character The field, expression, or literal value to test for a matching pattern.
new_string character The string to use to replace all values matching pattern.
The replacement string can contain literal characters, groups of
characters from the original string (using the $int element), or a
combination of the two.
Output
Character.
Examples
Basic examples
Working with spaces
Returns "AB CD EF", by replacing multiple spaces between text characters with a single space:
Returns the character field data with the spacing between words standardized on a single space:
Returns the character field data with the spacing between words standardized on a single space.
Using the BLANKS( ) function in new_string, rather than a literal space, makes spaces easier to
read and less likely to be overlooked:
REGEXREPLACE(SUBSTR("1234567890",1,14), "(\d{3})[\s-]*(\d{3})[\s-]*(\d
{4})","($1) $2-$3")
Returns the numbers in the Telephone_Number field and standardizes their formatting:
REGEXREPLACE(Telephone_Number, ".*(\d{3})[\s-\.\)]*(\d{3})[\s-\.]*(\d{4})",
"($1) $2-$3")
Extracts telephone numbers from surrounding text in the Comment field and standardizes their
formatting:
REGEXREPLACE(Comment, "(.*)(\d{3})[\s-\)\.]*(\d{3})[\s-\.]*(\d{4})(.*)","
($2) $3-$4")
REGEXREPLACE(REGEXREPLACE(REGEXREPLACE("1ABC-123aa","\d","9"),"[a-z]","x"),"
[A-Z]", "X")
REGEXREPLACE(REGEXREPLACE(REGEXREPLACE(Invoice_Number,"\d","9"),"[a-
z]","x"),"[A-Z]", "X")
Returns the names in the Full_Name field in their regular order: First (Middle) (Middle) Last:
Note
Name data can present various complications, such as apostrophes in names.
Accounting for variations in name data typically requires more complex regular
expressions than the one provided in the example above.
REGEXREPLACE("<a href='https://www.flgov.com/wp-con-
tent/uploads/orders/2020/EO_20-166.pdf' tar-
get='blank'>https://www.flgov.com/wp-content/uploads/orders/2020/EO_20-
166.pdf</a>", "<[^>]*>",' ')
Returns the hyperlinks in the Source_URL_Link field with the HTML markup removed:
Remarks
How it works
The REGEXREPLACE( ) function uses a regular expression to find matching patterns in data, and
replaces any matching values with a new string.
For example:
standardizes spacing in character data by replacing one or more spaces between text characters
with a single space.
The search portion of REGEXREPLACE( ) is identical to the REGEXFIND( ) function. For detailed
information about the search capability common to both functions, see "REGEXFIND( ) function" on
page 2470.
REGEXREPLACE(REGEXREPLACE("123ABC","\d","9"),"[A-Z]","X")
Returns "9X9X9X":
REGEXREPLACE(REGEXREPLACE("1A2B3C","\d","9"),"[A-Z]","X")
REGEXREPLACE("x123x","123","ABCDE")
Returns "xABCDEx", which includes all replacement characters and unreplaced existing characters:
REGEXREPLACE(SUBSTR("x123x",1,10),"123","ABCDE")
Note
The current implementation of regular expressions in Analytics does not fully
support searching languages other than English.
Metacharacter Description
{} Matches the specified number of occurrences of the immediately preceding literal, metachar-
acter, or element. You can specify an exact number, a range, or an open-ended range.
For example:
o a{3} matches "aaa"
o X{0,2}L matches "L", "XL", and "XXL"
Metacharacter Description
o AB-\d{2,}-YZ matches any alphanumeric identifier with the prefix "AB-", the suffix "-YZ", and
two or more numbers in the body of the identifier
() Creates a group that defines a sequence or block of characters, which can then be treated as a
single unit.
For example:
o S(ch)?mid?th? matches "Smith" or "Schmidt"
o (56A.*){2} matches any alphanumeric identifier in which the sequence "56A" occurs at least
twice
o (56A).*-.*\1 matches any alphanumeric identifier in which the sequence "56A" occurs at least
twice, with a hyphen located between two of the occurrences
\ An escape character that specifies that the character immediately following is a literal. Use the
escape character if you want to literally match metacharacters. For example, \( finds a left
parenthesis, and \\ finds a backslash.
Use the escape character if you want to literally match any of the following characters:
^$.*+?=!:|\()[]{}
Other punctuation characters such as the ampersand (&) or the 'at sign' (@) do not require the
escape character.
\int Specifies that a group, previously defined with parentheses ( ), recurs. int is an integer that
identifies the sequential position of the previously defined group in relation to any other groups.
This metacharacter can be used in the pattern parameter in both REGEXFIND( ) and
REGEXREPLACE( ).
For example:
o (123).*\1 matches any identifier in which the group of digits "123" occurs at least twice
o ^(\d{3}).*\1 matches any identifier in which the first 3 digits recur
o ^(\d{3}).*\1.*\1 matches any identifier in which the first 3 digits recur at least twice
o ^(\D)(\d)-.*\2\1 matches any identifier in which the alphanumeric prefix recurs with the alpha
and numeric characters reversed
$int Specifies that a group found in a target string is used in a replacement string. int is an integer that
identifies the sequential position of the group in the target string in relation to any other groups.
This metacharacter can only be used in the new_string parameter in REGEXREPLACE( ).
For example:
Metacharacter Description
o If the pattern (\d{3})[ -]?(\d{3})[ -]?(\d{4}) is used to match a variety of different telephone
number formats, the new_string($1)-$2-$3 can be used to replace the numbers with
themselves, and standardize the formatting. 999 123-4567 and 9991234567 both become
(999)-123-4567.
| Matches the character, block of characters, or expression before or after the pipe (|)
For example:
o a|b matches a or b
o abc|def matches "abc" or "def"
o Sm(i|y)th matches Smith or Smyth
o [a-c]|[Q-S]|[x-z] matches any of the following letters: a, b, c, Q, R, S, x, y, z
o \s|- matches a space or a hyphen
Tip
In addition to spaces, word boundaries can result from commas, periods, and
other non-word characters.
For example, the following expression evaluates to True:
REGEXFIND("[email protected]", "\bexample\b")
Related functions
If you want to find matching patterns without replacing them, use the "REGEXFIND( ) function" on
page 2470.
REMOVE( ) function
Returns a string that includes only the specified characters.
Syntax
REMOVE(string, valid_characters)
Parameters
Name Type Description
string character The field, expression, or literal value to remove characters from.
Note
If a character you specify does not appear in string, it is
not included in the return value.
Output
Character.
Examples
Basic examples
Returns "ABC123 ":
Returns all the values in the Product_Number field with all non-numeric characters removed:
REMOVE(Product_Number,"0123456789")
Remarks
Note
The REMOVE( ) function has been superseded by the INCLUDE( ) and EXCLUDE( )
functions.
REMOVE( ) is still available in the current version of Analytics for backwards
compatibility with earlier versions.
How it works
The REMOVE( ) function removes unwanted characters from character data and returns a fixed
length string.
Case sensitivity
The REMOVE( ) function is case-sensitive. If you specify "ID" in valid_characters, these characters
are not included in "id#94022". If there is a chance the case may be mixed, use the UPPER( )
function to convert string to uppercase.
For example:
REMOVE(UPPER("id#94022"), "ID0123456789")
Related functions
REMOVE( ) is similar to the INCLUDE( ) function, with the following difference:
l REMOVE( ) adds blanks to the end of the output to replace the characters that have been
removed. The original length of string is retained.
l INCLUDE( ) does not add any blanks.
REPEAT( ) function
Returns a string that repeats a substring a specified number of times.
Syntax
REPEAT(string, count)
Parameters
Name Type Description
Output
Character.
Examples
Basic examples
Returns "ABCABCABC":
REPEAT("ABC",3)
Returns "000000000":
REPEAT("0",9)
Remarks
When to use REPEAT( )
Use the REPEAT( ) function to initialize a variable with constant values or blanks, or to set a default
value for a computed field.
REPLACE( ) function
Replaces all instances of a specified character string with a new character string.
Syntax
REPLACE(string, old_text, new_text)
Parameters
Name Type Description
Output
Character.
Examples
Basic examples
Returns "a12345efg":
REPLACE("abcdefg","bcd","12345")
Returns "Rd.":
REPLACE("Road","Road","Rd.")
Returns "ac":
REPLACE("abc","b","")
Advanced examples
The field length is not automatically increased for subsequent replacements, and truncation
can result if the field is not long enough to accommodate all the new characters.
Returns "9ABC9A":
To avoid truncation, you can increase the length of string using the BLANKS( ) function, or
literal blank spaces.
Returns "9ABC9ABC":
If the resulting string is shorter than string, the resulting string is padded with blanks to
maintain the same field length.
Returns "9X9 ":
Remarks
How it works
The REPLACE( ) function replaces every instance of an existing string with a new string.
Returns "1234 Scott Road":
Case sensitivity
The REPLACE( ) function is case-sensitive. If you specify "RD." in old_text and the values in string
are lowercase, the new_text value will not be substituted because no matches will be found.
If there is a chance the case in string may be mixed, first use the UPPER( ) function to convert all
characters to uppercase.
Returns "1234 SCOTT ROAD":
By adding both a leading space and a trailing space to the value in old_text ( " rd " ), you prevent
the function from replacing instances where "rd" occurs in a name, because in these instances there
are no leading spaces.
Returns "645 Richard Road":
REVERSE( ) function
Returns a string with the characters in reverse order.
Syntax
REVERSE(string)
Parameters
Name Type Description
string character The field, expression, or literal value to reverse the order of.
Output
Character.
Examples
Basic examples
Returns "E DCBA":
REVERSE("ABCD E")
RJUSTIFY( ) function
Returns a right-justified string the same length as a specified string, with any trailing spaces moved
to the left of the string.
Syntax
RJUSTIFY(string)
Parameters
Name Type Description
Output
Character.
Examples
Basic examples
Returns " ABC":
RJUSTIFY("ABC ")
Remarks
When to use RJUSTIFY( )
Use the RJUSTIFY( ) function to right-justify a character field.
RLOGICAL( ) function
Returns a logical value calculated by an R function or script. Data processing in R is external to
Analytics.
Syntax
RLOGICAL(rScript|rCode <,field|value <,...n>>)
Parameters
Name Type Description
rScript | rCode character The full or relative path to the R script, or a snippet of R code to run.
If you enter R code directly rather than use an external file, you cannot
use the enclosing quotation character in your code, even if you escape
it:
o valid – 'var <- "\"test\"" '
o invalid – 'var <- "\'test\'" '
field | value <,...n> character The list of fields, expressions, or literal values to use as arguments for
the R script or code snippet.
optional numeric
The values are passed into the function you call in the order you
datetime
specify them, and you reference them using value1, value2 ...
logical valueN in the R code.
Note
Use the ALLTRIM() function to remove any leading or
trailing spaces from character input: ALLTRIM(str). For
more information, see "ALLTRIM( ) function" on
page 2187.
Output
Logical.
Examples
Basic examples
Returns T:
Advanced examples
Remarks
Returning data from R
When calling R scripts, use the source function and assign the return object to a variable. You can
then access the value returned from your R function from the return object:
# 'a' holds the response object and a[[1]] access the data value
"a<-source('c:\\scripts\\r_scripts\\sample.r');a[[1]]"
R log file
Analytics logs R language messages to an aclrlang.log file in the project folder. Use this log file
for debugging R errors.
RNUMERIC( ) function
Returns a numeric value calculated by an R function or script. Data processing in R is external to
Analytics.
Syntax
RNUMERIC(rScript|rCode, decimals <,field|value <,...n>>)
Parameters
Name Type Description
rScript | rCode character The full or relative path to the R script, or a snippet of R code to run.
If you enter R code directly rather than use an external file, you cannot
use the enclosing quotation character in your code, even if you escape
it:
o valid – 'var <- "\"test\"" '
o invalid – 'var <- "\'test\'" '
decimals numeric The number of decimal places to include in the return value. Must be a
positive integer.
field | value <,...n> character The list of fields, expressions, or literal values to use as arguments for
the R script or code snippet.
optional numeric
The values are passed into the function you call in the order you
datetime
specify them, and you reference them using value1, value2 ...
logical valueN in the R code.
Note
Use the ALLTRIM() function to remove any leading or
trailing spaces from character input: ALLTRIM(str). For
more information, see "ALLTRIM( ) function" on
page 2187.
Output
Numeric.
Examples
Basic examples
Returns 100 with 10 decimals (100.0000000000):
Advanced examples
Remarks
Returning data from R
When calling R scripts, use the source function and assign the return object to a variable. You can
then access the value returned from your R function from the return object:
# 'a' holds the response object and a[[1]] access the data value
"a<-source('c:\\scripts\\r_scripts\\sample.r');a[[1]]"
R log file
Analytics logs R language messages to an aclrlang.log file in the project folder. Use this log file
for debugging R errors.
ROOT( ) function
Returns the square root of a numeric expression.
Syntax
ROOT(number, decimals)
Parameters
Name Type Description
number numeric The numeric expression to find the square root of.
This function returns zero if number is a negative number.
Output
Numeric.
Examples
Basic examples
Returns 10.00:
ROOT(100, 2)
Returns 31.6228:
ROOT(1000, 4)
Remarks
How it works
The ROOT( ) function returns the square root of the numeric expression or field value with the
specified number of decimal places. The result is rounded appropriately.
ROUND( ) function
Returns a rounded whole number for a numeric value.
Syntax
ROUND(number)
Parameters
Name Type Description
Output
Numeric.
Examples
Basic examples
Returns 7:
ROUND(7.2)
Returns 8:
ROUND(7.5)
Returns -8:
ROUND(-7.5)
Advanced examples
Remarks
How it works
ROUND( ) returns a number equal to the number value rounded to the nearest integer:
ROUND(number)
is equivalent to:
DEC(number, 0)
RSTRING( ) function
Returns a string value calculated by an R function or script. Data processing in R is external to
Analytics.
Syntax
RSTRING(rScript|rCode, length <,field|value <,...n>>)
Parameters
Name Type Description
rScript | rCode character The full or relative path to the R script, or a snippet of R code to run.
If you enter R code directly rather than use an external file, you cannot
use the enclosing quotation character in your code, even if you escape
it:
o valid – 'var <- "\"test\"" '
o invalid – 'var <- "\'test\'" '
field | value <,...n> character The list of fields, expressions, or literal values to use as arguments for
the R script or code snippet.
optional numeric
The values are passed into the function you call in the order you
datetime
specify them, and you reference them using value1, value2 ...
logical valueN in the R code.
Note
Use the ALLTRIM() function to remove any leading or
trailing spaces from character input: ALLTRIM(str). For
more information, see "ALLTRIM( ) function" on
page 2187.
Output
Character.
Examples
Basic examples
Returns "abc123":
RSTRING("print(paste(value1,value2,sep=""))",6,"abc","123")
Advanced examples
Tip
To install the uuid package, open R.exe and execute the following command:
install.packages("uuid")
Remarks
Returning data from R
When calling R scripts, use the source function and assign the return object to a variable. You can
then access the value returned from your R function from the return object:
# 'a' holds the response object and a[[1]] access the data value
"a<-source('c:\\scripts\\r_scripts\\sample.r');a[[1]]"
R log file
Analytics logs R language messages to an aclrlang.log file in the project folder. Use this log file
for debugging R errors.
RTIME( ) function
Returns a time value calculated by an R function or script. Data processing in R is external to
Analytics.
Syntax
RTIME(rScript|rCode <,field|value <,...n>>)
Parameters
Name Type Description
rScript | rCode character The full or relative path to the R script, or a snippet of R code to run.
If you enter R code directly rather than use an external file, you cannot
use the enclosing quotation character in your code, even if you escape
it:
o valid – 'var <- "\"test\"" '
o invalid – 'var <- "\'test\'" '
field | value <,...n> character The list of fields, expressions, or literal values to use as arguments for
the R script or code snippet.
optional numeric
The values are passed into the function you call in the order you
datetime
specify them, and you reference them using value1, value2 ...
logical valueN in the R code.
Note
Use the ALLTRIM() function to remove any leading or
trailing spaces from character input: ALLTRIM(str). For
more information, see "ALLTRIM( ) function" on
page 2187.
Output
Datetime.
Examples
Basic examples
Returns `t0545`:
RTIME("value1+2700",`t0500`)
Advanced examples
Remarks
Returning data from R
When calling R scripts, use the source function and assign the return object to a variable. You can
then access the value returned from your R function from the return object:
# 'a' holds the response object and a[[1]] access the data value
"a<-source('c:\\scripts\\r_scripts\\sample.r');a[[1]]"
R log file
Analytics logs R language messages to an aclrlang.log file in the project folder. Use this log file
for debugging R errors.
SECOND( ) function
Extracts the seconds from a specified time or datetime and returns it as a numeric value.
Syntax
SECOND(time/datetime)
Parameters
Name Type Description
time/datetime datetime The field, expression, or literal value to extract the seconds from.
Output
Numeric.
Examples
Basic examples
Returns 30:
SECOND(`t235930`)
SECOND(`20141231 235930`)
SECOND(Call_start_time)
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
l "Using datetimes in expressions" on page 887
l "Serial datetimes" on page 900
l "How UTC offsets affect datetime expressions" on page 903
l "Date and Time options" on page 136
Parameter details
A field specified for time/datetime can use any time or datetime format, as long as the field definition
correctly defines the format.
Specifying a literal time or datetime value
When specifying a literal time or datetime value for time/datetime, you are restricted to the formats in
the table below, and you must enclose the value in backquotes – for example, `20141231 235959`.
Do not use any separators such as slashes (/) or colons (:) between the individual components of
dates or times.
l Time values – you can use any of the time formats listed in the table below. You must use a
separator before a standalone time value for the function to operate correctly. Valid
separators are the letter 't', or the letter 'T'. You must specify times using the 24-hour clock.
Offsets from Coordinated Universal Time (UTC) must be prefaced by a plus sign (+) or a
minus sign (-).
l Datetime values – you can use any combination of the date, separator, and time formats
listed in the table below. The date must precede the time, and you must use a separator
between the two. Valid separators are a single blank space, the letter 't', or the letter 'T'.
thhmmss `t235959`
Thhmm `T2359`
YYMMDDthhmm `141231t2359`
YYYYMMDDThh `20141231T23`
Note
Do not use hh alone in the main time
format with data that has a UTC offset.
For example, avoid: hh+hhmm. Results
can be unreliable.
SHIFT( ) function
Returns a single character string with the bits in the first character of the input value shifted to the left
or right.
Syntax
SHIFT(character, number_of_bits_to_left)
Parameters
Name Type Description
number_of_bits_to_ numeric Specifies the number of bits to shift the character value.
left o If the value is positive – character is shifted to the left
o If the value is negative – character is shifted to the right
If the specified value is greater than 15 or less than -15 the result is
binary zero, CHR(0).
Output
Character.
Examples
Basic examples
Returns the letter "X", or CHR(88) (00010110 becomes 01011000):
SHIFT(CHR(22), 2)
SHIFT(CHR(16), -1)
SHIFT(CHR(155), 5)
Remarks
When to use SHIFT( )
Use the SHIFT( ) function in conjunction with the BYTE( ), CHR( ) and MASK( ) functions to isolate
and move individual bits in a record.
SIN( ) function
Returns the sine of an angle expressed in radians, with a precision of 15 decimal places.
Syntax
SIN(radians)
Parameters
Name Type Description
Output
Numeric.
Examples
Basic examples
Returns 0.500000000000000 (the sine of the specified number of radians, equivalent to 30
degrees):
SIN(0.523598775598299)
Advanced examples
Remarks
Performing the Mantissa Arc Test
The three trigonometric functions in Analytics – SIN( ), COS( ), and TAN( ) – support performing the
Mantissa Arc Test associated with Benford's Law.
SORTWORDS( ) function
Returns a string with individual words sorted in sequential order.
Syntax
SORTWORDS(string)
Parameters
Name Type Description
Output
Character.
Examples
Basic examples
Literal character input
Returns "1 2 A Z a z" (non-Unicode Analytics):
SORTWORDS("Z a 2 z A 1")
SORTWORDS("Z a 2 z A 1")
SORTWORDS(UPPER("Z a 2 z A 1"))
Field input
Returns all the values in the Vendor_Address field with address elements sorted into sequential
order:
SORTWORDS(Vendor_Address)
Advanced examples
LEVDIST("125 SW 39TH ST, Suite 100", "Suite 100, 125 SW 39TH ST")
Now, let's add the SORTWORDS( ) function. The Levenshtein distance returned is 2 –
dramatically lower – which suggests the two strings are the same address.
Remarks
Overview video
For a video providing an overview of the function, see Fuzzy Matching Using SORTWORDS()
(English only).
For detailed information, see "The Sort Order option and sort sequences " on page 1195.
Analytics
Edition Sort Order default Associated sort sequence
Case sensitivity
SORTWORDS( ) is case sensitive. Depending on which edition of Analytics you are using (non-
Unicode or Unicode), casing in strings may affect sorting.
You can use the UPPER( ) function in conjunction with SORTWORDS( ) if you do not want case to
affect sorting:
SORTWORDS(UPPER("string"))
Caution
If you use SORTWORDS( ) in conjunction with any of the fuzzy matching commands
or functions you must apply SORTWORDS( ) to both strings or both fields being
compared. Applying the function to only one of the two strings or fields can seriously
degrade the results of fuzzy matching.
SOUNDEX( ) function
Returns the soundex code for the specified string, which can be used for phonetic comparisons with
other strings.
Syntax
SOUNDEX(name)
Parameters
Name Type Description
Output
Character. Returns a four-character soundex code.
Examples
Basic examples
Words that sound the same but are spelled differently
The two examples below return the same soundex code because they sound the same even though
they are spelled differently.
Returns F634:
SOUNDEX("Fairdale")
Returns F634:
SOUNDEX("Faredale")
SOUNDEX("Jonson")
Returns J523:
SOUNDEX("Jonston")
SOUNDEX("Smith")
Returns M235:
SOUNDEX("MacDonald")
Field input
Returns the soundex code for each value in the Last_Name field:
SOUNDEX(Last_Name)
Advanced examples
Add the computed field Soundex_Code to the view, and then perform a duplicates test on the
computed field to identify any matching soundex codes:
Matching soundex codes indicate that the associated character values in the Last_Name
field are possible duplicates.
Remarks
When to use SOUNDEX( )
Use the SOUNDEX( ) function to find values that sound similar. Phonetic similarity is one way of
locating possible duplicate values, or inconsistent spelling in manually entered data.
How it works
SOUNDEX( ) returns the American Soundex code for the evaluated string. All codes are one letter
followed by three numbers. For example: "F634".
Related functions
l SOUNDSLIKE( ) – an alternate method for phonetically comparing strings.
l ISFUZZYDUP( ) and LEVDIST – compare strings based on an orthographic comparison
(spelling) rather than on a phonetic comparison (sound).
l DICECOEFFICIENT( ) – de-emphasizes or completely ignores the relative position of
characters or character blocks when comparing strings.
SOUNDSLIKE( ) function
Returns a logical value indicating whether a string phonetically matches a comparison string.
Syntax
SOUNDSLIKE(name, sounds_like_name)
Parameters
Name Type Description
Output
Logical. Returns T (true) if the values being compared phonetically match, and F (false) otherwise.
Examples
Basic examples
Returns T, because "Fairdale" and "Faredale" both have a soundex code of F634:
SOUNDSLIKE("Fairdale","Faredale")
Returns F, because "Jonson" has a soundex code of J525, and "Jonston" has a soundex code of
J523:
SOUNDSLIKE("Jonson","Jonston")
Returns a logical value (T or F) indicating whether the soundex code for each value in the Last_
Name field matches the soundex code for the string "Smith":
SOUNDSLIKE(Last_Name,"Smith")
Advanced examples
Remarks
When to use SOUNDSLIKE( )
Use the SOUNDSLIKE( ) function to find values that sound similar. Phonetic similarity is one way of
locating possible duplicate values, or inconsistent spelling in manually entered data.
How it works
SOUNDSLIKE( ) converts the comparison strings to four-character American Soundex codes, which
are based on the first letter, and the first three consonants after the first letter, in each string.
The function then compares each string's code and returns a logical value indicating whether they
match.
For more information about soundex codes, see "SOUNDEX( ) function" on page 2526.
Case sensitivity
The function is not case-sensitive, so "SMITH" is equivalent to "smith."
l The soundex algorithm is designed to work with words pronounced in English, and has
varying degrees of effectiveness when used with other languages.
l Although the soundex process performs a phonetic match, matching words must all begin
with the same letter, which means that some words that sound the same are not matched.
For example, a word that begins with "F", and a word that begins with a "Ph", could sound the
same but they will never be matched.
Related functions
l SOUNDEX( ) – an alternate method for phonetically comparing strings.
l ISFUZZYDUP( ) and LEVDIST – compare strings based on an orthographic comparison
(spelling) rather than on a phonetic comparison (sound).
l DICECOEFFICIENT( ) – de-emphasizes or completely ignores the relative position of
characters or character blocks when comparing strings.
SPLIT( ) function
Returns a specified segment from a string.
Syntax
SPLIT(string, separator, segment <,text_qualifier>)
Parameters
Name Type Description
string character The field, expression, or literal value to extract the segment from.
text_qualifier character The character or characters that indicate the start and end of
segments of text.
optional
If the separator character occurs inside a paired set of text qualifiers, it
is read as text and not as a separator.
You must enclose the text qualifier in quotation marks. A single
quotation mark text qualifier must be enclosed in double quotation
marks, and a double quotation mark text qualifier must be enclosed in
single quotation marks.
Tip
This optional parameter can be useful when working
with imported source data that retains separators and
text qualifiers.
Output
Character.
Examples
Basic examples
Comma-delimited segments
Returns "seg1":
SPLIT("seg1,seg2,seg3", ",", 1)
Returns "seg3":
SPLIT("seg1,seg2,seg3", ",", 3)
SPLIT("seg1,seg2,,seg4", ",", 3)
SPLIT("seg1/*seg2/*seg3", "/*", 3)
Returns "Doe":
Advanced examples
Remarks
How it works
The SPLIT( ) function breaks character data into segments based on separators such as spaces or
commas and returns a specified segment.
If the source string does not begin with a separator, the segment preceding the first separator is
treated as segment 1.
Returns "seg1":
SPLIT("seg1,seg2,seg3", ",", 1)
If the source string begins with a separator, segment 1 is consider to be null. The segment that
follows the separator is treated as segment 2.
Returns "seg1":
SPLIT(",seg1,seg2,seg3", ",", 2)
Case sensitivity
If separator or text_qualifier specify characters that have both an uppercase and a lowercase
version, the case used must match the case of the separator or text qualifier in the data.
Related functions
SPLIT( ) and SUBSTR( ) both return a segment of data from a longer source string.
l SPLIT( ) identifies the segment based on a separator character.
l SUBSTR( ) identifies the segment based on a numeric character position.
STOD( ) function
Converts a serial date – that is, a date expressed as an integer – to a date value. Abbreviation for
"Serial to Date".
Syntax
STOD(serial_date <,start_date>)
Parameters
Name Type Description
start_date datetime The start date from which serial dates are calculated. If omitted, the
default start date of 01 January 1900 is used.
optional
Output
Datetime. The date value is output using the current Analytics date display format.
Examples
Basic examples
Returns `20141231` displayed as 31 Dec 2014 assuming a current Analytics date display format of
DD MMM YYYY:
STOD(42003)
Returns `20181231` displayed as 31 Dec 2018 assuming a current Analytics date display format of
DD MMM YYYY:
STOD(42003, `19040101`)
Returns the equivalent date for each serial date value in the Invoice_Date field:
STOD(Invoice_Date)
Advanced examples
STOD(42003) - 365
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
l "Using datetimes in expressions" on page 887
l "Serial datetimes" on page 900
l "How UTC offsets affect datetime expressions" on page 903
l "Date and Time options" on page 136
How it works
The STOD( ) function allows you to convert serial dates to regular dates. Analytics serial dates
represent the number of days that have elapsed since 01 January 1900.
1 02 January 1900
0 not valid
For more information about serial dates, see "Serial datetimes" on page 900.
Point of similarity
Both Analytics and Excel treat the year 1900 as a leap year, with 366 days. Although 1900 was not
in fact a leap year, Excel treated it as one in order to maintain compatibility with Lotus 1-2-3.
Point of difference
Analytics serial dates are offset from Excel serial dates by one day. In Excel, 01 January 1900 has a
serial date of '1'. In Analytics, 01 January 1900 is not counted, and 02 January 1900 has a serial
date of '1'.
The start_date
Some source data files may use a start date other than 01 January 1900. The start_date allows you
to match the start date in a source data file. The start date is the date from which serial dates are
calculated.
Start date in
source data
file Specify: Details
01 January STOD(date_field, `19010101`) You specify a start_date of `19010101` to match the start date of
1901 01 January 1901 used in the source data file.
01 January STOD(date_field) - 365 You cannot specify a start_date earlier than 01 January 1900. If
1899 a source data file uses a start date earlier than 01 January 1900,
you can create a datetime expression that subtracts an
Start date in
source data
file Specify: Details
STODT( ) Converts a serial datetime – that is, a datetime expressed as an integer, and a fractional portion
of 24 hours – to a datetime value. Abbreviation for "Serial to Datetime".
STOT( ) Converts a serial time – that is, a time expressed as a fractional portion of 24 hours, with 24
hours equaling 1 – to a time value. Abbreviation for "Serial to Time".
CTOD( ) Converts a character or numeric date value to a date. Can also extract the date from a
character or numeric datetime value and return it as a date. Abbreviation for "Character to
Date".
CTODT( ) Converts a character or numeric datetime value to a datetime. Abbreviation for "Character to
Datetime".
CTOT( ) Converts a character or numeric time value to a time. Can also extract the time from a
character or numeric datetime value and return it as a time. Abbreviation for "Character to
Time".
DATE( ) Extracts the date from a specified date or datetime and returns it as a character string. Can also
return the current operating system date.
DATETIME( ) Converts a datetime to a character string. Can also return the current operating system
datetime.
Function Description
TIME( ) Extracts the time from a specified time or datetime and returns it as a character string. Can also
return the current operating system time.
STODT( ) function
Converts a serial datetime – that is, a datetime expressed as an integer, and a fractional portion of 24
hours – to a datetime value. Abbreviation for "Serial to Datetime".
Syntax
STODT(serial_datetime <,start_date>)
Parameters
Name Type Description
start_date datetime The start date from which serial dates are calculated. If omitted, the
default start date of 01 January 1900 is used.
optional
Output
Datetime. The datetime value is output using the current Analytics date and time display formats.
Examples
Basic examples
Unadjusted start dates
Returns `20141231t060000` displayed as 31 Dec 2014 06:00:00 AM assuming current Analytics
date and time display formats of DD MMM YYYY and hh:mm:ss PM:
STODT(42003.25000)
STODT(42003.802431)
STODT(42003.50000, `19040101`)
Fields as input
Returns the equivalent datetime for each serial datetime value in the Receipt_datetime field:
STODT(Receipt_datetime)
Advanced examples
STODT(42003.75000) - 365
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
How it works
The STODT( ) function allows you to convert serial datetimes to regular datetimes. Analytics serial
datetimes represent the number of days that have elapsed since 01 January 1900, and following the
decimal point, represent a fractional portion of 24 hours, with 24 hours equaling 1.
For more information about serial datetimes, see "Serial datetimes" on page 900.
Point of similarity
Both Analytics and Excel treat the year 1900 as a leap year, with 366 days. Although 1900 was not
in fact a leap year, Excel treated it as one in order to maintain compatibility with Lotus 1-2-3.
Point of difference
Analytics serial dates are offset from Excel serial dates by one day. In Excel, 01 January 1900 has a
serial date of '1'. In Analytics, 01 January 1900 is not counted, and 02 January 1900 has a serial
date of '1'.
The start_date
Some source data files may use a start date other than 01 January 1900. The start_date allows you
to match the start date in a source data file. The start date is the date from which serial datetimes are
calculated.
Start date in
source data
file Specify: Details
01 January STODT(datetime_field, You specify a start_date of `19010101` to match the start date of
1901 `19010101`) 01 January 1901 used in the source data file.
01 January STODT(datetime_field) - 365 You cannot specify a start_date earlier than 01 January 1900. If
1899 a source data file uses a start date earlier than 01 January 1900,
you can create a datetime expression that subtracts an
appropriate number of days from the output results of the
STODT( ) function.
STOD( ) Converts a serial date – that is, a date expressed as an integer – to a date value. Abbreviation
for "Serial to Date".
STOT( ) Converts a serial time – that is, a time expressed as a fractional portion of 24 hours, with 24
hours equaling 1 – to a time value. Abbreviation for "Serial to Time".
CTOD( ) Converts a character or numeric date value to a date. Can also extract the date from a
character or numeric datetime value and return it as a date. Abbreviation for "Character to
Date".
CTODT( ) Converts a character or numeric datetime value to a datetime. Abbreviation for "Character to
Datetime".
Function Description
CTOT( ) Converts a character or numeric time value to a time. Can also extract the time from a
character or numeric datetime value and return it as a time. Abbreviation for "Character to
Time".
DATE( ) Extracts the date from a specified date or datetime and returns it as a character string. Can also
return the current operating system date.
DATETIME( ) Converts a datetime to a character string. Can also return the current operating system
datetime.
TIME( ) Extracts the time from a specified time or datetime and returns it as a character string. Can also
return the current operating system time.
STOT( ) function
Converts a serial time – that is, a time expressed as a fractional portion of 24 hours, with 24 hours
equaling 1 – to a time value. Abbreviation for "Serial to Time".
Syntax
STOT(serial_time)
Parameters
Name Type Description
Output
Datetime. The time value is output using the current Analytics time display format.
Examples
Basic examples
Returns `t060000` displayed as 06:00:00 AM assuming a current Analytics time display format of
hh:mm:ss PM:
STOT(0.25000)
Returns `t191530` displayed as 07:15:30 PM assuming a current Analytics time display format of
hh:mm:ss PM:
STOT(0.802431)
Returns the equivalent regular time for each serial time value in the Login_time field:
STOT(Login_time)
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
l "Using datetimes in expressions" on page 887
l "Serial datetimes" on page 900
l "How UTC offsets affect datetime expressions" on page 903
l "Date and Time options" on page 136
0.00 12:00:00 AM
0.0006945 12:01:00 AM
0.04167 01:00:00 AM
0.0423645 01:01:00 AM
0.042998 01:01:55 AM
0.25 06:00:00 AM
0.50 12:00:00 PM
0.75 06:00:00 PM
0.79167 07:00:00 PM
0.802431 07:15:30 PM
1.00 12:00:00 AM
STOD( ) Converts a serial date – that is, a date expressed as an integer – to a date value. Abbreviation
for "Serial to Date".
STODT( ) Converts a serial datetime – that is, a datetime expressed as an integer, and a fractional portion
of 24 hours – to a datetime value. Abbreviation for "Serial to Datetime".
CTOD( ) Converts a character or numeric date value to a date. Can also extract the date from a
Function Description
character or numeric datetime value and return it as a date. Abbreviation for "Character to
Date".
CTODT( ) Converts a character or numeric datetime value to a datetime. Abbreviation for "Character to
Datetime".
CTOT( ) Converts a character or numeric time value to a time. Can also extract the time from a
character or numeric datetime value and return it as a time. Abbreviation for "Character to
Time".
DATE( ) Extracts the date from a specified date or datetime and returns it as a character string. Can also
return the current operating system date.
DATETIME( ) Converts a datetime to a character string. Can also return the current operating system
datetime.
TIME( ) Extracts the time from a specified time or datetime and returns it as a character string. Can also
return the current operating system time.
STRING( ) function
Converts a numeric value to a character string.
Syntax
STRING(number, length <,format>)
Parameters
Name Type Description
Note
Non-numeric format characters that you specify
increase the length of number.
Output
Character.
Examples
Basic examples, output not formatted
Numeric value 125.2
Returns " 125.2":
STRING(125.2, 6)
The output string is padded with one leading space because the length value is 6, which is one
character longer than the number of digits and format characters in number.
STRING(-125.2, 4)
The output string is truncated because the length value is 4, which is two characters shorter than the
number of digits and format characters in number.
Returns " -125.2":
STRING(-125.2, 7)
The output string is padded with one leading space because the length value is 7, which is one
character longer than the number of digits and format characters in number.
STRING(125.2, 6, "(9,999.99)")
The output string is truncated because the length value is 6, which is one character shorter than the
number value after the specified format is applied.
Returns "125.20":
STRING(125.2, 7, "(9,999.99)")
Note
Starting from the right, the characters you specify for format are included in the
calculation of the length of number even if a format character is not required for a
specific instance of number. In the examples above, the right-hand parenthesis is
counted as a character even though it is not required for a positive value in number.
The output string is padded with two leading spaces because the length value is 10, which is two
characters longer than the number value after the specified format is applied.
STRING(Employee_number, 10)
Remarks
Formatting the output string
You can format the output string to display formatting that might be missing in the source data.
How the format affects the minimum required output string length
The value you specify for length must, at a minimum, be long enough to contain all the digits in the
longest value in a field, as well as any format characters that you specify.
If you want to add a dollar sign, and thousands separators, to the values in the field containing
amounts up to $5,000,000, you need to specify at least 13 for length: 9 digits + 4 non-numeric format
characters.
Returns numeric values in the Amount field as character strings with the specified format displayed.
Related functions
The STRING( ) function is the opposite of the VALUE( ) function, which converts character data to
numeric data.
SUBSTR( ) function
Returns a specified substring from a string.
Syntax
SUBSTR(string, start, length)
Parameters
Name Type Description
string character The field, expression, or literal value to extract the substring from.
Output
Character.
Examples
Basic examples
Literal character input
Returns "BCD":
SUBSTR("ABCDEF", 2, 3)
Returns "EF":
SUBSTR("ABCDEF", 5, 10)
SUBSTR("***189543***", 4, 6)
Returns the four-digit year out of a character field containing dates formatted as "MM/DD/YYYY":
SUBSTR(DATE, 7, 4)
Advanced examples
Remarks
How it works
The SUBSTR( ) function returns characters from the string value starting at the character position
specified by start. The number of characters returned is specified by length.
Note
Even though SUBSTR( ) specifies a length of 50 characters, the output is
limited to the field length of Product_Description.
Related functions
SUBSTR( ) and SPLIT( ) both return a segment of data from a longer source string.
l SUBSTR( ) identifies the segment based on a numeric character position.
l SPLIT( ) identifies the segment based on a separator character.
TAN( ) function
Returns the tangent of an angle expressed in radians, with a precision of 15 decimal places.
Syntax
TAN(radians)
Parameters
Name Type Description
Output
Numeric.
Examples
Basic examples
Returns 0.999999999999999 (the tangent of the specified number of radians, equivalent to 45
degrees):
TAN(0.785398163397448)
Advanced examples
Remarks
Performing the Mantissa Arc Test
The three trigonometric functions in Analytics – SIN( ), COS( ), and TAN( ) – support performing the
Mantissa Arc Test associated with Benford's Law.
TEST( ) function
Returns a logical value indicating whether a specified string occurs at a specific byte position in a
record.
Syntax
TEST(byte_position, string)
Parameters
Name Type Description
byte_position numeric The sequential number from the left in the table layout that identifies
the location of the first character of string.
The function evaluates to F if the start of string is not identified at this
position, even if string appears at another position in the record.
Output
Logical. Returns T (true) if the specified string starts at the specified byte location within a record,
and F (false) otherwise.
Examples
Basic examples
Given a record containing:
Department: Marketing
....|....|....|....|....|
Returns T:
TEST(5, "Department")
Returns F, because in the record, "Department" starts at the fifth byte position, not the sixth:
TEST(6, "Department")
TEST(5, "DEPARTMENT")
Advanced examples
TIME( ) function
Extracts the time from a specified time or datetime and returns it as a character string. Can also
return the current operating system time.
Syntax
TIME(<time/datetime> <,format>)
Parameters
Name Type Description
time/datetime datetime The field, expression, or literal value to extract the time from. If
omitted, the current operating system time is returned in the format
optional
hh:mm:ss.
format character The format to apply to the output string, for example "hh:mm:ss". If
omitted, the current Analytics time display format is used. You cannot
optional
specify format if you have omitted time/datetime.
Output
Character.
Examples
Basic examples
Literal input values
Returns "23:59:59" assuming an Analytics time display format of hh:mm:ss:
TIME(`20141231 235959`)
Returns the current operating system time returned as a character string in hh:mm:ss format (24-
hour clock):
TIME()
TIME(Receipt_timestamp)
Returns a character string for each value in the Receipt_timestamp field, using the specified time
display format:
TIME(Receipt_timestamp, "hh:mm:ss")
Advanced examples
Immediately after the command, or at the end of the script, specify the two lines below.
The first line creates a variable that stores the operating system time after the command or
script completes. The second line calculates the difference between the finish and start times,
and converts the result to an easily readable format.
Tip
You can double-click the CALCULATE log entry to see the elapsed time for
the command or the script.
If the command or script will run over the boundary of midnight, use this second line instead:
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
l "Using datetimes in expressions" on page 887
l "Serial datetimes" on page 900
l "How UTC offsets affect datetime expressions" on page 903
l "Date and Time options" on page 136
Parameter details
A field specified for time/datetime can use any time or datetime format, as long as the field definition
correctly defines the format.
If you use format to control how the output string is displayed, you are restricted to the formats in the
table below. You can use any combination of time and AM/PM formats. The AM/PM format is
optional, and is placed last.
Specify format using single or double quotation marks. For example: "hh:mm:ss AM".
hhmm
hh
thhmmss `t235959`
Thhmm `T2359`
YYMMDDthhmm `141231t2359`
YYYYMMDDThh `20141231T23`
(UTC offset)
Note
Do not use hh alone in the main time
format with data that has a UTC offset.
For example, avoid: hh+hhmm. Results
can be unreliable.
Related functions
If you need to return the current operating system time as a datetime value, use NOW( ) instead of
TIME( ).
DATE( ) Extracts the date from a specified date or datetime and returns it as a character string. Can also
return the current operating system date.
DATETIME( ) Converts a datetime to a character string. Can also return the current operating system
datetime.
CTOD( ) Converts a character or numeric date value to a date. Can also extract the date from a
character or numeric datetime value and return it as a date. Abbreviation for "Character to
Date".
CTODT( ) Converts a character or numeric datetime value to a datetime. Abbreviation for "Character to
Datetime".
CTOT( ) Converts a character or numeric time value to a time. Can also extract the time from a
character or numeric datetime value and return it as a time. Abbreviation for "Character to
Time".
STOD( ) Converts a serial date – that is, a date expressed as an integer – to a date value. Abbreviation
for "Serial to Date".
STODT( ) Converts a serial datetime – that is, a datetime expressed as an integer, and a fractional portion
of 24 hours – to a datetime value. Abbreviation for "Serial to Datetime".
STOT( ) Converts a serial time – that is, a time expressed as a fractional portion of 24 hours, with 24
hours equaling 1 – to a time value. Abbreviation for "Serial to Time".
TODAY( ) function
Returns the current operating system date as a Datetime data type.
Syntax
TODAY()
Parameters
This function does not have any parameters.
Output
Datetime.
Examples
Basic examples
Returns the current operating system date as a datetime value, for example `20141231`, displayed
using the current Analytics date display format:
TODAY()
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
l "Using datetimes in expressions" on page 887
l "Serial datetimes" on page 900
l "How UTC offsets affect datetime expressions" on page 903
l "Date and Time options" on page 136
Related functions
If you need to return the current operating system date as a character string, use DATE( ) instead of
TODAY( ).
TRANSFORM( ) function
Reverses the display order of bi-directional text within a specified string.
Syntax
TRANSFORM(original_string)
Parameters
Name Type Description
original_string character The field, expression, or literal value containing bi-directional text.
Output
Character.
Examples
Basic examples
In the input string, the characters "XZQB" represent Hebrew/bidirectional characters in an input
string that otherwise contains regular characters.
In the output string, the direction of "XZQB" is reversed, and returns "BQZX". The other characters
are unmodified.
Returns "ABC BQZX 123":
Remarks
How it works
The TRANSFORMS( ) function identifies bi-directional data and displays it correctly in the view,
from right to left.
All other characters processed by the function are unmodified and continue to display from left to
right.
TRIM( ) function
Returns a string with trailing spaces removed from the input string.
Syntax
TRIM(string)
Parameters
Name Type Description
string character The field, expression, or literal value to remove trailing spaces from.
Output
Character.
Examples
Basic examples
Note that in both examples the leading spaces and spaces between words are not removed by the
TRIM( ) function.
Returns " Vancouver":
Advanced examples
The REPLACE( ) function replaces any non-breaking spaces with regular spaces, and then
TRIM( ) removes any trailing regular spaces.
Remarks
How it works
The TRIM( ) function removes trailing spaces only. Spaces inside the string, and leading spaces,
are not removed.
Related functions
TRIM( ) is related to the LTRIM( ) function, which removes any leading spaces from a string, and to
the ALLTRIM( ) function, which removes both leading and trailing spaces.
UNSIGNED( ) function
Returns numeric data converted to the Unsigned data type.
Syntax
UNSIGNED(number, length_of_result)
Parameters
Name Type Description
Output
Numeric.
Examples
Basic examples
Returns 000075:
UNSIGNED(75, 3)
UNSIGNED(-75, 3)
UNSIGNED(7.5, 3)
Returns 2456 (1 is truncated because only 4 digits can be stored when the length_of_result is 2):
UNSIGNED(12456, 2)
Returns 000000012456:
UNSIGNED(-12.456, 6)
Remarks
What is Unsigned data?
The Unsigned data type is used by mainframe operating systems to store numeric values in a format
that uses minimal space, storing two digits in each byte. The Unsigned data type is the same as the
Packed data type, but it does not use the last byte to specify whether the value is positive or
negative.
UPPER( ) function
Returns a string with alphabetic characters converted to uppercase.
Syntax
UPPER(string)
Parameters
Name Type Description
Output
Character.
Examples
Basic examples
Returns "ABC":
UPPER("abc")
UPPER("AbCd 12")
UPPER(Last_Name)
Remarks
How it works
The UPPER( ) function converts all alphabetic characters in string to uppercase. All non-alphabetic
characters are left unchanged.
UTOD( ) function
Converts a Unicode string containing a formatted date to an Analytics date value. Abbreviation for
"Unicode to Date".
Note
This function is specific to the Unicode edition of Analytics. It is not a supported
function in the non-Unicode edition.
Use this function when working with dates in languages and formats that are
different from your default installation. If the string you want to convert is in your
default language, use CTOD( ) instead.
Syntax
UTOD(string <,locale> <,style>)
Parameters
Name Type Description
locale character The code that specifies the language and locale of the output string,
and optionally the version of the language associated with a particular
optional
country or region.
For example, "zh" specifies Chinese, and "pt_BR" specifies Brazilian
Portuguese.
If omitted, the default locale for your computer is used. If a language is
specified, but no country is specified, the default country for the
language is used.
You cannot specify locale if you have not specified date.
For more information about locale codes, see www.unicode.org.
style numeric The date format style to use for the Unicode string. The format style
matches the standard for the locale you specify:
optional
o 0 – full specification format, such as "Sunday, September 18, 2016"
Tip
For help determining the expected format of your input
string, do one of the following:
l Use the DTOU( ) function to generate an
example value using the style and locale.
In the command line, use the DISPLAY
command to print the value:
DISPLAY DTOU(`20160909`,
"es_MX", 3)
Output
Datetime. The date value is output using the current Analytics date display format.
Examples
Basic examples
Note
All examples assume a current Analytics date display format of DD MMM YYYY.
In the examples below, the locale code for Chinese ( "zh" ) and Simplified Chinese (
"zh_CN" ) match different input strings and are not interchangeable.
You must also specify the correct style. A long Unicode date string (that is, style is 1 )
does not return an Analytics date if you specify a style of 2.
UTOD(Invoice_date, "zh", 1)
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
l "Using datetimes in expressions" on page 887
l "Serial datetimes" on page 900
l "How UTC offsets affect datetime expressions" on page 903
l "Date and Time options" on page 136
Related functions
UTOD( ) is the inverse of DTOU( ), which converts a date to a Unicode string. If you are uncertain
which country/region and style to specify for UTOD( ), you can use DTOU( ) and experiment with
different parameters to produce an output Unicode string that matches the form of the input Unicode
strings you want to convert with UTOD( ).
VALUE( ) function
Converts a character string to a numeric value.
Syntax
VALUE(string, decimals)
Parameters
Name Type Description
Output
Numeric.
Examples
Basic examples
Returns -123.400:
VALUE("123.4-", 3)
Returns 123456.00:
VALUE("$123,456", 2)
Returns -77.45:
VALUE("77.45CR", 2)
Returns -123457:
VALUE(" (123,456.78)", 0)
Field input
Returns character values in the Salary field as numbers without any decimal places:
VALUE(Salary, 0)
Remarks
How it works
This function converts character data to numeric data. You can use the VALUE( ) function if you
need to convert character expressions or field values to numeric values for use in Analytics
commands.
Negative values
The VALUE( ) function can interpret different indicators of negative values such as parentheses and
the minus sign. It can also interpret CR (credit) and DR (debit). For example:
Returns -1000.00:
VALUE("(1000)", 2)
VALUE("1000CR", 2)
VALUE("123", 2)
If the number of decimals specified by decimals is less than the number in the field or expression,
the result is rounded. For example:
Returns "10.6":
VALUE("10.56", 1)
Related functions
The VALUE( ) function is the opposite of the STRING( ) function, which converts numeric data to
character data.
VERIFY( ) function
Returns a logical value indicating whether the data in a physical data field is valid.
Syntax
VERIFY(field)
Parameters
Name Type Description
Output
Logical. Returns T (true) if data in the field is valid, and F (false) otherwise.
Examples
Basic examples
Extracts any records where the VERIFY( ) function evaluates to false to a new Analytics table:
Remarks
The VERIFY( ) function determines whether the data in a field is consistent with the specified data
type for the field.
WORKDAY( ) function
Returns the number of workdays between two dates.
Syntax
WORKDAY(start_date, end_date <,nonworkdays>)
Parameters
Name Type Description
start_date datetime The start date of the period for which workdays are calculated. The
start date is included in the period.
end_date datetime The end date of the period for which workdays are calculated. The end
date is included in the period.
nonworkdays character The days of the week that are weekend days, or non workdays, and
excluded from the calculation. If nonworkdays is omitted, Saturday
optional
and Sunday are used as the default non workdays.
Enter nonworkdays using the following abbreviations, separated by a
space or a comma:
o Mon
o Tue
o Wed
o Thu
o Fri
o Sat
o Sun
nonworkdays is not case-sensitive. The abbreviations must be
entered in English even if you are using a non-English version of
Analytics:
Note
You can specify a datetime value for start_date or end_date but the time portion of
the value is ignored.
If start_date is more recent than end_date, a negative value is returned.
Output
Numeric. The number of workdays in the period for which workdays are calculated.
Examples
Basic examples
Literal input values
Returns 5 (the number of workdays between Monday, March 02, 2015 and Sunday, March 08, 2015
inclusive):
WORKDAY(`20150302`, `20150308`)
Returns 6 (the number of workdays between Monday, March 02, 2015 and Sunday, March 08, 2015
inclusive, when Sunday is the only non workday):
Returns 5 (the number of workdays between Sunday, March 01, 2015 and Saturday, March 07,
2015 inclusive, when Friday and Saturday are the non workdays):
You can also use the function to calculate the number of weekend days in a date range.
Returns 2 (the number of weekend days between Monday, March 02, 2015 and Sunday, March 08,
2015 inclusive):
WORKDAY(Start_date, `20151231`)
Returns the number of workdays between each date in the Start_date field and a corresponding
date in the End_date field inclusive:
l Statutory holidays are included in the workdays total and may need to be factored out using a
separate calculation
l A negative return value indicates a start date that is more recent than an end date
WORKDAY(Start_date, End_date)
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
l "Using datetimes in expressions" on page 887
l "Serial datetimes" on page 900
l "How UTC offsets affect datetime expressions" on page 903
l "Date and Time options" on page 136
Date formats
A field specified for start_date or end_date can use any date format, as long as the field definition
correctly defines the format.
When specifying a literal date value for start_date or end_date, you are restricted to the formats
YYYYMMDD and YYMMDD, and you must enclose the value in backquotes – for example, `20141231`.
You then create a conditional computed field, for example Workdays_no_holidays, that adjusts the
value returned by the first computed field (Workdays):
Note
The order of the conditions in the conditional computed field is important.
Analytics evaluates multiple conditions starting at the top. The first condition that
evaluates to true for a record assigns the value of the conditional computed field for
that record. A subsequent condition that evaluates to true does not change the
assigned value.
YEAR( ) function
Extracts the year from a specified date or datetime and returns it as a numeric value using the YYYY
format.
Syntax
YEAR(date/datetime)
Parameters
Name Type Description
date/datetime datetime The field, expression, or literal value to extract the year from.
Output
Numeric.
Examples
Basic examples
Returns 2014:
YEAR(`20141231`)
YEAR(`141231 235959`)
YEAR(Invoice_date)
Remarks
Date and time functions can sometimes be challenging to use correctly. In the Help, function topics
describe the specific details of how each function works. For information about some general
considerations when using date and time functions, see the following topics:
l "Using datetimes in expressions" on page 887
l "Serial datetimes" on page 900
l "How UTC offsets affect datetime expressions" on page 903
l "Date and Time options" on page 136
Parameter details
A field specified for date/datetime can use any date or datetime format, as long as the field definition
correctly defines the format.
YYYYMMDD `20141231`
YYMMDD `141231`
YYMMDDthhmm `141231t2359`
YYYYMMDDThh `20141231T23`
(UTC offset)
Note
Do not use hh alone in the main time
format with data that has a UTC offset.
For example, avoid: hh+hhmm. Results
can be unreliable.
ZONED( ) function
Converts numeric data to character data and adds leading zeros to the output.
Note
If you are using the Unicode edition of Analytics, you need to nest the ZONED( )
function inside the BINTOSTR( ) function to correctly display the return value of
ZONED( ).
You also need to nest ZONED( ) inside BINTOSTR( ) if you want to use the return
value of ZONED( ) as a parameter in another function.
If your goal is to add leading zeros to the values in a field, you can use the
LEADINGZEROS( ) function instead of ZONED( ). In many cases, LEADINGZEROS
( ) is easier to use than ZONED( ). LEADINGZEROS( ) is supported in both the
Unicode and non-Unicode editions of Analytics.
For more information, see "BINTOSTR( ) function" on page 2203 and
"LEADINGZEROS( ) function" on page 2352.
Syntax
ZONED(number, length)
Parameters
Name Type Description
Note
If you want to add leading zeros to a character value that
contains a numeric string, you must use the VALUE( )
function to convert the character to the numeric data
type before using the value as input for ZONED( ). For
more information, see "VALUE( ) function" on
page 2583.
Output
Character.
Examples
Basic examples
Integer input
Returns "235":
ZONED(235, 3)
Returns "00235", because length is greater than the number of digits in number so two leading zeros
are added to the result:
ZONED(235, 5)
Returns "35", because length is less than the number of digits in number so the leftmost digit is
truncated from the result:
ZONED(235, 2)
Decimal input
Returns "23585", because the zoned data format does not support a decimal point:
ZONED(235.85, 5)
Negative input
Returns "64489M", because the number is negative and "M" represents the final digit 4:
ZONED(-6448.94, 6)
Returns "489J", because length is less than the number of digits in number so the two leftmost digits
are truncated from the result, and the number is negative and "J" represents the final digit 1:
ZONED(-6448.91, 4)
Advanced examples
Tip
You must use the VALUE( ) function to convert the character to numeric data
before using the numeric as input for ZONED( ).
OPEN Ar PRIMARY
OPEN Customer SECONDARY
Remarks
How it works
This function converts numeric data to character data and adds leading zeros to the output. The
function is commonly used to harmonize fields that require leading zeros, for example, check
number, purchase order number, and invoice number fields.
Decimal numbers
The zoned data format does not include an explicit decimal point.
Negative numbers
If the input number is negative, the rightmost digit is displayed as a character in the result:
l "}" for 0
l a letter between "J" and "R" for the digits 1 to 9
ZSTAT( ) function
Returns the standard Z-statistic.
Syntax
ZSTAT(actual, expected, population)
Parameters
Name Type Description
population numeric The total number of items being tested. This parameter must be a
positive whole number greater than 0.
Output
Numeric.
Examples
Advanced examples
A Z-statistic of 1.96 has a significance of 0.05, and 2.57 has a significance of 0.01. Thus, the
probability that the higher rates of claims are due to chance is between 1:20 and 1:100.
The actual number of claims for July and August is lower than expected at 390. The expected
number of claims for this period is one sixth of the 2,450 annual claims, or 408.33. The Z-
statistic for these proportions is calculated as 0.967:
This is not a very significant result. Z-statistics of 1.000 and less are very common and can
typically be ignored.
The actual number of claims for April to June is represented by the proportion 660/2450,
which is higher than expected. The expected number of claims for this period should be 25
percent of the 2,450 annual claims. The Z-statistic for these proportions is 2.193:
A Z-statistic of 1.96 has a significance of 0.05, and 2.57 has a significance of 0.01. Thus, the
probability that the higher rates of claims are due to chance is between 1:20 and 1:100.
The actual number of claims for July and August is low at 390. The expected number of
claims for this period should be one sixth, or 16.6667 percent of the 2,450 annual claims. The
Z-statistic for these proportions is 0.967:
This is not a very significant result. Z-statistics of 1.000 and less are very common and can
typically be ignored.
Remarks
How it works
The ZSTAT( ) function calculates the standard Z-statistic for use in many problem-solving tasks,
including digital analysis. It outputs the result with a precision of three decimal places.
Using ZSTAT( )
Use ZSTAT( ) to evaluate the likely frequency of occurrence of a given result in a specified period or
category. The larger the resulting Z-statistic, the more unlikely the occurrence.
For example, a Z-statistic of 1.96 has a significance of 0.05, representing the likelihood of a one time
in 20 occurrence, whereas a Z-statistic of 2.57 has a significance of 0.01, representing the likelihood
of a one time in 100 occurrence. For information on the Z-statistic, consult a statistics textbook.
l When using an expression within an expression to calculate the actual or expected value, you
must specify the level of precision you want in the result by using a decimal multiplier.
Analytics has a precision of 8 digits, therefore a multiplier of 1.00000000 will return the
greatest precision attainable
Note
Version 16 of Analytics, and all subsequent versions, are not intended for use with
Analytics Exchange (AX). Diligent will end support for Analytics Exchange on
January 1, 2023. Learn more or upgrade to Robots.
For information about using Analytics in conjunction with Analytics Exchange, see
Analytics and ACLScript 15.1 Help.
COMMENT
//ANALYTIC Identify missing checks
This analytic script identifies missing check numbers
END
For more information, see "Working with analytic headers" on page 2614.
Note
Version 16 of Analytics, and all subsequent versions, are not intended for use with
Analytics Exchange (AX). Diligent will end support for Analytics Exchange on
January 1, 2023. Learn more or upgrade to Robots.
For information about using Analytics in conjunction with Analytics Exchange, see
Analytics and ACLScript 15.1 Help.
Tip
Identifying the required inputs and outputs before you begin will make development
go more smoothly.
Inputs Outputs
o non-Analytics files such as Excel or delimited o Analytics and non-Analytics results tables
("FILE tag" on page 2639) ("RESULT tag" on page 2660)
o input parameters such as cutoff amount, date, or ID o log files for successful scripts
codes
("RESULT tag" on page 2660)
("PARAM tag" on page 2642) o Analytics output tables that will be used as input for
o passwords subsequent scripts
("PASSWORD tag" on page 2652) ("DATA tag" on page 2667)
o Analytics tables and fields
("TABLE tag" on page 2655, "FIELD tag" on
page 2657)
Automated connectivity
The advantage of this approach is that data imports to Robots can be fully automated including
being run on a schedule.
In the body of the analytic script, use one of the ACLScript commands for connecting to an external
data source, importing data, and creating an Analytics table with a copy of the data:
l ACCESSDATA
l IMPORT ODBC
l IMPORT GRCRESULTS
l IMPORT GRCPROJECT
l DEFINE TABLE DB
Note
These commands do not require any corresponding analytic tag in the analytic
header.
Use ACCESSDATA unless you have a reason for using one of the other commands.
DEFINE TABLE DB is an older command that is maintained for backward compatib-
ility with older scripts.
Manual upload
Manual upload provides a simple way to import data to Robots, and it may be appropriate when
users have source data files stored locally.
You can manually upload non-Analytics files such as Excel or delimited to Robots. You need to use
a different method to make Analytics tables available.
l non-Analytics files – You can manually upload non-Analytics files such as Excel or delimited
to the Input/Output tab in a robot. To access the uploaded data in an analytic script, use a
FILE tag in the analytic header, and an appropriate import command, such as
IMPORT EXCEL, in the body of the script.
l Analytics tables – You cannot manually upload Analytics tables to the Input/Output tab.
Instead, use a DATA tag in the analytic header to save an Analytics output table to the
Input/Output tab. To access the Analytics table in a subsequent script, use the
OPEN command in the body of the script.
For more information, see "Working with analytic headers" on page 2614.
//RESULT LOG
To assign temporary test values using the Analytic Header Designer, enter the value in the Test
value field for all analytic tags that require user input.
For more information about assigning temporary test values, see "Specifying test input values in
Analytics" on page 2633.
Note
If you want to exit the analytic script before it completes, press Esc and click Yes in
the confirmation prompt.
Tip
You can delete all stored variables and variable assignments from the Analytics
project by entering DELETE ALL OK in the command line. Clearing the Variables tab
prior to stepping through an analytic script gives you a clean start.
Note
Version 16 of Analytics, and all subsequent versions, are not intended for use with
Analytics Exchange (AX). Diligent will end support for Analytics Exchange on
January 1, 2023. Learn more or upgrade to Robots.
For information about using Analytics in conjunction with Analytics Exchange, see
Analytics and ACLScript 15.1 Help.
COMMENT
//ANALYTIC TYPE ANALYSIS Identify missing checks
This analytic script identifies missing check numbers
//TABLE v_table_payments Payments Table
Select a table that lists payments and includes a check number column
//FIELD v_check_num CN Check Number
Select the field that contains the check numbers
//PARAM v_start_date D OPTIONAL Start Date (Optional)
Enter the start date for the analysis
//PARAM v_end_date D OPTIONAL End Date (Optional)
Enter the end date for the analysis
//PARAM v_region C MULTI SEPARATOR , QUALIFIER ' VALUES |North-
east|Southeast|Central|Western|West Coast| Regions
Enter one or more regions to include in the analysis
//RESULT TABLE Missing_Checks
//RESULT FILE Missing_Checks.xls
//RESULT LOG
END
Specifies that a log file is output for scripts that run success-
//RESULT LOG fully.
A log file is automatically output if a script fails.
Note
Names of analytic scripts in the same Analytics project must be unique.
The name identifies the analytic script in Robots. The analytic script name is
not the same as the script name that you specify in Analytics when you initially
create the script.
l Keep log file off – a log file is not output when the script runs successfully
Regardless of the Keep log file setting, a log file is automatically output if the script fails.
Tip
If you want to customize the name of the log file for successful scripts, use the
RESULT LOG tag.
3. To configure the tag, complete all the required fields in the tag configuration section, and any
optional fields that you need.
Guidance for configuring tags is embedded in the configuration section for each tag.
For detailed information about analytic header syntax, and a full list of analytic tags, see
"Analytic headers and tags" on page 2631.
4. Repeat the process for each additional tag that you need in the analytic header.
5. Click Save when you are finished.
Tip
If the nature of the error is not apparent based on the error message, review
the Help topic for the associated analytic tag. Carefully compare the syntax in
the topic with the syntax in the line of the analytic header. Errors can be
caused by minor discrepancies in the analytic header syntax.
Note
The name of the analytic script is the name specified in the ANALYTIC tag, not
the script name in the Overview tab in the Navigator.
Project-level validation is performed automatically when you commit scripts to Robots. You can also
perform the validation manually if you add the Check Scripts button to the Analytics toolbar.
1. If necessary, add the Check Scripts button to the Analytics toolbar:
a. Double-click an empty spot on the toolbar to open the Customize Toolbar dialog box.
b. In the Available toolbar buttons list, select the Check Scripts button and click Add.
c. In the Current toolbar buttons list, select the Check Scripts button and click Move Up or
Move Down to change the location of the button.
The order of the buttons from top to bottom corresponds to their location from left to right on
the toolbar.
d. Click Close to save your changes.
3. If the analytic headers contain an error, correct the error and click Check Scripts again
to ensure there are no further errors.
Test locally
Test all analytic scripts locally before deploying them to the Robots app. Ensure that analytic scripts
run as expected, and that they do not require user interaction.
For more information, see "Developing analytic scripts" on page 2607.
Note
The PASSWORD parameter is not required when running the import and export
commands in Analytics because the current user's HighBond access token, stored
locally in the Windows registry, is automatically used.
PASSWORD //PASSWORD
PAUSE no equivalent
Guidelines
l Interactive commands – To prevent analytic script processing failures, remove all interactive
commands.
l SET SAFETY – To ensure files can be overwritten as necessary without displaying a confirm-
ation dialog box, add the SET SAFETY OFF command at the beginning of an analytic script.
Add the SET SAFETY ON command at the end of the analytic script to restore the default
behavior.
l OK parameter – To prevent confirmation dialogs from crashing the analytic script, add the OK
parameter after any commands that normally display a confirmation dialog box:
l RENAME
l DELETE
l Ensure that the deployment environment contains a directory structure, or external scripts,
that align with the paths or external scripts specified in the analytic script.
COMMENT
//ANALYTIC TYPE PREPARE Sample Preparation analytic
This analytic script prepares the raw data table for analysis and saves it
to the new Analytics table "Trans_May_prepared" (the analysis table). The
analytic script defines a shorter version of the "Description" field because
classifying only supports field lengths up to 64 characters.
//TABLE v_RawTable Table to prepare
Select the raw data table you want to prepare
//RESULT TABLE Trans_*_prepared
//DATA Trans_*_prepared
//RESULT LOG
END
COMMENT
//ANALYTIC TYPE ANALYSIS Sample Analysis analytic
This analytic script classifies the analysis table and outputs the results
Note
Version 16 of Analytics, and all subsequent versions, are not intended for use with
Analytics Exchange (AX). Diligent will end support for Analytics Exchange on
January 1, 2023. Learn more or upgrade to Robots.
For information about using Analytics in conjunction with Analytics Exchange, see
Analytics and ACLScript 15.1 Help.
Example
This analytic header identifies a table and field to use in the script, as well as a start date
parameter:
COMMENT
//ANALYTIC Identify missing checks
This analytic script identifies missing check numbers
//TABLE v_table_payments Payments Table
Select a table that lists payments and includes a check number
column
//FIELD v_check_num CN Check Number
Select the field that contains the check numbers
//PARAM v_start_date D OPTIONAL Start Date (Optional)
Enter the start date for the analysis
END
Tag format
Each tag in the header uses the following format:
//tag_name attributes
optional_descriptive_text
The // tag indicator must be the first non-whitespace character on the script line. The tag name
must immediately follow the tag indicator, without any space or characters in between.
The optional descriptive text must be entered on the next line after the tag. The text can be multiline,
but it cannot skip lines. Line breaks are not preserved when the descriptive text is displayed in
Robots.
Tag conventions
Component Convention
Tag attributes When specifying attribute values for a tag, you may include spaces and optionally enclose the
value in quotation marks.
Tag descriptions Descriptions are optional. If a description is specified it can be multi-line, but line breaks are not
preserved in Robots.
When the script runs in Analytics, the parameter takes the value specified in the assignment. When
the analytic script runs in Robots, the test value is ignored and the user-defined input parameters
are used.
You must leave a space between the assignment operator and the tag syntax preceding it.
Assignment values must use the correct qualifier for the data type as required throughout Analytics.
For more information, see "Data types" on page 1471.
"ANALYTIC tag" on Designates a script as an analytic script that can run in Robots.
page 2635
Input tags
"FILE tag" on Specifies a non-Analytics file, such as an Excel file, or a delimited file, that provides input for an
page 2639 analytic script running in Robots. The file must be located in the Input/Output tab in the same
robot as the analytic script.
"PARAM tag" on Creates an input parameter for an analytic script, and defines the requirements for the input
page 2642 value.
An input parameter is a placeholder that allows the user to specify the actual value when
scheduling or running an analytic script.
"PASSWORD tag" Creates a password input parameter for an analytic script. The parameter provides encrypted
on page 2652 storage of a password for subsequent use in an ACLScript command.
The user is prompted to specify the required password value when they schedule or start the
analytic script so that user intervention is not required as the analytic script is running.
"TABLE tag" on Defines an Analytics table that the user selects as input for an analytic script.
Tag Description
page 2655 The TABLE tag can be followed by zero or more FIELD tags entered on sequential lines.
"FIELD tag" on Defines a field that the user selects as input for an analytic script.
page 2657
The field must be part of the table defined in the preceding TABLE tag. The first FIELD tag must
immediately follow a TABLE tag, and can be followed by additional FIELD tags entered on
sequential lines.
Output tags
"RESULT tag" on Specifies that the results output by an analytic script are available in Robots to end users.
page 2660
Output results, even if they exist, are not automatically made available.
"DATA tag" on Specifies that an Analytics table output by an analytic script is copied to a central data storage
page 2667 location in Robots.
Typically, you store Analytics tables so that they can be used as input tables for subsequent
analytic scripts.
ANALYTIC tag
Designates a script as an analytic script that can run in Robots.
Syntax
//ANALYTIC <TYPE IMPORT|PREPARE|ANALYSIS> name
<description>
Note
An ACLScript COMMENT command must be entered on the first line in an analytic
script, followed by the ANALYTIC tag on the second line. If the ANALYTIC tag is used in
any other location it is ignored.
One or more scripts in an Analytics project can include an ANALYTIC tag.
Parameters
Name Description
Name Description
Note
Analytic script names in the same project must be unique. If name has an
identical value in two or more analytic scripts, an error occurs when you
try to commit the analytic scripts.
description A description of the analytic script or other information that the user might need to run the
analytic script successfully.
optional
The description appears with the analytic script in Robots. The description can be
multiline, but it cannot skip lines. The description must be entered on the line below the
associated ANALYTIC tag.
Examples
The following analytic header contains a name and a description of the analytic script:
COMMENT
//ANALYTIC Identify missing checks
This analytic script identifies missing check numbers.
END
COMMENT
//ANALYTIC TYPE PREPARE Standardize address data
This analytic script cleans and standardizes the address field in
preparation for duplicates analysis.
END
COMMENT
//ANALYTIC TYPE IMPORT Import transactional data
This analytic script imports data from the Excel file Trans_May.xls
and saves it to the new Analytics table "Trans_May_raw" (the raw data
table).
//FILE Trans_May.xls
//DATA Trans_May_raw
//RESULT LOG
END
Remarks
Using analytic script type and name to sequentially order
a series of scripts
You can use the TYPE and name parameters to sequentially order a series of analytic scripts in a
robot task.
Note
The TYPE and name parameters affect the ordering of analytic scripts only. They do
not affect auxiliary or helper scripts called using the DO SCRIPT command.
TYPE parameter Groups analytic scripts into separate areas in a task, in the following order:
o Import
o Preparation
o Analysis
name parameter Orders analytic scripts alphanumerically by name in a task, or in an area in a task
FILE tag
Specifies a non-Analytics file, such as an Excel file, or a delimited file, that provides input for an
analytic script running in Robots. The file must be located in the Input/Output tab in the same robot
as the analytic script.
Syntax
//FILE filename
<description>
Parameters
Name Description
filename The name of the file in the Input/Output tab in Robots to use as input for an analytic
script.
Note
The filename value must exactly match the name of the file in the
Input/Output tab. filename cannot include a path.
You can use wildcard characters in filename to assist with matching a
name.
You cannot use a variable for filename.
Wildcard characters
Wildcards are supported when specifying the file name. Use a single asterisk ( * ) to
substitute for zero or more consecutive characters.
For example:
o Inv12* matches all of the following: Inv12, Inv123, and Inv1234
o *.* matches all files of all extensions
Name Description
description Descriptive text about the non-Analytics file or other information. The description can be
multiline, but it cannot skip lines.
optional
The description appears in the analytic header only and is not visible to end users in
Robots.
Examples
Basic examples
Specifies a specific file:
//FILE FlaggedAccounts.csv
//FILE Flagged*.csv
//FILE *.*
Advanced examples
COMMENT
//ANALYTIC TYPE IMPORT employee_import
Remarks
To be used in a script, a non-Analytics file must first be imported into an Analytics table. Non-
Analytics files cannot be used directly in a script.
PARAM tag
Creates an input parameter for an analytic script, and defines the requirements for the input value.
An input parameter is a placeholder that allows the user to specify the actual value when scheduling
or running an analytic script.
Syntax
//PARAM variable_name type <OPTIONAL> <MULTI> <SEPARATOR value>
<QUALIFIER value> <VALUES value_list> label
<description>
Parameters
Name Description
variable_name The name of the variable that stores the input value(s) selected or specified by the user.
Use variable_name in the analytic script to reference the input value.
For example:
o v_start_date
o v_regions
o v_input_file
Note
When an analytic script is run, the variable is created only if the user
provides an input value. If a parameter is optional, and the user skips it,
the variable is not created.
If subsequent logic in the analytic script requires the variable to exist, you
can test for its existence, and if it does not exist, create it and initialize it.
For more information, see "Designing optional input parameters" on
page 2648.
Name Description
type The data type of the parameter, which controls what sort of input values can be entered.
The following types can be specified using uppercase letters:
o C – character data
o N – numeric data
o D – date subtype of datetime data
o DT – datetime subtype of datetime data
o T – time subtype of datetime data
o L – logical data
Note
Qualifying character input values is required for an analytic script to run
successfully.
OPTIONAL Specifies that the parameter is optional and the user does not need to enter a value.
optional For more information, see "Designing optional input parameters" on page 2648.
MULTI The user can select one or more values from a list of values.
VALUES
VALUES
For more information, see "Summary of the MULTI and VALUES options" on page 2649.
Multiple character input values
If you specify MULTI , and type is C (Character), you can also specify the SEPARATOR and
QUALIFIER options to automatically insert separators (delimiters) and text qualifiers in a
string of input values.
Note
Delimiting and qualifying multiple character input values is required for an
analytic script to run successfully. The separators and qualifiers can be
inserted automatically, or manually by the user.
SEPARATOR value SEPARATOR can be used only when MULTI is specified, and type is C (Character).
optional Specifies that a separator character is automatically inserted between multiple character
Name Description
input values, creating a delimited list that is passed to the analytic script for processing.
value specifies the separator character to use. A commonly used separator, or delimiter,
is the comma , .
If SEPARATOR is omitted, a single space is used as the separator by default. The space
character cannot be specified as value.
For more information, see "Delimiting and qualifying character input values" on
page 2650.
QUALIFIER value QUALIFIER can be used only when MULTI is specified, and type is C (Character).
optional Specifies that a text qualifier character is automatically inserted at the start and end of
each character input value in a delimited list that is passed to the analytic script for
processing. Any text enclosed within the qualifier characters is treated as plain text.
value specifies the qualifier character to use. A commonly used qualifier is the single
quotation mark ' .
If QUALIFIER is omitted, there is no default qualifier used. You cannot specify a space
character as value.
For more information, see "Delimiting and qualifying character input values" on
page 2650.
Note
Analytic input parameters currently do not support the use of the double
quotation mark (") as a text qualifier. You can use the single quotation
mark (') instead. Specifying a double quotation mark qualifier will cause
the PARAM tag to malfunction.
VALUES value_list A list of values that the user can select from when running the analytic script.
optional Use the following syntax to specify the values:
VALUES The user can select one or more values from the list of values.
MULTI
VALUES The user can select a single value from the list of values.
MULTI
For more information, see "Summary of the MULTI and VALUES options" on page 2649.
Format of values in value_list
Name Description
description Descriptive text that provides additional information about the parameter.
optional In Robots, description is displayed with the input field.
description can provide instructions that assist the user. For example, "Enter the cutoff
date for the payroll period".
description must be entered on the next line after the associated PARAM tag. The text can
be multiline, but it cannot skip lines. Line breaks are not preserved when displayed in
Robots.
Examples
Basic examples
Allows the user to optionally specify a date range:
Advanced examples
COMMENT
//ANALYTIC test_analytic
//PARAM v_min_amount N Minimum Amount
Enter a minimum amount
//PARAM v_max_amount N Maximum Amount
Enter a maximum amount
END
You need to classify the records in a table but you want to give the user the option to exclude
some customers from the analysis.
To do this, you provide an optional character parameter. Your script tests whether or not the
value is provided, and if so, those customer numbers are excluded from the classify
command:
COMMENT
//ANALYTIC test_analytic
//PARAM v_cust_no C OPTIONAL MULTI SEPARATOR , QUALIFIER ' Customer
Numbers to exclude (optional)
Specify one or more customer numbers. Press "Enter" after each num-
ber, so that each number is on a separate line. Do not enclose numbers
in quotation marks.
END
COMMENT
//ANALYTIC test
Remarks
Designing optional input parameters
If you use OPTIONAL with the PARAM tag, the variable associated with the input parameter may or may
not be created when the analytic script runs:
l variable automatically created – if the user specifies an input value
l variable not created – if the user skips the optional parameter and does not specify an input
value
Parameter
User input control (Robots) design MULTI VALUES
A single input
value manually
entered in a
field
One or more
input values
manually
entered in a
field
A single input
value selected
from a drop-
down list of
values
One or more
input values
selected from a
checklist of
values
Note
One or more of the methods may not be applicable, depending on how you are using
the MULTI and VALUES options.
Each input parameter must use only one of these methods.
Use SEPARATOR and Include the SEPARATOR and QUALIFIER options in the PARAM tag.
QUALIFIER
For example:
Tip
Use this method whenever possible. It is the least labor-intensive
1 and the least error-prone.
Manually specify Require the user of the analytic script to manually specify separators and
separators and qualifiers qualifiers in addition to the actual input values.
For example:
'North America','Europe','Asia'
Include qualifiers in the Include qualifiers with each value in the value_list specified with the VALUES
value_list option.
For example:
Enclose the parameter In the syntax of the Analytics script, enclose the parameter variable in text
variable in qualifiers qualifiers.
For example:
IF MATCH(REGIONS, "%v_regions%")
4 Use this method only if you are using VALUES without MULTI.
Note
Analytic input parameters currently do not support the use of the double quotation mark (") as
a text qualifier. You can use the single quotation mark (') instead with the QUALIFIER option,
in the value_list, or when manually specifying qualifiers around input values. Double
quotation marks can be used as text qualifiers in the body of an Analytics script.
PASSWORD tag
Creates a password input parameter for an analytic script. The parameter provides encrypted
storage of a password for subsequent use in an ACLScript command.
The user is prompted to specify the required password value when they schedule or start the
analytic script so that user intervention is not required as the analytic script is running.
Syntax
//PASSWORD identifier label
<description>
Parameters
Name Description
identifier The numerical identifier associated with the password. The value must be from 1 to 10.
label In Robots, the interface label that users see when prompted to enter the password. For
example, SAP Password:
description In Robots, descriptive text about the required password that users see. The description
can help the user enter the correct password.
optional
The description can be multiline, but it cannot skip lines. The description must be entered
on the line below the associated PASSWORD tag.
Examples
COMMENT
//ANALYTIC SAP Password Example
//PASSWORD 1 SAP Password:
//DATA RSADMIN
END
SET SAFETY OFF
RETRIEVE RSADMIN PASSWORD 1
OPEN RSADMIN
SET SAFETY ON
Note
The password input parameter and the password parameter in the
RETRIEVE command are linked by using the same numerical identifier:
COMMENT
//ANALYTIC HighBond Password Example
//PASSWORD 3 HighBond Password:
END
SET SAFETY OFF
OPEN AR_Exceptions
EXPORT FIELDS No Due Date Ref Amount Type ACLGRC PASSWORD 3 TO
"10926@us"
SET SAFETY ON
Remarks
Password storage and encryption
Password values are associated with individual users, and are encrypted at rest. Passwords remain
secure throughout analytic script processing, and are encrypted in any temporary files created in the
deployment environment.
Testing in Analytics
If you test an analytic script that has one or more PASSWORD tags in Analytics, Analytics automatically
generates a PASSWORD command and prompts you to enter the appropriate password. This auto-
generated command saves you the labor of inserting PASSWORD commands in the script portion
of an analytic script for the purposes of testing, and then removing them again before delivering the
analytic script to users.
The auto-generated PASSWORD command is saved in the log, without the password value.
Password values are not saved when you run an analytic script in Analytics, so you must specify the
password or passwords each time you run the analytic script, including running or stepping through
the analytic script from the cursor position.
TABLE tag
Defines an Analytics table that the user selects as input for an analytic script.
The TABLE tag can be followed by zero or more FIELD tags entered on sequential lines.
Note
The TABLE and FIELD tags require that an Analytics table pre-exists in the storage
location in order to be available to be selected. For more information, see "DATA
tag" on page 2667.
Use the TABLE and FIELD tags if you want to create variables that allow users to
specify different tables or fields for use with the same analytic script. If the script is
designed to always work with the same table and set of fields, with names that do
not change, you can hardcode the table and field names into the script and avoid
use of the TABLE and FIELD tags.
Syntax
//TABLE variable_name label
<description>
Parameters
Name Description
variable_name The name of the variable that stores the input table name selected by the user. Use
variable_name in the analytic script to reference the table.
Do not include any spaces in variable_name.
Do not use any of the following characters in variable_name. They are not supported:
label In Robots, the interface label that users see when prompted to select the table. For
example, Payments Table
description In Robots, descriptive text associated with the input field that users see. The description
can be multiline, but it cannot skip lines.
optional
The description can help the user select the correct table. For example, Select a table
that lists payments and includes a check number column.
The description must be entered on the line below the associated TABLE tag.
Examples
Basic examples
TABLE tag with description to help user select the correct input table:
Advanced examples
COMMENT
//ANALYTIC example_script
//TABLE v_table_payments Payments Table
Select a table that lists payments and includes a check number
column.
END
OPEN %v_table_payments%
AGE ON payment_date CUTOFF 20141231 INTERVAL 0,30,60,90,120,10000
SUBTOTAL Payment_Amount TO r_output
CLOSE %v_table_payments%
FIELD tag
Defines a field that the user selects as input for an analytic script.
The field must be part of the table defined in the preceding TABLE tag. The first FIELD tag must
immediately follow a TABLE tag, and can be followed by additional FIELD tags entered on sequential
lines.
Note
The TABLE and FIELD tags require that an Analytics table pre-exists in the storage
location in order to be available to be selected. For more information, see "DATA
tag" on page 2667.
Use the TABLE and FIELD tags if you want to create variables that allow users to
specify different tables or fields for use with the same analytic script. If the script is
designed to always work with the same table and set of fields, with names that do
not change, you can hardcode the table and field names into the script and avoid
use of the TABLE and FIELD tags.
Syntax
//FIELD variable_name type label
<description>
Parameters
Name Description
variable_name The name of the variable that stores the input field name selected by the user. Use
variable_name in the analytic script to reference the field.
Do not include any spaces in variable_name.
Do not use any of the following characters in variable_name. They are not supported:
type The types of fields that can be selected. Any type, or combination of types, from the
following list can be selected:
o C – character data
o N – numeric data
o D – date, datetime, or time subtype of datetime data
o L – logical data
Name Description
Any computed fields in a table can be selected regardless of the type specified.
label In Robots, the interface label that users see when prompted to select the field. For
example, Payment Date Field
description In Robots, descriptive text associated with the input field that users see. The description
can be multiline, but it cannot skip lines.
optional
The description can help the user select the correct field. For example, Select the
column that contains the check payment date.
The description must be entered on the line below the associated FIELD tag.
Examples
Basic examples
Specifies a character field:
Advanced Examples
COMMENT
//ANALYTIC test analytic
//TABLE v_table_payments Payments Table
Select a table that lists payments and includes a check number
column.
//FIELD v_check_num CN Check Number Field
OPEN %v_table_payments%
EXTRACT FIELDS %v_check_num%, %v_payment_date% TO t_analyze
RESULT tag
Specifies that the results output by an analytic script are available in Robots to end users.
Output results, even if they exist, are not automatically made available.
Note
If your organization uses an on-premise Robots Agent, specifying a RESULT tag may
upload data from the agent to the cloud-based Robots app in HighBond. For
information, see "Uploads to the cloud-based Robots app" on page 2664.
Syntax
//RESULT type name
<description>
Parameters
Name Description
Note
Do not use //RESULT LOG or //RESULT FILE if your organization uses an
on-premise Robots Agent and has disabled file uploads to Robots. For
more information, see "Uploads to the cloud-based Robots app" on
page 2664.
For more information about logs, see "How log files are output" on
page 2665.
Note
The name value must exactly match the name of the result item in the
analytic script. You are not naming an item with name, you are matching
a name specified in the script.
You can use wildcard characters in name to assist with matching a name
in the script.
You cannot use a variable for name.
Name Description
Table name
The name value specifies an Analytics table name. You must specify the table name, not
the source data file name.
Correct:
Incorrect:
Log name
Optional. The name value specifies an analytic log file name. If you do not specify name,
the default log name is used: analytic_name.log.
Note
If you specify a log name, SET LOG TO log_name must appear in the
script.
File name
The name value specifies a non-Analytics file name.
You must specify the appropriate file extension for the type of non-Analytics file being
output.
Correct:
Name Description
Incorrect:
Wildcard characters
Use one or more wildcard characters in name to assist with matching a table, log, or file
name in the script. Use a single asterisk ( * ) to substitute for zero or more consecutive
characters.
Patterns created by mixing wildcard and literal characters allow you to match all items of
a particular type (for example, *.xlsx ), or items where part of the name may change
based on a variable definition in the script.
description Descriptive text about the result or other information. The description can be multiline,
but it cannot skip lines.
optional
The description appears in the analytic header only and is not visible to end users in
Robots.
Examples
Basic examples
RESULT tag for an Analytics table:
//RESULT LOG
Advanced examples
Remarks
Uploads to the cloud-based Robots app
If your organization uses an on-premise Robots Agent, specifying a RESULT tag in an analytic header
may upload data from the agent to the cloud-based Robots app in HighBond. All data is encrypted in
transit, and when stored in Robots.
The Permitted file uploads configuration setting in Robots controls whether output results specified
by the RESULT tag are:
l uploaded to Robots
l restricted to being output locally on the server where the Robots Agent is installed
For more information about the configuration setting, see Configuring a Robots Agent.
//RESULT TABLE Analytics result table Analytics result tables Analytics result table
layouts only are uploaded (layout and data) are layouts only are uploaded
(field name, data type, field uploaded (field name, data type, field
length) length)
Result table data remains Result table data remains
on the server in your on the server in your
network network
//RESULT LOG Analytics log files, for both Analytics log files, for both Do not specify, causes an
successful and failed successful and failed analytic script to fail
tasks, are uploaded tasks, are uploaded
//RESULT FILE Non-Analytics result files Non-Analytics result files Do not specify, causes an
(such as Excel) are (such as Excel) are analytic script to fail
uploaded uploaded
log file uploaded to cloud-based Robots app, unless log file output to cloud-based Robots app
Permitted file uploads setting = "File uploads not o RESULT LOG not specified
permitted"
no log file
o RESULT LOG not specified
no log file
o RESULT LOG tag not considered o RESULT LOG tag not considered
log file automatically uploaded to cloud-based Robots log file automatically output to cloud-based Robots
DATA tag
Specifies that an Analytics table output by an analytic script is copied to a central data storage
location in Robots.
Typically, you store Analytics tables so that they can be used as input tables for subsequent analytic
scripts.
Note
Storing Analytics tables in a central data storage location is supported by
ACL Robotics with an on-premise Robots Agent only. This capability is not available
if you are using a cloud-based Robots Agent. The DATA tag is ignored in analytic
scripts run with a cloud-based agent.
Syntax
//DATA table_name
<description>
Parameters
Name Description
Note
The table_name value must exactly match the name of the Analytics
output table in the analytic script. You are not naming a table with table_
name, you are matching a table name specified in the script.
You can use wildcard characters in table_name to assist with matching a
table name in the script.
You cannot use a variable for table_name.
You must specify the table name, not the source data file name.
Correct:
//DATA Missing_Checks
Incorrect:
Name Description
//DATA Missing_Checks.fil
Note
If an existing Analytics table in the data subfolder has the same name as
the value you specify, the existing table is overwritten.
Wildcard characters
You can use wildcard characters in table_name if part of the table name may change. For
example, if the table name depends on the month (invoices-jan, invoices-feb, and so
on), specifying invoices-* ensures that the table is copied to the data subfolder
regardless of the month suffix.
You can specify a single wildcard character to copy all Analytics output tables in the
analytic script to the data subfolder:
//DATA *
Caution
Be careful when using wildcards characters. You may unintentionally
overwrite existing data tables if the wildcard pattern that you specify
matches unintended tables.
As a best practice, make the value of table_name as specific as possible.
Use wildcard characters only where they are required.
Uploads to Robots
For information about uploads to Robots, see "Uploads to the cloud-based Robots app"
on page 2671.
description Descriptive text about the output table or other information. The description can be
multiline, but it cannot skip lines.
optional
The description appears in the analytic header only and is not visible to end users in
Robots.
Examples
The following analytic header specifies that the Invoices table, which is output in the
associated script, is copied to the storage location:
COMMENT
//ANALYTIC Import Table
//DATA Invoices
END
IMPORT DELIMITED TO Invoices "Invoices.fil" FROM "Invoices.csv" 0
SEPARATOR "," QUALIFIER '"' CONSECUTIVE STARTLINE 1 KEEPTITLE ALLCHAR
ALLFIELDS
Remarks
Storing output tables
Output tables are not automatically copied to the storage location. You must use a DATA tag for each
table that you want to store. You can include multiple DATA tags in an analytic header if necessary.
Note
If an entire data analysis process is completed using a single analytic script, use of
the DATA tag is not required.
The DATA tag is not intended to be used for specifying result tables. Use the
RESULT tag instead. For more information, see "RESULT tag" on page 2660.
Deployment envir-
onment Use the DATA tag if... Do not need the DATA tag if...
Robots o an Analytics table output in one robot task o an Analytics table is output and
is required as input in another robot task subsequently input during a sequence of
(Enterprise Edition
analytic scripts run in a single robot task
only) o an entire data analysis process is
completed using a single analytic script
//DATA src_Invoices
You must add the prefix to the table name in both the DATA tag and in the accompanying script.
The Source tables section allows you to visually separate tables that provide input for subsequent
scripts. If no output table names have the src_ prefix, the Source tables section does not appear in
the Input/Output tab and all tables are located by default in the Other tables section.
What is Unicode?
Unicode is a standard for encoding text that uses two or more bytes to represent each character,
and characters for all languages are contained in a single character set. The Unicode editions of
Diligent products allow you to view and work with files and databases that contain Unicode-encoded
data in all modern languages.
Note
Analytics and the Robots Agent support little-endian (LE) encoded Unicode data.
These products cannot be used to analyze big-endian (BE) encoded data.
Non-Unicode
Unicode
Conversion Functions
l PACKED( )
l STRING( )
l UNSIGNED( )
l VALUE( )
l ZONED( )
String functions
l AT( )
l BLANKS( )
l INSERT( )
l LAST( )
l LENGTH( )
l REPEAT( )
l SUBSTRING( )
Miscellaneous functions
l FILESIZE( )
l LEADING( )
l OFFSET( )
l RECLEN( )
1000 No preferences file (*.prf) was found. A new default preferences file was created.
1001 The preferences file (*.prf) is missing some required information. A new default preferences file was
created.
1002 The scripting engine cannot start because no preferences file (*.prf) was found and a new default
Error
Code Description
preferences file cannot be created because the necessary folder permissions do not exist.
1003 The project has been upgraded from an earlier version. A copy was saved with a .old extension.
1004 The project file could not be processed. The last saved project was used.
1009 The specified .old project file cannot be used. You must specify a project file with the .ACL extension.
1018 Data could not be saved to the working directory because it does not have write permissions.
Command errors
The table below lists the error codes that are returned when an analytic script fails because of an
invalid ACLScript command. The error code number returned identifies the command that failed.
1 SAMPLE
2 EXTRACT
3 LIST
4 TOTAL
5 DEFINE
6 COMMENT
7 QUIT
8 STOP
9 BYE
10 USE
11 OPEN
12 SAVE
13 DISPLAY
14 ACTIVATE
15 CLOSE
16 HELP
17 COUNT
18 STATISTICS
19 HISTOGRAM
20 STRATIFY
21 SUMMARIZE
22 EXPLAIN
23 GROUP
24 ELSE
25 END
26 CANCEL
27 SUBMIT
28 DELETE
29 RANDOM
30 SORT
31 FIND
32 DIRECTORY
33 TYPE
34 DUMP
35 INDEX
37 SET
40 DO
41 TOP
42 EXPORT
43 VERIFY
44 SEEK
45 JOIN
46 MERGE
47 SEQUENCE
48 CALCULATE
49 PRINT
50 LOCATE
51 RENAME
54 COPY
55 REPORT
56 EJECT
58 LET
59 ACCUMULATE
63 ACCEPT
64 ASSIGN
65 AGE
66 CLASSIFY
67 PROFILE
68 DO REPORT
69 LOOP
70 PAUSE
71 SIZE
72 EVALUATE
73 DIALOG
74 IF
75 GAPS
76 DUPS
77 SQLOPEN
78 PASSWORD
79 IMPORT
80 REFRESH
81 NOTIFY
82 CONNECT
83 RETRIEVE
84 FIELDSHIFT
85 BENFORD
86 CROSSTAB
87 (not used)
88 ESCAPE
89 NOTES
90 FUZZY DUPLICATE
91 EXECUTE
92 ACCESSDATA32
93 ACCESSDATA64
94 APPEND
95 RCOMMAND
96 CVSPREPARE
97 CVSSAMPLE
98 CVSEVALUATE
99 OUTLIER
100 FUZZYJOIN
101 CLUSTER
102 TRAIN
103 PREDICT
Error
Code Error message
-10 The analytic results could not be saved because the destination results folder was deleted after the
analytic started running.
-23 Publish failed. One or more of the table's column names are too long.
-24 Publish failed. Invalid values within data cells within an Analytics table.
-25 Publish failed. Not supported data types within table fields.
-27 Job did not run. The user was removed or does not have permission.
-28 Job did not run. Unexpected error. See the server log and Analytics log for details.
-29 Could not copy data files. The analytic failed because the required data files could not be copied to the jobs
directory.
-31 Publish failed. The exception mapping file could not be located.
Error
Code Error message
-34 Failed to store job results. Check that there is sufficient space on the drive storing the jobs folder and that
no data files are locked.
Analytics 16.1 Run the version 16.1.1 installer Analytics upgraded to version 16.1.1
(ACLforWindows1611.exe)
Analytics 16.0 Run the version 16.1.1 installer Analytics upgraded to version 16.1.1
(ACLforWindows1611.exe)
ACL Analytics or ACL Desktop Run the version 16.1.1 installer Analytics 16.1.1 installed side by
earlier than 16.0 (ACLforWindows1611.exe) side with the earlier version
No upgrade is involved. You have
the option of leaving the previous
version of Analytics or ACL Desktop
installed, or you can uninstall it.
Note
When you install or upgrade ACL for Windows, any existing Analytics sample data
files are overwritten if they are in the Analytics working directory that you specify
during the installation or upgrade.
If you have made changes to any of the sample projects or data files that you want to
keep, save the files elsewhere before installing or upgrading, or rename the folder
containing them. Do the same with the associated command log files if you want to
preserve them.
Tip
The securit