Tableau Essentials: Calculated Fields – Number Functions

Data

Tableau Essentials: Calculated Fields – Number Functions

Not everyone is a Tableau guru, at least not yet. To help Tableau rookies, we’re starting from square one with the Tableau Essentials blog series. The series is intended to be an easy-to-read reference on the basics of using Tableau Software, particularly Tableau Desktop. Since there are so many cool features to cover in Tableau, the series will include several different posts.

Not everyone is a Tableau guru, at least not yet. To help Tableau rookies, we’re starting from square one with the Tableau Essentials blog series. The series is intended to be an easy-to-read reference on the basics of using Tableau Software, particularly Tableau Desktop 8.1 and 8.2. Since there are so many cool features to cover in Tableau, the series will include several different posts. This is the tenth post in the series. Check out the full list on our Tableau Essentials blog channel. This is also the third post in the Calculated Fields sub-series.

Today, we’ll dig into another group of functions used for Tableau’s calculated fields. In part one, we looked at Logical Functions. For part two, we’ll examine Number Functions.

To start, let’s go back to the Calculated Fields window. Right-click in the sidebar (a.k.a. Data window) and select Create Calculated Field:

Create Calculated Field 

In the Calculated Field window, select Number from the Functions drop-down menu:

Functions > Number” height=”354″ src=”/wp-content/uploads/sites/default/files/TECFNumber2.png” width=”170″ /> </p>
<p>Let’s start examining each of these functions in more detail. Let’s put them into groupings by their type of number function just to help organize our overview:</p>
<h2>Mathematical</h2>
<h3>ABS Function</h3>
<p><strong>ABS(number)</strong></p>
<p>The ABS function returns the absolute value of the number. Example:</p>
<p><img decoding=

DEGREES Function

DEGREES(number)

This function converts the number or field from radians to degrees. For example:

DEGREES(PI( )/4) = 45.00

EXP Function

EXP(number)

The number e is the base of the natural logarithm. This function returns e raised to the power of the number, i.e. e^5 would be expressed as:

EXP(5) = 148.44

LN Function

LN(number)

This function returns the natural log of the number. If the number is less than or equal to zero, it will return NULL. Example:

LN(5) = 1.61

LOG Function

LOG(number,[base])

LOG returns the log of the number for the given base. If no base is provided, it will use base 10 by default. Example:

LOG(5,[2]) = 2.32

PI Function

PI()

This function returns the numeric constant of pi.

PI() = 3.14159

POWER Function

POWER(number, function)

The POWER function raises the number to the specified power. Example:

POWER(4,3) = 64

RADIANS Function

RADIAN(number)

This function converts the number from degrees to radians.

RADIANS(180) = 3.14159

ROUND Function

ROUND(number,[decimals])

This function rounds the number to the nearest integer or to a specified number of decimal places. Example:

ROUND([Profit], 2) = 7.62

SIGN Function

SIGN(number)

The SIGN function returns the sign of a number. For positive numbers, the function returns a 1. For zero, it returns a 0. And for negative numbers, it returns a -1. Example:

SIGN([Revenue]) = -1

SQRT Function

SQRT(number)

The SQRT function returns the square root of a number. Example:

SQRT (9)  =  3

SQUARE Function

SQUARE(number)

SQUARE returns the square of a number. Example:

SQUARE(9) = 81

ZN Function

ZN(expression)

The ZN function evaluates the expression, and if it is NULL, then it will return a value of 0. Otherwise, the expression is returned as stated. Example:

ZN([Revenue]) = [Revenue]

Statistical

MAX Function

MAX(number, number)

The MAX function returns the maximum of a single expression across all records or the maximum of two expressions for each record. The two arguments must be the same type. This function will return a value of NULL if either argument is NULL. Example:

MAX(4,7) = 7

MIN Function

MIN(number, number)

Similar to the MAX function, the MIN function returns the minimum of a single expression across all records or the minimum of two expressions for each record. MIN returns a value of NULL if either of the two arguments is NULL. The two arguments must be of the same type. For example:

MIN(4,7) = 4

Trigonometric

ACOS Function

ACOS(number)

This function returns the arc cosine of a number. The result is in radians. Example:

ACOS(-1) = 3.14159

ASIN Function

ASIN(number)

ASIN returns the arc sine of a number. The result is in radians. Example:

ASIN(1) = 1.57079

ATAN Function

ATAN(number)

The ATAN function returns the arc tangent of a number. The result is in radians. Example:

ATAN(180) = 1.56524

ATAN2 Function

ATAN2(y number, x number)

The ATAN2 function returns the arc tangent of two given numbers. The result is in radians. Example: 

ATAN2(2, 1) = 1.10714

COS Function

COS(number)

COS returns the cosine of an angle. Specify the angle in radians. Example:

COS(PI()/4) = 0.70710

COT Function

COT(number)

This function returns the cotangent of an angle. Specify the angle in radians. Example: 

COT(PI()/4) = 1

SIN Function

SIN(number)

The SIN function returns the sine of an angle. Specify the angle in radians. Example:

SIN(0) = 0.70710

TAN Function

TAN(number)

This function returns the tangent of an angle. Specify the angle in radians. Example:

TAN(PI()/4) = 1.0

Depending on the nature of your reporting and your business, you many need to use Number Functions routinely or not at all. If you do need to use them or just wish to experiment to build your knowledge, Tableau will offer help when you click on any of these functions. A brief introduction and example of the function will be presented in the lower right-hand box on the Calculated Fields window.

Calculated Fields

Calculated fields can add a whole new layer of insight to your Tableau dashboards. The possibilities are practically endless, but we’ll be covering the fundamentals, especially functions, to help you build a foundational understanding of how and when to use them. Check back for more posts covering:

Introduction

  1. Logical Functions
  2. Number Functions
  3. Date Functions
  4. String Functions
  5. Type Conversion
  6. Aggregate Functions
  7. User Functions

Another great resource for functions is Dan Murray’s best-selling guidebook, “Tableau Your Data!” It features a whole section devoted the functions we’ll be covering in this series and much, much more.

More Tableau Essentials

Want to learn more about Tableau? We have several posts outlining all of Tableau’s fantastic features. Check out the full list on our Tableau Essentials blog channel.

As always, let us know if you have any questions or comments about this post or Tableau in general. If you’re looking for personalized training or help with something bigger, contact us directly!

 

Want More Tableau Essentials

  1. Tableau Essentials: Chart Types – Introduction
  2. Tableau Essentials: Chart Types – The Text Table
  3. Tableau Essentials: Chart Types – Heat Map
  4. Tableau Essentials: Chart Types – Highlight Table
  5. Tableau Essentials: Chart Types – Symbol Map
  6. Tableau Essentials: Chart Types – Filled Map
  7. Tableau Essentials: Chart Types – Pie Chart
  8. Tableau Essentials: Chart Types – Horizontal Bar Chart
  9. Tableau Essentials: Chart Types – Stacked Bar Chart
  10. Tableau Essentials: Chart Types – Side-by-Side Bar Chart
  11. Tableau Essentials: Chart Types – Treemap
  12. Tableau Essentials: Chart Types – Circle View
  13. Tableau Essentials: Chart Types – Side-by-Side Circle View
  14. Tableau Essentials: Chart Types – Line Charts (Continuous & Discrete)
  15. Tableau Essentials: Chart Types – Dual-Line Chart (Non-Synchronized)
  16. Tableau Essentials: Chart Types – Area Charts (Continuous & Discrete)
  17. Tableau Essentials: Chart Types – Scatter Plot
  18. Tableau Essentials: Chart Types – Histogram
  19. Tableau Essentials: Chart Types – Box-and-Whisker Plot
  20. Tableau Essentials: Chart Types – Gantt Chart
  21. Tableau Essentials: Chart Types – Bullet Graph
  22. Tableau Essentials: Chart Types – Packed Bubbles
  23. Tableau Essentials: Formatting Tips – Introduction
  24. Tableau Essentials: Formatting Tips – Custom Shapes
  25. Tableau Essentials: Formatting Tips – Labels
  26. Tableau Essentials: Formatting Tips – Color
  27. Tableau Essentials: Formatting Tips – Tooltips
  28. Tableau Essentials: Formatting Tips – Maps
  29. Tableau Essentials: Calculated Fields – Introduction
  30. Tableau Essentials: Calculated Fields – Logical Functions
  31. Tableau Essentials: Calculated Fields – Number Functions
  32. Tableau Essentials: Calculated Fields – Date Functions
  33. Tableau Essentials: Calculated Fields – String Functions
  34. Tableau Essentials: Calculated Fields – Type Conversion
  35. Tableau Essentials: Calculated Fields – Aggregate Functions
  36. Tableau Essentials: Calculated Fields – User Functions

More About the Author

Robert Curtis

Managing Director, APAC
Building Solutions with InterWorks at Corinium’s Data Architecture Conference in Melbourne InterWorks was a proud sponsor of the Data Architecture Conference hosted by Corinium in Melbourne on 21 and 22 June 2023. Hundreds of ...
Virtual Event Recap: Deep Dive of Tableau Parameters For our June Lunch and Learn, we did a deep dive on parameters for our friends across Australia and Singapore. Tableau is the premier ...

See more from this author →

InterWorks uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy. Review Policy OK

×

Interworks GmbH
Ratinger Straße 9
40213 Düsseldorf
Germany
Geschäftsführer: Mel Stephenson

Kontaktaufnahme: markus@interworks.eu
Telefon: +49 (0)211 5408 5301

Amtsgericht Düsseldorf HRB 79752
UstldNr: DE 313 353 072

×

Love our blog? You should see our emails. Sign up for our newsletter!