Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
Could you please deliver me a script that can handle in this kind of situation
The desired Output depends on the last score from a series in column 'Score'.
Thanks and best regards,
Cornelis
Again, sort the data by ID in descending order and then use the Previous function to check the score of the previous record (the next higher ID because of the reversed sort order). You can check for empty strings and null values with Len(Trim( ...something...))=0.
Temp
LOAD
ID,
Score
FROM
... source ...
;
Result:
LOAD
ID,
Score,
If(Len(Trim(Previous(Score)))=0 and Score='K','K') as Output
RESIDENT
Temp
;
DROP TABLE Temp;
Again, sort the data by ID in descending order and then use the Previous function to check the score of the previous record (the next higher ID because of the reversed sort order). You can check for empty strings and null values with Len(Trim( ...something...))=0.
Temp
LOAD
ID,
Score
FROM
... source ...
;
Result:
LOAD
ID,
Score,
If(Len(Trim(Previous(Score)))=0 and Score='K','K') as Output
RESIDENT
Temp
;
DROP TABLE Temp;