2 Replies Latest reply: Aug 21, 2017 6:19 AM by Zain Shaikh

Match original and overridden values from two tables

Hi All,

I need a solution which I'll be demonstrating through the below image:

As you can see, we have two table Original and Overrided respectively. The Original table is holding the Original value and the Overrided table holds the value overriden by the customer. As you can, there's a common column Key with matching values and 'Value in Original table is similar to Original Value in the Overrided table'.

So, if the value gets overridden then it has to be picked from Overrided table for e.g. Key=1, Value and Original Value=50, Overrided Value=55. The value 50 should be replaced by 55.

Similarly, 'Key=2, Value and Original value=60, Overrided value=0'. Here, the Overrided value is Zero so it should pick value as 60.

Similarly, 'Key=3, Value and Original value=0, Overrided value=70'. Here, the Original value is Zero so it should pick value as 70 i.e. Overrided value.

Regards,

Zain Shaikh

• Re: Match original and overridden values from two tables

Hi Zain,

Temp:
Key,Value
1,50
2,60
3,0
]
;

Key,Original,Overrided
1,50,55
2,60,0
3,0,70
]
;
NoConcatenate
If(Overrided > Original,Overrided,Value) as Value
Resident Temp;
Drop Table
Temp

Regards,

Antonio

• Re: Match original and overridden values from two tables

Thanks Antonio. Mine approach is different but, your answer gave me a way to get the solution.

I followed similar steps with some joins and I got it. Really appreciated.