Using one-way links in formulas

One-way (but not two-way) links can be used as part of a standard formula. In addition, because the link functions can return ranges as well as individual cells, you can apply any function that has a range as a parameter directly to the link. For example, using the following spreadsheet called quarter:

image\intgrt2.gif

When building a formula in another spreadsheet or a field in a Write document, treat the link function like any other. For example:

=10+SSGET("Quarter", "B3") / 2

To count the number of records, and to find the total, average and maximum volume, refer to the range and use these built-in functions:

=ROWS(SSGET("Quarter", "B2..B5"))
=TOTAL(SSGET("Quarter", "B2..B5"))
=AVERAGE(SSGET("Quarter", "B2..B5"))
=MAX(SSGET("Quarter", "B2..B5"))

The same ideas can be applied to a database table. Consider the following invoice table in an accounts database:

image\intgrt3.gif

The table information can be referred to in the following ways:

=10+DBGET("accounts.adb", "invoices", "invtotal", 3) / 2

to re-use the invoice total field from row 3 (that is the value 8.50) in a formula; and

=ROWS(DBGET("accounts.adb", "invoices", "invtotal"))
=TOTAL(DBGET("accounts.adb", "invoices", "invtotal"))
=AVERAGE(DBGET("accounts.adb", "invoices", "invtotal"))
=MAX(DBGET("accounts.adb", "invoices", "invtotal"))

to find the number of records, and the total, average and maximum of the invoice totals.