Enter or Edit Expressions

Arcadia Instant provides you with an option to manually adjust expressions that modify the field values of the visual, the Enter /Edit Expression interface.

Examine some usage examples: Simple Alias expression and CASE expression.

Developer Notes:
  • Ensure that column names in the expressions are bracketed, like this: [field].
  • When manually editing expressions, you can apply changes that are equivalent to all transformation described in Customizing Field Properties, except those covered by Order and Top K and Display Format. Entering these changes causes an error.

To set the customize expressions, follow these steps.

  1. Click on the field you plan to modify, to open the Field Properties menu.
  2. Under Field Properties, click the [] Enter/Edit Expression option to open the Expression Editor.

    opening the expression editor
  3. In the Enter/Edit Expression editor, change the expression.

    See Simple Alias expression and CASE expression for demonstration of some of the varied expressions you can build using the expression editor.

    1. Expression Text: Enter/modify the expression directly in the text field.
    2. Autocomplete: Click this field to turn expression autocomplete on or off.
    3. Functions: By default, all available functions show. Scroll down to find a specific function, and click it to add it to the Expression Text field. Note the location of the cursor.

      Alternatively, click the All Functions menu to see the function groupings and select the functions from these. Available expression groupings include Aggregate, Conditional, Mathematical, Miscellaneous, String, Filter, and Date and Time.

      Note that different connections have their own SQL syntax, and therefore a different catalog of functions.

    4. All Fields: By default, all available fields show. Scroll down to find a specific field, and click it to add it to the Expression Text field. Note the location of the cursor.

      Alternatively, click the All Fields menu to see the Measures and Dimensions groupings, and select the fields from these.

    5. Validate Expression: Validate the expression that you build.
  4. Click Save.
  5. Click Refresh Visual.

Simple Alias expression

You can add an alias to the expression simply by typing it in the text field:

sum([population]) as 'Population'

Remember to Validate Expression, and click Save.

After clicking Refresh Visual, you will see a change similar to the one in the following image:

CASE expression

You can add a CASE expression to categorize the values, by selecting CASE in the functions area, and using autocomplete. The expression in this example follows; if you paste it into the editor, remove hard line returns:

CASE WHEN sum([population])<1000000 THEN 'very low' 
  WHEN (sum([population])<10000000 and sum([population])>=1000000) THEN 'low' 
  WHEN (sum([population])<20000000 and sum([population])>=30000000) THEN 'medium' 
  WHEN (sum([population])<40000000 and sum([population])>=30000000) THEN 'high' 
  ELSE 'very high' 
END 
as 'Population'

Remember to validate the expression and click Save.

After clicking Refresh Visual, you will see a change similar to the one in the following image: