Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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!
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.
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.
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.
Thanks!
It works perfectly.
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.