Working with Data: All the calculations you need t
  • Introduction
  • What is this book?
  • How to Use this Book
  • Document Notes
  • Authors' Thanks
  • Strings
    • Concatenate
    • Split
    • Length
    • Slice
    • Trim
    • Contains
    • Match
    • Replace
    • Upper/Lower Case
  • Numbers
    • Sum
    • Average
    • Roll Ups
    • Round
    • Floor
    • Power
    • Square Root
    • Absolute
  • Dates
    • Date Difference
    • Age
  • Logical
    • Logical Operators
    • If
    • Case / Switch
    • Is Null/Empty
  • General
    • Count
    • Filter
    • Sort
    • Lookup/Join
    • Variables
    • Convert Type
  • Appendix
    • DateTime Parts
    • Helpful Resources
Powered by GitBook
On this page
  • Excel
  • Tableau
  • Alteryx
  • OrgVue
  • tSQL
  • Python

Was this helpful?

  1. Numbers

Floor

This can be useful in certain mathematical scenarios e.g. when calculating age (where you don't want to round up the number of years).

NB. For most tools, FLOOR rounds the number down to the nearest integer. In Excel, it rounds the number down to the specified degree of significance.

Excel

=~FLOOR!~(‹number›, ‹significance›)

=FLOOR(1.58,0.1)
//Returns 1.5, ie rounding 1.58 towards zero to the nearest multiple of 0.1

NB. Inputs need to have the same sign.

Tableau

~FLOOR!~(‹measure›)

FLOOR(1.58) // Returns 1

Alteryx

~FLOOR!~(‹measure›)

FLOOR(1.58) // Returns 1

OrgVue

~Math.floor!~(‹measure›)

Math.floor(1.58) // Returns 1

NB. Make sure to use Math and not math. "Math" is a library of functions which contains floor; "math" is a function itself.

tSQL

~FLOOR!~(‹measure›)

SELECT FLOOR(1.58) 
FROM Table
-- Returns 1

Python

~math.floor!~(‹measure›)

import math

math.floor(1.58) # Returns 1

NB. This requires the math library to be imported.

PreviousRoundNextPower

Last updated 5 years ago

Was this helpful?