Carrot reference

Functions

functions in charthop work just like functions in spreadsheets they perform calculations on particular data (passed in as parameters ) and return a return value some functions also retrieve data from the charthop database syntax a function in carrot appears as the function name followed by parentheses, which accepts one or several parameter values function(parameter1, \[parameter2]) all function names are case insensitive usage functions can be used in any carrot expression, anywhere carrot is used (in smart calc or smart bucket field types, when filtering the data sheet, configuring charts within dashboards, building out custom content for the homepage or profiles, etc ) function list function description abs() returns the absolute value of a given value asof() returns the result of a carrot expression on a particular date using either only primary data, or both primary and scenario based data boolean() converts supported datatypes into a boolean, equal to either true or false comphistory() returns the value of base or variable compensation on a given date compbetween() calculates the base, variable or cash compensation of a person over a specified period of time including all jobs the person has held costbetween() calculates the cost of a job over a specified period of time where the cost of a job includes if multiple people have held that job date() converts input to date including relative date input day() returns the day of the month of a particular date daysoffbetween() returns the number of days off taken between two given dates diffyears() returns the total number of years between two given dates diffmonths() returns the total number of months between two given dates distance() returns the distance between built in addresses in charthop in the specified units monthend() returns the last day of a given month formatmoney() converts a given value of type money into a string , while retaining the currency type in the string output optionally specify the format and locale of the returned value formatround() converts a given value into a string , rounded to specific decimal place accepts number , money , or percent datatypes formatnumber() converts a given value of type number into a string formatpercent() converts a given value of type percent into a string formatdate() converts a given value of type date into a string grantedshares() returns all of the shares that were granted between two specified dates length() returns the number of items in a list or set, or the length of a string max() returns the highest of all values passed as parameters mean() returns the mean value of all the passed parameters, excluding nulls money() converts a given value to datatype money , including currency conversion month() returns the ordinal number of the month of a particular date, from 1 12, where 1 is january, 2 is february, and so on min() returns the lowest of all values passed as parameters nextanniversary() given a date, returns the next upcoming anniversary of that date number() given a value, returns that value as a number pluralize() given a value of type string , returns that value in plural form percent() given a value, returns that value as a percent random() returns a random number between 0 and 1 round() rounds a given value to the defined number of decimal places roundup() rounds a given value to the next largest integer rounddown() rounds a given value to the next smallest number string() given a value, returns that value as a string substring() given a string and specified parameters, returns a part of that string stockprice() given a date , returns the value of shares on that date monthstart() returns the first day of a given month split() divides a string into a list of strings vestvalue() given a start date and end date, returns the share price value of stock that will vest over that period of time vestshares() given a start date and end date, returns the number of shares that will vest over that period of time year() returns the gregorian calendar year of a particular date