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: 
Not applicable

Table alias

Hi Team,

I have an excel file containing unusual header names like F1, F2, F3 etc.

I want to change it in the form SubjectName_Externals, SubjectName_Internals and SubjectName_Practicals.

but the problem that I am facing is

Subject name is either of 2 word or more as shown below

Subject1 = 'Embedded System';

Subject2 = 'Imformation Security Management';

Kindly help me with a solution to resolve this issue.

I have also attached qvw file.

Regards

Priyanka

1 Solution

Accepted Solutions
prieper
Master II
Master II

You need to put square brackets into the script, not the variables:

Directory;

LOAD [Student Name] as Student_Name,

     [Paper-I] as [$(Subject1)_$(Ext)],

....

Peter

View solution in original post

6 Replies
JonnyPoole
Employee
Employee

add square brackets in the variable values

change :

Let Subject1 = 'Embedded System';

Let Subject2 = 'Imformation Security Management';

Let Subject4 = 'Ethical hacking';

to:

Let Subject1 = '[Embedded System]';

Let Subject2 = '[Imformation Security Management]';

Let Subject4 = '[Ethical hacking]';

Not applicable
Author

Hi Jonathan,

Thanks for you reply.

I tried to implement it and I got syntax error.

Regards,

Priyanka

prieper
Master II
Master II

You need to put square brackets into the script, not the variables:

Directory;

LOAD [Student Name] as Student_Name,

     [Paper-I] as [$(Subject1)_$(Ext)],

....

Peter

Not applicable
Author

Thanks Peter

Gabriel
Partner - Specialist III
Partner - Specialist III

Hi,

Try this

Let Subject1 = chr(91) & 'Embedded System' & chr(93);
Let Subject2 = chr(91) & 'Imformation Security Management' & chr(93);
Let Subject3 = chr(91) & 'Virtualization' & chr(93);
Let Subject4 =chr(91) & 'Ethical hacking' & chr(93);


JonnyPoole
Employee
Employee

Hi - yes sorry.  because you are using 2 variables the square brackets need to come at the beginning and end of the full string.  Something like this:

Let Ext = 'External]';

Let Int = 'Internals]';

Let Prac = 'Practical]';

Let Subject1 = '[Embedded System';

Let Subject2 = '[Imformation Security Management';

Let Subject3 = '[Virtualization';

Let Subject4 = '[Ethical hacking';

then this: 

     [Paper-I] as

$(Subject1)_$(Ext),

will evaluate to

    

     [Paper-I] as[Embedded System_External];

Or you can try the valid alternative mentioned by PR too.