Query editor
with holdings as (selectsubject, sum(CASEWHEN isBuy = true THEN CAST(shareAmount as double)WHEN isBuy = false then -1*CAST(shareAmount as double)ELSE 0 END) as keycountfromfriendtech_base.FriendtechSharesV1_evt_Tradewheretrader = {{trader}}group by subject)select *from holdingswhere keycount > 0