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

Next and Previous date based on current date

Hi,

Date

12/27/19

1/15/20

2/13/20

I need to find the next date and the previous date based on today's date in this table.

Ex: Today 1/13/20 then Next date- 1/15/20 Previous date-12/27/19

How can I do that in Qlik Sense?

 

 

 

Labels (3)
1 Solution

Accepted Solutions
Stoyan_Terziev
Partner - Creator III
Partner - Creator III

Hi,

 

You can use a set expression like so for previous date:

Max({<Date = {"<=$(=Date(Today()))"}>} Date)

 And like so for the next:

Min({<Date = {">$(=Date(Today()))"}>} Date)

Remember to be mindful of date formats!

I hope that helps!

Regards,
Stoyan

View solution in original post

1 Reply
Stoyan_Terziev
Partner - Creator III
Partner - Creator III

Hi,

 

You can use a set expression like so for previous date:

Max({<Date = {"<=$(=Date(Today()))"}>} Date)

 And like so for the next:

Min({<Date = {">$(=Date(Today()))"}>} Date)

Remember to be mindful of date formats!

I hope that helps!

Regards,
Stoyan