Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewaf
Creator
Creator

Script error: Why?

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

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

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?

View solution in original post

3 Replies
Anil_Babu_Samineni

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 ....;

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Miguel_Angel_Baeyens

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?

antoniotiman
Master III
Master III

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