Depending on your use case, I have had to use scalar variables in SQLScript in WHERE clauses between two select statements to achieve similar performance as branch-pruning graphical CalcViews. You'd use an input parameter rather than WHERE clause.
Example:
SELECT ..
FROM ..
WHERE :input_parameter = 'A'
UNION ALL
SELECT ..
FROM ..
WHERE :input_parameter = 'B'