Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

User variable as a fieldname during the script loading

Hi Everyone!

I would like to know is it possible to use variable as a field name during the loading?

For example:

let vFieldName = 'aaabbb'

Table:

LOAD

     ID,

     Description as $(vFieldName)

     Value

FROM...

Thanks for your help!

1 Solution

Accepted Solutions
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Yes.  Variables are very flexible in QlikView, in expressions and load script.  Believe it or not the following will work...

let vFieldName = 'tion as Fie';

Table:

LOAD

     ID,

     Descrip$(vFieldName)ldname,

     Value

FROM...

The syntax highlighting will have a wobbler, but you just have to think of dollar sign expansion as copying and pasting the contents of the variable into the location where you do the DSE.

Hope that makes sense.

View solution in original post

4 Replies
Anonymous
Not applicable
Author

Yes it is certainly possible and works.

Just make sure you have a semicolon after the let statement and a comma after the dollar expansion.

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Yes.  Variables are very flexible in QlikView, in expressions and load script.  Believe it or not the following will work...

let vFieldName = 'tion as Fie';

Table:

LOAD

     ID,

     Descrip$(vFieldName)ldname,

     Value

FROM...

The syntax highlighting will have a wobbler, but you just have to think of dollar sign expansion as copying and pasting the contents of the variable into the location where you do the DSE.

Hope that makes sense.

Not applicable
Author

Thanks!

It works perfectly.

Not applicable
Author

Hi,

Thanks for your reply. I missed the semicolon only from the post. I tried to passed the variable to the fieldname as $(vFieldName)&'_xy' instead of $(vFieldName)_xy. Now it works.