Forum Discussion

ddalton's avatar
ddalton
Resolver I
4 years ago
Solved

Creating new columns from another table based on two criteria

I have the following tables. Note "..." represents similar data or arbitrary values etc.

 

TBL1

REFSTG_IDIDSMPL_IDSMPL_NUME1E2E3E4E5E6E7
884-A129711111010.50538
884-A129711221110.50528
884-A22971111100.50.60325
884-A22971122.....................
335-B12971133.....................
335-B12971144.....................
350-E12721155.....................
350-E12721166.....................
350-E22721155.....................
...           

 

TBL2

IDEXMINMAX
297E1811
297E20.51.5
297E300.6
............
297E767.5
272E1811
272E20.51.5
272E300.6
............
272E767.5
............

 

I have created the following relationship between the tables:

TBL1*:*TBL2

 

The relationship currently filters in both directions. 

 

I would like to create new columns in TBL1 that correspond to the MIN and MAX values of the respective ID and EX in TBL2, i.e., an E1_min, E1_max, E2_min, E2_max column etc. similar to below

 

REFSTG_IDIDSMPL_IDSMPL_NUME1E1_minE1_maxE2E2_minE2_max...
884-A129711111081110.51.5...
884-A129711221181110.51.5...

 

The MIN and MAX values should not differ for rows with the same ID so some kind of a lookup for the ID and EX values should be sufficient. 

 

I've achieved similar things before but only based on a single criteria and using either a LOOKUPVALUE or a CALCULATE with FILTER etc. 

 

I'd be grateful for any recommendations on how to achieve it. 

2 Replies