### Extract substrings using subString() Source: https://docs.charthop.com/substring Examples demonstrating how to extract a portion of a string starting from a specific index, with and without a defined length. ```text subString("Piece of cake.", 2) ``` ```text subString("Piece of cake.", 2, 3) ``` -------------------------------- ### Boolean conversion examples Source: https://docs.charthop.com/boolean Basic usage examples showing how numeric and string inputs are evaluated to boolean results. ```text boolean(0) ``` ```text boolean("yes") ``` -------------------------------- ### Subtract Operator Usage Examples Source: https://docs.charthop.com/subtract Examples demonstrating arithmetic subtraction with numbers and date manipulation. ```text (1 - 2) - 3 ``` ```text ('2021-01-02') - 1 ``` -------------------------------- ### Base Compensation Examples Source: https://docs.charthop.com/basecomp Examples demonstrating how to access different attributes of the base compensation, such as its value in the organization's currency, annualized figures, and interval. ```APIDOC ## Base Compensation Fields ### Description Examples of accessing and manipulating base compensation data. ### Method N/A (These are data access examples) ### Endpoint N/A ### Parameters N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ## Compound Field Examples ### Base Pay - **Base**: `baseComp` - **Base (org currency)**: `baseComp.asOrgCurency` ### Annualized Base Pay - **Base - annualized**: `baseComp.annualized` - **Base - annualized (org currency)**: `baseComp.annualized.asOrgCurrency` ### Pay Interval - **Base interval**: `baseComp.interval` ### Yearly Base Pay - **Base – yearly**: `baseComp.yearly` - **Base – yearly (org currency)**: `baseComp.yearly.asOrgCurrency` ### Hourly Base Pay - **Base – hourly**: `baseComp.hourly` - **Base – hourly (org currency)**: `baseComp.hourly.asOrgCurrency` ### Last Raise Information - **Base – last raise %**: `baseComp.lastRaise.percent` - **Base – last raise amount**: `baseComp.lastRaise.pay` - **Base – last raise amount (org currency)**: `baseComp.lastRaise.pay.asOrgCurrency` - **Base – last raise date**: `baseComp.lastRaise.date` - **Base – last raise type**: `baseComp.lastRaise.type` - **Base – months since last raise**: `baseComp.lastRaise.date.monthsSince` ### Target Hours Per Week - **Target hours per week**: `targetHoursPerWeek` ``` -------------------------------- ### Birth Date Usage Examples Source: https://docs.charthop.com/birth-date Examples of birth date formatting with and without the year component. ```text 08/12 ``` ```text 08/12/2022 ``` -------------------------------- ### Date Utility Functions Source: https://docs.charthop.com/turnoverrate Examples of using the 'date' utility function to get current, past, or future dates, and to convert Unix timestamps. ```javascript date() ``` ```javascript date("-3m") ``` ```javascript date(1744206569) ``` ```javascript date("2025-12-25") ``` ```javascript date("+6w", createDate) ``` -------------------------------- ### CQL Syntax by Context Source: https://docs.charthop.com/cheat-sheet Examples of how CQL syntax is applied depending on the specific ChartHop feature or interface. ```text base * fieldCode1 ``` ```text diffYears(startDate, today()) ``` ```text {{formatMoney(base)}} ``` ```text formAnswers['fieldCode1'] * 100 ``` ```text {{name}} ``` ```text {{base / fieldCode1}} ``` -------------------------------- ### Addition and Concatenation Examples Source: https://docs.charthop.com/add Demonstrates basic arithmetic, string concatenation, and date manipulation using the + operator. ```text 1 + 2 + 3 ``` ```text "concat" + "enate" ``` ```text ('2021-01-01') + 1 ``` -------------------------------- ### Retrieve unique departments Source: https://docs.charthop.com/unique Example usage showing how to extract a unique set of departments from a list of jobs. ```text underJobs.unique{department} ``` -------------------------------- ### Calculate Data with Carrot Source: https://docs.charthop.com/carrot-cql Examples of calculating compa-ratio and tenure using field codes and date functions. ```text base / fieldCode1 (compa-ratio)diffYears(startDate, today()) (tenure in years) ``` -------------------------------- ### GET /websites/charthop/state Source: https://docs.charthop.com/state Retrieves the current 'open' state of a job. This is a read-only field. ```APIDOC ## GET /websites/charthop/state ### Description Returns the value of `open` for a job. This field indicates whether the job is currently open or closed. ### Method GET ### Endpoint /websites/charthop/state ### Parameters This endpoint does not accept any path, query, or request body parameters. ### Response #### Success Response (200) - **open** (Enum) - The current state of the job (e.g., 'OPEN', 'CLOSED'). #### Response Example ```json { "open": "OPEN" } ``` ``` -------------------------------- ### GET /websites/charthop/XCYW-comp-band Source: https://docs.charthop.com/XCYW-comp-band Retrieves the compensation band details for a specific job. ```APIDOC ## GET /websites/charthop/XCYW-comp-band ### Description Returns the compensation band that determines the compensation range. ### Method GET ### Endpoint /websites/charthop/XCYW-comp-band ### Parameters #### Query Parameters - **compBand** (string) - Required - The field code for the compensation band. ### Response #### Success Response (200) - **compBand** (Comp Band) - The compensation band object containing details about the compensation range. #### Response Example { "compBand": { "name": "Senior Engineer", "min_comp": 120000, "max_comp": 180000, "mid_comp": 150000 } } ``` -------------------------------- ### Group by department and gender in ChartHop Source: https://docs.charthop.com/advanced-chart-customization Example of grouping by department and gender to sum headcount. Requires a pre-defined jobFilter. ```Carrot db.job.find(jobFilter).groupBy{department, gender}.sum{headcount} ``` -------------------------------- ### Get Max Value from List Source: https://docs.charthop.com/GTXU-max Returns the largest numeric value in a List. No special setup is required. ```javascript [1, 2, 3].max() ``` -------------------------------- ### Calculate Mean of a List Source: https://docs.charthop.com/yOFs-mean Use .mean() on a list of numbers to get the average value. No special setup is required. ```javascript [1, 2, 3, 4].mean() ``` -------------------------------- ### Example: Mean of Base Compensation in Engineering Department Source: https://docs.charthop.com/yOFs-mean Demonstrates how to use the .mean{expression} function to calculate the average base compensation for employees in the engineering department. ```APIDOC ## db.job.find{dept:engineering}.mean{baseComp} ### Description Returns the mean average base compensation for employees in the Engineering department. ### Method N/A (This is a function applied to a data structure) ### Endpoint N/A (This is a function, not a REST endpoint) ### Parameters - **expression** (Carrot Expression) - Required - `baseComp` (evaluates the base compensation field for each job record). ### Request Example ``` db.job.find{dept:engineering}.mean{baseComp} ``` ### Response #### Success Response (200) - **mean_value** (number) - The calculated mean average base compensation. ``` -------------------------------- ### Job Entity Field: startDatePlanned Source: https://docs.charthop.com/startdateplanned Details regarding the Planned Start Date field used for tracking job start dates. ```APIDOC ## Field: startDatePlanned ### Description For open roles, the intended target start date of the job. The field still remains once the job is hired. ### Metadata - **Label**: Planned Start Date - **Code name**: startDatePlanned - **Sensitivity**: Org Public - **Data type**: Date - **Data category**: Structure - **Entity type**: Job - **Read only**: No ``` -------------------------------- ### Execute Functions Source: https://docs.charthop.com/UbzXHCfuZThOOKISh2HOa Functions perform calculations on data or content within parentheses. ```none baseCompBetween('2017-07-01', '2022-08-01", 1.0) ``` -------------------------------- ### GET /websites/charthop/comp-band-base-interval Source: https://docs.charthop.com/comp-band-base-interval Retrieves the compensation band interval details. ```APIDOC ## GET /websites/charthop/comp-band-base-interval ### Description The pay interval that the compensation range is specified in. *Hourly* or *Salary*. ### Method GET ### Endpoint /websites/charthop/comp-band-base-interval ### Parameters #### Query Parameters - **fields** (string) - Optional - Specifies the fields to retrieve. For example: `fields=compBand`. ### Response #### Success Response (200) - **compBand** (string) - The compensation band interval. Possible values are 'Hourly' or 'Salary'. #### Response Example ```json { "compBand": "Salary" } ``` ``` -------------------------------- ### GET /websites/charthop/titledate Source: https://docs.charthop.com/titledate Retrieves the date of the most recent title change for a Job. ```APIDOC ## GET /websites/charthop/titledate ### Description Returns the date of the most recent title change for a Job. ### Method GET ### Endpoint /websites/charthop/titledate ### Parameters #### Query Parameters - **jobId** (string) - Required - The ID of the job to retrieve the title change date for. ### Response #### Success Response (200) - **titleDate** (Date) - The date of the most recent title change for the Job. #### Response Example { "titleDate": "2024-11-22T13:37:51.204Z" } ``` -------------------------------- ### Conditional Logic Prompt Template Source: https://docs.charthop.com/customize-your-forms A template for prompting an AI to generate conditional content using ChartHop syntax. ```Text Add a conditional block that only shows if {{department.name}} equals 'Sales'. When it does, show: [YOUR CONTENT] Use ChartHop's conditional syntax: {% if [condition] %} ... {% endIf %} ``` -------------------------------- ### Grouping Chart Data by Ethnicity Source: https://docs.charthop.com/advanced-chart-customization This example shows how to group chart data by ethnicity using the groupBy functionality. This allows for dynamic visualization of data based on changing values in ChartHop. ```javascript groupBy("ethnicity") ``` -------------------------------- ### GET variableTarget.percent Source: https://docs.charthop.com/target-variable-percent Retrieves the value of the target variable if it is of type Percent. ```APIDOC ## GET variableTarget.percent ### Description Returns the value of the variable if that value is of type Percent. This field is read-only and associated with the Job entity. ### Parameters - **Code name**: variableTarget.percent - **Sensitivity**: Cash Compensation - **Data type**: Percent - **Data category**: Cash Compensation - **Entity type**: Job - **Read only**: Yes ### Usage Example | Values | | ---------- | | 10% | ``` -------------------------------- ### GET Days Off (In Lieu) Source: https://docs.charthop.com/days-off-in-lieu Retrieves the number of days off in lieu for a person. ```APIDOC ## GET /websites/charthop/days-off-in-lieu ### Description Retrieves the number of days off in lieu for a person in the current calendar year. ### Method GET ### Endpoint /websites/charthop/days-off-in-lieu ### Parameters #### Query Parameters - **personId** (string) - Required - The unique identifier for the person. ### Response #### Success Response (200) - **daysOff.toil** (DaysOff) - The number of days off in lieu. #### Response Example ```json { "daysOff": { "toil": { "taken": 5, "approved": 2 } } } ``` ``` -------------------------------- ### Example: Finding Max Compensation Source: https://docs.charthop.com/GTXU-max This snippet demonstrates a practical use case of the .max{expression} method to find the highest compensation within a filtered dataset. ```APIDOC ## Example: Finding Max Compensation ### Description Finds the highest base compensation among employees in the Engineering department. ### Method Method Chaining (applied to a Sequence or List) ### Endpoint N/A (This is a method applied to data structures) ### Parameters - **expression** (Carrot Expression) - Required - `baseComp` (accesses the base compensation field). ### Request Example ``` db.job.find{dept:engineering}.max{baseComp} ``` ### Response #### Success Response (200) - **max_compensation** (number) - The highest base compensation value. #### Response Example ```json 150000 ``` ``` -------------------------------- ### AI Prompt Template for ChartHop Homepage Source: https://docs.charthop.com/build-your-charthop-homepage This template provides instructions for an AI to generate HTML for your ChartHop homepage. Fill in your brand details and design preferences. Remember to only output HTML. ```plaintext You are helping me build HTML for ChartHop, an HR platform. Rules: - Use only inline CSS (no