Hi, I am trying to calculate the number of times a specific value (in this case a string) occurs in a variable, and place it in a new variable.
In the end I would like it to be like this:
Any ideas on how I can do this?
Kind regards,
Petar
Code:
gen occurence_id = .
id | occurence_id |
12345678 | 4 |
45624845 | 1 |
12345678 | 4 |
51564215 | 3 |
56435158 | 1 |
12345678 | 4 |
46548675 | 1 |
51564215 | 3 |
12345678 | 4 |
51564215 | 3 |
Kind regards,
Petar
Comment