Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
dirk1955
Creator
Creator

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.

Labels (1)
1 Solution

Accepted Solutions
Not applicable

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

View solution in original post

2 Replies
swuehl
Champion III
Champion III

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

[$(vDate) IZ]:

Load ... From ...;

Not applicable

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