Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to assign a variable value to a new field during loading

Dear all,

I've to gather the same information from several DB's. In order to avoid any kind of ambiguity, I would store the DB name into the final table.

All the tables, are named as Mytabel + Dbname

FOR i=0 to $(DATA_COUNT)-1

let DBName=peek('NOME_DB',$(i),'mydblist');

let nomedb = trim($(DBName));

load .

..

.. all the fields

...

from

Mytable$(DBName).qvd

(qvd);

What I'm trying is to add a new field like this:

Load

...

newfield containing the dbname

from .....

But without success. Is it possible to do it ?

The final table should be like this:

DBNAME     InvoiceNr.

AAA               1

AAA               2

BBB               1

BBB               2

CCC               1

CCC               2

...

Help please

Thanks in advance for your help

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Dear all,

perhaps I found the solution.

I tryed the following:    '$(DBNAME)' as  Newfield

It was necessary to put the variable into  ' '

Thanks to everybody anyway

View solution in original post

1 Reply
Anonymous
Not applicable
Author

Dear all,

perhaps I found the solution.

I tryed the following:    '$(DBNAME)' as  Newfield

It was necessary to put the variable into  ' '

Thanks to everybody anyway