Transforms¶
While for the most part, heedy transforms are extremely simple to use, they are actually part of a powerful time-series analysis language called PipeScript.
List of Transforms¶
The following is a list of all transforms built into PipeScript & Heedy. Click on a transform to see details and examples of use.
Name | Description |
---|---|
$ | Represents the current datapoint. It is the identity transform. |
alltrue | Returns true if all datapoints seen have been true, otherwise returns false |
anytrue | Returns true if at least one of the datapoints seen was true |
bucket | Puts numbers into custom-sized buckets. Useful for histograms. |
changed | Returns true if the datapoint has a different value from the previous one |
contains | Returns true if the given string is found in the datapoint string |
count | returns the total number of datapoints in the stream |
day | Returns the number of days since Jan 1 1970 in the given time zone. |
dayhour | Returns the hour in a day during which the datapoint happened. |
distance | Returns distance in meters from given latitude/longitude coordinates to datapoint |
dt | Gives access to the datapoint's duration |
endswith | Returns true if datapoint string ends with the substring given in arg |
filter | Filters all datapoints that do not pass the given conditional |
first | Returns true if first datapoint of a sequence, and false otherwise |
hour | Returns the number of hours since Jan 1 1970 in the given time zone. |
i | Gives array index of the timeseries |
last | Returns true if last datapoint of a sequence, and false otherwise |
length | Returns the length of an array/string, or number of object keys. |
map | Splits the timeseries by the first arg, and returns an object where each key is the result of running the pipe in the transform in the second arg on the split series |
max | Returns the maximum datapoint in the timeseries |
mean | Finds the mean of the timeseries data |
min | Returns the minimum datapoint in the timeseries |
month | Returns the number of months since Jan 1 1970 in the given time zone. |
monthday | Returns the number of day in the datapoint's month (int) |
reduce | Takes a json object, and considers each field to be a separate datapoint's data. It then runs the transform in its argument over the elements |
regex | Returns true if the given regular expression matches the data string |
startswith | Returns true if datapoint string starts with the substring given in arg |
sum | Sums data |
t | Gives access to the datapoint's timestamp |
tshift | Shift the datapoint timestamp by a constant number of seconds |
urldomain | Returns the domain name/host that is used in the given url |
wc | Returns the number of words in the given string |
week | Returns the number of weeks since Jan 5 1970 (First Monday after unix time) in the given time zone. |
weekday | Returns the weekday during which the datapoint happened ('Monday','Tuesday'...) |
while | Equivalent to a while loop that runs while the first argument is true. Restarts the loop when the argument is false. |
year | Returns the year of the datapoint in the given time zone. |
yearday | Returns the day of the year during which the datapoint happened [1,365] non-leap, and [1,366] for leap years. |
yearmonth | Returns the month name during which the datapoint happened ('January','February'...) |