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

Issue in importing CSV file in Qlikview application

Hi,

       Pleasefind attached one CSV file format.

    Can any one help me to load this CSV file in Qlikview application.

Issue is QV appilcation not loading the CSV file due to some column dont have header name(field name) but it has data.

Thanks,

Antony

12 Replies
Not applicable
Author

Can any one help me to solve the above Query.

vijay_iitkgp
Partner - Specialist
Partner - Specialist

Hi,

Qlikview doesnot understand the space as field header. Instead of using Embeded Label use explicit label and define your labels after loading.

Hope this will help

Not applicable
Author

If i have more than 100 fields then how can i rename each & every fields.

is there any other option to rename blank header column.

Not applicable
Author

Hi Antony,

     Please find the attched qvw, hope this will help you.

     Use Explict label and remove the header.

Not applicable
Author

Hi Sri,

          If i have less fields then not a problem to do rename but i have more than 100 fields in each CSV file with some blank header name.

sivarajs
Specialist II
Specialist II

Its better to suggest them to add field name in log itself

Sivaraj S

Not applicable
Author

Hi Antony,

   Please check, Is there any possibilty in Excel to fill the empty cells to string.

Regards,

Siri

flipside
Partner - Specialist II
Partner - Specialist II

Hi Antony,

Use this script to rename your missing fields with MissingField1, MissingField2 etc. if too many to rename. Ensure you have a RowNo() in your data table to identify the top row which needs deleting.

Data:
LOAD
  RowNo() AS Hdr,
  @1, ...

FROM
[test_customer.csv]
(txt, codepage is 1252, no labels, delimiter is ',', msq);

let fldCount = NoOfFields('Data');

let fldMissing = 1;

For c = 2 to fldCount // ignore col 1 as the link

let fldName = FieldName('$(c)','Data');
let fldValue = FieldValue('$(fldName)',1);

if fldValue = '' then
  let fldValue = 'MissingField' & '$(fldMissing)';
  let fldMissing = fldMissing +1;
end if;

RENAME FIELD '$(fldName)' to '$(fldValue)';

Next c;

right keep (Data)
load Hdr resident Data where Hdr <>1;

DROP FIELD Hdr;

flipside

Not applicable
Author

Hi flipside,

   Just wondering why you need a RowNo() as the first field. I deleted it and it works fine as well. Could you explain me that? Thank you.

Regards,

Xue Bin