Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Multiline Lists

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

2 Solutions

Accepted Solutions
Clever_Anjos
Employee
Employee

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

View solution in original post

Anonymous
Not applicable
Author

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.

View solution in original post

6 Replies
OmarBenSalem

Was that a question?

Anil_Babu_Samineni

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,,!

Please add me Anil_Babu_Samineni to interact faster when reply back. Speak low think High.

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
pradosh_thakur
Master II
Master II

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

Learning never stops.
pablolabbe
Luminary Alumni
Luminary Alumni

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.

Clever_Anjos
Employee
Employee

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

Anonymous
Not applicable
Author

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.