here is an example that I create to show you what you could do. You can use this script like this in a new document.
my script :
// First you declare your table
load * inline [
12 , aa
// you make a loop for each row of your table
for i = 1 to NoOfRows('table1')
// you can get the name of the field that you want
let vField = FieldName(1,'table1');
// you can get the value of a field like this
LET vfieldvalue = FieldValue('$(vField)',$(i));
//you can store like this with a concatenation of the value of your data and a generic string
store * from table1 into test & $(vfieldvalue).qvd ;
This example wil create 4 qvd named like this :
test12.qvd, test123.qvd, test223.qvd, test233.qvd
Hope that it will help you.
Thank You!. In fact I found an answer from other question ( http://community.qlik.com/message/7705#7705 ), but yours is the closest to the solution that I implemented, so I count it for correct answer.
this is a littlee Script based on a german Northwind DB:
ODBC CONNECT TO Nordwind;
SQL SELECT Firma as Company, //field is not null
Load num(count(Company)) as Number
Let varNumberEnd = num(Peek('Number',-1,'Counter'));
for a=0 to $(varNumberEnd)-1
Let varCompany = Peek('Company',$(a),'Customer');
noconcatenate load *
store [StoreCust$(varCompany)] into 'StoreCust'&$(varCompany).qvd;
drop table [StoreCust$(varCompany)];
Hope that helps.