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

Date field not recognized in Date Picker widget

The Date Picker widget does not recognize my date field. I have tried many load script solutions, however it does not format the date correctly.  The [provisioned_on] is the field I would like to convert to a date. The [provisioned_on] format going into Qlik is "2018 Mar 23 12:00:00 AM". When I open the Date Picker drop down menu to "select  a value" the provisioned_on field is missing (attached pic). Are there limitations to the Date Picker widget? 

previous load scripts that do not work:

//Date(Timestamp#([provisioned_on],'YYYY MMM DD hh:mm:ssTT'),'YYYY-MM-DD') AS "Provisioned On",
//Date(Date#(provisioned_on,'YYYY MMM DD hh:mm:ssTT'),'YYYY-MM-DD') AS "Provisioned On",
//Date(Date#(left(provisioned_on,10),'YYYYMMDDhh:mm:ssTT'),'YYYY-MM-DD') AS "Provisioned On",
//Date(Floor(Date#([provisioned_on],'YYYY MMM DD hh:mm:ssTT')),'YYYY-MM-DD'),
//Date([provisioned_on], 'YYYY-MM-DD') AS "Provisioned On",
//Timestamp(Timestamp#([provisioned_on], 'YYYY-MM-DD')) AS [provisioned_on],
//Date(Date#([provisioned_on], 'YYYY-MM-DD')) AS [provisioned_on],
//Date(Date#([provisioned_on], 'YYYY-MM-DD')) AS [provisioned_on],

I am running Qlik Sense February 2021

Thanks

Darren

1 Solution

Accepted Solutions
Darren1
Contributor III
Contributor III
Author

Thanks again for the follow up. Your solution to add a tag is exactly correct. Once I added the tag to the load script the field became available in the Date Picker widget. 

View solution in original post

6 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

The Date Picker dropdown will only show fields that have Date values. Your field is a Timestamp. 

Extract the date portion using Floor() to make it a proper date. 

Date(Floor(Timestamp#([provisioned_on],'YYYY MMM DD hh:mm:ssTT')),'YYYY-MM-DD') AS "Provisioned On"

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

Darren1
Contributor III
Contributor III
Author

Thank you for a detailed response to my Date Picker issue. The Load Script you provided formatted the date in the correct format (ex: 2014-04-23). However the "Provisioned On" field is not available in the Date Picker field. 

 

Qlik Date Picker.png

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I just went through this with a customer last week. The issue is that the Date Range Picker only offers fields that have the $date tag. The workaround is to force the tag. Add this line to the end of your script.

Tag "Provisioned On" with '$date';

I haven't figured out why the tag is not automatically assigned in some cases. I think it has to do with the field not being a proper date the first time it's created. 

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

Darren1
Contributor III
Contributor III
Author

Thanks again for the follow up. Your solution to add a tag is exactly correct. Once I added the tag to the load script the field became available in the Date Picker widget. 

SET_Padawan
Contributor III
Contributor III

Hello! I have the same issue, just wondering exactly where I should be putting these lines of code?

Darren1
Contributor III
Contributor III
Author

I placed the Tag under the autogenerated autoCalendar which is in my first Section

Darren1_1-1689939477057.png