Sorry if i was not clear enough ^^
My Actual situation is the following:
FOLLOWUP_NO VERSION 2013026 1 2013026 2 2013026 3 2013026 4
and my desired output is the following:
FOLLOWUP_NO VERSION LAST_VERSION_FLAG 2013026 1 No 2013026 2 No 2013026 3 No 2013026 4 Yes
So LAST_VERSION_FLAG should be calculated in script.
Hope i made it clear now.
LOAD Folllwoup_no, max(version) as max from Table group by Folllwoup_no;
LET vflag = peek('tmp', 0, 'max');
if(version = $(vFlag), 'Yes,' No') as flag_version
drop table Original_table;
Here is a solution. It is not the only one, you can use applymap, or use 2 tables with join
up to you