Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

tomarnold
New Contributor

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

Tags (1)
1 Solution

Accepted Solutions
Employee
Employee

Re: Multiline Lists

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

6 Replies
OmarBenSalem
Esteemed Contributor

Re: Multiline Lists

Was that a question?

Re: Multiline Lists

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

Life is so rich, and we need to respect to the life !!!
pradosh_thakur
Honored Contributor II

Re: Multiline Lists

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.
Luminary
Luminary

Re: Multiline Lists

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.

Employee
Employee

Re: Multiline Lists

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

tomarnold
New Contributor

Re: Multiline Lists

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.

Community Browser