Looker Connect Training
Help Center
Documentation
Community
Cloud Certifications
I was able to solve this problem today, will share the solution that might help someone in the future. Btw, I think that the title of this question don't really describes the problem, but I wasn't able to change it.I left the idea of using parameters aside, and used liquid variables to solve the issue.dimension: state { type: string sql: CASE WHEN ${view_name.start_date} IS NULL OR COALESCE({% date_end filter_field_name %}, TIMESTAMP(CURRENT_DATE())) < ${view_name.start_date} THEN 'Inactive' ELSE 'Inactive' END ;; }where this {% date_end filter_field_name %} is used to get the end date of my filter.This will change the value from state depending on the last date of my filter. For now, seem like it's only working with date ranges, but is enough for my current problem.Not sure if there is a better way of doing this, but if you know a better way, please share with me :)
I was able to create the behavior that I desire using parameters. but It's not totally right yet and causing me some problems. This is how I define the parameter #this parameter is being used to filter the data parameter: effective_date { type: date } #The dimension just exists to bring the parameter value into the explore #in a way that a table calc can reference it dimension: pass_effective_date { type: date sql: {% parameter effective_date %} ;; }and the table calculations for the field is something like: if( is_null(${table.end_date}) OR ${table.pass_effective_date} < ${table.end_date}, "Active", "Inactive"))I'm also using this parameter to create a custom filter.This solution is only working if the user choose the filter as "Is on the Day" or "In anytime", other filters which gives the user an option for data range, causes the dashboard to bring no result, which I suspect is related to the value of the parameter while doing the table calculation
Already have an account? Login
No account yet? Create an account
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.