Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

bibopipo
Contributor II

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
bibopipo
Contributor II

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

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

1 Reply
bibopipo
Contributor II

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

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

Community Browser