Qlik Community

Ask a Question

New to QlikView

If you’re new to QlikView, start with this Discussion Board and get up-to-speed quickly.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

& Character in Column Header Name

I have an excel file I am trying to import into QlikView where the column headers contain the ampersand (&) character. I am using the wizard to try to do this import; I keep getting an error and when I debug the script, I get an error because the script now has duplicate column names.

For example, I have A&B Costs, Total A&B Costs as columns. The script truncates these to B Costs and B Costs - resulting in duplicate columns.

I do not have the ability to change the Excel file.

Is there a way to escape the & character in the data load script so that QlikView will load a file that results in two columns labelled A&B Costs and Total A&B Costs?

1 Solution

Accepted Solutions

Hi,

Not clearly understood your requirement,

but you can rename / alias  it in load to avoid duplicate column error.

for example

Load A as NewA,

A as NewB

From table;

Great dreamer's dreams never fulfilled, they are always transcended.

View solution in original post

5 Replies
Creator II
Creator II

One quick and easy way to achieve this would be by using Script Editor. Press CTRL + E to open script editor.

Here in the Data tab below, click Table Files. This will ask you to open the excel file on your computer. Once selected you can use the Embedded Label option (as in the screenshot below) to have your column names populated.

Basically in your load script the syntax should be similar to:

LOAD [A&B Costs],

     [Total A&B Costs],

Tx

Contributor II
Contributor II

try like this

Capture.JPG

Hi,

Not clearly understood your requirement,

but you can rename / alias  it in load to avoid duplicate column error.

for example

Load A as NewA,

A as NewB

From table;

Great dreamer's dreams never fulfilled, they are always transcended.

View solution in original post

Not applicable

Thanks for responding and taking the time to provide a potential solution. I did as you suggested however the editor still refuses to recognize characters up to and including the ampersand.

So this in Excel:

Capture1.PNG

Becomes this once I open the editor in QlikView and select Embedded Labels:

Capture.PNG

You can even see how the editor is appending the last field with a "1" - I presume to avoid duplicates.

The solution you proposed, unfortunately, does not resolve my problem - which is to load data with the field names as specified in Excel.

Not applicable

Thank you - though I have to admit, going through and aliasing every field that contains the & is a little clunky. This did work using the script editor.