Lookup, Connection, Rollup or Equation?

A Lookup, a connection, a Rollup and an Equation can all put a value on a record. They answer different questions, though. This video sets them side by side, so you know which one to reach for.

  • Video 9 of 9
  • 3:29
  • Transcript below
On this page
  1. Chapters
  2. Read the docs
  3. Transcript

Chapters

  1. 0:00 Intro
  2. 0:15 The idea
  3. 0:31 The four
  4. 1:31 Choosing
  5. 2:24 Rules

Read the docs

Transcript

Show the full transcript

0:00 Intro

A Lookup, a connection, a Rollup and an Equation can all put a value on a record. They answer different questions, though. This video sets them side by side, so you know which one to reach for.

0:15 The idea

Back at the parcel counter, the clerk has four tools. The price chart on the wall. A tag on a string, tying the parcel to the customer who sent it. A basket that gathers every parcel one customer sent this month. And a calculator.

0:31 The four

The tag on a string is a connection. Somebody ties this parcel to Birchwood Bakery on purpose. Now the parcel knows its customer, and the customer knows its parcels. Use a connection when the answer is which other record this one belongs to. The chart is a Lookup. Nobody ties anything. The parcel's zone and service are matched against the chart, and the rate comes back, thirteen fifty. Use a Lookup when the answer sits in a reference chart and you find it by matching values. The basket is a Rollup. It follows the connections to every parcel Birchwood sent, and turns them into one number on the customer, like a total or a count. Use a Rollup when many connected records become one value. The calculator is an Equation. It works only with this parcel's own fields. Add the base rate, the weight charge and the service fee together. Use an Equation for maths on the record itself.

1:31 Choosing

When you're not sure, ask four questions. Does a person choose which other record this belongs to? Use a connection. Is the answer in a chart you match against? Use a Lookup. Do many connected records become one value? Use a Rollup. Is it maths on this record's own fields? Use an Equation. They work best together. On P one thousand two, one Lookup finds the base rate, thirteen fifty. Another finds the weight charge, eleven. A third finds the service fee, twelve. An Equation adds them up, thirty-six fifty. And on the customer, a Rollup can total every parcel's Parcel Total. You could connect each parcel to a row of the rate chart, but think about what that means. Somebody has to pick the right row for every single parcel, and pick again whenever the zone changes. A Lookup finds the row from the parcel's own values, every time, on its own.

2:24 Rules

Three rules to keep track of. Rule one: one Lookup returns one field. It brings back the fee, and if you also want the delivery window from the same row, add a second Lookup with the same key. If you need many fields of another record, a connection may suit better. Rule two: a Lookup can't read its own table. It always looks in another table. If you want a value from another row of the same table, like the previous parcel, that's a job for the Rollup window functions, such as Previous Row's Value. Rule three: a connection stays put, a Lookup follows the values. Change a connected parcel's zone, and its connection still points at the same record. Change a looked-up parcel's zone, and the Lookup finds a new row by itself. So that's the four. A connection, when a person ties records together. A Lookup, when a chart has the answer. A Rollup, when many records become one. And an Equation, for maths on the record itself. That's the series. Learn more about Lookup fields at tadabase.com.

Also on Vimeo · the whole series on Vimeo