Hello everyone,

I need help with making a new Id that will solve my table so basically, I have data that has

Bank ID which is the bank number
Before, During after which variables that did take 0 for no and 1 for yes
Ticker which is the name of the company

this new ID I want it
If ticker Apple has a value of 1 in before and value of 1 after for the same Bank ID (score 1 In result)
If ticker Apple has a value of 1 in before and value of 0 after for the same company ID (score 0 In result)

This is the table before
Array

and this is what I want it to look like
Array


what Is the best way to do it in stata since manually will take a lot of time