Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

date(date#()) function

Hi,

Can any one help me =date(date#(Date,'DD/MM/YYYY'))  how this works.My date formate is 28/2/2015.when i apply this function it gives 2/28/2015.

Thanks,

1 Solution

Accepted Solutions
sagarkharpude
Creator III
Creator III

Date#() is used how to interpret the data.  For example

date#('2013_24_10','YYYY_DD_MM') tells that the first four digits are year, the digits between two '_'s are Date, and the last two are Month.

Date() is used to tell how to show the data.  For example

date(today(),'YYYY_DD_MM') returns  2013_24_10

date(today(),'MM/DD/YY') returns  10/24/13

Combination of both:

date(date#('2013_24_10','YYYY_DD_MM'),'MM/DD/YYYY') returns 10/24/2013

Also refer the attached files

View solution in original post

7 Replies
amit_saini
Master III
Master III

Hi,

Check below:

The Date Function

Thanks,
AS

Not applicable
Author

hi,

If you will use date function without specifier it will always give answer(MM/DD/YYYY).

if you want in your desired format then Date(MDATE,'DD/MM/YYYY).

Regards

Vimlesh

sagarkharpude
Creator III
Creator III

Date#() is used how to interpret the data.  For example

date#('2013_24_10','YYYY_DD_MM') tells that the first four digits are year, the digits between two '_'s are Date, and the last two are Month.

Date() is used to tell how to show the data.  For example

date(today(),'YYYY_DD_MM') returns  2013_24_10

date(today(),'MM/DD/YY') returns  10/24/13

Combination of both:

date(date#('2013_24_10','YYYY_DD_MM'),'MM/DD/YYYY') returns 10/24/2013

Also refer the attached files

Not applicable
Author

Hi chandini,

  Date#() function is called Interpretation function.It will convert the string -to-number format. Date() function is called Formatting function.It will convert number-to-string format.

Normally Qlikview itself as an intelligence to interpret the date function but at times it will failed to interpret the date correctly. During those times we need to use date#() function manually help the qlikview to interpret the date.

                                           Date#('your-date-field','current date_format')

Once the Qlikview is recognized the correct format of date it will map the date to the corresponding number.From that you can use date() function to format the date to any form.

                                          Date(Date#('your-date-field','current date_format'),'required date_format')

Regards

Lathaa

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

date#(string, dateformat) converts a string to a date, optionally using the supplied date format

date() formats a date to the default date format for your system, or optionally the supplied date format.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
ksant
Contributor
Contributor

Tengo un formato fecha y hora tipo 02/25/2022 4:33:10 PM ,quisiera pasarlo a MM/DD/YYYY hh:mm hora militar, como haria en ese caso ?

ValeriaBonini
Partner - Creator
Partner - Creator

Use Date(Date#(date_field,'DD/MM/YYYY'),'MM/DD/YYYY') AS Date_Feild