Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
ferha_jafri
Partner - Creator III
Partner - Creator III

dates format automatically changes when we change month and year format

Hi Everyone,

I have a data model in which the dates are in different format ,when i change the format for month and year as they were in text format i have changed them to number format to use them in max function,there are many dates which automatically changes to number format eg. created date. In this model when i am trying to convert the created date in date format as mm/dd/yyyy ,i am not able to do that,i am not able to understand the issue.One more thing i want to understand the master calendar concept .plz help me in understanding this and in which model we can apply master calendar.

Thanks in advance

Ferha Jafri

3 Replies
Not applicable

Hi Ferha ,

Please find the attachment, hope this will help you.

Thanks

Raj

ferha_jafri
Partner - Creator III
Partner - Creator III
Author

It is working on the front end but when i try to change the complete field in the script and gave a specific format it is not working.Why??

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Some dates in your source data are numeric and others are strings. You use the date# function to convert a string to a date. The date function is used to give a numeric date a format. If you want to convert a string to a date and give it a specific format then you need to use both of them:  date(date#(MyStringDate, 'YYYY-MM-DD'),'MM/DD/YYYY'). Also, make sure to use MM for month and not mm, since mm is for minutes.

See this discussion for information about using MasterCalendars: Tutorial - Using Common Date Dimensions and Shared Calendars


talk is cheap, supply exceeds demand