Qlik does the selection whatever you given as expression in the dimension
but when you use the vDimension variable in place of above expression, which has value of =if(Flag='Territory','rep','[区]'). it will evaluate and use the output value as dimension, it does the selection for that field only.
Note: when I use the variable, field names are within single quotes.
PS: Mark this post as solution, to avoid others spending time on your post to answer it.