Skip to content

Add Using Parameters in Filters #194

@torimwhaley

Description

@torimwhaley

I was trying a use case where I want to test the outcome of two different ticket tagging automations (to see which one is tagging best). I have is_bug & is_bug_2 for flagging tickets with a bug tag.

In my .yml, I wanted to use a parameter to filter some metrics I created:

lightdash.config.yml:
`parameters:
is_bug_toggle:
label: "Bug Field Toggle"
description: >-
There are two fields representing whether an issue is a bug or feature request.
Choose which field to use.
One is based on Question Type custom field, and the other is based on Bug or Feature Request custom field."
options:
- "is_bug"
- "is_bug_2"
default: "is_bug"
multiple: false

is_feat_req_toggle:
label: "Feature Request Field Toggle"
description: >-
There are two fields representing whether an issue is a bug or feature request.
Choose which field to use.
One is based on Question Type custom field, and the other is based on Bug or Feature Request custom field."
options:
- "is_feature_request"
- "is_feature_request_2"
default: "is_feature_request"
multiple: false`

example metric:
unique_bug_issues: type: count_distinct groups: - issues label: Unique Bug Issues description: Count of unique issues that are classified as bugs. format: '0' sql: | CASE WHEN ${lightdash.parameters.is_bug_toggle} = 'is_bug' AND ${is_bug} = TRUE THEN ${id} WHEN ${lightdash.parameters.is_bug_toggle} = 'is_bug_2' AND ${is_bug_2} = TRUE THEN ${id} ELSE NULL END

I wasn't sure how to do this from reading the docs, but it could be useful. the end result is that I can toggle between is_bug and is_bug_2 and see how many unique bug tickets each tagging system is generating.

Image

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions