"Group by Attributes" Parameter in "Aggregate" Operator is leading to some sorting problems
ella_
New Altair Community Member
Hi everybody,
I was discretizing an Attribute "id_copy" so that the Attribute time has a sample rate of 1 second now.
Afterwards I used the "Aggregate" Operator for Averaging all Attributes except "id_copy" and grouping them by "id_copy".
This worked well for samling down and averaging the data but it lead to some sorting problems.
"id_copy" is sorted like 109, 11, 110, 111, 112 e.g.
The problem seems to be, that there should be some zeros as placeholders in "id_copy" and in "id" so they can be sorted like 009, 010, 011 e.g.
The "Sort" Operator for the Attribute "id_copy" in increasing direction didn´t change anything.
Can anybody help me with this issue?
Best
Ella
I was discretizing an Attribute "id_copy" so that the Attribute time has a sample rate of 1 second now.
Afterwards I used the "Aggregate" Operator for Averaging all Attributes except "id_copy" and grouping them by "id_copy".
This worked well for samling down and averaging the data but it lead to some sorting problems.
"id_copy" is sorted like 109, 11, 110, 111, 112 e.g.
The problem seems to be, that there should be some zeros as placeholders in "id_copy" and in "id" so they can be sorted like 009, 010, 011 e.g.
The "Sort" Operator for the Attribute "id_copy" in increasing direction didn´t change anything.
Can anybody help me with this issue?
Best
Ella
Tagged:
0
Best Answer
-
Most likely your id treated as a nominal and not as an integer, which is probably even intended as otherwise you wouldn't be able to use 009 and so. If you need to keep this trailing zeros you could create a copy of the id column, parse this as a number and apply the sort on this attribute. This will give proper numeric sorting.
The sorting you have now is perfectly normal from 'nominal point of view'.1
Answers
-
Most likely your id treated as a nominal and not as an integer, which is probably even intended as otherwise you wouldn't be able to use 009 and so. If you need to keep this trailing zeros you could create a copy of the id column, parse this as a number and apply the sort on this attribute. This will give proper numeric sorting.
The sorting you have now is perfectly normal from 'nominal point of view'.1