Looker support here, thanks for reaching out. Generally, to implement “partition by” in Looker, you can create a derived table that uses window functions: Using Window Functions in Looker

One other option outlined in this article is to use table calculations: https://docs.looker.com/exploring-data/using-table-calculations. For example, using the sample you provided above, we could use a table calculation to get the minimum order number for each product.

Let me know if you have any additional questions about this subject, or feel free to send us an email at support@looker.com any time.

Probably the best general solution to this problem is to build a dimension on orders that is the sequence number for the transaction. The reason this is useful is that once sequence number is added to the model, you can look at the first, second, last or Nth transaction. Or make comparisons between transactions, right from the explore interface.

At the end of the day, you end up with a new dimesion, ‘Order Sequence Number’. In your case, you would just filter the data where that number is 1.

Here is an article about how to implement that in LookML.

Thanks, Andrew and lloyd. I will build the sequence number dimension.

This site uses cookies. By continuing to browse the site, you are agreeing to our use of cookies. You can choose your cookie settings at any time. Find out more here.