Show data from 2nd table once row is selected in 1st table

Hello,

What is the best way to achieve it in Looker?

I have two tables invoice and invoice items. 

Invoice items table should show data only if I select invoice from invoice table.

Thank you!

MA

0 3 184
3 REPLIES 3

Check out chart cross-filtering. Cross-filtering lets you interact with one chart and apply that interaction as a filter to other charts in the report. So you could click an invoice number in your Invoices table to filter the Items table by that number.


@markoadzic wrote:

Invoice items table should show data only if I select invoice from invoice table.

 


Chart cross-filtering will work to display the items for the selected invoice BUT if no invoice is selected it will show all the items, which it sounds like you don't want. IF you ONLY want to show items in the second table when one invoice is selected, you can do this by incorporating a cross-join blend.

Create a blend that includes Item field(s) on the left,, cross-joined with a CTD invoice number (metric, let's call it CountInvoices) on the right.

Then use this blend for your item table, displaying a chart-level calculated field like this : IF(CountInvoices=1, Item, ""). The item table will only show items when the number of invoices selected is 1, otherwise it shows nothing.

 


@lauratilton wrote:

Create a blend that includes Item field(s) on the left,, cross-joined with a CTD invoice number (metric, let's call it CountInvoices) on the right.

Then use this blend for your item table, displaying a chart-level calculated field like this : IF(CountInvoices=1, Item, ""). The item table will only show items when the number of invoices selected is 1, otherwise it shows nothing.


 

can you pls explain with some more details?