How to store the first transaction value in variable because when run the second transaction that time first transaction value is not coming null

How to store the first transaction value in variable because when run the second transaction that time first transaction value is not coming null?