A chart per record?


(Tim Shay) #1

Hey! Sorry if this is a n00b question… I’m just getting started with Dashboards and Reports.

Is it possible to generate a series of charts at runtime (multiple charts, not multiple series in one chart)? I can generate the data as two queries (Query A gives me a list of ID’s, Query B is run multiple times with the ID as a filter - one chart for each ID) or as a single query (IDs and series data in one query, but the results would then be separated into a chart per ID)?

A use case for this would be: We have 5000 stores. We want a dashboard or report that will show us a chart of the daily sales values for each of the top 20 stores by their most recent monthly total (a chart per store). Each month the set of stores would change, so we couldn’t use fixed criteria in 20 separate looks


(Nathaniel Thompson) #2

Hey @twoshay!

Not a n00b question at all! I definitely see the use case here.

For our use case, we can use a Look or Explore with store IDs that is limited to 20 rows, sorted by most recent monthly total. This accomplishes “Query A”.

For our approach, we can use the link parameter within the definition of the store ID dimension. Here’s a link to our documentation on that parameter. Of particular use to us is the example for passing liquid values into links.

We can use the url parameter within the link, using a Look ID for a Look with the daily sales values, and the expected visualization set (here we use 1). The {{ value }} liquid HTML variable will automatically populate with the ID of the selected store, and the Look will then filter on that store ID.

link: {
   label: Daily Sales Values Chart
   url: "/looks/1&f[stores.ID]={{ value }}"
}

Here’s a link to our documentation on liquid variables that goes in more depth on other options for value.

The Look that we link to here accomplishes “Query B”.

Our Help Center also has a great resource on Custom Drilling Using link, which you can find here.

If you’d like to dive deeper into a specific use case, feel free to reach out at support@looker.com!


(Tim Shay) #3

Thanks a ton! This sounds great. I’m not at all afraid of the legwork… it’ll help me with my learning curve as I start getting some reports moved over to new databases.