fb

Holistics Blog: SQL

Tricks, tips on using SQL

Calculate Cohort Retention Analysis with SQL

Cohort Retention Analysis is a powerful thing that most business owners need to look at.

Retention: If first-time user A goes to the store on Week 1, and returns to the store the next week, he is a returned user. If user B also goes to the store on Week 1 and does not return the next week, he’s a bounced user, that basically means you lose him as a user (despite all the marketing money you spent to lure him to your store).

Cohort Analysis is a technique to see how variables change in different...

Building Daily + Running Total Report With SQL

In this article I will show you how to build daily user growth report with cumulative number (running total) using mostly SQL, and filter capabilities of Holistics platform.

Animated raw

Requirements: We want to build a report that:

  • Show daily users and a cumulative user growth
  • Ability to select a date range
  • Ability to filter by some user’s conditions (gender, user type, etc)

First, The Dataset & A Simple Daily Count

Assume we work with this simple users table in PosgresSQL (fields like username...

Splitting array/string into rows in Amazon Redshift or MySQL

We’ve worked with a lot of customers who writes SQL on a regular basis. And from time to time they come to us with SQL question - that we thought would be interesting to share with others!

Today, one of our customers came to us with a question - They were having problems unnesting a string/array into rows in Amazon Redshift.

Question - Splitting comma-delimited string into rows in Redshift

Suppose we have a books table in Amazon Redshift that has these data:

tags (varchar)
-----
A
A, B
C...

Holistics Data Reporting provides a web interface for your existing SQL database to build and access reports

Holistics Data Preparation helps provide you an effortless approach to set up your reporting database.