Skip to content

REPLACE

The REPLACE function in Infoveave replaces a specified number of characters in a text string with another text string, starting from a specified position.

Applicable to

Calculated Columns

Return Value

  • The REPLACE function returns a new text string where characters starting from the start position in the text are replaced with the replace text string.
  • If chars are greater than the remaining characters in text starting from start, the function replaces all remaining characters.

Remark

  • The REPLACE function is case-sensitive.
  • If start is greater than the total length of text, the replaced word will be added to the end of the text.
  • If char is greater than the length of text, the whole text will be replaced by the replace text.
  • If char is 0, the replace word will be added to the text at the defined position.
  • The REPLACE function replaces NULL with the replace text.

Syntax

REPLACE(<expression>,start, chars, replace)

REPLACE in Calculated Columns

ParameterDescription
ExpressionA placeholder in a function that is replaced with the actual column name.
Column NameThe name of the column in the dataset or Datasource that contains the values you want to analyze.
StartThe starting position from which to replace characters.
CharThe number of characters to replace.
ReplaceThe text string that will replace the specified number of characters starting from the start position in the text.

Steps to Use

  1. Write the REPLACE function. For instance REPLACE(<expression>,start, chars, replace)
  2. Replace the Column Name with the actual name of your column required.
  3. To learn how to add calculated columns in Infoveave, visit the section Calculated Columns.

Example You can use the REPLACE function to replace the first two characters of the text from the [COUNTRY] column with “IN”, as

REPLACE(VALUE([COUNTRY]), 1, 2, "IN")