It is a relatively common requirement to want to manipulate data into a slightly different format than that in which it's stored e.g. Create a report based on the first 2 characters of a postcode to perform geographical analysis.

This forum article explains how to manipulate data using the Calculated Column's Formula builder functionality:

 

LEFT & RIGHT Operators

Allows you to select a specified number of characters from the left or right of a field, such as the first 2 characters of a Postcode.  

Syntax: LEFT or RIGHT (field_name, [number of characters] )

Example: LEFT(main_postcode_or_zipcode, 2)

This example shows two calculated columns.  LEFT has been used to select only the first two characters of the postcode.  COUNT has been used to tally the records.


Note: The MID operator is very similar, but rather than picking from the right or left of a field you specify where to start and the number of characters e.g. MID(name, 3, 2).  This will return the 4th and 5th characters of a field.

 

 

CONCAT Operator

Allows you to join/concatenate two or more fields, such as Company Name and Town/City into the same field to output data in a single column e.g. Speedy Cabs (Reading)

Tip: Although joining 2 or more fields is simple you are likely to want to separate text with a spacing character, hyphen, or enclose in brackets.  To achieve this simple enclose the character in single quotes e.g. ' ' will output a space, '(' will output a bracket.

Syntax: CONCAT (field_name_1, ' ', field_name_1)

Example 1: CONCAT (name, ' ', main_town_or_city) 

Example 2: CONCAT (name, ' (', main_town_or_city, ')'  ) 

 

 

Reply