Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jmarinesc
Contributor III
Contributor III

Field Names must be unique in CONCATENATE Table

Hello QV Community;

When I try to reload below script in order to get matching and non matching fileds, I get message:

Field Names must be unique in CONCATENATE Table

What am I doing wrong?

Directory;
TablaA:
LOAD *
,'Table 1' as Table,
    REMISION as remision,
    AEROPUERTO as idestacion,
    LITROS as vnatural
FROM
(qvd);

CONCATENATE

//***************MOVIMIENTO TABLE******************

LOAD*
,'Table 2' as Table,
    remision,
    idestacion,
    vnatural
FROM
(qvd);

//******************INNER JOIN*************************
INNER JOIN (Table)
LOAD *
WHERE "Only in One Table?"
  OR  "idestacion Different?"
  OR  "vnatural Different?"
;
LOAD
remision
,if(count(remision)<2,-1) as "Only in One Table?"
,if(maxstring(idestacion)<>minstring(idestacion),-1) as "idestacion Different?"
,if(max(vnatural)<>min(vnatural),-1) as "vnatural Different?"
RESIDENT Table
GROUP BY remision;

STORE Table INTO C:\Users\jmarinesc\Downloads\SIAMCO\01_DATA\SQL\QVD\ESLK1JJOINA.qvd; 

Regards

James

1 Solution

Accepted Solutions
Gysbert_Wassenaar

You load all fields from Movs1Jun2010.qvd with * and then you additionally load the fields remision, idestacion and vnatural again without renaming them. So you try to load these fields twice with the same name. I think that's the problem qlikview complains about.

LOAD*

,'Table 2' as Table,

    remision,

    idestacion,

    vnatural

FROM

(qvd);


talk is cheap, supply exceeds demand

View solution in original post

2 Replies
Not applicable

Dear Jaime.

the error is due to Load *.

no need to Write * after load ,

if you write * it will take all the fileds from that table.

if you write * then no need to write all the fields names.

either you can you Load * or Load fieldnames.

you can't use both .

like,

Table:

LOAD

*

FROM

C:\Users\pss\Desktop\Test.xlsx

(ooxml, embedded labels, table is Sheet1);

Or

LOAD SNO,

     NAME

FROM

C:\Users\pss\Desktop\Test.xlsx

(ooxml, embedded labels, table is Sheet1);

both the above statement will give the same result.

your script should be like these

TablaA:
LOAD
'Table 1' as Table,
    REMISION as remision,
    AEROPUERTO as idestacion,
    LITROS as vnatural
FROM
(qvd);

CONCATENATE(TablaA)

//***************MOVIMIENTO TABLE******************

LOAD
'Table 2' as Table,
    remision,
    idestacion,
    vnatural
FROM
(qvd);

Thanks,

Mukram

Gysbert_Wassenaar

You load all fields from Movs1Jun2010.qvd with * and then you additionally load the fields remision, idestacion and vnatural again without renaming them. So you try to load these fields twice with the same name. I think that's the problem qlikview complains about.

LOAD*

,'Table 2' as Table,

    remision,

    idestacion,

    vnatural

FROM

(qvd);


talk is cheap, supply exceeds demand