Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Max date & min date

Hi Qlickers,

I have a doubt on max & min date

My data is like

IDDate
407325-07-2013
407303-04-2014
407301-08-2014
1714-04-2012
1713-04-2014
1701-08-2012

from this data I want to find the  min & max date based on the ID

Ex:

case 1:

when I select the ID as  4073 ,min date:25-07-2013 ,Max date:01-08-2014

please help me .........

1 Solution

Accepted Solutions
Not applicable
Author

hi

load

ID,

max(Date) as maxdate,

min(Date) as minDate

From tablename

group by ID;

View solution in original post

6 Replies
Not applicable
Author

hi

load

ID,

max(Date) as maxdate,

min(Date) as minDate

From tablename

group by ID;

PrashantSangle

Hi,

Try it in script

Like

Load max(date) as maxDate

min(date) as minDate,

ID

From tableName

Group By ID;

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

hi

Tab1:

LOAD * INLINE [

    ID, Date

    4073, 25-07-2013

    4073, 03-04-2014

    4073, 01-08-2014

    17, 14-04-2012

    17, 13-04-2014

    17, 01-08-2012

];

LOAD

ID,

max(date(date#(Date,'DD-MM-YYYY'),'DD-MM-YYYY')) as maxdate,

min(date(date#(Date,'DD-MM-YYYY'),'DD-MM-YYYY')) as mindate

Resident Tab1

Group By ID;

DROP Table Tab1;

Not applicable
Author

hi

you can also try according to this

LOAD

ID,

FirstSortedValue(date(date#(Date,'DD-MM-YYYY'),'DD-MM-YYYY'),-date(date#(Date,'DD-MM-YYYY'),'DD-MM-YYYY')) as maxdate,

FirstSortedValue(date(date#(Date,'DD-MM-YYYY'),'DD-MM-YYYY'),date(date#(Date,'DD-MM-YYYY'),'DD-MM-YYYY')) as mindate

Group by ID;

Tab1:

LOAD * INLINE [

    ID, Date

    4073, 25-07-2013

    4073, 03-04-2014

    4073, 01-08-2014

    17, 14-04-2012

    17, 13-04-2014

    17, 01-08-2012

];

anbu1984
Master III
Master III

Check this

Anonymous
Not applicable
Author

Hi All,

Thanks for your valuable replies.........