Create a unique column to get join function to work

Hello everyone,

I am trying to create a dependent column that forms a unique column. it is required to get join function to work accurately.

suppose I have a column which has 10 instance of “1000” (string), similarly it has another record “anjankum” that comes 20 times. I want to create a dependent column that should be such as -

1000 - 1
1000 - 2
1000 - 3
anjankum - 1
anjankum - 2
anjankum - 3
anjankum - 4
anjankum - 5


could someone help.

@anjankum Can you explain bit more briefly?

suppose column-1 exist 20,000 records, I want another column-2
the value that i require in column-2 should be a calculated column based on column-1

I simply want, if column-1 has anjankum 10 times, column-2 should pick anjankum-1,anjankum-2,anjankum-3 upto anjankum-10.

@anjankum Read your excel file, Get all unique values from first column.

For each unique value get the count in the first column, Then use counter variable till and add the new columns till counter value is matched with count of value in First column of excel. Once columns are for one first unique, it will be repeated for other unique values.

Finally write the datatable to required excel file.

This method is taking lot of time since I have around 20,000 records. is there an SQL query that I can run to achieve it bit fast

I don’t know how to do it with SQL query, Someone else in the forum can help you on that.