Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Store in CSV without double quotes

Hi,

I have a script which ends by storing formated data in a csv file (delimiter ';') that can later be uploaded in SAP. This is for a recurring job I'd like to get fully automated. It all works fine except that the final csv file contains double quotes around a field. This field is a long text containing a simple quote, which I insert as &chr(39)& in the concatenation.

But then, whether I make

store * from ExportCSV into ExportCSV.csv (txt, utf8, delimiter is ';')

or

store * from ExportCSV into ExportCSV.csv (txt, utf8, delimiter is ';', no quotes)

I get those double quotes.

Is there a way to overcome this? Or is there other ways, like using a macro to clear the double quotes in the csv afterwards ?

Many thanks in advance.

16 Replies
Not applicable
Author

I have the same problem - even worse, the contents of every field that contains a string must be enclosed in double quotes.

Fortunately, I do not need to automate the export. What I did is this:

- Prepare the table in the Script

- Have a table box that contains the table

- Klick on the "Send to Excel" icon in the table box's title bar

- select the required columns in excel, Copy and Paste into an editor, Save.

I ended up adding a "RecNo" column to my table, sorting according to it in the table box and leaving it out when copying in Excel. Without that, the order in the Excel export seemed to be unpredictable.

HTH, Frank

lalitinmbd
Partner - Contributor III
Partner - Contributor III

Any Ideas How to resolve this problem??

lalitinmbd
Partner - Contributor III
Partner - Contributor III

How can we avoid these double quotes as the file needs to be used in a separate system.??

Anonymous
Not applicable
Author

I have seen looking around many post the same issue since 2013 and I really feeling shocking that qlik has not declare an oficial solution. I have the same issue and this issue has generated several questioning around my company to prospect to migrate a qlik environment. Another developer is just working now in an PHP cron that solve the problem. Quotes 1, QLIK 0.

Regards

tomasz_tru
Specialist
Specialist

Have you tried some kind of 'exotic' delimiter like '&'?

Tomasz

quaresmar
Contributor
Contributor

This way worked for me.

LET vDoubleQuote = Chr(10);

NoConcatenate
FACTS:
LOAD
CRM_CODE,
'$(vDoubleQuote)'&ProductPackName&'$(vDoubleQuote)' as ProductPack,
'$(vDoubleQuote)'&'SELLOUT'&'$(vDoubleQuote)' as METRIC,
'$(vDoubleQuote)'&left(cod_date_operation,4)&'$(vDoubleQuote)' as Year,
'$(vDoubleQuote)'&right(cod_date_operation,2)&'$(vDoubleQuote)' as Month,

If(IsNull(#SellOut_Units),0,#SellOut_Units) as VALUE
Resident FactsTransact;

 

STORE FACTS into Facts.csv (txt, delimiter is '|');

GeigerS
Contributor
Contributor

Find a string that isn't in your file Before exporting, Find & Replace All double quotes " with xxx. Export your file to txt or csv. Open txt files and Find & Replace All quotes with nothing.