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

How to get Closest Date

Hi,

5 Replies
sunny_talwar

Hi Francisco -

Do you literally mean the closest date? It could be above or below the dates you have?

afurtado
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Francisco.

What you mean with "closest Date"  To Up or Down?

For this

Table1:

Number     Date1

1               16/08/2016

you have in table2

Table2:

Number     Date2             State

1              10/08/2016             A

1              14/08/2016             B

1              20/08/2016             D

1              28/08/2016             B

and the final was

Final Table:

Number     Date1           State

1               16/08/2016          B

To Number 1 and Date1 16/08/2016, the closest (before 16/08/2016) was 14/08/2016 and State B (like you TableFinal)

But, in other hand....

Table1:

Number     Date1

1               26/08/2016

Table2:

Number     Date2             State

1              10/08/2016             A

1              14/08/2016             B

1              20/08/2016             D

1              28/08/2016             B

Final Table:

Number     Date1           State

1               26/08/2016          B

Would be B  or D (20/08/2016 - D)?

I did like this

Numero DataInicio1 DataInicio2 Estado
116/08/201614/08/2016B
121/08/201620/08/2016D
126/08/201620/08/2016D
207/08/201605/08/2016C
216/08/201610/08/2016C
307/08/201606/08/2016A
312/08/201606/08/2016A


furtado@farolbi.com.br
Not applicable
Author

It was literally the closest date, Antonio Mancini got it right in the other topic. How to get Closest Date

Not applicable
Author

It was the closest date, independent if it was up or down, in the case you mentioned the state would be B.

sunny_talwar

Mark this discussion as Assumed Answered.

Qlik Community Tip: Marking Replies as Correct or Helpful

Thanks,

Sunny