Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to create a script that creates the normalized column names with non-repetitive numbers that are generated from 1 to the maximum number of clients.
Example:
Client Normalized
Company A Client 3
Company B Client 1
Company C Client 4
Company D Client 2
If your normalized representation is to be used as a key value, you can use autonumber() to generate consistent numbering across your script, e.g.
... autonumber(Client, 'Client') AS Normalized, ...
Peter
I think you want load script that looks something like this (example also attached):
Data:
LOAD *,
'Client ' & RecNo() as Normalized
INLINE [
Company, Client
Company A, John Smith
Company B, Jane Smith
Company C, Joe Smith
Company D, Janet Smith
];
DROP FIELD Client;
If your normalized representation is to be used as a key value, you can use autonumber() to generate consistent numbering across your script, e.g.
... autonumber(Client, 'Client') AS Normalized, ...
Peter
Peter Cammaert is right about needing to use autonumber() if Client needs to be a key value.
Something else to think about... You haven't given us a description on what Clients really are. If they are people's names, like John Smith, if two different people have the same name, you will end up with the same Client # for them using autonumber, but a different Client # for them using RecNo().
So I think you need to take into consideration if you need Client as a key and what Client really is.
The company names are unique so they can be used as a key. They are large Fortune 500 companies. So for example, a company might be called General Industry. I want to create an anonymized name for that company (I called them the normalized names in my example table), so it could be Client 10. If the list of clients is 30 long. Then I want the normalized list to go from 1 to 30. But I don't want the Client number be in the same order as the alphabet because I don't want someone to guess that client 30 is for example, Zebra Electric.
I hope this explanation helps.
Ed
Hi
Autonumber will number them in the order they are read. If that is not sufficiently random, then you could use autonumberhash128 or autonumberhash256. The hashes should be anonymous. They are not guaranteed to be unique, but with no more than a few hundred names, the chances of a collision are infinitesimal.
Regards
Jonathan
Thank you all. I ended up using the following. Jonathon was correct that the order of appearance of the clients in the data was random enough.
AutoNumber(CLIENT) as [Client Norm]