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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
balanandam
Creator II
Creator II

Extract Min and Max Dates

HI All,

I have some data like below:

   

loginTimelogoutTimeSessionIDusernameLogindate
01-05-2018 05:07:1801-05-2018 05:37:41155testing12301-05-2018
01-05-2018 05:37:4101-05-2018 05:37:46156testing12301-05-2018
01-05-2018 05:37:4601-05-2018 05:39:35157testing12301-05-2018
01-05-2018 05:39:3501-05-2018 07:17:26158testing12301-05-2018
01-05-2018 07:17:2601-05-2018 07:21:52159testing12301-05-2018
01-05-2018 07:21:5201-05-2018 07:22:11160testing12301-05-2018
01-05-2018 07:22:1101-05-2018 07:23:00161testing12301-05-2018
01-05-2018 07:23:5001-05-2018 07:25:43162testing12301-05-2018

I wanted min & max dates for each day by user. Can you help me out here ?

Attaching App & sample data in Excel

Thanks In advance!

Br, Balanandam

1 Solution

Accepted Solutions
6 Replies
rubenmarin

Hi Balanandam, time is loaded as a string, you need to convert to time using timestam#(), ie.:

=Timestamp(min(Timestamp#(loginTime, 'DD-MM-YYYY hh:mm:ss')))

balanandam
Creator II
Creator II
Author

Thanks Ruben for the response!

I need data like, one row for every unique combination of Date,username. I believe I need to apply aggr() in expression.

Minmum date group by Date & username combination

Data I need as below:

   

testing12319-04-201819-04-2018 11:53:01
testing12320-04-201820-04-2018 00:47:29

Br, Balanandam

rubenmarin

Not really, if you alredy have username and date as dimension there is no need to use aggr, the default behaviour is to calculate the measure for each combination of the dimensions.

balanandam
Creator II
Creator II
Author

Hi Ruben,

some how it is not working...

if you see app attached by you the Date & username combination is repeating...

Br, Balanandam

rubenmarin

That would be because these are different dates, althought you only see the date internally it's storing the time.

You can load using floor to ignore the time and have only one date, or use a calculated dimension that removes the time.

balanandam
Creator II
Creator II
Author

Awesome!!