Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
if i have 2 tables linked by a field A but those fields haven't the same data type, field A in table 1 is varchar and the other is a number. it affects the join or not?
Thanks
It does affect the join, yes. Just convert one of the fields to match the other when reading them in. If you want them to be text, then do this when loading the table where it's a number:
text(A) as A
Or if you want them to be numbers, do this when loading the table where it's text:
num(A) as A
They would just be force concatenated.Take a look ate the below example.
A:
LOAD * INLINE [
A, B
1, 4
2, 5
3, 6
];
B:
LOAD * INLINE [
A, D
a, 1
b, 2
c, 3
];
Output:
When we create a table box using Table A and B :
A | B | D |
a | - | 1 |
b | - | 2 |
c | - | 3 |
1 | 4 | - |
2 | 5 | - |
3 | 6 | - |
Can you share the kind of data you have?
It does affect the join, yes. Just convert one of the fields to match the other when reading them in. If you want them to be text, then do this when loading the table where it's a number:
text(A) as A
Or if you want them to be numbers, do this when loading the table where it's text:
num(A) as A
Thanks John.