Klipfolio PowerMetrics offers a variety of Excel-like functions to perform calculations and manipulate data.
This article includes:
List of all functions
The following table includes a categorized list of all functions with links to information for each one.
About the formula bar
Functions are used in the formula bar in PowerMetrics when creating and editing data feeds for use with custom metrics.
In the formula bar, you can type in formulas or select from a list of functions. When you start typing a function name, a list of functions filtered by the letter you entered is displayed. Function Help with examples and parameters automatically displays for each function in a pop-up window.
Learn more about using the formula bar.
The Function Reference Guide
Klipfolio functions are separated into these categories: Data manipulation, logic, math, text, date/time, statistics, and Klipfolio functions for JSON data. The following tables are organized by category and include the purpose of each function along with information and tips/examples on using them in PowerMetrics.
Data manipulation functions
Logic functions
Math functions
Text functions
| Function | Description |
|---|---|
| CAPITALIZE |
Use CAPITALIZE to change the first letter in each word to uppercase. Syntax and Parameters:
Example: Capitalize "the 5th dimension". Formula:
Results: The 5th Dimension |
| CONCAT |
Use the CONCAT function to join two or more values into one text string. Syntax and Parameters:
Example: Create a sentence template using data from columns A, B and C. A:A contains [added, updated], B:B contains [May 22, 2025, Oct 2, 2025], C:C contains [2:20pm, 8:12am] Formula:
Results: The data source was added May 22, 2025 at 2:20pm The data source was updated Oct 22, 2025 at 8:12am |
| CONTAINS |
Use the CONTAINS function to test each value in the haystack parameter to see if it contains the value in the needle parameter. Syntax and Parameters:
Example: Return true for all values that have the letter "a" in them. A:A contains [Apple, Banana, Orange, Plum] Formula:
Results: false, true, true, false |
| COUNTRY_CLEAN |
Use the COUNTRY_CLEAN function to avoid multiple variations of a country’s name and return all the country names in the same form, either as full names or as ISO 3166 standardized names. If a value cannot be identified as a country, INVALID COUNTRY will display. Syntax and Parameters:
Examples:
The result is country names display in their full form, for example, Canada, Mexico, Canada, Canada, Canada, United States, United States, United States.
The result is country names display using the 2-character ISO code, for example, CA, MX, CA, CA, CA, US, US, US.
The result is country names display using the 3-character ISO code, for example, CAN, MEX, CAN, CAN, CAN, USA, USA, USA. |
| INDEXOF |
Use INDEXOF to search the values in the text parameter for the specified occurrence of the search text (case sensitive) parameter and return the position of where it is found. If search text is not found at the specified occurrence, null is returned. Syntax and Parameters:
Example: Return the position of the second occurrence of "at" in column A. A:A contains [abc, The Cat in the Hat] Formula:
Results: null, 16 Note: INDEXOF is typically used with SUBSTRING to determine where to begin or end the substring. |
| JOIN |
The JOIN function takes a set of values, joins these values with the glue parameter (a comma is used if glue is not specified), and returns them as a single value. Syntax and Parameters:
Example: A:A contains [January, February, March, April, May, June] Formula:
Results: January,February,March,April,May,June |
| LASTINDEXOF |
Use LASTINDEXOF to search the values in the text parameter for the last occurrence of the search text (case sensitive) parameter and return the position of where it is found. If search text is not found at the specified occurrence, null is returned. Syntax and Parameters:
Example: Return the position of the last occurrence of "at" in column A. A:A contains [abc, The Cat in the Hat] Formula:
Results: null, 16 Note: LASTINDEXOF is typically used with SUBSTRING to determine where to begin or end the substring. |
| LEFT |
Use the LEFT function to return the first character or a specified number of characters starting from the first value on the left. Syntax and Parameters:
Example: A:A contains [Bat Cat, The Cat in the Hat] Formula:
Results: B T Example: A:A contains [Bat Cat, The Cat in the Hat] Formula:
Results: Bat Cat The Cat |
| LENGTH |
Use the LENGTH function to count the number of characters in a text string. Syntax and Parameters:
Example: Count the number of characters in "Hello" and "Hello World". Formula:
Results: 5, 11 |
| LOWER |
Use the LOWER function to change all characters in the values parameter to lowercase. Syntax and Parameters:
Example: A:A contains [Bat Cat, The Cat in the Hat] Formula:
Results: bat cat the cat in the hat |
| NUMBERFORMAT |
Use the NUMBERFORMAT function to take a set of values, treat them as numbers, and return them as text with as many digits of decimal places as specified by the precision parameter. Syntax and Parameters:
Example: A:A contains [123.456, 1245687, January] Formula:
Results: 123, 1245687, 0 Note: If the data parameter is defined with text values or a blank, the results will be returned as a 0. |
| REMOVE_EMOJI |
Emojis are pictographs most often seen in social media data sources, such as Facebook posts. They may also appear in other data source types. As new emojis are developed, new encoding is used and sometimes this encoding cannot be processed by Klipfolio. The REMOVE_EMOJI function is used to strip emojis from data so the remaining data can be processed. Syntax and Parameters:
Example: Where message and name point to the /data/message and /data/from/name fields in a Facebook data source.
Note: If the selected data does not contain emojis, the REMOVE_EMOJI function returns the selected data as is. |
| RIGHT |
Use the RIGHT function to return the first character or a specified number of characters starting from the right of the first value. Syntax and Parameters:
Example: A:A contains [Bat Cat, The Cat in the Hat] Formula:
Results: Bat Cat, the Hat |
| SUBSTITUTE |
The SUBSTITUTE function replaces a set of characters with another set of characters in a text string. If the occurrence parameter is specified, that occurrence is substituted, otherwise, all occurrences are substituted. Syntax and Parameters:
Example: Substitute the 3rd occurrence of the letter a in each word in the data. A:A contains [Ottawa, banana] Formula:
Results: Ottawa, banan@ Note: While the SUBSTITUTE function is similar to the REPLACE function, the SUBSTITUTE function is used to replace part of a value. |
| SUBSTITUTE_REGEX |
Use SUBSTITUTE_REGEX to substitute text based on a specific pattern, such as location in text. REGEX (REGular EXPression) is a standard for describing patterns in text. There are several online resources, such as regexr.com., that describe how to define REGEX expressions. Syntax and Parameters:
Example: The regex anchor, ^, is used to match only when 'a' is the first character in a text string.
The result of this formula is xpple, bread, eggs. The regex anchor, $, matches the last character in a text string and the pipe (|) indicates 'or'.
The result of this formula is xpple, bananx, orange. Example: Substitute all characters until the last dash. A:A contains [Albany-Orlando-Ottawa] Formula:
Results: @Ottawa |
| SUBSTRING |
Use the SUBSTRING function to return a sub-string of text from a string of text. Syntax and Parameters:
Example: Return data after position 11 in each string. A:A contains [2025-10-11T1:12:00, 0123456789abcdef] Formula:
Results: 1:12:00, bcdef |
| TEXT_REVERSE |
Use the TEXT_REVERSE function to reverse the order of characters or numbers in the data. Syntax and Parameters:
Example: A:A contains [Canada, United States, Mexico] Formula:
Results: adanaC, setatS detinU, ocixeM |
| TRIM_WHITESPACE |
Use the TRIM_WHITESPACE function to return the text without leading and trailing spaces. Syntax and Parameters:
Example:
The result of this formula returns: Reseller, Distributor, Customer without the leading or trailing spaces. Example: Remove leading and trailing spaces around the word " Hello World ". Formula:
Results: Hello World |
| TRUNCATE |
Truncates text to the specified number of characters, starting from the position parameter and optionally inserting a style character. Syntax and Parameters:
Example: This example cuts off the text string after 5 characters and adds an ellipsis to the end of the value. Formula:
Results: abcde… |
| UPPER |
Use the UPPER function to change all characters in the values parameter to uppercase. Syntax and Parameters:
Example: A:A [Bat Cat, The Cat in the Hat] Formula:
Results: BAT CAT, THE CAT IN THE HAT |
| URLDECODE |
Use the URLDECODE function to decode data that is encoded for use in a URL using URLENCODE, UTF-8, to plain text. Syntax and Parameters:
Example: A:A contains Formula:
Results: www.myCompany.com/business users, www.powermetrics.app/integrations |
| URLENCODE |
Use the URLENCODE function to encode data to be safely used in URLs. Syntax and Parameters:
Example: A:A contains Formula:
Results: www.myCompany.com%2Fbusiness+users www.powermetrics.app%2Fintegrations |
Date/Time functions
When using Date/Time functions in Klipfolio PowerMetrics, it’s important to remember that formulas process the dates in Unix time format. This means that human readable date formats have to be converted before they can be used in formulas. When converting dates, the format of the date (that you want to convert) must be specified and must be entered as a string surrounded by quotes in the formula. Learn more about Date/Time formats.
Note: You can use an external Unix time converter to find the Unix time format of readable dates.
Time zones are an optional parameter available for specification in Date/Time functions. However, time zones can also be set at your account level and do not typically need to be set individually for every formula. Setting time zones in Klipfolio PowerMetrics.
Statistics functions
Klipfolio Functions for JSON data
Klipfolio functions for JSON data are the perfect choice for situations where more complex XPath manipulation is required to access and align JSON data. Learn more about JSON and XML data sources here.
| Function | Description |
|---|---|
| kf:element_at |
Syntax: Select an element at the position specified by index. This function is used when a field name is unnamed and is instead referenced by number (position). For example, using the following data source:
Example 1:
Returns:
Example 2:
Returns:
|
| kf:fill_elements |
Syntax: Note: You can enter the formula manually or generate it automatically by choosing the Selection Option Select all <field_name> elements in all <parent> elements, adding blanks for missing <field_name> elements. This function is used to “fill in” blanks for an element that is not included in every record. This is useful for data alignment. For example, using the following data source:
Example 1:
As is, the data incorrectly aligns Anders with the nickname, Rocket, and Maurice with the nickname, The Great One. Use
Returns: <blank>, Rocket, The Great One Example 2:
Returns: 1974-1978, <blank>, 1978-1979 Note: This function does not work for nested arrays. |
| kf:names |
Syntax: Note: You can enter the formula manually or generate it automatically by choosing the Selection Option Select all field names in <parent> element. The Example 1: For example, Facebook can return page fans data by gender and age. To create a list of these categories for a table column for a bar/line chart x-axis, use:
Which returns data shown in the following image:
Compare with More examples: The following show more examples using the data source featured in the previous function (
Note: Unnamed fields cannot be selected directly; see kf:element_at (described at the top of this table). |


