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.
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
MVP
MVP

Re: User variable as a fieldname during the script loading

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.

4 Replies

Re: User variable as a fieldname during the script loading

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.

MVP
MVP

Re: User variable as a fieldname during the script loading

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

Re: User variable as a fieldname during the script loading

Thanks!

It works perfectly.

Not applicable

Re: User variable as a fieldname during the script loading

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.

Community Browser