Passing parameters into PDT

Hi

I’ve got a question regarding Solution 2 in this article
https://help.looker.com/hc/en-us/articles/360023861633
 

Is it possible to use Looker Liquid variable “ _explore._name “ instead of direct explore name, if I’d like to use the same view multiple times?

Thank you

Solved Solved
0 1 703
1 ACCEPTED SOLUTION

Hi @Alexey2 

Unfortunately this wouldn’t be possible for a couple of reasons

  1. The liquid variable _explore._name and similar variables require the query to be run before the value can be determined. However, the query can’t be run without the field for the filter being defined. 
  2. The reason why the extends solution (Solution 1) works is that an extend creates a copy of the view. This allows for different filters to be applied to each copy of the view i.e. the base view can be filtered in one way and the extended view that’s joined can have different filters. If it was possible to do use something similar to your question, any filter applied to one of the views would be applied to all instances of the view within the Explore
     

I hope this helps. Let me know if you have any questions

Naomi, Redkite

View solution in original post

1 REPLY 1

Hi @Alexey2 

Unfortunately this wouldn’t be possible for a couple of reasons

  1. The liquid variable _explore._name and similar variables require the query to be run before the value can be determined. However, the query can’t be run without the field for the filter being defined. 
  2. The reason why the extends solution (Solution 1) works is that an extend creates a copy of the view. This allows for different filters to be applied to each copy of the view i.e. the base view can be filtered in one way and the extended view that’s joined can have different filters. If it was possible to do use something similar to your question, any filter applied to one of the views would be applied to all instances of the view within the Explore
     

I hope this helps. Let me know if you have any questions

Naomi, Redkite

Top Labels in this Space
Top Solution Authors