Qlik Community

Qlik Sense Data Connectivity

Discussion board where members can learn more about Qlik Sense Data Connectivity.

Announcements
BARC’s The BI Survey 19 makes it official. BI users love Qlik. GET REPORT
Highlighted
oliverqueen
New Contributor II

[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
Partner
Partner

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

Hi Oliver, you found out how to do it?

regards, Emma

ivostapchuk
New Contributor III

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

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?