Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm loading tables in a script by creating a list of the table names and then looping through them. The list is getting long and unwieldy, so instead of this:
```
Set tableList = 'table1','table2','table3',...;
```
I would like to do something more maintainable, maybe like this:
```
Set tableList =
'table1',
'table2',
'table3',
...
;
```
I tried this, but apparently the line returns are preserved. Is there a way to do multiline lists?
Thanks
-tom
Maybe this can help you
SET List =
'vExpPositiveVoice',
'vExpTelefonia',
'vExpTaxaErro',
'vExpAbandono',
'vExpChamadas',
'vExpChamadasPreditivas',
'vExpChamadasManuais',
'vExpChamadasPreview',
'vExpChamadasAtendidas',
'vExpClientesContatados',
'vExpSucesso',
'vExpAgendamento',
'vExpBilhetesNaoTarifados',
'vExpDuracaoNaoTarifada',
'vExpCustoChamada',
'vExpDuracaoChamada';
Let List = Replace(List,chr(10),''); // removes the cr
for each table in $(List) // iterate over your list
trace $(table);
next
Aha! Removing the line endings works. One note: I had to use `chr(13) & chr(10)` instead of just `chr(10)`. Probably just depends what system you're on.
Was that a question?
Each array can allocate in singular formation not multi lines. So, AFAIK that can not be done. Not sure in your case, Why Array needed in long key using all tables in single momentum,,!
Why not try something like this if your table name are Table1,Table2 etc,.. it will include all of them ,
FOR i = NoOfTables()-1 to 0 STEP -1
LET vTableName=TableName($(i));
IF WildMatch('$(vTableName)', 'Table*') THEN
.
.
.//your code here
.
ENDIF
NEXT i
When applicable please mark the appropriate replies as CORRECT. This will help community members and Qlik Employees know which discussions have already been addressed and have a possible known solution. Please mark threads as HELPFUL if the provided solution is helpful to the problem, but does not necessarily solve the indicated problem. You can mark multiple threads as HELPFUL if you feel additional info is useful to others.
Maybe this can help you
SET List =
'vExpPositiveVoice',
'vExpTelefonia',
'vExpTaxaErro',
'vExpAbandono',
'vExpChamadas',
'vExpChamadasPreditivas',
'vExpChamadasManuais',
'vExpChamadasPreview',
'vExpChamadasAtendidas',
'vExpClientesContatados',
'vExpSucesso',
'vExpAgendamento',
'vExpBilhetesNaoTarifados',
'vExpDuracaoNaoTarifada',
'vExpCustoChamada',
'vExpDuracaoChamada';
Let List = Replace(List,chr(10),''); // removes the cr
for each table in $(List) // iterate over your list
trace $(table);
next
Aha! Removing the line endings works. One note: I had to use `chr(13) & chr(10)` instead of just `chr(10)`. Probably just depends what system you're on.