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: 
Anonymous
Not applicable

How to add double quotes

Hello,

I know how to read a QVD and export it to a CSV.  But how would I go about adding double quotes to my

field data?  For example, say my QVD contains 3 columns.  First name, last name and street.  I want the content of

my CSV file to look like this:

"JOHN", "DOE", "123 ABC STREET"

Thank you

28 Replies
sinanozdemir
Specialist III
Specialist III

Hi,

See the below example, I used chr(34):

Capture.PNG

And here is the data model:

Capture.PNG

Hope this helps.

Anonymous
Not applicable
Author

When I used the chr(34) to surround the date field, it produced this format in my CSV which isn't what I wanted:

"""7/6/2011 12:00:00 AM"""

I only want to surround the data value with double quotes.  How can I fix this? 

Thanks for the help!

sinanozdemir
Specialist III
Specialist III

Can you post a sample data-set here? Because you shouldn't be having this issue unless there are already double quotes in this field?

Anonymous
Not applicable
Author

Here's a screenshot of the first two columns in my QVD file.

Add_Quotes.jpg

As you can see, there are no quotes.  I can produce a CSV as the way it is.  I just needed to surround each

column with the double quotes.  Thanks

Anonymous
Not applicable
Author

Here are the two lines of code in my load statement which produces the output shown in the screenshot.

chr(34) & Timestamp(TransactionPostDate) & chr(34) as 'TransactionPostDate2',

Date(TransactionPostDate) as 'TransactionPostDate',

Add_Quotes 2.jpg

Anonymous
Not applicable
Author

Even when I tried this, I got six double quotes.  Is there some type of global setting that I need to look at?

LOAD

chr(34) & 'Test' & chr(34) as 'Col1'

"""Test"""

"""Test"""

sinanozdemir
Specialist III
Specialist III

Another question is how does your store function look like to export to csv?

I have been using the below and never had this problem:

Store Test into 'C:/Desktop/Text.csv'(txt);

sinanozdemir
Specialist III
Specialist III

Probably. I think the best way to find out is looking at you app so if you could attach your qvw, it would be better.

sinanozdemir
Specialist III
Specialist III

I think your text delimiter is "" ie "Test" in the source file so you may need to change that in the load script if you are loading the data from a csv or excel.