How to refer to the computed value of a filter in a markdown viz/note

So Connor has an example here (How do I reference a filter value? (Filters as parameters) - Modeling - Omni Community) where you can refer to the filter’s value. But for dates - if you use the filter as past 1 complete month - I would like it to show the start date - end date or do something

If you type in {{ inspect }} you can see the whole query payload (see below).

For filters, we don’t pass start / end, but as a workaround you can either add and hide a measure with the min and max and compute off of that, or you could go the much more involved route of using templated filters.

Here’s a mini pseudo model for the templated example:

schema: public
sql: |-
SELECT *
FROM users
WHERE 1=1
AND created_at >= {{filters.users.test.range_start}}
AND created_at < {{filters.users.test.range_end}}

dimensions:
test_start:
sql: “{{ filters.users.test.range_start }}”

test_end:
sql: “{{ filters.users.test.range_end }}”

measures:
count:
format: NUMBER
aggregate_type: count

filters:
test:
type: timestamp
1 Like