Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sdk$runInlineQuery Filter with multiple options. #28

Open
dougneedham opened this issue Jul 16, 2018 · 1 comment
Open

sdk$runInlineQuery Filter with multiple options. #28

dougneedham opened this issue Jul 16, 2018 · 1 comment
Assignees
Labels
Status: Investigating Package maintainer is gathering more information about the issue to decide what to do next.

Comments

@dougneedham
Copy link

I need to be able to run an inline query where I can use a combination of filters.
For example: data <- sdk$runInlineQuery(model = "model_name",
view = "my_awesome_explore",
fields = c("id", "count"),
filters = list("field_name" = "filter_expression",
"another_field" = "filter_expression"),
How would I do something like this:

data <- sdk$runInlineQuery(model = "model_name",
view = "my_awesome_explore",
fields = c("id", "count"),
filters = list("field_name" = "filter_expression1","filter_expression2","filter_expression3")

@maxcorbin
Copy link
Contributor

maxcorbin commented Jul 16, 2018

Hey @dougneedham, thanks for bringing this up. It's not immediately clear to me whether the Looker API accepts duplicate keys for the same field in the filters parameter. Based on what I know, I would expect the following to work:

filters = list("field_name" = "filter_expression1",
               "field_name" = "filter_expression2")

But this may not be the case based on how the Looker API expects the request and how LookR creates the request. There might be room for improvement on my end here. I'll do some testing and get back to you.

In the meantime, Looker allows you to combine multiple filter expressions into a single filter expression, with different methods for different data types. For example, with string type fields, you can use commas to match either string. FOO,BAR will match either FOO or BAR. For number type fields, you can use the AND and OR keywords. >10 AND <=20 will match numbers 11-20.

@maxcorbin maxcorbin added the Status: Investigating Package maintainer is gathering more information about the issue to decide what to do next. label Jul 16, 2018
@maxcorbin maxcorbin self-assigned this Jul 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Investigating Package maintainer is gathering more information about the issue to decide what to do next.
Projects
None yet
Development

No branches or pull requests

2 participants