Forum Discussion

TWolsten's avatar
TWolsten
Advocate IV
4 years ago
Solved

Pulling data from a range in a different table

Hi all,

 

Hopefully someone might have the answer to this query.

 

I have two tables which I need to compare Table 1 to Table 2 with the following criteria:

Table1[from_code] = Table2[code]

and

Table1[from] >= Table2[m] and Table1[from_c] >= Table2[c]

and 

Table1[to] <= Table2[m] and Table1[from_c] <= Table2[c]

 

Table 1

referencefrom_mfrom_cto_mto_cfrom_codeto_code
Ref 2120512045AAAAAA

 

Table 2

codemclonglat
AAA1000-0.6985452.93361
AAA10015-2.1634352.15026
AAA1105-0.6952752.93401
AAA1200-0.2547151.53321
AAA12015-2.884853.3538
AAA12032-2.1634352.15026
AAA12043-2.7438452.70946
AAA12055-2.9623253.47024
AAA120600.020622

51.48446

 

The result I want is a 3rd table with the below:

reference [from Table1]long [from Table2]lat [from Table2]
Ref 2-2.884853.3538
Ref 2-2.1634352.15026
Ref 2-2.7438452.70946

 

So using the Table 1 reference line and pulling back the long and lat from Table 2 split out into multiple lines.

 

Any ideas would be massively helpful!

  • Hi TWolsten ,

     

    This part of the judgment condition seems to be somewhat incorrect. But the desired result can be obtained by creating the following formula.

    M = IF(120>=MAX(Table2[m]) && 5>=MAX(Table2[c]) ,1,0)

     

     


    If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


    Best Regards,
    Henry


    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

1 Reply

  • v-henryk-mstf's avatar
    v-henryk-mstf
    Community Support

    Hi TWolsten ,

     

    This part of the judgment condition seems to be somewhat incorrect. But the desired result can be obtained by creating the following formula.

    M = IF(120>=MAX(Table2[m]) && 5>=MAX(Table2[c]) ,1,0)

     

     


    If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.


    Best Regards,
    Henry


    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.