3 Replies Latest reply: Jul 22, 2018 11:06 AM by Jonathan Dienst

# How to do lookup() in script load with no exact match

Hi Community,

Hope you can help me with next:

I have a facts table with unique numbers, points and a rent value.

Based on that I joined a table to get max rent per point (see bottom left), that's OK:)

BUT, now I would like to determine the other way: max points based on given rent.

My problem is that the rent has not an exact match with the joined table.

Can you help me to solve this?

In excel the solution is a Vlookup function with TRUE as 4th argument.

• ###### Re: How to do lookup() in script load with no exact match

Hi,

I think your best alternative is using a mapping table. This can be done with the ApplyMap function.

Here is a YouTube video referring to that Excel function you are trying to do and solving it with ApplyMap and LookUp function.

Best,

Ali A

• ###### Re: How to do lookup() in script load with no exact match

Hi, yo can add to your points table the min rent for each points to create and interval and use intervalmatch to assign the Points:

```Rents:
Rent
13
25
90
];

Points:
Points, Max Rent
40, 12.21
50, 24.35
60, 35.25
];

PointInterval:
If(IsNull(Peek([Min Rent])), 99999, Peek([Min Rent])-0.001) as [Max Rent],
[Max Rent] as [Min Rent],
[Points]
resident Points order by Points desc;

DROP Table Points;

Inner Join IntervalMatch ( Rent )