Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
dirk1955
Contributor

Using a variable as table name

Hi,

I wonder if it is possible to use a variable as a table name.

Explanation, i have a lot of reportings and i would love to ad a variable to a tabel name.

vDate = 20130901

the table name from the file is [IZ] and i would love to rename the table name like this $(vDate) IZ

Anyone?

THX in advance.

1 Solution

Accepted Solutions
Not applicable

Re: Using a variable as table name

Hi,

Yes you can use variable as table name. See the below script:

 

SalesIV:

LOAD * INLINE [
Dept, Name, Sales
Inventory, A, 10
Inventory, B, 15
Inventory, D, 2
Sales, A, 14
Sales, C, 30
]
;

set vtabname
= 'Sales';

Test:

NoConcatenate

load

Dept

Resident

$(vtabname)IV;

Hope this help,

Anosh

2 Replies
MVP
MVP

Re: Using a variable as table name

Yes ,should not be a big problem. Have you tried something like

[$(vDate) IZ]:

Load ... From ...;

Not applicable

Re: Using a variable as table name

Hi,

Yes you can use variable as table name. See the below script:

 

SalesIV:

LOAD * INLINE [
Dept, Name, Sales
Inventory, A, 10
Inventory, B, 15
Inventory, D, 2
Sales, A, 14
Sales, C, 30
]
;

set vtabname
= 'Sales';

Test:

NoConcatenate

load

Dept

Resident

$(vtabname)IV;

Hope this help,

Anosh

Community Browser