I was just about to come back and reply to this.
Yes, the raise aggressor position doesn't use 9 for the SB, it works on actual position off the button. I don't know if this is by design or not, but I'll try to find out.
Raise aggressor position is -1 when you (or rather, the current selected player) are the aggressor.
I've fixed it to work, though.
Aggressor is in the SB when their position is one less than the number of players in the hand.
sum(if[holdem_hand_player_statistics.flg_p_fold AND
holdem_hand_player_statistics.position = 8 AND (holdem_hand_summary.cnt_players - holdem_hand_player_detail.val_p_raise_aggressor_pos) = 1 AND holdem_hand_player_statistics.flg_blind_def_opp,1,0])
and
sum(if[holdem_hand_player_statistics.position = 8 AND (holdem_hand_summary.cnt_players - holdem_hand_player_detail.val_p_raise_aggressor_pos) = 1 AND holdem_hand_player_statistics.flg_blind_def_opp,1,0])