Qlik script processor
Creates or transforms inputs using Qlik script.
The Qlik script processor allows you to directly enter Qlik script in a text editor to prepare data, or load data when used as input. Aimed at more advanced users, you can benefit from the whole Qlik syntax if you prefer coding certain operations manually when manipulating tables.
Usage
-
In order to use the Script processor in a data flow, the code that you add in the editor must be consistent with the schema of the incoming data, and the preparation actions that have been performed until this point. Also, the script needs to follow certain rules:
-
The script must contain a resident statement to use the table coming from the input flow.
resident tablename
For more information, see Load.
-
You need to include a NoConcatenate statement.
NoConcatenate LOAD A,B
For more information, see NoConcatenate.
-
After adding the script for the specific operation you want to perform, you must include a drop table statement at the end to drop the incoming table and keep only the generated output.
drop table tablename
For more information, see Drop table.
- When using the processor as input node, you can have a maximum of two output flows, to load two different tables.
- When using the processor as intermediary node, you can have multiple input flows and a maximum of two output flows.
Properties
Property | Configuration |
---|---|
Script |
Enter your Qlik script in the text editor that includes the following placeholder with the required statements. NoConcatenate Load * Resident [name of input table]; Drop Table [name of input table];
The names of your input tables are listed above the script editor. They correspond to the inputs connected to the processor. |
To rename the processor or edit its description, click the Edit icon next to the processor name in the Properties panel.
Examples
-
Create an inline table with editable data as input for your flow:
MyTable: Load * Inline [ Country, Year, Sales Argentina, 2014, 66295.03 Argentina, 2015, 140037.89 Austria, 2014, 54166.09 Austria, 205,182739.87 ];
For more inforamtion, see Using inline loads to load data.
-
Add a new field to your data:
NoConcatenate Load *, 1 as newfield
Resident [name of input table];
Drop Table [name of input table];[MyOutputTable]:
For more examples of script expressions, see Regular statements and Script and chart functions.