Skip to content

MID

The MID function extracts a specified number of characters from a text string, starting at a specified position.

Applicable to

Calculated Columns

Return Value

  • The MID function returns a text string containing the specified number of characters from the input text string, starting at the specified position.
  • If start number is greater than the length of text, the function returns an empty string.
  • If number character is greater than the number of characters remaining after the start position, the function returns all remaining characters.

Remark

  • If start number is less than 1, the function returns an empty string.
  • If number character is less than 1, the function returns an empty string.
  • If text is a NULL value, the function returns NULL.
  • The first character in the text string starts at position 0.
  • MID function is applicable only for text values

Syntax

MID(<expression>,chars, start)

MID in Calculated Columns

ExpressionA placeholder in a function that is replaced with the actual widget and measure names.
Column NameThe name of the column in the dataset or Datasource that contains the values you want to analyze.
CharsNumber of characters to extract from the text string
StartStart position of characters to extract from the text string.

Steps to Use MID Function

  1. Write the MID function. For instance MID(<expression>,chars,start)
  2. Replace <expression> with VALUE([Column Name]) and replace number with the starting position from which to extract characters and the number of characters to extract from the text string.
  3. Replace the Column Name with the actual name of your column required.
  4. To learn how to add calculated columns in Infoveave, visit the section Calculated Columns.

Objective Consider that you have the below dataset, your goal is shortening the product description.

PRODUCT IDPRODUCT NAMEDESCRIPTION
1Apple iPhone 13The latest iPhone model from Apple.
2Samsung Galaxy S21Samsung’s flagship smartphone.
3Google Pixel 6Google’s premium Android smartphone.

You can use the MID function like

MID(VALUE([DESCRIPTION]), 0,10)

The new calculated column “Short Description” will return

PRODUCT IDPRODUCT NAMEDESCRIPTIONSHORT DESCRIPTION
1Apple iPhone 13The latest iPhone model from Apple.The latest
2Samsung Galaxy S21Samsung’s flagship smartphone.Samsung’s
3Google Pixel 6Google’s premium Android smartphone.Google’s p