# How to Calculate Churn Rate in PostgreSQL

Learn how to calculate Churn Rate with your churned and total customers. We'll also cover industry averages for churn rate and how to find the metric on Stripe!

Optimizing churn rate is one of the best ways to know if your business can create loyal customers for a certain period. By definition, the churn rate is the rate at which customers stop doing business with an entity (thanks, Investopedia!). More specifically, we like to look at it as how long you were able to maintain the interest of your customers. While the metric seems simple on the surface, it gives valuable insights into areas of future growth and improvement. We'll take you through how to calculate this metric, how to understand it in the context of your industry, and how to apply it to the platforms you're using now.

## How to Calculate Churn Rate

You can calculate the churn rate by dividing the number of churned customers by the total number of customers. Churn rate can be assessed for various time-periods (i.e. day, week, month, year) and, if your churn rate is tied to certain products or campaigns, you can assign a specific churn rate for each.

If you’re confused about how to define the number of churned customers and total number of customers, we’ve included some nifty definitions and examples below:

• Number of churned customers is the number of customers that leave a service/website/app at a certain period. This may include customers who downloaded an app but no longer use it or those who canceled their subscriptions.
• Total number of customers is the number of customers that you have during a period. This may be those who visited the website, availed service or plan, or downloaded the app.

There are also other ways of computing the churn rate of a business. The one above is the most basic way which can also be called customer churn. There is also gross dollar churn, which calculates the total revenues lost.

When choosing what to include in your calculations, remember: consistency is key! That means, if you decide to include XYZ in your churn rate for the month, you should include it in the next month’s churn rate as well. Having consistent metrics will allow you to better identify the causes of good or bad performance.

## How to Calculate Metric in PostgreSQL

It can be difficult to calculate this metric in PostgreSQL, but we have a quick and easy solution, Lido.app. Read below to learn more and get started today.

## What is Lido?

Lido allows you to connect, analyze, and visualize all of your data in a single spreadsheet. Don't wait for engineers to build analysis dashboards! Lido provides a simple and easy solution to importing data from numerous platforms. Automatically import data from your favorite platforms such as Shopify, Facebook, Google Analytics, and many more and apply Lido's software to extract meaningful metrics from them. After applying Lido software to your data, you will be left with sleek, attractive dashboards to share with your stakeholders, rather than confusing and jumbled raw data. Furthermore, the dashboards are easily editable to focus on specific data or metrics.