-
In Data Perspective Studio, create a parameter to inject expressions into your data query.
-
From the top bar, click $ Input parameters.
-
In the Parameters panel, click to add a Parameter.
-
Give a name to the parameter. For example,
myparameter.
-
For Return type, select the return type of the input
parameter.
The return type is the type that comes out of the expression. If the expression
takes a string and an integer as input, and processes data to calculate another
integer, then the return type must be Integer. If the expression
calculates a string, the return type must be String.
-
For Default value, define the same type as the
Return type.
-
Select DataQuery parameter, to make the input parameter
available in data queries.
There is a correlation between the input parameters arguments and the expression
arguments. For example, if you create an arg1 argument, of type
String, you can use it in your expression by entering
arg1 directly. It also works the other way round. If you define an
expression using a variable part (for example, "a+b"), you can create the
corresponding arguments in the input parameter (for example, arguments
"a" and "b").
-
Add an operator to the data query. For example, add a FILTER
operator.
-
Select an Index unit.
-
In Variable, select an index unit class, and specify the
name of the variable that you will use in the Expression
field.
-
In the operator, configure an Expression calling the input
parameter.
-
In Expression, click .
-
In the Expression Editor, enter an expression. For example,
you can enter an expression so that
input.age must be higher than the
result of your expression.

-
Add a RESULT SET operator at the end of the data query and test
your configuration.
-
Click
Run.
-
In the Params field, you can see the input parameter.
-
Enter an expression and verify its result in the right panel.
-
In Data Factory Studio, create a field of type
Text in your Semantic Graph Index to contain the expression.
You might need to "escape" the expression. For example, enter the following string in
your index unit: a===\"Paris\" to run an expression like
a==="Paris" in Data Perspective Studio.
-
In Data Perspective Studio, create an
Expression variable.
-
From the navigation menu, select .
-
Click
Add variable.
-
In Name, enter the variable name. For example,
myvar.
-
In Type, select
Expression and whether it must be mono-valued or multivalued.
-
Enter either an Initial value if your variable has a single
value, or several Initial values if your variable has multiple
values.
-
Add a Set variable effect.
-
From the navigation menu, select .
-
Under On Perspective access, click to add a new effect.
-
Select the Set variable effect.
-
From Information source, select a data query and a result set. Then select the
field from which the Data Perspective will retrieve the first value.
-
From Target studio variable, select the
Expression variable defined in the previous step.
|