Define dimension from a sub table's column

  • 26 May 2022
  • 2 replies

I have a derived table on view, the sql goes like:

with events AS (

    select create_time, export_duration, upload_duration from datasets


select ‘export’ AS phase, min(export_duration), max(export_duration) from events


select ‘upload’ AS phase, min(upload_duration), max(upload_duration) from events

Since min and max are aggregate function, I cannot put create_time within the outside select clause, but I need to define a dimension based on create_time (so I can add a filter on top of that).


Best answer by Dawid 26 May 2022, 11:44

View original

2 replies

Userlevel 7
Badge +1

For this you will need to use a parameter + Liquid statements in your derived tables.

First point would be to read more about the parameters here:

The section that will be of the most interest to you is this one:

Once you have that, you need to look at how to insert the values of user’s input to the SQL code. Templated filters is what you need:



It works, thank you so much!