admin管理员组

文章数量:1291148

Can we extract the filter value(s) selected in a dashboard filter (applied on a different dataset's column, which is not present in my current dataset) using Jinja in Superset?

Issue: I tried using the following Jinja expression:

min("month_datetime_col") <= 
dateadd(s, (
    {%    if    filter_values    ("month2_datetime_col")|length %}
        {{ filter_values   ("month2_datetime_col")[0] }}
    {% else %}
        extract(epoch from current_date)
    {% endif %}
) / 1000, '1970-01-01 00:00:00')

However, I am facing two issues:

When applied to the same dataset, it first filters the dataset and then counts the IDs according to the condition. When applied to a different dataset, it always takes the else condition value. Goal: I am trying to calculate the total base of IDs up to the selected filter value. Specifically, I need a solution to:

Achieve the same logic in a table that has month-wise columns Get the total base of IDs till each month If anyone has a solution or an alternative approach.

本文标签: jinja2Extracting the Values selected in the Filter on a column from a different datasetStack Overflow