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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

CSV files with some column headers missing

Hi All,

I have two problems

1) Hope this will be an easy one to solve. I have a large amount of CSV files which are generated evey day automatically from on of our core systems. These reports formats can not be changed.

Some of the coumns do not have headers, however I want to import these as well as the columns that do. Does anyone know how to do this.

2) The second problem is that each file is for a particular client and is named xxxxxxx EEMCP dd/mm/yyyy.csv where xxxxxxx is the client name. The client name is not contained in the file itself and I need to take the client name from the filename and add this as a column when importing.

I tried something like varStringSpace = substringcount(filename(),' ') to try and find the first space so that I can then use that to extract the name into a variable and populate the table. It doesnt seem to work and I am not getting any clue as to what the problem is...it may be that filename() does not contain the file name but I am not sure. Can anyone help.

Thanks in advance.

Alan

1 Solution

Accepted Solutions
hector
Specialist
Specialist

Hi, i made this zip file, with csv files and the qv model

First:
i think the "secret" is read all the csv files with "no labels", and try to find a numeric field, so if this field reads a text (field name), just drop it (with the isnum() function)

Second:
filename() will work for you "inside" the load statement

check the model and tell me if it works for you

rgds

View solution in original post

2 Replies
hector
Specialist
Specialist

Hi, i made this zip file, with csv files and the qv model

First:
i think the "secret" is read all the csv files with "no labels", and try to find a numeric field, so if this field reads a text (field name), just drop it (with the isnum() function)

Second:
filename() will work for you "inside" the load statement

check the model and tell me if it works for you

rgds

Not applicable
Author

Thanks Hector,

Thats got it sorted.

Regards

Alan