Data functions that perform different types of calculations can be
created using the installed Spotfire client. If the data function is saved in
the library, anyone with authoring licenses plus the
Execute Data Functions license feature (under
Spotfire Advanced Analytics) can use the data function when creating an
analysis. Consumer users can benefit from the results of the calculations when
interacting with the finished analysis.
Before you begin
Data function
definitions have been created using the installed Spotfire client and saved in
the library.
Procedure
-
On the authoring bar, click
f(x) or
Files and data.
If you cannot see any data functions in the f(x) flyout, you can
select and pin data functions from the library yourself, provided that you have
the required licenses. See
Pinning data functions to the f(x) flyout.
-
Use search to find a specific data function. Note that search in
the
f(x) flyout will only search among the pinned
data functions in that flyout; you must either start in the
Files and data flyout or use the menu in the
search field and select
Find items in the library to actually search
the library.
Tip: When clicking
Files and data
![](../../images/data_files_and_data_i.png)
, you can find all data
functions in the library by entering type:datafunction in the search field, and
limit further by typing a part of the name. See
Searching the Library
for more details.
-
Click on the data function in the
f(x) flyout, or double-click on the data
function in the
Files and data flyout, to run it directly.
Note: Some data
functions require that you already have some data in the analysis to be able to
run. Others might work best if you have a specific type of visualization
available, etc.
You can view more information about the data function before you
run it by clicking on the menu next to it in the list and selecting
View details.
-
If the data function needs some configuration, the flyout will
show a list of the information you should provide. Click on each item to expand
and make the selections needed.
Tip: If there are many inputs in your selected data
function, and only some of them are required, you can click
Always show required inputs first to move
optional inputs to the end of the list and hide them.
It is the author of the data function that determines what the
data function will do and what it needs to be able to perform its function. In
some cases, you might need to select a data table, in others, you would type a
value, or select one or
more columns. You must provide all required options to be
able to continue, but you might also be able to provide optional
configurations, such as threshold values or similar.
-
Determine whether updates to the data function results should be
manual or automatic whenever input settings are changed, using the
Refresh function automatically check box.
-
Click
OK when you are done.
-
If the results from the data function can be added to the analysis
in several different ways, the summary view is shown in the flyout and you will
get the option to determine
how to add your new data.
Depending on the type of data function, and how the author has
configured it, you might be able to add the data as a new data table, as rows
or columns added to an existing data table, as calculated columns, or, for
single values, as a document-, column- or data table property value. If there
are multiple outputs, you can exclude some, but not all, of them.
-
Click
OK when you are done.
Results
The data function is
executed.
Depending on the type of data function and what the results are, the
analysis will be updated and ready to be opened by Consumer users once it has
been saved in the library.
Tip: When a data function instance has been added to an
analysis, and the outputs are columns or rows used in a visualization, you can
tweak your input values directly from the
visualization, and quickly try out different input values. Even more editing
options are available when looking at
Data functions in the Data canvas.