Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Picking up the next Date

Hi All,

I have a requirement to take the first date from the date field.,

ie.,

Date

20101101

20101105

20101107

20101109

20101111

20101121

20101131 .,

Min(Date) gives us the date "20101101".

How can i take the next date ie., "20101105"

If i go with Min(Date)+1 it gives me 20101102 ie., next date in the calendar., but i want to pick the next from the date field.

Please advise.

Thanks,

Swathi

6 Replies
tresesco
MVP
MVP

Min(Date, 2)         // 2 indicates rank of min, i.e. - second minimum here.

Not applicable
Author

Thank you..

But the real problem is it is in the integer format. it's working fine once after changing into Date.

Anonymous
Not applicable
Author

Yes you have to change it to date format.

As Min, Max , avg etc functions return numeric values.

anbu1984
Master III
Master III

Min(Date#(Date,'YYYYMMDD'), 2)

jagan
Luminary Alumni
Luminary Alumni

Hi Swathi,

Change the date field into date format like this

LOAD

'

'

'

'

Date(Date#(DateFieldName, 'YYYYMMDD')) AS FormattedDate

FROM DataSource;

Now use this expression

=Min(FormattedDate, 2)

Regards,

Jagan.

Anonymous
Not applicable
Author

Hi Swathiji,

Select min(date) from table where date not in (select min(date) from table);

Regards.

Anjan