I have a dataset which have three variable.below is the example dataset.
Id Region Amount
1 A 20
1 A 40
1 A 50
2 B 40
2 B 30
2 B 60
3 C 10
3 C 30
4 D 20
4 D 50
4 D 10
I want to create macro variable for each region and then assigned the minimum amount to those variable. For example in case of above dataset answer should be 4 macro variable with their value as:
macro_var val
A 20
B 30
C 10
D 10
Any help would be highly appreciated.