Share clauses between queries?

A number of my reports share WHERE clauses to blacklist certain data from the reports. These blacklists are somewhat dynamic and it becomes real hairy to ensure each report is updated if it changes.

I can't seem to find a way to either:

a) Share a query between reports
b) Share a liquid definition between queries, across reports

Does anyone have a suggestion on how I can deduplicate text/logic in my queries across multiple reports?

Thanks

5replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Definitions does somewhat what I want to do. I'd have to restructure some queries so that they're doing a subselect from a centralized query which has been blacklisted already. https://help.modeanalytics.com/articles/definitions/

    But it would be neat to have a Definitions-like feature which worked with Liquid to be able to insert partial queries and not full SELECTs

    Reply Like
  • Jeff Andersen Yeah Definitions actually isn't what I'd be looking to use. Especially where the queries are not structured to operate from a sub-select query.

     

    Ideally it would be part of the templating system that enables me to append to a WHERE clause with specific shared items.

    Reply Like
  • Jeff Andersen Hello Jeff, did you find any solution? is there any way to share a liquid template at least between queries on the same report?

    Reply Like
  • Javier Berlana the workaround I'm using, which is not performant, is to create a query in a definition which can be used as a join.

    It works because my main deduplication is around creating a blacklist of records I do not want to be included in subsequent queries. My definition returns a whitelist of related records, then I query a separate table and join on to the definition.

    So, to my knowledge, there still isn't really a solution to simply templating your queries across reports.

    Reply Like
  • Jeff Andersen Now I see... thanks a lot for your reply.

    What a pitty there is no way to do something like this in a clean way, I think is a really common use case.

    Reply Like
Like2 Follow
  • 2 Likes
  • 2 days agoLast active
  • 5Replies
  • 284Views
  • 2 Following

Create A New Discussion

Share your thoughts