I'm trying to make a simple join in QGIS 3.10 between a table with a generated ID (using "Add unique value index field") named POINTID and a table created by the Distance Matrix algorithm with an InputID field (whose values come from the POINTID).
But this simply doesn't work as I get an error message during the processing saying that all my features could not be matched…
First, it looked like a duplicate of Joining attributes by field value not working but I double checked the fields type and it is the same: int/integer(0,0) as you can see in both the layers properties and in the logs.
I also checked that IDs are common to both tables so that the join can be done.
Strange thing but maybe irrelevant: the length of the generated field is 0. But the documentation of this function doesn't say anything about setting a field length (see enter link description here). The way the values are sorted in the table from Distance matrix is strange too (1,10,11…,2,20,21,…).
Also, it looks like the join works well on fields of type string, but I didn't find a way to generate unique ID fields of type string (I'm using the graphical modeler).
This gets me confused, any ideas what I'm doing wrong ?
[EDIT] : here is some simple csv data to check the process (SRID is 2154)
Table A
STR_ID;X;Y;Z
P_0;311794;6644698;-0.885
P_1;311803;6644708;-0.689
P_2;311813;6644718;-0.516
P_3;311823;6644728;-0.337
From table A, I generate a POINTID field using X column as class for algorithm "Add unique value index field".
Table B (one point from which to compute distance)
STR_ID;X;Y;Z
P_REF;312556;6646432;-0.885
Table which is the result of Distance Matrix (distance values may be wrong but it doesn't matter):
InputID;TargetID;Distance
0;0;392.1
1;0;378.3
2;0;365.8
3;0;358.4




layer_1a to pointlayer_2, but theUnique identifier fieldfor the two layers don't much. Right? However, your screenshot shows the algorithmJoin attributes by field value. So I'm quite confused. Can you share a sample of your data? – Babel Mar 26 '21 at 22:15