Is it possible to create multiple CTEs with the Notebook Editor?

I am creating a cohort analysis and would like to use a pivot table to visualize it nicely (instead of a table). In order to use a pivot table, however, the question needs to be built using the notebook editor instead of SQL, but I am not sure how (or if it is possible) to create multiple CTEs using the notebook editor.

Essentially, I have a base dataset I can use to start off from a saved question built with the SQL editor. Based on it, however, I need to create 4 CTEs to get the data for the cohorts, but can't find a way to do it in the Notebook editor. Is this possible? Thanks!

Hi @liliana
The Notebook editor does not handle CTEs. You would have to do that in SQL. You can then use the SQL question as the base in the Notebook - either with a Saved Question or Model.
https://www.metabase.com/docs/latest/users-guide/04-asking-questions.html#creating-a-new-question-with-the-query-builder

1 Like