I answere this "old" question for everyone who has the same Problem and is looking for a working solution. At least in JMeter 5.11 the answer of Dmitri T is not always true.
From the JMeter Documentation:
- Note that the values defined by the Test Plan and the User Defined
Variables configuration element are made available to the whole test
plan at startup. If the same variable is defined by multiple UDV
elements, then the last one takes effect. Once a thread has started,
the initial set of variables is copied to each thread. Other elements
such as the User Parameters Pre-Processor or Regular Expression
Extractor Post-Processor may be used to redefine the same variables
(or create new ones). These redefinitions only apply to the current
thread.
A good and working solution for using local variables, that are only visible in the actual Thread Group, is to use the User Parameters Pre-Processor instead of the User Defined Variables configuration element.
Happy load testing ...