problem is (case when a.pre_or_post_change = 0 then sum(a.Total_XP_Made) else 'None' end)
you have sum(a.Total_XP_Made) and 'None' for same variable XpMade, of which one value is numeric and another one is character
Try change 'None' to .( a missvalue for numeric variable)
... View more