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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
fendora
Contributor II
Contributor II

[CSV] How to link Column Names in Schema and Header?

Hi!
I've got a question regarding tfileinputdelimited and their schemas, i made a simple job :

Both input read the same file, this one :

(A tab separated value file)
Here are the schemas of my two inputs :
http://i.imgur.com/nzQkzJ2.png http://i.imgur.com/hSNE6n0.png

And here's the output :


As you can see, in the second output, the values are wrong.
The components does not link the value and their header names (provided in the file) to the names specified in the schema, as a mysqlinput component would do, but instead read them in the order they come.
The output of my tLogRow_2 component should read "HO | HU" (second and third columns), not "Hi, HO". Is there a way to link header column names in file and columns names in schemas?

Here are the job's components if you want to test it, thank you very much :
TestJob.zip_20160630-2351.zip
Labels (2)
4 Replies
Anonymous
Not applicable

The CSV file is read by position.
If you're expecting your input files to have columns out of order and you want to match up using header names, this component will not do this for you.
fendora
Contributor II
Contributor II
Author

Thank your for your answer. Should i use another component, or will the csv format prevent me from doing this, regardless of the technique used?
Anonymous
Not applicable

It's unclear what you're trying to do.
Is your use case that you have to read CSV files that have columns in an unpredictable order?
Ideally, this should not happen. If it is, then I think you'd have to do you're own parsing of the input data to assign the correct inputs to the correct outputs.
Anonymous
Not applicable

It looks like this tutorial might be what you need (https://www.rilhia.com/tutorials/dynamic-column-order). This shows how you can handle a dynamic column order with the Open Source product.