Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Aditya_Chitale
Specialist
Specialist

Storing table into CSV changes date format

Hi All,

I am encountering a bizarre issue where storing a Qlik sense table into CSV file format is messing up the date format. Some dates are getting converted into text format. If I keep the date format as M/DD/YYYY, it is showing properly. But I want to store the dates in DD-MM-YYYY format. This is where I am struggling.

Any help in solving this issue would be greatly appreciated.

 

Regards,

Aditya

Labels (2)
1 Solution

Accepted Solutions
Aditya_Chitale
Specialist
Specialist
Author

Thanks everyone for your help but on further digging, I found out that the issue was related to the system on which I was viewing the CSV. When viewed on a different system, the dates were displayed in the desired format and uniformly.

 

Regards,

Aditya

View solution in original post

10 Replies
steeefan
Luminary
Luminary

Can you share the code that creates the table which you want to store? Have you tried formatting the date with Date(DateField, 'DD-MM-YYYY') AS DateFormatted? Have you tried changing your global variables to match the desired format?

LRuCelver
Partner - Creator III
Partner - Creator III

If storing the dates while still formatted as a date doesn't work, you could try converting them to a formatted string.

Text(Date(YourDateField, 'DD-MM-YYYY'))

 

Aditya_Chitale
Specialist
Specialist
Author

@steeefan 

I haven't modified much in the code. I am pulling the data from an excel file which has source data formatted as DD-MM-YYYY. Now I am applying incremental load and just storing the table as .csv file. But when I open the csv file, some dates are showing in text format.

I tried converting using Date() function but it isn't helping. The only uniform format of dates that is working in csv file is M/DD/YYYY. Only in this format, all dates are getting formatted uniformly.

 

Regards,

Aditya

Aditya_Chitale
Specialist
Specialist
Author

@LRuCelver Tried this too. Not working.

Regards,

Aditya

steeefan
Luminary
Luminary

Which date format is specified in your global app variables?

Aditya_Chitale
Specialist
Specialist
Author

Earlier it was M/D/YYYY. I changed it to DD-MM-YYYY and stored csv.  Still same  result.

Aditya_Chitale_0-1708501708829.png

 

Regards,

Aditya

steeefan
Luminary
Luminary

Would you be able to post some rows of your original data or file containg all the various date formats as an Excel file? That would certainly help investigating.

Cascader
Creator
Creator

try this: 

Date(Date#(YourDateField, 'DD-MM-YYYY'), 'DD-MM-YYYY') as YourDateField

pallavsi_08
Contributor II
Contributor II

The date can simply be converted to a number, and formatting can be done after.

Alternatively, you might use the Alt function.