Site icon i2tutorials

Amazon QuickSight – parseDecimal

Amazon QuickSight – parseDecimal

 

The parseDecimal function in Amazon QuickSight converts a string to a decimal number.

 

Syntax

#Start#
parseDecimal(expression)
#End#

 

This function takes one argument:

 

 

 

Suppose you have a dataset containing prices in string format, such as ‘10.99’ or ‘$5.00’. However, QuickSight does not recognize these strings as decimal numbers, so you need to convert them using the parseDecimal function.

 

Assume the following dataset:

ItemPrice
Apple0.99
Banana$1.25
Orange$0.89
Pear1.50

 

To convert the Price field to a decimal number, you can use the parseDecimal function:

Example

 

#Start#
parseDecimal({Price})
#End#

This expression converts the Price field to a decimal number. The resulting calculated field will be a decimal number that QuickSight can recognize and use for visualizations and analysis.

 

 

After creating this calculated field, the Price field will be recognized as a decimal number, and you can use it for visualizations and analysis. In this example, the calculated field would have the following values:

ItemPrice
Apple0.99
Banana1.25
Orange0.89
Pear1.50

 

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

 

Exit mobile version