Question

Possible to hide joins?

  • 13 January 2018
  • 24 replies
  • 2363 views

Userlevel 1

We would like to restructure/clean-up existing explores to make our models more intuitive. However I would like to avoid breaking too many things. Similar to explores and fields, is it possible to hide joins? So that users can’t pick from those any more but existing Looks don’t break.


Thanks in advance,

Dimitri


24 replies

Hey @Dimitri_Masin,


There isn’t a ‘hidden’ parameter that can be applied to joins. I am trying to see if there is a workaround, but the most straightforward way of addressing this might be to either create an new explore that doesn’t have these joins. Ideally, you could have a base explore with only the necessary joins and extend that (doc here) to have the joins needed for the existing views. This would be a bit trickier since you would be changing it over to a base explore, then extending that for the looks (which would then be the extended explore) and then hiding that explore (discourse explanation here). The content validator (doc here) would be really helpful here in making sure none of the Looks that are using the explore got broken in either the process of extending or in just creating a separate explore for them, or using it to change the reference of those looks to a new explore.


If you have additional questions, feel free to reach out to us here at help.looker.com


Best,

Jeremy

Userlevel 6
Badge

Unfortunately, there is no way to do this ‘en mass’. The simplest way I can think to do this would be to use extends. Create an extended version of the view that hides all the fields and join it in instead.


Suppose you have:


explore: some_explore {
joins: some_view {
...
}
}

view: some_view {
dimension: d1 {...}
dimension: d2 {...)
}


To hide all the fields in some_view


explore: some_explore {
join: some_view {
from: some_view_hidden
...
}
}

view: some_view_hidden {
extends: [some_view]
dimension: d1 {hidden: yes}
dimesnion: d2 {hidden: yes}
}

Userlevel 1

thanks @jeremy.eckman and @lloydtabb.

I ended up changing the view_label of those joins to “xxx TO BE REMOVED” which collapses the three unnecessary joins to one label and puts it to the end of the list. My hope is that people will not use it and I can remove them in 6 months time. Not very clean, but in terms of effort/value tradeoff seemed like an acceptable solution to me. Hidding the joins would have been a lot slicker 🙂

Thanks for sharing your solution @Dimitri_Masin - I’m glad you were able to find a solution that fits your needs- this should help ease the transition to removing those joins without putting too much time into trying to hide those joins. 😃

You can try to use an empty fields tag in the join-block of your explore. Since you don’t include any fields from the join, all dimensions and measures from the join are not included in the field-picker.

Awesome, just tried this and it worked like a champ!

Userlevel 1

Being able to hide fields from explore en masse like this would be immensely useful

Thanks for the feedback! I’ve relayed it to the product team.


Cheers,

Talal

Using fields restrict the information being picked up. Suppose we just need to hide the information in the explore. But needs to see the dimensions in some other explore. So we need an option to hide the dimension from the explore as well

Userlevel 2

Hey @rshelly,


Why not use hidden: parameter in the case if you want to hide certain dimensions/explores.

If you want to selectively hide fields in field picker that is currently not possible. If a field is excluded from a join, it’s not reference-able, correct. It’d be possible to create a filtered measure based on the field, but it would be hidden from the field picker for certain, declared explores. I am happy to pass along your use case to our Product team.


Best,


Sasha

Hi @Aleksandrs_Vederniko,

I am not trying to hide the explore. I want to selectively hide dimensions from various different explore.

And I want to just hide them, not remove access.

Userlevel 2

Hi @rshelly,


Ok, I got you. So this is not currently possible as I mentioned above. However I am happy to pass this along to our Product Team.


Best,


Sasha

Is there an update to this? I’d like to selectively hide fields from certain explores while keeping these fields available for other explores.

Userlevel 4

I don’t think Looker have any updates for this at the moment.


I guess this highlights the important of management of information system to Looker developers. One brilliant tool I came across is Henry - a bot that helps identify codes which can be deleted. You can read more about it at Henry - A Command Line Tool for Looker Instance Cleanup.


However if you’re trying to just HIDE it from certain views, I guess grouping them in a folder and labelling it that says its removed is the only way to go. Personally, I faced the same problem… Hence, we added the word “deleted”. But it will be a great feature for Looker product team to add! 😃


Anyways you can vote for features here, https://discourse.looker.com/c/feature-requests

Userlevel 7
Badge +1

Kevin, It sounds like your use case actually would match the use of the fields parameter! It lets you explicitly hide fields from certain explores. Check it out:



I’m also looking to hide the joined table from an explore. We use the join to filter the data that is available used on a user attribute. However, I just want the join to do the filtering but didn’t want the joined table to be shown in the table/field choices in the explore.

Userlevel 4

Hi Liz

thats not a problem.


You could define all dimensions and measures of the “lookup” view as “hidden: yes” and still use ist to join


Means, the view is used for joining, but not visible in your explore.

Userlevel 7
Badge +1

Or you can specify no fields in the join:


join: name {
fields: []
}
Userlevel 4

even better!

When I write fields: [] I get an error which is due to the fact that the table to which I am joining contains a user_attribute I need to have be part of the filter. When writing fields: [] it appears to not then access that field as part of the where clause which I need it to do.


Our table has a user attribute then a list of IDs to which they have access to so use attribute does need to be part of the table I just don’t want it exposed to end users.

Userlevel 7
Badge +1

That’s correct. fields[] makes the join work but you can’t use the fields from it because you’re not selecting any

Hi,


you can also assign a blank label to the view_label in the view file: view_label: “” . That will hide it in the explorer.

Hello,

You can also use the below as a view.

In your join you set the parameter from to be: joins_to_be_hidden

view: joins_to_be_hidden {
extends: [explore_to_be_joined]
fields_hidden_by_default: yes

 

Userlevel 1

I’ve tried a number of ways of doing this and by far the easiest is to use a blank view_label.

Add to your join:

view_label: ""

The view will then not show up in the explore (you can still call the dimensions in custom measures / dimensions / filters)

 

The other answers are all great, fields: [] works fine but not if you want to join other views to dimensions in the hidden view.

I’ve also used the method to extend a view and add fields_hidden_by_default: yes in the view.

Reply