# Unleashing the Power of Calculations in Hex: New Use Cases and Input Parameters

Four ways calculations are empowering business users to slice, dice, and explore data themselves

Every data person knows this one: You just put the finishing touches on a “comprehensive” report, hit send with a sense of accomplishment, and within minutes your inbox pings: “This looks great! But could you add a column showing percent of total?” and then another one “Can I get this but with just my target segment highlighted?”

It’s not that your report wasn’t thorough — it’s that a good data culture comes with infinite questions and one-more-things. Every answer or report inevitably spawns new questions and if every one of those has to go through the data team, there’s no way you can keep up.

This is why we added Calculations into Hex. We took the secret programming language that everyone already knows — spreadsheet functions — and brought them deep into Hex to work at data warehouse scale. Calculations empower business users to dive deeper into data and answer their own “what if” questions without constantly tapping the data team on the shoulder.

Here’s three of the most common use cases for Calculations we’ve heard about from our customers — and a bonus one that’s newly possible with a feature we’re releasing today! See our full July bundle of product updates.

## Quick analysis and modeling

Calculations make it easy for anyone familiar with spreadsheet functions to calculate their own metrics on the fly. This means business users can do things that are difficult or impossible with just a drag-and-drop query interface like:

• Create financial models with ease (e.g., revenue forecasting, budget planning)

• Build what-if scenario analyses

• Implement custom scoring or ranking systems

• Calculate relative measures (e.g., percent_of_total, difference_from_average)

Nikita, a Risk Analyst from Chime, uses calculations for all kinds of math and statistical modeling. She tells us: “Using Calcs is just faster. I’ve already done the work to get data [from the warehouse] into a table, and with Calculations there’s no need to go into code.”

Calcs run with a real-time output preview, so it feels efficient to prototype even complex formulas. Once you finish, everything automatically compiles to SQL on the backend so your calculation can run on data of any size — even millions, or billions of rows.

## Creating segments for visualization

One of the most common reasons a self-serve attempt becomes a data team request is the need for a “custom segment”. You have a bunch of raw data broken out at a detailed resolution and now you want to re-group it for visualization — but not by a predefined dimension! Often, this looks like bucketing a few different values into new groups or binning rows based on numeric thresholds.

Whatever the scenario, this is something that’s incredibly easy to do in Excel, but painfully difficult for business users in most data tools.

Using simple IF() or SWITCH() statements in Calculations, anyone can build segments and groups on the fly, and then easily visualize them using a downstream chart cell. We’ve seen users:

• Dynamically categorize transactions based on custom criteria

• Build user cohorts for comparative analysis

• Flag outliers or anomalies using simple statistical thresholds

• Implement custom color-coding for visual emphasis

The slice-and-dice control this gives stakeholders and business users is the stuff that’s typically the domain of SQL and Python experts.

## Simplifying complex filter logic

Calculations can handle complex logic and can also be used as filters, which makes them a great tool for —you guessed it!— creating advanced filters. Because they operate using simple column references and are written in a familiar language, Calculations can turn potentially confusing data operations into easily manageable and achievable spreadsheet tasks.

Liz Kennedy, Principal Marketplace Operations Manager at Upside uses Calculations to find underlying causes for incidents with site operations: “There’s a series of checks we need to run through when a site isn’t processing correctly. I set up nested IF() statements in a calc, and it makes that really easy.”

• Turn complicated multi-step filters into a single column

• Create boolean flags for more intuitive filtering (e.g., is_active, meets_criteria)

• Create filter groups based on quantitative thresholds or statistical comparisons (e.g., only return rows with a MRR greater than the last year average)

• Generate custom categories or tags based on multiple attributes

Because Calculations can be added as columns and then optionally used for filtering, it’s easy for business users to set up reports that serve as exploration launchpads for other stakeholders. A growth marketer, for instance, can share a report with calculated columns that team members can use to filter and explore on their own, eliminating the need to start from scratch or the risk of looking in the wrong direction.

And the data team never has to get involved.

## Bonus: Build interactive data apps

As of today, Calculations can be used to build end-to-end interactive data apps that prompt end users for input and then build scenarios, visualizations, or dynamic reports based on that input — without writing a single line of SQL or Python code.

Calculations can now be “parameterized” with values from Hex’s Input Parameters by referencing the name of a parameter with curly brackets: `{{parameter}}`. With the ability to reference user input in any calculation, every use case described above can become dynamic and interactive.

Here’s a short 5-minute video of me building a data app end-to-end that gives users a what-if scenario tool. I don’t write a single line of SQL or Python code, and the end product is embedded below for you to play with.

The resulting app:

Giving everyone the power to build these interactive experiences not only empowers users, but also reduces the burden on data teams! Just like the other use cases, a workflow that traditionally required data team intervention is now well within the reach of any data-curious explorer.

See our July bundle of product updates.

This is something we think a lot about at Hex, where we're creating a platform that makes it easy to build and share interactive data products which can help teams be more impactful.

If this is is interesting, click below to get started, or to check out opportunities to join our team.