Looker API 4.0 - Run Inline Query Endpoint

sho
Bronze 1
Bronze 1

Hi all, I'm running into issue with the Run Inline Query endpoint usage, specifically with the filters param.

Upon experimenting different arguments for filters, it doesn't seem like it's taking any effect on the result set, for example, if I pass in "table.columnName": "after 100 minutes ago", I'll still get results that timestamped in the last few minutes.
My goal is to filter my results by table.created_time, where created_time >= 2024-03-06 00:00:00 AND <= 2024-03-07 01:00:00.
Does anyone know if there's a known issue with this endpoint? If not, if there's issue with my syntax above? I've tried a few args that would either give me a syntax error, or yields the same result:
key --> "after 2024-03-06 00:00:00 AND before 2024-03-07 00:00:00"
key --> "after 1008 hours, before 1009 hours ago"
key --> "on 2024-03-06"

Any guidance will be appreciated! 🙂

 

Solved Solved
1 2 82
1 ACCEPTED SOLUTION

I would recommend checking out: https://cloud.google.com/looker/docs/filter-expressions#date_and_time , specifically the "relative" dates section if you want it to be dynamic. 

I think you probably want "2024-03-06 00:00:00 to 2024-03-07 01:00:00" from the "{time} to {time}" option. 

Easiest way to play around with this to get the combination you want is to go to an explore with the filter and use the "matches advanced" option which will accept these strings and you can quickly check it is generating the expected SQL.  

Hope this helps! 

 

View solution in original post

2 REPLIES 2

I would recommend checking out: https://cloud.google.com/looker/docs/filter-expressions#date_and_time , specifically the "relative" dates section if you want it to be dynamic. 

I think you probably want "2024-03-06 00:00:00 to 2024-03-07 01:00:00" from the "{time} to {time}" option. 

Easiest way to play around with this to get the combination you want is to go to an explore with the filter and use the "matches advanced" option which will accept these strings and you can quickly check it is generating the expected SQL.  

Hope this helps! 

 

Hi Ian, thanks for the help here and the linked docs, super helpful and it worked perfectly!