Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Kanstussy
Contributor
Contributor

Finding nearest possible value

Table 1 

KEY   Month1  VAL1

K1      Jan       10

K1     Feb        20

K1     Mar       10

K1    Apr        12

 

TABLE 2

KEY Month2  VAL2

K1    FEB         38

now the requiment is to check Month2 which is FEB and val2 which is 38. Based on that I have to take the same month in Table 1 as starting point which is FEB and see how close I can go to 38 by adding the Feb and >Feb months val.

For Example in this case

FEB = 20 

MAR = 10  total is (FEB+MAR VAL) 30 which is 8 less than 38

Apr =12   total is (FEB+APR VAL) 32 which is 6 less than 38 , so my output should be this one.

Labels (2)
1 Solution

Accepted Solutions
Saravanan_Desingh

If you add Apr, it is 42. This is 4 higher than 38.

View solution in original post

2 Replies
Saravanan_Desingh

If you add Apr, it is 42. This is 4 higher than 38.

Kushal_Chawda

Would you be able to share sample data?