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

How to get max time stamp from first 3 dates

I want to get the max time stamp of first 3 days .I am using  aggr(max(Datetime),Date) but I want to restrict to first 3 days

   

Data  Expected output
7/13/2016 9:45:26 PM7/13/2016 9:45:26 PM
7/13/2016 8:45:26 PM7/12/2016 9:48:38 PM
7/12/2016 9:48:38 PM7/11/2016 9:45:26 PM
7/12/2016 9:45:26 PM
7/11/2016 9:45:26 PM
7/11/2016 8:45:26 PM
7/8/2016 9:45:26 PM
7/8/2016 8:45:26 PM
7/7/2016 9:45:26 PM
7/7/2016 8:45:26 PM
7/7/2016 11:45:26 AM
7/7/2016 10:45:26 AM
7/6/2016 9:45:26 PM
7/6/2016 8:45:26 PM
1 Solution

Accepted Solutions
effinty2112
Master
Master

Hi Krishna,

Is this any good?

Date Max TS
13/07/20169:45:26 pm
12/07/20169:48:38 pm
11/07/20169:45:26 pm

It's a straight table with a hidden first expression which I'll unhide:

=Date(Floor(Timestamp#(TS))) =Rank(Max(Date(Floor(Timestamp#(TS))))) Max(Time(Timestamp#(TS)))
13/07/201619:45:26 pm
12/07/201629:48:38 pm
11/07/201639:45:26 pm

In the dimensions limit tab set it to show the smallest three values for the most recent dates. If you set it to show the largest three you will get data on the three oldest dates. You can hide this column by selecting the option in the Presentation tab.

Cheers

Andrew

View solution in original post

5 Replies
Not applicable
Author

This expression gives the desire result

=if(Max(TOTAL DATE ,3) <=DATE,

aggr(

    max

     (

      Datetime

      )

     ,DATE)

)

sunny_talwar

Is this for a calculated dimension? May be this:

Aggr(If(Max(TOTAL <Date> Datetime, 3) >= Datetime, Datetime), Date, Datetime)

Not applicable
Author

That didn't work.it displays more than 3 and not the max of each day

Anonymous
Not applicable
Author

Yes, it's fine.

What is your question? Do you want to do this in script?

effinty2112
Master
Master

Hi Krishna,

Is this any good?

Date Max TS
13/07/20169:45:26 pm
12/07/20169:48:38 pm
11/07/20169:45:26 pm

It's a straight table with a hidden first expression which I'll unhide:

=Date(Floor(Timestamp#(TS))) =Rank(Max(Date(Floor(Timestamp#(TS))))) Max(Time(Timestamp#(TS)))
13/07/201619:45:26 pm
12/07/201629:48:38 pm
11/07/201639:45:26 pm

In the dimensions limit tab set it to show the smallest three values for the most recent dates. If you set it to show the largest three you will get data on the three oldest dates. You can hide this column by selecting the option in the Presentation tab.

Cheers

Andrew