Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Stop numbers from changing to dates when stored in csv

Whenever I store a table into a .csv file, if a column has data in the form like 3-5 or 2-3, it is automatically stored like 5-Mar or 3-Feb respectively.

How can I stop that from happening?

7 Replies
oknotsen
Honored Contributor III

Re: Stop numbers from changing to dates when stored in csv

Did you check the content of the CSV in a text editor or in XLS?

May you live in interesting times!
Not applicable

Re: Stop numbers from changing to dates when stored in csv

I import the data from a QVD which has the column values like 3-5, 5-7 etc.
When i store that table into a CSV file, the contents of that column change to dates.

Even when I normally enter 3-5 in a cell in an Excel workbook and press enter, it automatically changes to May-3.
So that is why the values of the column of the table change while storing. So how do i stop that?

For now i have found a temporary solution. In my table, the values 3-5, 5-7 etc are range of years, interpreted as 3 to 5 years.
So for now i have concatenated that whole column with 'years' so now the CSV file shows the value as '3-5 years' instead of May-3.

oknotsen
Honored Contributor III

Re: Stop numbers from changing to dates when stored in csv

No offence intended, but could you please answer my very basic question?

To clarify:

If you load data into XLS it will often do these kinds of conversion. So the data can still be scored correctly in the CSV but XLS ruins it for you.

So, could you please just open the CSV in a basic text editor, like notepad, and check if it contains "3-5" or "mar-5".

May you live in interesting times!
Not applicable

Re: Stop numbers from changing to dates when stored in csv

In text editor it contains 3-5

oknotsen
Honored Contributor III

Re: Stop numbers from changing to dates when stored in csv

So your problem has (as I expected) nothing to do with Qlik Sense but with loading in XLS. The data is stored the way you want it in CSV.

May you live in interesting times!
kvanandan1
Contributor

Re: Stop numbers from changing to dates when stored in csv

Hi,

While storing any special characters data in csv or excel , use the prefix ' (single quotes) in front of the data.

for example, '3-5 will show correctly in csv or excel.

Employee
Employee

Re: Stop numbers from changing to dates when stored in csv

Use ' before your field