Skip to content
Advertisement

Compare two values from one column based on values in another

I have table where I need to compare two values based on their names in another column to see which one is bigger. Basically:

enter image description here

I have done summations but I cannot find a way to use the CASE WHEN approach to this situation.

Advertisement

Answer

You can PIVOT the data and have all values in current row. Then, compare them as you like:

or

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement