Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
How can I solve this problem?
I have a table like this with a task and a number connected.
22-3
22-4
22-5
23-6
24-7
25-3
25-4
How can I sort out just the first of each task so that the table will look like this:
22-3
23-6
24-7
25-3
Is it possible to implement a condition in the field dimension, and not in the script?
This must work for a long list of numbers, not only this example.
Perhaps like this:
Tasks:
LOAD
Task,
SubField(Task,'-',1) as TaskNumber,
SubField(Task,'-',2) as Number
INLINE [
Task
22-3
22-4
22-5
23-6
24-7
25-3
25-4
];
Result:
LOAD
Task
WHERE
Index = 1
;
LOAD
Task,
If(TaskNumber=Previous(TaskNumber), Peek(Index)+1,1) as Index
RESIDENT
Tasks
ORDER BY
TaskNumber,
Number
;
DROP TABLE Tasks;
But it is possible to solve this without coding in the script, only use the user interface?