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: 
Anonymous
Not applicable

problem with timestamp to get max value

Hi,

I have timestamp column and trying to get max value from this function. But it is displaying null value

=MaxString(Date(Floor(Timestamp#(account_created_datetime)),'DD/MM/YYYY')).


Plese help me on this



Regards,

Kumar

1 Solution

Accepted Solutions
sunny_talwar

Good catch Stefan. This should also work:

Max(Date(Floor(Timestamp#(SubField(account_created_datetime, '.', 1),'DD/MM/YYYY hh:mm:ss')),'DD/MM/YYYY'))

View solution in original post

11 Replies
sunny_talwar

Firstly you havn't specified what format your timestamp for QlikView to understand:

Try something like this:

=Max(Date(Floor(Timestamp#(account_created_datetime, 'TimeStampFieldFormatHere')),'DD/MM/YYYY'))

swuehl
MVP
MVP

Your Timestamp#() function seems not properly parsed the account_created_datetime values.

Please post some sample data.

Anonymous
Not applicable
Author

Hi Sunny,

Thanks for your reply.

I have made changes, but no use.

Max(Date(Floor(Timestamp#(account_created_datetime,'DD/MM/YYYY hh:mm:ss')),'DD/MM/YYYY'))


actually dates are populated like below


sunny_talwar

you mean that you are still seeing the time component? Would you be able to share a sample of where the above provided expression isn't working?

swuehl
MVP
MVP

Try

Max(Date(Floor(Timestamp#(account_created_datetime,'DD/MM/YYYY hh:mm:ss.fff')),'DD/MM/YYYY'))

sunny_talwar

Good catch Stefan. This should also work:

Max(Date(Floor(Timestamp#(SubField(account_created_datetime, '.', 1),'DD/MM/YYYY hh:mm:ss')),'DD/MM/YYYY'))

jonathandienst
Partner - Champion III
Partner - Champion III

Please avoid the Max(Date(Floor ....) redundant formatting operation between the Floor (returns a number) and Max (returns a number). The Date in between serves no purpose as the format is immediately overridden by the Max.

I think you probably mean:

Date(Max(Floor(Timestamp#(account_created_datetime, 'DD/MM/YYYY hh:mm:ss.fff'))), 'DD/MM/YYYY')

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Thanks sunny and it is working.

I have a doubt why did you mentioned subfield of '.' ,1  Can you explain

Anonymous
Not applicable
Author

Thanks Jonathan,  I am trying to get max month from this date.