Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi.
I am running into an interesting situation. I have a table which is a result of concatenating three loads coming from three different sources (A, B, C). I then include rec() into the load so that I will have a unique number per row. Oddly this step is resulting in multiple instances of the same rows for records I loaded from B and C. I checked the sources for B and C and there are no duplicates. For testing, I also tried displaying in a simple Table Box of all the fields from that Table and did not see any duplicates. But when I reload the table with a new field such as rec() as recID suddenly the loaded table is having multiple identical rows.
Any ideas?
Got it fixed Sunny! Don't know why I hadn't thought about it but this time I did Load Distinct. I realize for the data from sources B and C I was doing a simple Load while the data from source A I had Load Distinct.
Still no idea though why I'd have to put Distinct in the load script as they're all unique anyway.
Have you tried with RowNo() instead of RecNo()?
RowNo() as RecID
Tried just now and still having the same result. I'm perplexed. Very odd.
Would you be able to share the script don't need the field names... but a basic outline
Got it fixed Sunny! Don't know why I hadn't thought about it but this time I did Load Distinct. I realize for the data from sources B and C I was doing a simple Load while the data from source A I had Load Distinct.
Still no idea though why I'd have to put Distinct in the load script as they're all unique anyway.
If you used a logic like this:
table:
load *, rowno() as RowNo, recno() as RecNo inline [
F1, F2
a, 1
b, 2
];
concatenate(table)
load *, rowno() as RowNo, recno() as RecNo inline [
F1, F2
c, 3
d, 4
];
concatenate(table)
load *, rowno() as RowNo, recno() as RecNo inline [
F1, F2
e, 5
f, 6
];
it will work or is anything different in your logic?
- Marcus
Distinct is not important to the functionalities of rowno/recno but it could have an impact to all merged tables not only the one in which is was declared.
- Marcus