This module is included in every Sheetsee build. It contains methods for basic data manipulation you might want to do.
Sheetsee pairs with Tabletop.js which will fetch the data from your spreadsheet and return it as an array of objects. You'll use these methods from Sheetsee after you have that data.
Here are the functions you can use!
data
array of objectskeyword
string- Returns number
Given your data and keyword to search by, this function returns the number of times it occurs throughout all of the data.
getGroupCount(data, 'cat')
// returns a number
data
array of objectskeyword
string- Returns number
Given your data and a keyword to search by, this function returns every row which contains a match to the keyword.
getKeyword(data, 'cat')
// returns array of objects
data
array of objectscolumn
string- Returns number
Use only with columns of numbers
Given your data and column header, this function sums each cell in that column and returns the value.
getColumnTotal(data, 'cuddlability')
// returns number
data
array of objectscolumn
string- Returns number
Given your data and column header, this function returns the average value of every cell in the column.
getColumnAverage(data, 'cuddlability')
// returns number
data
array of objectscolumn
string- Returns array
Given your data and column header, this function returns an array of the rows with the lowest values within the specified column.
getMin(data, 'cuddlability')
// returns array
data
array of objectscolumn
string- Returns array
Given your data and column header, this function returns an array of the rows with the highest values within the specified column.
getMin(data, 'cuddlability')
// returns array of objects
data
array of objectsfilter
stringcolumn
string- Returns array
Takes data, a filter term to search by within a column and returns every row that matches,
getMatches(data, 'dog', 'kind')
// returns array of objects
// [{'name': 'coco', 'kind': 'dog'...}, {'name': 'wolfgang', 'kind': 'dog'...},{'name': 'cooc', 'kind': 'dog'...} ]
data
array of objectscolumn
string- Returns object
Takes data column header and returns an object with key/value pairs of how often an item occurs in the column.
getOccurance(data, 'kind')
// Returns an object
// {'dog': 3, 'cat': 3}
Don't Forget JavaScript Math! Create variables that are the sums, differences, multiples and so forth of others. Lots of info on that here on MDN.
var profit09 = Sheetsee.getColumnTotal(data, '2009')
var profit10 = Sheetsee.getColumnTotal(data, '2010')
var difference = profit09 - profit10