looker / lookerbot

Lookerbot lets you access all your Looker data from Slack! Super fun!
https://looker.com/lookerbot
MIT License
169 stars 141 forks source link

Support multiple filters #28

Open fernavid opened 8 years ago

fernavid commented 8 years ago

If a dashboard has a date filter, and you try to query using the looker filter expressions for dates, it returns an empty chart.

@looker dashboard123 5 days user123

looker response: (1kb blank chart)

wilg commented 8 years ago

Filter expressions for dates should work, but only one filter is supported.

Looks to me that the filter syntax 5 days user123 is being interpreted as a date filter and is not valid.

fernavid commented 8 years ago

Only one filter is supported? The looker help command seems to imply more than one filter is supported. It shows error rates*​ <username>, <days>

wilg commented 8 years ago

Ah, it's true the help text will show that, which is misleading. But yes, only one filter is supported.

We are trying to figure out a natural syntax for multiple filters. Unfortunately people want to put commas directly into a single filter as well.

IanAtLooker commented 8 years ago

+1

rumanone commented 8 years ago

Is this still WIP? It'd be really helpful to have this functionality.

wilg commented 8 years ago

@rumanone It's really just a matter of figuring out an understandable syntax for people.

The primary issue is a number of people already use filters like User1, User2 since commas in our filter syntax indicate an OR.

So we either need some other way of handling it, or have a way of marking certain dashboards as able to use multiple filters.

fernavid commented 8 years ago

How about a | between filter expressions?

wilg commented 8 years ago

Technically that's a valid character as well but that's what I was thinking as well.

dthorpe commented 8 years ago

| pipe char between filter expressions to mean OR, or to mean AND?

dmarkell commented 8 years ago

Why not the same thing way the explore GUI works, where including a comma in a filter requires escaping with "\"... or maybe putting the entire filter expression in double quotes e.g.:

users Male Washington\, DC or users Male "Washington, DC"

On the subject of multiple filters, it would also be helpful to have the syntax extend to leaving out optional filters... i.e. 1) positional filter arguments using comma-separated values where the filter values are completed in order as they appear in the dashboard (as above, commas within one filter value should be escaped with a forward slash or the entire filter enclosed in double quotes)

users New York City Washington\, DC

or

2) named filter arguments using comma-separated key-value pairs in format "filter_name=filter_value" or "filter_name:filter_value" including filter name / values in any order

users City=Washington\, DC, Gender=Male

this syntax is a little less intuitive for business users, but still would make it a lot easier to share a simple query than building a new dashboard (with a new dashboard name) for every combination of input values -- and in the case of filter values without commas would be pretty straightforward to understand.

wilg commented 8 years ago

Interesting! I really like the named arguments approach, that could be a clean way to differentiate between the current single-filter syntax and a slightly more complex new one. Positional arguments get out of hand really quick here, I think.

brandonrobbins commented 7 years ago

+1

dionedge commented 7 years ago

+1

llakata commented 7 years ago

+1

serdaradali commented 7 years ago

+1 this is a very important feature, I hope you will come up with something soon!

Corentinflajoliet commented 7 years ago

+1 Very interested in having this feature too !

jtao27 commented 7 years ago

+1 again

trunsky commented 7 years ago

+1

philip-martinelli commented 6 years ago

+1

dashirov-ga commented 6 years ago

+1

tthustla commented 6 years ago

+1

EricKeen commented 4 years ago

+1