Using Informer Calculated Columns

From Informer 4 Wiki

Jump to: navigation, search

To add a calculated column, click Add Calculations in the Edit Columns menu bar. This pops the Add Calculation dialog allowing you to create a new calculated column for your report which are evaluated when the report is run. There are two types of calculated columns you can create:

Using Templates

Concatinating first name and last name
If you have two columns in your report, one for first names, and one for last names. You can add a template calculated column to combine first name and last name into one field. Click Add Calculations then drag the column header for first name into the text area, add a space, then drag the column header for last name into the text area. You should now have an expression that looks like this:

  ${first_name} ${last_name}

Click "Add Calculation" and you now have one column that has both first and last names.

Using Scripts

Switch Statement
The following is an example of using a Javascript switch statement inside a script calculated column:

  var state = 1;
  switch (state) {
  case 0:
     "The state = 0"
     break;
  case 1:
     "The state = 1"
     break;
  case 2:
     "The state = 2"
     break;
  }


First Value of a Multi-value Field
The following is an example of using a Javascript statement to pull the first value of a multi-vaule field:

  alias[0];

Note: the word "alias" needs to be replaced with the alias of your multi-value field.


Last Value of a Multi-value Field
The following is an example of using a Javascript statement to pull the last value of a multi-vaule field:

  alias[alias.length - 1];

Note: the word "alias" needs to be replaced with the alias of your multi-value field.

Personal tools