I have a existing report which needs to migrate into looker in which one filter values are having the column names . If I select any value in the filter the column will be adding to the report dynamically. Is there any way we can add a column dynamically basing on the filter selection
1 Like
If you want to add only one column based on the filter value, you can achieve it using parameter as your filter.
You can create a dimension based on parameter and display the results.
parameter: date_granularity {
type: string
allowed_value: { value: “Day” }
allowed_value: { value: “Month” }
}
dimension: date {
label_from_parameter: date_granularity
sql:
{% if date_granularity._parameter_value == “‘Day’” %}
${created_date}::VARCHAR
{% elsif date_granularity._parameter_value == “‘Month’” %}
${created_month}::VARCHAR
{% else %}
NULL
{% endif %} ;;
}