Function List
HENGSHI provides a rich set of calculation functions to meet users' data analysis needs. Function support may vary depending on different data sources. If you use a function that is not supported by the data source, the HENGSHI system will provide a corresponding prompt. This document introduces the following function categories:
- Operators: Operators are used to perform operations on values. For example, arithmetic operators (+, -, *, /), comparison operators (=, >, <, >=, <=, <>), and logical operators (AND, OR, NOT) are used to build complex expressions.
- Text Functions: Mainly used for processing string data. Operations such as concatenating strings, changing string case, finding the position of a substring, replacing substrings, trimming leading and trailing spaces, and obtaining string length can all be easily accomplished with string functions.
- Number Functions: Mainly used for numerical calculations. Common operations include rounding numbers, taking the integer part, calculating absolute values, square roots, logarithms, and generating random numbers. These functions meet various numerical processing needs.
- Date Functions: Used for various operations on date and time data. For example, obtaining the current date and time, formatting date and time, calculating the difference between two dates, and performing addition or subtraction on dates. These are powerful tools for handling time-related business.
- Logical Functions: Able to return corresponding values based on specific conditions. The IF function can return different results based on condition judgment, and the CASE WHEN function can implement more complex multi-condition logic, commonly used for data filtering and result formatting.
- Array Functions: Mainly used for array operations. You can get the length of an array, access specific elements in an array, sort, merge, and split arrays, providing convenience for processing array data.
- JSON Functions: Used for processing JSON-formatted data. They can extract specific values from JSON data, modify JSON structures, and determine whether a certain key or value exists in JSON, making it easy to handle JSON-type data in databases.
- Aggregate Functions: Mainly used for summarizing multiple values. Common aggregate functions include sum, average, maximum, minimum, and count, which can quickly provide statistical results for datasets.
- Window Functions: Group data according to certain conditions and perform calculations within each group. They can be used to implement ranking, moving statistics, sliding windows, and other features, helping users analyze and process time series data.
- Advanced Calculation Functions: These functions can perform more complex calculations. Through simple configuration, you can complete complex operations such as year-over-year and month-over-month comparisons, moving calculations, duplication rates, and more.
- Dataset Functions: Used for operations on datasets. You can filter, sort, and merge datasets, helping users obtain the required data combinations from multiple datasets.