Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Error while implimenting inner join in qlik document

Hi all,

I am implementing inner join in qlikview and getting a corresponding error as 'field name must be unique within table '

here is the script below:-

Incremental_Non_Etp_Sales:
Concatenate(POS_Master_final)
Load
ApplyMap('SAPCODE_ETPCodeMapping',NCode,'') as ETPCode,
InvoiceNumber as [inv no],
Date#(SalesDate, 'YYYYMMDD') as Sold_Date,
month(Date#(SalesDate, 'YYYYMMDD')) as Sold_Month,
year(Date#(SalesDate, 'YYYYMMDD')) as Sold_Year,
replace(ItemNumber,' ','') as itemnumber,
left(ItemNumber,3) as [Season Code],
//'N_ETP SALE' as SaleType,
    SaleQuantity as quantity_sold,
NetValue as [inv value],
MRPValue as [sales price],
if ( NetValue <500, '<500', if ( NetValue <800, '500-799',if ( NetValue <1200, '800-1199',if ( NetValue <1600,'1200-1599',if ( NetValue <2500,'1600-2499',if ( NetValue <3500,'2500-3499',if ( NetValue <5000,'3500-4999','>=5000'))))))) as [Inv val Bucket],
TaxAmount as [tax amount];
SQl Select WH.GoodsSender as NCode, SD.InvoiceNumber, SD.SalesDate,SD.ItemNumber,
SD.SaleQuantity, SD.NetValue,SD.MRPValue,SD.TaxAmount
FROM SAP_Link.dbo.Sales_DataNonETP_BIReports SD
INNER JOIN ETPEAS.dbo.warehouse_sap_bireport WH
ON SD.CustomerId = WH.Warehouse
where SD.Doc_Type = 'ZIKE' and SD.SalesDate >= 20130101 and SD.SalesDate <= '$(currentdate)' ;

6 Replies
techvarun
Specialist II
Specialist II

As per the screenshot we can see the field names are not unique within the table. Some field names are repeating.

Rename the fields and proceed with the load

rahulpawarb
Specialist III
Specialist III

e.g. Date#(SalesDate, 'YYYYMMDD') as Sold_Date field is included twice in Incremental_Non_Etp_Sales table. Due to which reload activity is throwing "Field names must be unique within table". Remove/rename one of it to fix this issue.

Regards!

Rahul

Anonymous
Not applicable
Author

as per screenshot sold_date, sold_month and sold_year are repeating...thats why its failing with that error.

senpradip007
Specialist III
Specialist III

As per the screen shots you have shared it is observed that Date#(SalesDate, 'YYYYMMDD') as Sold_Date is used twice. Omit one and code will run with no error.

Anonymous
Not applicable
Author

thanks.

senpradip007
Specialist III
Specialist III

Mark the discussion as 'Correct' or 'Helpful' so that it will help others.