Site icon i2tutorials

Amazon QuickSight – Rtrim

Amazon QuickSight – Rtrim

 

The ‘rtrim’ function in Amazon QuickSight removes all trailing spaces from the right side of a string expression.

 

Syntax

#Start#
rtrim(expression)
#End#

 

This function takes one argument:

 

 

Suppose you have a dataset containing a field with strings that have trailing spaces that you want to remove.

 

Assume the following dataset:

 

ItemDescription
AppleFresh apples
BananaRipe bananas
OrangeSweet oranges
PearJuicy pears
PeachDelicious peaches
MangoJuicy mangoes
KiwiTangy kiwis

 

To remove the trailing spaces from the Description field, you can use the rtrim function:

 

 

Example

#Start#
rtrim({Description})
#End#

 

This expression removes all trailing spaces from the Description field. The resulting calculated field will contain the trimmed strings.

 

 

After creating this calculated field, you can use the trimmed strings for visualizations and analysis. In this example, the calculated field would have the following values:

 

ItemDescriptionTrimmed Description
AppleFresh applesFresh apples
BananaRipe bananasRipe bananas
OrangeSweet orangesSweet oranges
PearJuicy pearsJuicy pears
PeachDelicious peachesDelicious peaches
MangoJuicy mangoesJuicy mangoes
KiwiTangy kiwisTangy kiwis

 

Note that the “Trimmed Description” column is a calculated field, and the values are not stored in the original dataset.

 

Exit mobile version