Here is a sample source table
REGION_CODE TIER
093 4
091 5
090 1
096 null
Target Table
REGION_CODE D_REGION_CODE_ID TIER
Right now the target table will be empty, I want to find the MAX value of D_REGION_CODE_ID column and insert the value into it like MAX( D_REGION_CODE_ID ) + 1 for new each record.(like if max is null then it will be 1 and then it will be 1+1, 2+1 and so on)
I have a completely parameterized mapping and I tried using Aggregator trasnformation with connected lookup on target table but it seems that its reading the specific row value rather than the max from that column(i.e max of row value itself) I have to built it as completely parameterized so i cannot use a straight forward sql query in lookup transformation.Also I can't use sequence generator to insert new surrogate keys as i already have a sequence generator being used to populate surrogate keys for the table,so if i add a new sequence it would just replicate the values from the earlier sequence.
Is there any way to populate rows based on the fetched max value? So that it achieves like this
REGION_CODE D_REGION_CODE_ID TIER
093 1 4
091 2 5
090 3 1
096 4 null