Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
i'm getting this error in red below when i load my script. It's the first time and on that portion of scripet all field are unique.
Which could be the reason?
hanks
Field names must be unique within table
Concatenate (F42119Temp)
LOAD
'000'&[COMPANY],5 as Order_Company,
'000'&[COMPANY],5 as CompanyBP,
RECORD_NO as Order_Line,
CUSTOMER_NO as Ship_to_Number,
CUSTOMER_NO as Address_Number,
If(Match(COMPANY, 10), 'USD', If(Match(COMPANY, 80), 'JPY')) as Currency,
Date#(If(Len(MONTH)=1,YEAR&'0'&MONTH&'01',YEAR&MONTH&'01'),'YYYYMMDD') as Date,
Date(Date#(If(Len(MONTH)=1,YEAR&'0'&MONTH&'01',YEAR&MONTH&'01'),'YYYYMMDD'), 'MM/DD/YYYY') as Date2,
ITEM_NO as Item_Number,
Num(EXTENDED_PRICE_AMT_LCL) as ExtendedOriginal,
QUANTITY as Qty_Sold,
QUANTITY as Qty_Shipped,
ApplyMap('PlanRate', (If(Match(Right([COMPANY],2), '10', '14'), 'USD', If(Match(Right([COMPANY],2), '15'), 'CAD', If(Match(Right([COMPANY],2), '32', '34', '40', '46'), 'EUR',
If(Match(Right([COMPANY],2), '42'), 'GBP'))))), 'FX-not-found')* Replace(EXTENDED_PRICE_AMT_LCL, '.',',') as ExtendedUSD
Resident SalesInternationalTemp
At a first glance, it's because
'000'&[COMPANY],5 as Order_Company,
'000'&[COMPANY],5 as CompanyBP,
use a comma without escaping, so the name of the field in both cases is
'000'&[COMPANY]
Maybe you want something like this instead:
"'000'&[COMPANY],5" as Order_Company
using double quotes?
This error indicates if we are not initiating the fields then this error will come up Field names must be unique within table
Load *, If(.....);
Load File1, File2, File3 ....;
At a first glance, it's because
'000'&[COMPANY],5 as Order_Company,
'000'&[COMPANY],5 as CompanyBP,
use a comma without escaping, so the name of the field in both cases is
'000'&[COMPANY]
Maybe you want something like this instead:
"'000'&[COMPANY],5" as Order_Company
using double quotes?
Hi Antonio,
Miguel is right.
If You want Order_Company like '00015' or '00001', then if COMPANY is numeric try
Num(COMPANY,'00000') as Order_Company,
Regards,
Antonio