Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
WE ARE LISTENING! New Navigation for Qlik Community, Sept. 26: TELL ME 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