Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 Niqander
		
			Niqander
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Guys,
I'm quite experienced with Qlik, but this CSV is killing me.
When loading this CSV in Excel, it will tranfsorm the text to columns without a problem
When loading it into an Qlik Cloud analytics app it cannot figure out how to get around these two things:
The CSV will load correctly in qlik when i manually correct the file like this:
Now above manual corrections is not what i want to do for a daily refreshed csv.
Can you solve this puzzle for me?
 
					
				
		
 rwunderlich
		
			rwunderlich
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
Here's an updated script that correctly handles the comma lists.
 Niqander
		
			Niqander
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Do I need to create an automation which will picks up this file and pulls it through a powershell script which preps this csv for Qlik and then stores the prepped csv for loading into qlik?
 Niqander
		
			Niqander
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		This is the powershell which will overwrite the CSV with a qlik-prepped CSV. it basically deletes the first character for every row and it replaces "" for ".
 
					
				
		
 rwunderlich
		
			rwunderlich
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		You may find that the cleanest solution is to preprocess with something like an Automation. For what it's worth, here's a pure script solution that works only if there are no double quotes in the actual data, as it just blindly purges all double quotes.
 Niqander
		
			Niqander
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Rob, Thanks for climbing into this CSV! I got your solution working and attached I have the result.
As you can see the file loads and colums get filled, but there is 1 field "regions" which has comma separated values inside the field. these values will populate and mess up the fields after "regions" .
 
					
				
		
 rwunderlich
		
			rwunderlich
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
Here's an updated script that correctly handles the comma lists.
 Niqander
		
			Niqander
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Rob, many thanks for changing the code for me to only purge the first and last " with the mid function, I could/should have done that myself, sorry for taking your time on this one. I ran the code for the full dataset and all data looks to be loading into the correct fields now.
I have filed an "Qlik Sense | Data Prep & Modeling" Ideation for this CSV file to be handled by the engine automatically without the need of the above script, just like MS Excel (see attached) does with the text-to-columns function without any further need to alter text beforehand.
 
					
				
		
 rwunderlich
		
			rwunderlich
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Glad it works. I agree it would be good if the loader handled it as-is.
-Rob
