0

I’m working on a Looker project with two main datasets:

  • Table A: Contains only id values and other related data.
  • Table B: Maps id values to human-readable name values (e.g., id-name).

My goal is to allow users to filter the data in Table A using a concatenated id-name field from Table B (e.g., 1234-Example Name). The id-name field is only for UI purposes; the actual filtering needs to happen on the id.

Here’s what I have so far:

I created a LookML filter dimension in the view for Table A, which fetches id-name in the Looker UI. However, when I apply the filter, I get SQL like this:

(table_a.website_name) = '12345 - example.com'

The issue is that website_name does not exist in Table A—it only has id.

Questions:

  • How can I set up the filter so that it uses the id-name from Table B for UI purposes, but correctly filters Table A based on the id?
  • Is there a way to dynamically fetch and apply the id from Table B without joining the tables directly in LookML?

Any help or suggestions would be greatly appreciated! Thank you!

3
  • See some like select * from table_a where table_a.website_id in (select website_id from table_b where table_b.website_name='12345 - example.com') Commented Dec 30, 2024 at 18:00
  • The issue is that the ui filter adds a condition on table_a like this where website_id_name = '12345 - example.com' i tried to have something like this but i couldn't achieve such a thing where website_id = SPLIT('12345 - example.com','-')[OFFSET(0)] Commented Dec 30, 2024 at 18:23
  • Won't the UI only give you the value example.com? Please show data example. Commented Dec 30, 2024 at 19:09

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.