How to edit unwanted characters from a column?

How to edit unwanted characters from a column?

book

Article ID: KB0083487

calendar_today

Updated On:

Products Versions
Spotfire Analyst All Versions

Description

You have a data column that has standard text, then an ID number. You only want to display the ID number:

Data stored:  "ID-2345"

Desired data: "2345"

 

Issue/Introduction

How to edit unwanted characters from a column.

Resolution

You can trim the characters by using the Right() and Len() functions in a calculated column or custom expression.

Right([columnA], Len([columnA]) - 3)

In this example, the number 3 is the number of characters you want to remove, "ID-".

Len(Arg1) 
Returns the length of Arg1. Arg1 is of type string and the result is of type integer.

Right(Arg1, Arg2) 
Returns the last Arg2 characters of the string Arg1. Arg1 and the result are of type string. Arg2 is of type real, but only the integer part is used. If Arg2 > the length of Arg1, the whole string is returned. If Arg2 is negative, an error is returned.