Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Changing field names

Hi All,

I have created a pivot table where the expressions has field names which are expressions. For instance:

  Name                   '31-Aug' & Year(Today())

     a                              1

     b                              2

     c                              3

     d                              4

This is an input for another document. Hence the script load:

Load Name,

        [31-Aug-2014]

From

Sample.xls

However this data is changed in the next year so the first table becomes

Name'31-Aug' & Year(Today())

a                         5

b                         6

c                         7

d                         8

And the script load

Load Name,

        [31-Aug-2015]

From

Sample.xls

Is there anyway I can alias a field to an expression?

Thank you in advance

Labels (1)
3 Replies
tresB
Champion III
Champion III

You could use '*' or field number reference instead of directly putting field name like:

Load * From <>;     // this works if you want all the fields in the excel sheet

Load Name, @2 From <>;   // @2 - refers the column number 2

Not applicable
Author

Thank you but there is another condition.

I am to join a third table with the second table based on the value in the field [31-Aug-2014].

So how am I to join if I cant rename the third table to the same name as in the fields of the second table

tresB
Champion III
Champion III

You can rename it in normal way like:

Load @2 as Key,

          Name

From <>;

Join

Load *, key From <>;

Now, this gives you the field whatever name it may have and join with another table.