REFRESH command

Concept Information

Updating data in Analytics tables

Updates the data in an Analytics table from its associated data source.

Syntax

REFRESH <table_name> <PASSWORD num>

Parameters

Name Description

table_name

optional

The name of the Analytics table to refresh. If you do not specify a table_name, the open table is refreshed.

PASSWORD num

optional

The password definition to use.

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, PASSWORD 2 specifies that password #2 is used.

For more information about supplying or setting passwords, see:

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

Refreshing a table with no password required

If a password is not required for the data source, just specify the REFRESH command and the name of the Analytics table to refresh.

REFRESH Invoices

Refreshing a table with a password in an interactive script

If you are creating an interactive script, you can prompt the user for the password:

PASSWORD 1 "Enter your password:"
REFRESH Invoices PASSWORD 1

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

Refreshing a table with a password in a non-interactive script

You can set the password in a script if you do not want to prompt the user for the value:

SET PASSWORD 1 TO "password"
REFRESH Invoices PASSWORD 1

The disadvantage of this method is that the password appears as clear text in the script.

Refreshing a table with a password in an AX Server analytic

If you are creating an AX Server analytic, you can prompt the user for the password when the analytic is scheduled, or run ad-hoc:

COMMENT
//ANALYTIC Refresh Table
//PASSWORD 1 "Enter your password:"
END
REFRESH Invoices PASSWORD 1

Remarks

For more information about how this command works, see Updating data in Analytics tables.

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.

REFRESH updates table content only

The REFRESH command updates only the content of existing fields in an Analytics table. It cannot update an Analytics table layout.

You cannot use REFRESH if the structure of the source data has changed – for example, if fields have been added or removed. You must re-import the data.

Data sources that support refreshing

You can use the REFRESH command to update the content of an Analytics table created using any of the following commands:

  • IMPORT ACCESS
  • IMPORT DELIMITED
  • IMPORT EXCEL
  • IMPORT ODBC (legacy ODBC command)
  • IMPORT PDF
  • IMPORT PRINT
  • IMPORT SAP
  • IMPORT XBRL
  • IMPORT XML
  • ACCESSDATA (ODBC data sources)

REFRESH and ACCESSDATA

The following guidelines apply when refreshing a table imported from an ODBC data source using the ACCESSDATA command.

  • Open table 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.
  • Analytics 12 Tables that were imported using the ACCESSDATA command 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.

REFRESH and passwords

You can use the REFRESH command with password-protected data sources that exist in a database, or in a cloud data service.

You cannot use the REFRESH command with password-protected file-based data sources, such as Excel files. The one exception is password-protected PDFs.

REFRESH and the Analysis App window

Do not use the REFRESH command in scripts that you intend to run in the Analysis App window.

Depending on how a table is imported, refreshing the data in the table is either not supported, or produces unpredictable results, if attempted in the Analysis App window.

If you want to refresh data as part of a script run in the Analysis App window, use either an IMPORT command, or the ACCESSDATA command, and overwrite the table.