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() https //docs charthop com/abs returns the absolute value of a given value asof() https //docs charthop com/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() https //docs charthop com/boolean converts supported datatypes into a boolean, equal to either true or false comphistory() https //docs charthop com/comphistory returns the value of base or variable compensation on a given date compbetween() https //docs charthop com/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() https //docs charthop com/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() https //docs charthop com/grpu date converts input to date including relative date input day() https //docs charthop com/day returns the day of the month of a particular date daysoffbetween() https //docs charthop com/daysoffbetween returns the number of days off taken between two given dates diffyears() https //docs charthop com/diffyears returns the total number of years between two given dates diffmonths() https //docs charthop com/diffmonths returns the total number of months between two given dates distance() https //docs charthop com/distance returns the distance between built in addresses in charthop in the specified units monthend() https //docs charthop com/monthend returns the last day of a given month formatmoney() https //docs charthop com/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() https //docs charthop com/formatround converts a given value into a string , rounded to specific decimal place accepts number , money , or percent datatypes formatnumber() https //docs charthop com/formatnumber converts a given value of type number into a string formatpercent() https //docs charthop com/formatpercent converts a given value of type percent into a string formatdate() https //docs charthop com/formatdate converts a given value of type date into a string grantedshares() https //docs charthop com/grantedshares returns all of the shares that were granted between two specified dates length() https //docs charthop com/length returns the number of items in a list or set, or the length of a string max() https //docs charthop com/k5dk max returns the highest of all values passed as parameters mean() https //docs charthop com/mean returns the mean value of all the passed parameters, excluding nulls money() https //docs charthop com/money converts a given value to datatype money , including currency conversion month() https //docs charthop com/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() https //docs charthop com/min returns the lowest of all values passed as parameters nextanniversary() https //docs charthop com/nextanniversary given a date, returns the next upcoming anniversary of that date number() https //docs charthop com/number given a value, returns that value as a number pluralize() https //docs charthop com/pluralize given a value of type string , returns that value in plural form percent() https //docs charthop com/l3gk percent given a value, returns that value as a percent random() https //docs charthop com/random returns a random number between 0 and 1 round() https //docs charthop com/round rounds a given value to the defined number of decimal places roundup() https //docs charthop com/roundup rounds a given value to the next largest integer rounddown() https //docs charthop com/rounddown rounds a given value to the next smallest number string() https //docs charthop com/ocdo string given a value, returns that value as a string substring() https //docs charthop com/substring given a string and specified parameters, returns a part of that string stockprice() https //docs charthop com/stockprice given a date , returns the value of shares on that date monthstart() https //docs charthop com/monthstart returns the first day of a given month split() https //docs charthop com/split divides a string into a list of strings vestvalue() https //docs charthop com/vestvalue given a start date and end date, returns the share price value of stock that will vest over that period of time vestshares() https //docs charthop com/vestshares given a start date and end date, returns the number of shares that will vest over that period of time year() https //docs charthop com/year returns the gregorian calendar year of a particular date
