Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[QS] How to store an evaluated expression as a column name?

To store an evaluated expression as a field in data load editor, one can do this:

Let vMonth = FileName();

LOAD

    $(vMonth) as "Month",

    ...

    ....

But how can I store the variable as a column name such that:

Let vMonth = FileName();

LOAD

    "ColumnA" as $(vMonth),

    ...

    ....

where ColumnA is a field from my data source. I've played around with combinations of Set and Let and equal signs and quotation marks but to no avail.

2 Replies
EmmaC
Partner - Creator
Partner - Creator

Hi Oliver, you found out how to do it?

regards, Emma

Anonymous
Not applicable
Author

next sample works:

Let vField = 'MyNewField';

Test:

LOAD

Year as $(vField),

  * inline [

Year Quarter Sales

2012 Q1 1100

2012 Q2 1700

2012 Q3 1400

2012 Q4 1800

2013 Q1 1000

2013 Q2 1300

2013 Q3 1100

2013 Q4 1400] (delimiter is ' ');

But what return FileName() before Load statement?