Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Date format

I have a field called FECHA_SOLICITUD

contains several dates (if a show
list box does show the date format
with their respective hours )

I draw a list box on the deadline
putting in a list box as follows:

max ( FECHA_SOLICITUD )

It perfect but detail is that I
he is giving in " text " format and i need it
"Date " (date and time )

How could I do to make me become
date format?

Thanks in advance : )

6 Replies
swuehl
MVP
MVP

Not sure if I fully understand your request, but to format the number returned by max(FECHA_SOLICITUD), you can use Date() or Timestamp() function:

=Date( max( FECHA_SOLICITUD) )

or

=Timestamp( max( FECHA_SOLICITUD) )

You can also specify a format code, like

=Date(max(FECHA_SOLICITUD), 'YYYY-MM-DD')

=Timestamp(max(FECHA_SOLICITUD), 'YYYY-MM-DD hh:mm:ss')

Not applicable
Author

Exactly , I just used because these formats
as Date or Date #, Timestamp or Timestamp #

Still not working 

Thanks anyway.

swuehl
MVP
MVP

Sorry, I don't understand.

Does

max(FECHA_SOLICITUD)

return a number? If yes, then you should be able to format the number using Date() or Timestamp().

If not, then we need to look into your values of field FECHA_SOLICITUD.

Could you please post samples of these field values?

svenkita
Creator II
Creator II

Following is the sample code

Tmp:
Load *, Date(Date#(SHIFT_DAY,'YYYYMMDD'),'DD/MM/YYYY') as NewShiftDate,
Timestamp(Timestamp#(CLOCK_IN_OUT,'MM/DD/YYYY hh:mm'),'DD/MM/YYYY hh:mm') as NewClockInOut,
Num(Timestamp(Timestamp#(CLOCK_IN_OUT,'MM/DD/YYYY hh:mm'),'DD/MM/YYYY hh:mm')) as NewClockInOutNum;
 
LOAD * INLINE [
BRANCH_ID, EMPLOYEE_ID, CLOCK_IN_OUT, SHIFT_DAY
24, 413481137, 6/17/2015 15:01, 20150617
24, 413481137, 6/18/2015 3:36, 20150617
24, 516151270, 6/17/2015 11:36, 20150617
24, 516151270, 6/17/2015 19:26, 20150617
]
;

Also attached is the sample file

Hope this helps

Anonymous
Not applicable
Author

Venkita,

In your example, there is something to simplify.  There is no need for the timestamp() here

Num(Timestamp(Timestamp#(CLOCK_IN_OUT,'MM/DD/YYYY hh:mm'),'DD/MM/YYYY hh:mm')) as NewClockInOutNum

It is enough to use it this way:

Num(Timestamp#(CLOCK_IN_OUT,'MM/DD/YYYY hh:mm')) as NewClockInOutNum

svenkita
Creator II
Creator II

Just wanted to show the options of converting the date to the format of Choice.

& the option of converting to num format as well which is easier to handle