Adding New Columns with Custom Logic (Expression/Script)

Parent Previous Next

Adding New Columns with Custom Logic (Expression/Script)


Apart from columns existing in the source, new columns can also be added in the target dataset with specific calculations or logic. These calculations can be defined in form of single-line expressions or scripts (only JavaScript is supported). IDEAL-ANALYTICS [IA] provides an integrated development environment or editor for writing your own expression/script. This editor will be available if you click on the icon located at the top-right corner of the Data-set configuration interface. The expression/script editor looks like below:



This interface has three sections:

  1. Calculated column definition or expression explorer section (left most section)
  2. Expression/script editor section (middle section)
  3. Variable/function suggestion section (right most section)


To add a new calculated column to your target dataset requires adding a new expression/script first and associating the same with the calculated column you want to define.


You have to click on the icon to add a new expression/script. It will open a form which you have to submit with expression/script name and its type (Expression/Script).


Here, the difference between expression and script is very important. If your logic involves complex calculations that cannot be expressed in a valid single-line expression, then you should go for scripts (JavaScript) where you can write valid JavaScript codes with functions, multiline control statements, and loops and so on.



Once you add a new expression/script, it will be displayed in the left panel explorer under “Expressions/Scripts” folder and it will also be available for editing in the editor section (middle panel) of the interface.


IDEAL-ANALYTICS [IA] provides support in writing expressions with built-in functions and included columns to be used in your expression body. This support is available in the right-most section of the interface. Double-click on any function/variable in this section to append it in the cursor position in the expression kept open in the editor section. This help/support is not available or applicable for scripts. There is no option for compile or validate your expression/script before saving. Therefore be careful about writing expression/scripts otherwise any error (compile-time/runtime) will result in errors and affect the data-loading process.

After writing your expression/script, click on the button at the top to save it. Thus expressions/scripts get created in IDEAL-ANALYTICS [IA]. You can write as many expressions/scripts as you wish and some (or even all) of them may be kept unused.


Now it is the time for you to create new calculated column with your expressions/scripts.

Select the “Column Definition” section in the left-most panel and fill-up the form with all required configuration for that column. Click the “Save” button to add this new customized column in your target dataset.

Created with the Personal Edition of HelpNDoc: Full featured Help generator