Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

set analysis and firstsorted value

Hi,

I need your help!

OUTLET Initial validity date VALUE

A 01/04/2011 x

A 07/04/2011 y

B 01/01/2011 z

How select the more recent value under condition that Initial validity date <= $(DATE) for example 06/04/2011?

I tried unsuccessfully:

=

FirstSortedValue({$<[Initial validity date] <= {$(DATE)}>} VALUE, -[Initial validity date])

Thank's!



1 Solution

Accepted Solutions
Not applicable
Author

Perfect!

thank you so mutch!!

View solution in original post

2 Replies
Miguel_Angel_Baeyens

Hello,

Set Analysis is calculated once for the entire chart, so probably DATE is returning a value that will match some of the records but not all of them.

You can use an If() statement to get the result for each value of the dimension:

FirstSortedValue(VALUE, -If([Initial validity date] < DATE, [Initial validity date]]))


Hope that helps.

Not applicable
Author

Perfect!

thank you so mutch!!