Re: How to use value of the variable in load script?
There are a few ways of doing this. I'll quickly list them as you may prefer one over another;
1) Your code above looks almost sound as long as you only allow one selection on com_Level. But I'd advise not loading from your SQL DB directly as this may affect performance of your source system. It would be more efficient and simpler to have this SQL table stored into a qvd and load from this, use formula;
2) Hide all your tabs and only show them after your use has performed a data reduction (i.e. Have them open the fully populated qvw but do not allow them access to any functionality via conditional hides until they have performed this data reduction).
3) Provide a selection box and a reload button to make the selection easier for you users. (This is similar to option 1). I have attached an example so that you may see the logic of the load script.