知識庫

How to Round Up Numbers At Decimal Points in Tableau Desktop


發佈時間 : 04 Feb 2022
上次修改日期 : 05 Feb 2022

問題

How can I display the numbers rounded up after a certain decimal point?
When the result of multiplication results in a decimal point, how to display it by truncating.

Example: 
$3456.15  → 3457  OR  $3456.15  → 3456.2
$3456.87  → 3457  OR  $3456.87  → 3456.9

環境

  • Tableau Desktop

答案

Create the following calculations to round up the numbers after a certain decimal point in Tableau Desktop.

Without Parameter (Not able to specify the decimal point):
  • Round up to the whole number: CEILING(SUM([Quantity])) 
  • Round up with decimal point: CEILING(SUM([Quantity (copy)])*10)/10
With Parameter (Able to specify the decimal point):
  • CEILING(SUM([Quantity])*[Number])/*[Number]
  • The parameter setting is as follows:
  • User-added image

The results are as follows, please check the attached workbook for details:


User-added image
這篇文章是否解決了問題?