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

Sum

PreviousNumbersNextAverage

Last updated 5 years ago

Was this helpful?

In most cases, this will be the total within a field of numerical data, though you might also want to sum a filtered subset of numbers or a list of numbers provided by you, e.g. as an array [2,7,8,3]. All the sum functions below will allow you to choose either a set of numerical values or specify your own.

Excel

=~SUM!~(‹number_array›) =~SUM!~(‹number1›«, number2», «numberN»)

=SUM(A:A)
// OR
=SUM(2,7,8,3) // Returns 20

Tableau

~SUM!~(‹measure›)

SUM([Sales])

Alteryx

Use the Summarize tool (in the Transform palette):

(group by field, sum by measure).

OrgVue

‹measure›.~sum!~; ‹number_array›.~sum!~;

nodes().sales.sum
// OR
array(2,7,8,3).sum // Returns 20

tSQL

~SUM!~(‹measure›)

SELECT SUM(sales)
FROM SalesData

Python

~sum!~(‹number_array›)

sum([2,7,8,3]) # Returns 20