Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
varmekontrol
Creator
Creator

How to use Dynamic header on different headers and rows.

HI

Confusing subject i know..  but let me try to explain what I need 🙂

I need to load all .csv files from a folder into a .qvd file. 
That task of loading all files is simple enough, but herein lies my question. 

There are about 6 different .csv files in this folder, that varies in headers, and field contents. 

File example 1: 

SerialNoCreatedVolume1Volume2Volume3Volume4

 

File example 2: 

SerialNoCreatedHeat1Heat2Heat3Heat4TemperatureDelta-TErrorCode

 

File example 3: 

SerialNoCreatedTemperature1Temperature2Temperature3Humidity1Humidity2Humidity3

 

What I need to do is load all the files in a folder, but depending on the headers, they should be treated differently. Not only the header but the contents that comes with it in that field. 

//something like this

Load 
	SerialNo,
	Created,
		If(@3='Volume1', as volume1, 
		if(@3='Heat1', as Heat1,
		if(@3='Temperature' as Temperature)))
	
if(@4='' //and so on....

 

Labels (1)
2 Replies
juliensaintmaxent3113
Luminary Alumni
Luminary Alumni

hi,

if the structure is the same between files and the fields are different, i think this solution works.

load * from lib;\\mylib\*.csv 

bye

 

varmekontrol
Creator
Creator
Author

Hi

That did not do the job. 
When doing so I, first of all, get a lot of  syn_keys (15 in total) 

Second, the data is just mixed in the fields, and not separated into the right columns. 

Example 1 and Example 2 is attached.