Overview
Custom Dimensions in Polar Analytics let you segment, label, and transform your data using rule-based logic. They are useful when you want to clean up raw values, group records into meaningful categories, extract parts of text, or build date-based and numeric breakdowns for reporting. The current feature set includes comparison operators, text functions, date functions, math functions, and regex-based pattern matching.
In this article, readers will learn:
how Custom Dimension logic works using When, Then, and Else
which operators are available and when to use each one
how to format text, date, math, and regex functions correctly
step-by-step examples for building practical Custom Dimensions in reports
Extended Custom Dimension tutorial
Section 1: Understand Custom Dimension Logic
Before using operators or functions, it helps to understand the structure of a Custom Dimension. Every rule is built from three parts:
When: the condition that must be true
Then: the value returned when the condition is met
Else: the fallback value returned when no conditions match
A single When block can contain multiple conditions. These conditions can be combined with:
AND: all conditions must be true
OR: at least one condition must be true
Examples:
Country is "US"ANDDevice is "Mobile"returns only mobile users in the US.Country is "US"ORCountry is "CA"returns users from either country.
Step by step: build your Custom Dimension logic
Open the Custom Dimension builder.
Add a When condition using the dimension you want to evaluate.
Choose the operator that matches the type of comparison you need.
Enter the value or formula to test.
In Then, enter the output you want Polar to return when the condition is true.
In Else, add a fallback output so unmatched values still return something useful.
Save the Custom Dimension and add it to a report as a breakdown or grouping field.
Available operators
Use operators to compare a dimension against a condition:
Operator | Description | Example |
| True if the dimension includes a specific value |
|
| True if the dimension excludes a value |
|
| Same as |
|
| Case-sensitive exclusion |
|
| Exact match |
|
| Excludes exact match |
|
| Matches a beginning value |
|
| Matches an ending value |
|
| Matches one of several values. Be sure to remove the spaces after each "," |
|
| Excludes all values in the list. Be sure to remove the spaces after each "," |
|
Formatting tip for lists
For Is in list and Is not in list, remove spaces after each comma when formatting the list.
Section 2: Use Functions to Transform Text, Dates, and Numbers
Functions let you return transformed values instead of raw dimension values. They are especially useful for cleaning labels, extracting parts of strings, formatting dates, and making simple calculations directly inside a Custom Dimension.
Text functions
Use text functions to shorten, standardize, combine, or extract text from fields like SKUs, titles, tags, or UTM values.
Left - Returns the leftmost characters of a string.
Left - Returns the leftmost characters of a string.
Format: Left(value, length)
value: The dimension/text you want to shorten (e.g. a SKU, title, or URL).length: The number of characters to keep from the start.
Example: Left(SKU, '4') → PREM-123456 → PREM
In the example below, we're splitting the SKU dimension so that any SKU containing a hyphen "
-" only returns the first 12 characters:
Right - Returns the rightmost characters of a string.
Right - Returns the rightmost characters of a string.
Format: Right(value, number)
value: The dimension/text you want to shorten (e.g. a SKU, title, or URL).length: The number of characters to keep from the start.
Example: Right(SKU, '4') → PREM-1234 → 1234
Lower - Converts all text to lowercase.
Lower - Converts all text to lowercase.
Format: Lower(value)
value: The dimension you want to convert
Example: Lower(Country Code) → "RO" becomes "ro"
Upper - Converts all text to uppercase.
Upper - Converts all text to uppercase.
Format: Upper(value)
value: The dimension you want to convert
Example: Upper(Campaign Name) → "summer sale" becomes "SUMMER SALE"
Concat - Combines two dimensions or strings.
Concat - Combines two dimensions or strings.
Format: Concat(value1, value2)
value1: The first dimension or text string you want to pull invalue2: The second dimension or text string you want to pull in
Example: Concat(Country Code, Zip Code) → "IL" + "90210" → "IL90210"
Replace - Replaces a dimension or string of text with a defined value or dimension
Replace - Replaces a dimension or string of text with a defined value or dimension
Format: Replace(subject, pattern, replacement)
subject: The dimension you want to targetpattern: The substring that you want to replacereplacement: The value used as a replacement
Example: Replace(Product Title, 'Trial', 'Standard') → "Trial Kit" becomes "Standard Kit"
Split Part - Splits a dimension or a string of text into parts using a delimiter and returns the selected part.
Split Part - Splits a dimension or a string of text into parts using a delimiter and returns the selected part.
Format: Split_part(string, delimiter, partNumber)
string: The dimension or text to be split into partsdelimiter: The text representing the delimiter to split bypartNumber: The requested part of the split (starts at 1)
Example: Split_part(SKU, '-', '2') → "PREM-01-GOLD" returns "01"
Step by step: create a text transformation
Add a new Custom Dimension rule.
In When, define the condition that identifies which rows should be transformed.
In Then, enter the function using the correct format.
Use the original dimension or a fallback label in Else.
Save the Custom Dimension and test it in a report.
Example workflow:
Use
SKU contains "-"in When.In Then, enter
Left(SKU, '12')if you want the first 12 characters only.In Else, return
SKUso all other values stay unchanged.
Date functions
Date functions help you extract or reshape dates for time-based reporting. When using them, you must specify the date field to use, such as the shared Date dimension or a field like Customer First Order Date or Order Processed Date.
When using date functions, you need to specify which date to use. This will typically be a dimension like:
Date→ the shared date dimension that automatically uses the date range selected in your report.Customer First Order Date,Order Processed Date, etc. → specific dimensions from your data.
Week / Month / Quarter / Year - Assigns a number to the week, month, quarter, or year.
Week / Month / Quarter / Year - Assigns a number to the week, month, quarter, or year.
Format: Week(date) / Month(date) / Quarter(date) / Year(date)
Example: Week(Date) → "2022-04-10" → 15
Day Name - Returns the name of the weekday.
Day Name - Returns the name of the weekday.
Format: DayName(date)
Example: DayName(Date) → "Tuesday"
Day of Week - Returns a number from 0 (Sunday) to 6 (Saturday).
Day of Week - Returns a number from 0 (Sunday) to 6 (Saturday).
Format: DayOfWeek(date)
Example: DayOfWeek(Date) → "2022-04-10" → 0 (Sunday)
Current Timestamp - Returns the current timestamp in UTC
Current Timestamp - Returns the current timestamp in UTC
Format: Current_timestamp()
Example: Current_timestamp() -> "2025-08-28 12:15:32"
Date - Returns the calendar date part of a timestamp
Date - Returns the calendar date part of a timestamp
Format: Date(Date)
Example: Date(Date) -> "2025-08-28 12:15:32" -> "2025-08-28"
CONVERT_TIMEZONE - Convert a timestamp in UTC to a target timezone
CONVERT_TIMEZONE - Convert a timestamp in UTC to a target timezone
Format: Convert_timezone(Timezone, Date)
Example: Date(Date) -> "Europe/Paris", "2025-08-28 12:15:32" -> "2025-08-28 14:15:32"
DATEADD - Add a number of days, weeks, months etc. to a date
DATEADD - Add a number of days, weeks, months etc. to a date
Format: Dateadd(Date Part, Amount, Date)
date_part: The unit of time (year, month, day, quarter)amount: How many of date_part to add (negative values for subtraction)
date: The date to operate on
Example Dateadd(Date Part, Amount, Date) -> 'day', 2, '2025-08-28' -> '2025-08-30'
DATEFORMAT - Format a date using Snowflake formatting
DATEFORMAT - Format a date using Snowflake formatting
Format: Dateformat(Date, Format)
Example: Dateadd(Date, Format) -> '2025-08-28', 'MMMM' -> 'August'
Date Diff - Returns the difference between two dates.
Date Diff - Returns the difference between two dates.
Format: Datediff(date_part, date1, date2)
date_part: The unit of time (year, month, day, quarter)date1: The first value to comparedate2: The second value to compare
Example: Datediff('day', Processed date, Updated day) → "2022-01-01" and "2022-01-10" = 9
Math Functions
Math functions let you calculate or standardize numeric values in Custom Dimensions.
POW - Calculate the power of a number
POW - Calculate the power of a number
Format: Pow(Base, Exponent)
Example: Pow(Base, Exponent) -> 2, 4 -> 16
DIV0 - Calculate the division between two numbers. Fall back to 0 if the denominator is 0.
DIV0 - Calculate the division between two numbers. Fall back to 0 if the denominator is 0.
Format: Div0(Base, Exponent)
Examples:
Div0(Base, Exponent) -> 2, 4 ->0.5Div0(Base, Exponent) -> 6, 0 ->0
MOD - Calculate the rest of the integer division between two numbers.
MOD - Calculate the rest of the integer division between two numbers.
Format: Mod(Base, Exponent)
Example: Mod(Base, Exponent) -> 5, 3 -> 2
ABS - Calculate the absolute value of a number.
ABS - Calculate the absolute value of a number.
Format: Abs(Value)
Example: Abs(Value) -> -3 -> 3
ROUND - Round a number.
ROUND - Round a number.
Format: Round(Value)
Example: Round(Value) -> 1.7 -> 2
FLOOR - Calculate the floor of a number.
FLOOR - Calculate the floor of a number.
Format: Floor(Value)
Example: Floor(Value) -> 1.7 -> 1
CEIL - Calculate the ceiling of a number.
CEIL - Calculate the ceiling of a number.
Format: Ceil(Value)
Example: Ceil(Value) -> 1.7 -> 2
Section 3: Use Regex and Real Report Examples
For more advanced use cases, Custom Dimensions also support regex-based extraction through the Regexp(subject, pattern) function. This is helpful when values are embedded inside structured text, JSON-like strings, notes, or tags.
Regexp - Extracts text based on a regex pattern.
Regexp - Extracts text based on a regex pattern.
Format: Regexp(subject, pattern)
subject: The dimension or string on which you want to apply the regexpattern: The regular expression or the text that precedes the string you want to extract followed immediately by([^ ]*)or([^"]*)
Pattern | Use when... | Example Target |
| The value ends with a space |
|
| The value ends with a quote |
|
Example: Regexp(Order Line Properties, '{"name":"Color","value":"([^"]*)') -> Extracts "Blue" from: [{"name":"Color","value":"Blue"}]
Example: Regexp(Notes, 'Duties and Fees: ([^ ]*)') -> Extracts "17.39" from: Duties and Fees: 17.39 GBP
⚠️ Tip: If copying ([^"]*), ensure your quotation marks stay straight quotes (") and not curly quotes (“”) — some browsers may auto-format them incorrectly.
Examples
Analyze Total Sales by Day of the Week
If you'd like to break down your Total Sales by the day of the week they were processed (to identify your highest sales days over a given period), you can use a Custom Dimension like this:
What this does:
If there's a valid
Order Processed Date, it returns the day of the week (e.g. Monday, Tuesday).If no date is available, it returns
"No Data - Extend date range"as a fallback.
Note: The specific date range rule applied to the Order Processed Date doesn’t matter much—what’s important is that your report covers a wide enough date range to include meaningful data.
Once this Custom Dimension is created, add it as a breakdown in a Custom Report alongside Total Sales. You’ll instantly see which days drive the most revenue.
Example Insight:
In the sample report below, Saturdays had the highest Total Sales, while Tuesdays had the lowest—helping you identify weekly patterns and plan accordingly.
Add Labels to Week Numbers Using Concat
If you want to track performance by week, labeling your weeks clearly can help you compare trends more easily across months or years.
For example, if you're analyzing sales or sessions on a weekly basis, adding a prefix like "W-" to your week numbers makes charts and tables easier to read and interpret at a glance.
You can do this using the Concat function:
Concat ('W-', Week (Date))→"2022-04-10"→W-15
What this does:
Week((Date))pulls the week number from a date (e.g."2022-04-10"becomes15).Concat("W-", ...)adds the"W-"prefix to make the output easier to interpret in your reports.
Tip: This kind of labeling is especially helpful when visualizing data by week in bar charts or tables—clearer labels make insights easier to spot.
Conclusion
Custom Dimensions in Polar Analytics give you a powerful way to turn raw data into meaningful, actionable insights. By combining When / Then / Else logic with operators and functions, you can clean, categorize, and transform your data directly within your reports—without needing external tools.
To get the most value, start with simple rules, validate your outputs, and gradually layer in more advanced functions like date formatting, math calculations, or regex extraction. Small improvements in how your data is structured can lead to much clearer reporting and better decision-making.
As you build more Custom Dimensions, you’ll be able to tailor your analytics to match your exact business needs—making your dashboards more intuitive, scalable, and insightful.














