Need to create a field that returns a Yes/No based on timeframe chosen by user

I have a table of Tasks with the description/info of the task as well as that date it was created.

What I need is a field that returns a yes or no if a task was created within the timeframe that the user specifies when filtering in the Explore. How could this be accomplished? 

I’ve never used liquid parameters, but I’m thinking maybe that could help?

Solved Solved
0 1 404
1 ACCEPTED SOLUTION

Hi,

Yes, you’re on a right track!

First create a simple Filter of type:date

filter: date_filter {
type: date
}

Then create a Yes/No dimension that is a result of the filter:

dimension: is_within_param {
type: yesno
sql: {% condition date_filter %} ${TABLE}.your_date_field {% endcondition %} ;;
}

Then you can use this field as an another filter or even attach it permanently in another explore sql_always_where, or in an NDT.

View solution in original post

1 REPLY 1

Hi,

Yes, you’re on a right track!

First create a simple Filter of type:date

filter: date_filter {
type: date
}

Then create a Yes/No dimension that is a result of the filter:

dimension: is_within_param {
type: yesno
sql: {% condition date_filter %} ${TABLE}.your_date_field {% endcondition %} ;;
}

Then you can use this field as an another filter or even attach it permanently in another explore sql_always_where, or in an NDT.

Top Labels in this Space
Top Solution Authors