Before I answer your question (or try to) I want to make a suggestion about your current expression.
It is basically OK, but it will also count some other cases, such as when the player bets, then re-raises (3-bet) the check/raise and folds to a 4-bet, or when they face 2 raises (C bets, A raises, B re-raises).
You can avoid the first case by using the actions string. e.g. replace:
holdem_hand_player_statistics.flg_f_bet AND holdem_hand_player_statistics.flg_f_face_raise AND holdem_hand_player_statistics.flg_f_fold
..with..
lookup_actions_f.action = 'BF'
For more info on action strings check out the 'Constructing Column Expressions' section of the
Tutorial - Custom Reports and Statistics.
To count only cases where the player faced a single raise you would need to add a check for "holdem_hand_player_statistics.flg_f_3bet_opp".
OK, to your question.
"holdem_hand_player_detail.flg_f_has_position" does indeed check that the player has absolute position, but this only means that they are last to act (nearest the button) on the flop.
I think what you want to do is remove the need for the "holdem_hand_player_detail.flg_f_has_position" check but still only count check raises, not include raises from players behind. Is that right?
You can't build this entirely accurately, but you can get pretty close using holdem_hand_player_detail.val_f_raise_aggressor_pos, and comparing it to the player's position (holdem_hand_player_statistics.position).
You should note, however, that holdem_hand_player_detail.val_f_raise_aggressor_pos is the position of the
last flop raise, not the first; so [to quote Kraada from his
advanced HUD guide] in certain multiway situations these stats are not perfect. However, in all of those spots, it doesn't count as a time when you faced a check/raise either, so the numbers should not be skewed much. These cases are also fairly rare. For example, if A is in front of you and B is behind you, A checks, you bet, B calls, A raises, you fold, B reraises and A folds, it should count as a fold to check/raise if the stat were perfect. The stat is not perfect because the last raise came from someone in position relative to you, despite the initial raise coming from A. In this case, it is neither a check/raise defense opportunity, nor a fold to check/raise. It simply isn't counted at all. Since all spots that cause problems involve multiple raises on the street in question, I don't think it significantly affects the validity of the stat, so I have opted to include it in the popup display.