I have two very large (200000×200) tables, Table_1 & Table_2. They have columns/variables that store different data types- strings, doubles, integers etc.
I want to create a third table, Table_3, that superimposes Table 2 over Table 1 if Table 1 has a missing value. i.e.
if Table_1(row,column)<>{''}, Table_3(row,column)=Table_1(row,column) else Table_3(row,column)=Table_2(row,column)
For example,
Table 1 Table 2 Table 3 Record Name Age Record Name Age Record Name Age1 John 10 1 John 1 John 102 Daniela 2 Daniela 5 2 Daniela 53 Austin 30 3 Austin 30 3 Austin 304 45 4 Mark 45 4 Mark 45
I want to do this without using for loops because the time to traverse them is very very slow.
To consider:
- Is there a way to do this using the fillmissing() function? This would be the most natural approach however, Table_3=fillmissing(Table_1,'Constant',Table_2) doesn't work. (The 2nd argument (Table_2) cannot be multidimensional.)
- If this were a simple matrix, Table_3(Table_1=='')=Table_2 would've worked; but I can't seem to do this with tables.
Thanks, NT
Best Answer