Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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)' ;
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
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
as per screenshot sold_date, sold_month and sold_year are repeating...thats why its failing with that error.
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.
thanks.
Mark the discussion as 'Correct' or 'Helpful' so that it will help others.