Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.

Comparing a row agains each element of a table

Hello,

I have two tables: (1) Product and (2) Storage

In my Product table I have a virtual column that automatically calculates the product suggested storage position based on a calculation (SuggestedPosition). For example: 40 (from 0 to 100).

In the Storage table I have a Position column. For example: 10, 30, 60, 100, 120, etc.

I'm looking for a way to identify which would be the closest suggested storage by comparing: (a) Product[SuggestedPosition] vs (b) Each row in the Storage[Position] column and get the minimum/closest one.

For example:

ABS(40-10)=30, ABS(40-30)=10 (winner) , ABS(40-60)=20

So far I've tried:

ANY(SELECT(Storage[id],
(
MIN(SELECT(ABS(Storage[Position]-[SuggestedPosition]),FALSE))
),
TRUE))

but with no luck.

Thanks for any tip!

Solved Solved
0 5 289
1 ACCEPTED SOLUTION

You can either:

  • Yes, literally as rows in the sheet, or
  • Using recursive (looping) actions, or
  • Through an Apps Script 

View solution in original post

5 REPLIES 5
Top Labels in this Space