Looker Studio Function : NARY_MAX

Category: Arithmetic function

The NARY_MAX function in Looker Studio helps you identify the maximum value among multiple fields or expressions. It’s ideal for use cases where comparative analysis across various data points is essential. This function supports data-driven decisions, customer segmentation, and performance benchmarking with ease.

Purpose of the NARY_MAX Function

1. Data Distribution Analysis :

NARY_MAX helps understand how different data sources or columns vary in terms of peak values. This is useful in identifying outliers or top-performing segments, offering deeper insight into data patterns.

2. Customer Segmentation :
With NARY_MAX, businesses can classify customers based on their highest interaction levels, purchase volumes, or engagement scores, helping in precise segmentation and targeted marketing strategies.

3. Decision Making :

By extracting the maximum values from multiple KPIs, decision-makers can focus on top-performing strategies or products. This supports informed, metrics-based business decisions.

Type of Calculation:

Use CaseDescription
Performance BenchmarkIdentify which product, campaign, or channel performs the best across several metrics.
Customer SegmentationCategorize users by their maximum spending, activity level, or frequency of engagement..
Time Series AnalysisCompare monthly or quarterly figures to find peak performance periods across multiple metrics.

NARY_MAX(value1, value2, ..., valueN)

 
ParameterTypeDescription
value1NumberFirst numeric field or expression to evaluate
value2NumberSecond numeric field or expression to evaluate
valueNNumberAdditional numeric values or fields to compare

How Does the NARY_MAX Function Work?

The NARY_MAX function evaluates a list of numeric inputs and returns the one with the highest value. It runs on row-level data and can be applied across various dimensions or calculated fields. This function is highly efficient for comparative analysis and highlighting peak values across multiple metrics.


When Should You Use NARY_MAX?

Use NARY_MAX when you need to:

  • Compare multiple metrics to find the highest one per row.

  • Create dynamic fields for peak performance tracking.

  • Highlight leading customer behavior patterns or top metrics.

Example of  NARY_MAX with Result

Example 1: Basic Usage

NARY_MAX(Sales_Q1, Sales_Q2, Sales_Q3, Sales_Q4)

Example 2: Column Usage 

NARY_MAX([Profit 2023], [Profit 2024])
Result: Helps compare profits across two years.

Example 3: Handling Decimals and Scientific Notation

NARY_MAX handles decimal precision and values in scientific notation accurately, ensuring valid maximum output across complex datasets.

Example 4: Combining with Other Functions

NARY_MAX(ABS(Value1), Value2)

Tips and Tricks

  • Use in scorecards to highlight top performance KPIs.

  • Combine with CASE WHEN for rule-based logic.

  • Ideal for comparative dashboards to showcase peak trends.

1. What is NARY_MAX used for in Looker Studio?

NARY_MAX is used to return the highest value among multiple numeric expressions, ideal for comparisons, peak analysis, and data segmentation.

2. Can NARY_MAX handle null values?

Yes, NARY_MAX automatically ignores null values and evaluates based on available data.

3. How many arguments can I pass into NARY_MAX?

You can pass multiple numeric expressions; there is no strict limit, but performance may vary with too many fields.

4. Is NARY_MAX different from MAX?

Yes. MAX typically operates on one field, while NARY_MAX allows comparison across multiple fields or expressions in a single row.

5. Can I use NARY_MAX with calculated fields?

Absolutely! NARY_MAX works seamlessly with calculated fields, helping you build dynamic and insightful metrics.