I am trying to summarize the serval variables if they are greater than the maximum of another variable. Below is my attempted code which is incorrect. How can I fix this?


sum TLE_50_512 if TLE_50_512 > max (TLE_50_511)
sum TLE_50_513 if TLE_50_513 > max (TLE_50_511)