/    /  Amazon QuickSight – Round

Amazon QuickSight – Round

 

The round function in Amazon QuickSight rounds a decimal number to a specified number of decimal places.

 

Syntax

#Start#
round(decimal, scale)
#End#

 

This function takes two arguments:

 

  • decimal (required): the decimal number to round.
  • scale (required): the number of decimal places to round to.

 

 

Suppose you have a dataset containing a field with decimal numbers that you want to round to 2 decimal places.

 

Assume the following dataset:

 

ItemPrice
Apple1.2345
Banana2.3456
Orange3.4567
Pear4.5678

 

To round the Price field to 2 decimal places, you can use the round function:

  • Select the dataset that you want to create a calculated field for.
  • Click on the “Add field” button.
  • Enter the following expression:

 

Example

 

#Start#
round({Price}, 2)
#End#

 

This expression rounds the Price field to 2 decimal places. The resulting calculated field will contain the rounded decimal values.

 

  • Click “Create field” to create the calculated field.

 

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

 

ItemPriceRounded Price
Apple1.23451.23
Banana2.34562.35
Orange3.45673.46
Pear4.56784.57

 

Note that the “Rounded Price” column is a calculated field, and the values are not stored in the original dataset. The round function uses the half-up rounding method, which rounds numbers up if the next digit is 5 or greater, and rounds down otherwise.