Discussion Board for collaboration on QlikView Scripting.
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.
Go to Solution.
You need to put square brackets into the script, not the variables:
LOAD [Student Name] as Student_Name,
[Paper-I] as [$(Subject1)_$(Ext)],
add square brackets in the variable values
Let Subject1 = 'Embedded System';
Let Subject2 = 'Imformation Security Management';
Let Subject4 = 'Ethical hacking';
Let Subject1 = '[Embedded System]';
Let Subject2 = '[Imformation Security Management]';
Let Subject4 = '[Ethical hacking]';
Thanks for you reply.
I tried to implement it and I got syntax error.
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);
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';
will evaluate to
Or you can try the valid alternative mentioned by PR too.