Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Vlookup equivalent in related Table

Featured Replies

Ok I am somewhat at a loss. There is hopefully an easy solution that I have missed.

I have two tables.

Table 1: Products

PID

Table 2: Prices

fPID

Date

Price

Table 1 has a one-to-many relationship to prices. That is one product may have many different prices.

I would like to create a field in the Products Table called Total Amount, which is = Amount (entered by user) and Last Price (Calculation Field).

I am having problems getting the Last Price calculation. Ideally I would like to have a Vlookup function (equivalent) into the Prices table, that gives me the price as at the Maximum Date.

Anyone know how to do this.

To provide an Example:

Table 1:

PID1

Table2

fPID Date Price

PID1 31/01/2009 10

PID1 30/01/2009 9

I would like to create a calculation field in Products table that gives me the latest price.

In this case it would be 10 (because it is the most updated price). I would then like to be able to use this calculated field in another calculation to get the total amount (= Last Price * Amount (constant) )

Thank you in advance.

R

Mark

Edited by Guest

If you sort the relationship (in the RG d-click the relationship) by Prices:Date desc, then FM will "see" the price with the highest date as the first related record.

Your calc in Products for LastPrice then equals sortedRelationship:Price.

In any InvoiceLineItem, you should use the lookup feature to "copy" the LastPrice into the InvLI record.

Edited by Guest

  • Author

Good thank you.

Lets add some more complexity to this.

I have a third table called Transactions which is related to the Products table. One product can have many transactions such that

Transactions > --- Products ----< Prices

fPID PID fPID

Can I create a Last Price calc in the Transactions table that essentially gives me the last price for fPID in the Prices Table?

Thank you

Mark

Edited by Guest

I would define a new relationship between Transactions and another occurrence of Prices.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.