Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello guys i've faced with a sorting problem. I have a table which consists of 2 fields: first one is about names, another one - IDs. Gotta make up a way how to make additional field in this table by which i could sort IDs.
For instance , heres the table:
Data1:
LOAD * INLINE [
FIELD1, FIELD2
Moscow, ID1
Anapa, ID2
Paris, ID3
Rio, ID4
Beijing, ID5
];
Need to add one more field so as the result i could have smt like this
FIELD1, ID, SORT
Moscow, ID1, 3
Anapa, ID2, 1
Paris, ID3, 4
Rio, ID4, 5
Beijing, ID5, 2
SORT field shows numbers of how those names from FIELD1 would go in alphabetical ORDER
Try this:
Table:
LOAD * INLINE [
FIELD1, FIELD2
Moscow, ID1
Anapa, ID2
Paris, ID3
Rio, ID4
Beijing, ID5
];
FinalTable:
LOAD *,
AutoNumber(FIELD2) as SORT
Resident Table
Order By FIELD1;
DROP Table Table;
Try this:
Table:
LOAD * INLINE [
FIELD1, FIELD2
Moscow, ID1
Anapa, ID2
Paris, ID3
Rio, ID4
Beijing, ID5
];
FinalTable:
LOAD *,
AutoNumber(FIELD2) as SORT
Resident Table
Order By FIELD1;
DROP Table Table;