Hi Philipp - I was working on this exact scenario recently - try this - it works for me. It will give you example of the correct syntax to use when using variables - you need to wrap the variable in single quotes or brackets.
This will also give an idea on how to concatenate variables - for example the path and file name.
let vRootPath = 'lib://QlikSenseDataFolder/';
let vFileName = 'sample_data.qvd';
let vFullFilePath = '$(vRootPath)$(vFileName)';
trace This is the root path: $(vRootPath);
trace This is the file name: $(vFileName);
Load * Inline [
2,Human Resources,150000, 10000
Store SampleTable INTO '$(vFullFilePath)' (qvd);
Please mark the appropriate replies as helpful / correct so our team and other members know that your question(s) has been answered to your satisfaction.