Skip to main content
Announcements
Qlik Launches Open Lakehouse and advanced agentic AI experience in Qlik Answers! | LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
xyz2
Contributor III

Change Date Format

Hello,

I would like to change the Date Format

"2022-05-23T11:11:42.397Z" 

to

"23.05.2022" (DD.MM.YYYY)

Does anyone know, how i can solve this problem?

 

1 Solution

Accepted Solutions
Or
MVP

No idea, because this works fine when I load it inline... perhaps something is wrong with the CSV load itself?

Load Date(Date#(Left("Created Date",10),'YYYY-MM-DD'),'DD.MM.YYYY') as [Created_Date] INLINE [
Created Date
2021-04-28T09:50:58.767Z
2021-04-22T16:34:35.533Z
2021-10-08T12:30:28.79Z
2022-02-14T09:31:13.19Z
2022-04-07T09:40:34.437Z
2022-04-19T14:43:29.353Z
2022-05-18T07:25:03.573Z
2022-05-19T13:28:12.093Z
2022-06-24T12:29:24.71Z
2022-07-05T11:21:37.703Z
2021-08-03T14:37:04.757Z
];

Or_0-1657099290454.png

 

View solution in original post

10 Replies
salonicdk28
Creator II

Please try this once

=Date(Floor(DateTime), 'DD.MM.YYYY')

Thanks,

Saloni

xyz2
Contributor III
Author

Thank you for your answer.

I tried this, but it still doesn't work. Do i have not reference to my data? I mean, at which part i can say, that this Method should been used for my field.

 

Thanks!

Or
MVP

If this is being recognized as a string, which is probably the case, you'll need to treat it as such rather than using date functions directly on it. This is where the date#() function comes in:

Date(Date#(Left(YourField,10),'YYYY-MM-DD'),'DD.MM.YYYY')

 

 

xyz2
Contributor III
Author

You're right. I get my Data from an .csv-File.

I tried you're solution, but it also doesn't work. Again, no data returned.

 

Or
MVP

Then something is likely not as you described, because this works correctly when I use it in Qlik:

Or_0-1657098070770.png

If the field was already recognized as a date (rather than a string), then date(Field,'DD.MM.YYYY') would work, but you said you already tried that.

 

xyz2
Contributor III
Author

Maybe i wasn't specific enough. Sorry for that!

Created Date
2021-04-28T09:50:58.767Z
2021-04-22T16:34:35.533Z
2021-10-08T12:30:28.79Z
2022-02-14T09:31:13.19Z
2022-04-07T09:40:34.437Z
2022-04-19T14:43:29.353Z
2022-05-18T07:25:03.573Z
2022-05-19T13:28:12.093Z
2022-06-24T12:29:24.71Z
2022-07-05T11:21:37.703Z
2021-08-03T14:37:04.757Z

 

then i am loading my data into Qlik:

LOAD

Date(Date#(Left("Created Date",10),'YYYY-MM-DD'),'DD.MM.YYYY') as [Created_Date]

FROM ...

 

Afterwards, i am adding my Filed [Created_Date] into my visualization and it returns Null.

Do you may need more information or can you recognize, what i am doing wrong?

 

Thanks!

Or
MVP

No idea, because this works fine when I load it inline... perhaps something is wrong with the CSV load itself?

Load Date(Date#(Left("Created Date",10),'YYYY-MM-DD'),'DD.MM.YYYY') as [Created_Date] INLINE [
Created Date
2021-04-28T09:50:58.767Z
2021-04-22T16:34:35.533Z
2021-10-08T12:30:28.79Z
2022-02-14T09:31:13.19Z
2022-04-07T09:40:34.437Z
2022-04-19T14:43:29.353Z
2022-05-18T07:25:03.573Z
2022-05-19T13:28:12.093Z
2022-06-24T12:29:24.71Z
2022-07-05T11:21:37.703Z
2021-08-03T14:37:04.757Z
];

Or_0-1657099290454.png

 

salonicdk28
Creator II

Yes, It's working in my application also, first one I am calculating in table directly and other one is I am calculating in script editor

salonicdk28_0-1657099279352.png

 

 

xyz2
Contributor III
Author

I also think that something is wrong with the LOAD itself...

so i did this in the Visualization:

=left([Created_Date],11)

now, i did not get the format that i wanted, but at least it shows me just the date.

 

Thank you for your help!