I want to replace a name with a unique reference number. Is this possible?
see example below
I want to create 'Annon' column based on the name See above.
Solved! Go to Solution.
just try this
LOAD * INLINE [
Date, Name, Amount, Annon
01/04/2017, Sam Smith, 100, 1234
02/04/2017, Joe Bloggs, 50, 5678
02/04/2017, Sam Smith, 150, 1234
03/04/2017, Peter Potter, 20, 9876
03/04/2017, Joe Bloggs, 100, 5678
AutoNumber(Name) as Result
Although AutoNumber is a quick and easy option, here is another one which will probably give better performance on larger dataset
If(Name = Previous(Name), Peek('Annon'), RangeSum(Peek('Annon'), 1)) as Annon
Order By Name;
DROP Table Table;
Autonumber can give you different representation of Name when reloading the data. If you want to have permanent Name<>Annon connection, use hashing functions: Hash128 ‒ QlikView