Tableau Math Functions

Tableau provides various Math and Trigonometric Functions to perform mathematical operations on our data. They are FLOOR, CEILING, ABS, DIV, POWER, SQRT, SQUARE, MIN, MAX, SIN, COS, TAN, ACOS, ASIN, ATAN, ATAN2, LN, LOG, etc. In this article, we show how to use Tableau Math Functions with examples.

To demonstrate these Tableau Math Functions, we are going to use the below-shown data. As you can see, there are nine records in this table.

Remember, this is an Excel Worksheet. So, Please refer Connecting to the Excel Files article to understand the connection settings.

Tableau Math Functions 1

Tableau Math Functions

The following examples will show you the list of Math Functions in Tableau

ABS

The Tableau ABS function is used to return the absolute positive value and the syntax of this ABS is:

ABS(number)

To demonstrate these math functions, we use Calculated Fields. To create a calculated field, navigate to Analysis Tab, and select Create Calculated Field… option.

Tableau Math Functions 2

Once you click on the Create Calculated Field… option, the following window will open. Here, we renamed the default calculation name as ABS.

Below statement will find the Absolute values of Service Grade

ABS([Service Grade])
ABS Function 3

Let me add this ABS field to an existing table (by dragging a field to Measures Shelf). Please refer Create Table Report article to understand the process of creating a table

ABS Function 4

ACOS

The Tableau ACOS function calculates the Arc cosine of a given number and the syntax of this ACOS is:

ACOS(Number)

The below ACOS statement will find the ArcCosine of Service Grade

ACOS([Service Grade])
ACOS Function 5

ASIN

Tableau ASIN function will calculate the Arc sine of a given number and the syntax of this ASIN is:

ASIN(Number)

The following statement finds the Arcsine of Service Grade

ASIN([Service Grade])
asin Function 6

ATAN

Tableau ATAN function is used to calculate the Arc Tangent of a given number and the syntax of this ATAN is:

ATAN(Number)

Below statement will find the Arc Tangent of Service Grade

ATAN([Service Grade])
atan Function 7

SIN

Tableau SIN function is used to calculate the Sine value and the syntax of this SIN is:

SIN(Number)

It will find the Sine value of Service Grade

SIN([Service Grade])
sin Function 8

TAN

Tableau TAN function is to calculate the Tangent value and the syntax of this TAN is:

TAN(Number)

Below statement will find the Tangent value of Service Grade

TAN([Service Grade])

Let me add this TAN field to Measures shelf

tan Function 9

COS

Tableau COS function will calculate the Cosine value and the syntax of this COS is:

COS(Number)

It will find Cosine value of Service Grade

COS([Service Grade])
cos Function 10

ATAN2

Tableau ATAN2 function is to calculate arc Tangent of two given numbers and the syntax of this ATAN2 is:

ATAN2(y_number, x_number)

Below statement will find the Arc Tangent value of Sales amount and Standard cost

ATAN2([Standard Cost], [Sales Amount])
atan2 Function 11

COT

Tableau COT function will calculate the Cotangent value and the syntax of this COT is:

COT(Number)

It will find Cotangent value of Service Grade

COT([Service Grade])
atan2 Function 12

Tableau DEGREES Function

The Degrees function will convert Radians to Degrees and the syntax of this Degrees is:

DEGREES(Number)

It will convert the Radiant value in Service Grade to degrees

DEGREES([Service Grade])

Let me add this Degrees field to Measures shelf

degree Function 13

Tableau RADIANS Function

The The RADIANS function will convert Degrees to Radians and the syntax of this Radians is:

RADIANS(Number)

It will convert the degrees value in Sales Amount to Radians

RADIANS([Service Grade])

Let me add this Radians field to Measures shelf

radians Function 14

Tableau EXP Function

The EXP function returns e raised to the power of the user-specified number and the syntax of this EXP is:

EXP(Number)

It finds e power service grade

EXP([Service Grade])

Let me add this EXP field to Measures shelf

EXP Function 15

Tableau SQUARE Function

The Tableau Square function finds the square of a given number and the syntax of this Square Function is:

SQUARE(Number)

It will find out the square of the tax amount

SQUARE([Tax Amt])

Let me add this SQUARE field to Measures shelf

square Function 16

Tableau SQRT Function

The Tableau Sqrt function finds the square root of a given number and the syntax of this Sqrt is:

SQRT(Number)

It will find the square root of Sales amount

SQRT([Sales Amount])

Let me add this SQRT field to Measures shelf

sqrt Function 17

Tableau ROUND Function

The Tableau Round function returns the nearest integer value. It accepts the second argument (optional) to specify the number of decimals. The syntax of this Round Function is:

ROUND(Number, no_of_decimals)

For example,

  • ROUND(248.6759) = 249
  • ROUND(248.6759, 1 ) = 248.7
  • ROUND(248.6759, 2 ) = 248.68

Below statement will round the Standard Cost values to the nearest integer

ROUND([Standard Cost])

Let me add this ROUND field to Measures shelf

round Function 18

Tableau CEILING Function

The Tableau Ceiling function returns the closest integer value, which is greater than or equal to a given value. The syntax of this Ceiling Function is:

CEILING(Number)

Below statement will find the closest integer value which is greater than or equal to Standard Cost

CEILING([Standard Cost])

Let me add this CEILING field to Measures shelf

ceiling Function 19

Tableau FLOOR Function

The Tableau Floor function is used to return the closest integer value, which is less than or equal to a given value. The syntax of this Floor Function is:

FLOOR(Number)

The below Floor statement will find the closest integer value which is less than or equal to Standard Cost

FLOOR([Standard Cost])
floor Function 20

Tableau SIGN Function

The Sign function is handy to find the integer Sign, This function return

  • +1  = Positive Value
  • -1 = Negative values
  • 0 = for zeros.

The syntax of this Tableau Sign Function is:

SIGN(Number)

The Sign function will find the sign of a Service Grade records

SIGN([Service Grade])
sign Function 21

Tableau PI Function

The PI returns numeric value 3.14, and the syntax is:

PI()

It will divide the PI value, i.e., 3.14 with Service Grade values. Let me add this PI field to Measures shelf

PI() / [Service Grade]
pi Function 22

Tableau POWER Function

This function is used to find the Power of a given number. Use the second argument to specify the Power. The syntax of this Tableau Power Function is:

POWER(Number, power)

For example Power(2, 3) = 2³. It will find the Sales Amount raised to the power of 2

POWER([Sales Amount], 2)

Let me add this Power field to Measures shelf

power Function 23

LN

The Tableau LN function is used to find the natural logarithmic value of a given number and the syntax of this LN is:

LN(Number)

It will find the natural logarithmic value of Sales Amount

LN([Sales Amount])
LN Function 24

LOG

The Tableau LOG function is used to find the logarithmic value of a given number for a specified base. Here, the second argument is optional, and its default value is 10. The syntax of this LOG is:

LOG(Number, base)

It will find the logarithmic value of Sales Amount for base 5

LOG([Sales Amount], 5)

Let me add this LOG field to Measures shelf

log Function 25

DIV

The Tableau DIV function divides one number by another and the syntax of this DIV is:

DIV(integer, integer)

The following DIV statement divides Sales Amount by 5

DIV(INT([Sales Amount]), 5)
div Function 26