Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

cristihainic
New Contributor III

Workaround for "Field names must be unique within table" error?

Hi everyone,

I have a CSV table with duplicate column names and Qlik refuses to load those fields, throwing the error from the title. Now, data-wise, I actually want all data within those columns to be loaded under the same field name. What can I do in the Data Load Editor to obtain this result?

E.g., I have this piece of data:

Name, Name, Name, Planet

Chris, John, Mary, Earth

I want to have it loaded in Qlik as it is and in the visualization use a *single* field name to refer to Chris, John and Mary. That field name would be "Name". Any thoughts on how I might achieve this?

Thanks,

Chris

4 Replies
MVP
MVP

Re: Workaround for "Field names must be unique within table" error?

Try something like

CrossTable (FieldName, Name)

LOAD Planet, Name, Name, Name INLINE [

Name, Name, Name, Planet

Chris, John, Mary, Earth

];

DROP FIELD FieldName;

edit: sorry, this is only half way solution and will not work as is . what's your data source, an excel or text file?

cristihainic
New Contributor III

Re: Workaround for "Field names must be unique within table" error?

Hi Stefan,

Unfortunately the resulting data looks like this:

crosstable.png

Chris and John are out of the equation

My source file is a CSV

Employee
Employee

Re: Workaround for "Field names must be unique within table" error?

Try using the DataManager and load with ',' as separator, using positional columns instead of column names

Capturar.PNG

MVP
MVP

Re: Workaround for "Field names must be unique within table" error?

For an excel fiel, it could lok like

CrossTable (Field, Name)

LOAD D as Planet, A, B, C

FROM [MultipleFieldNames.xlsx] (ooxml, no labels, header is 1 lines, table is Tabelle1);

DROP FIELD Field;

and for your txt file maybe

CrossTable (Field, Name)

LOAD @4 as Planet, @1, @2, @2

FROM [MultipleFieldNames.csv] (txt, no labels, header is 1 lines, delimiter is ',');

DROP FIELD Field;

or use the wizard like shown above and then apply the CROSSTABLE.

edit: edited format code

Community Browser