Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
ToinkToinkTigger
Contributor
Contributor

Date format

Hi there,

I have a column with date values. The format from the source is:

6/7/2022 08:49 PM Europe/Berlin

 

I would like to use the built-in calendar measurement in QS, however it does not regognize values as a date value.

Tried to split the field into pieces to extract the ''D/M/YYYY" however, did not get this to work.

Perhaps I can change the date format in the script loader? Would appreciate some help 🙂 Thanks

 

Labels (1)
19 Replies
canerkan
Partner - Creator III
Partner - Creator III

But are Date values in your column? If your create a straight table with this column, what values are displayed?

ToinkToinkTigger
Contributor
Contributor
Author

This is how the values are displayed now after putting in the line of code. Looks like a date format, but still not detected by QS. 

ToinkToinkTigger_0-1663941453819.png

 

canerkan
Partner - Creator III
Partner - Creator III

Maybe there could be a problem if your standard date format in your main script part does not match the format. Have you checked that it's the same format?

ToinkToinkTigger
Contributor
Contributor
Author

Hi Good morning. This is how it looks right now.

Good news is that I have a column with a date now in MM/DD/YYYY format.

Still cannot use the calendar measurement function in Qlik as it keeps saying the field is not a data field.

ToinkToinkTigger_0-1664178999878.png

 

brunobertels
Master
Master

Hi 

you need to Name your dimension : 

 

Date(......subfield(....))) AS "Completion date" ,

ToinkToinkTigger
Contributor
Contributor
Author

Hi, sorry for being a noob... but what is the full line of code? tried several things but just getting an error after loading.

 

ToinkToinkTigger_0-1664179641658.png

 

canerkan
Partner - Creator III
Partner - Creator III

This is the line you need to user in your load script:

Date(Date#(SubField("Completion Date",' ',1),'D/M/YYYY')) as "Completion Date",

Then use Dimension "Completion Date" in your Visualization.

 

If it's still not working, can you provide some sample data?

ToinkToinkTigger
Contributor
Contributor
Author

So the date fields are now being displayed properly. However, still no options to categorize by year or month etc.  How do we achieve this? Normally the calendar function does this. Which is not working.

ToinkToinkTigger_0-1664180678476.png

 

canerkan
Partner - Creator III
Partner - Creator III

You can do that yourself by using Date Functions like Month etc. in your load script. Or create a Mastercalendar.

Check the link below for a pretty good collection of information to that topic by @marcus_sommer :

https://community.qlik.com/t5/QlikView-Documents/How-to-use-Master-Calendar-and-Date-Values/ta-p/149...

 

ToinkToinkTigger
Contributor
Contributor
Author

Okay Thanks everyone. So in Summary the lines of codes suggested fixed my issue. The auto calendar feature is now working after reloading the script and data source again. 

Thanks everyone for helping out. Until the next one 🙂