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

Problem with MIN between user field selection

Hello, i have the following data:

table:

LOAD * INLINE

[

id, name, year

1, a, 2015

2, a, 2016

3, a, 2017

4, a, 2018

5, b, 2016

6, b, 2017

7, b, 2018

8, c, 2017

9, c, 2018

]


When the User filters by year:

filter.png

a890944236c44625b295163c6192f256.png

what i need is the minimal value in the User selection interval:

a 2015

b 2016

c 2017

I can't use {1}  because it ignores the user selection. I tried $<year={$(=(MIN(year))}> but i got nulls for b and c


Thank you.

1 Solution

Accepted Solutions
thiago_miranda
Contributor II
Contributor II
Author

After some testing i found it:

Min({<year={">=$(=MIN(year))"}>*<year={"<=$(=MAX(year))"}>}year)

It should be the intersection operator or else global minimums are shown.

Thank you for your attention.

View solution in original post

4 Replies
Thiago_Justen_

Thiago,

You could try somenthing like this:

Min(Aggr(Year),name))

Or

FirstSortedvalue(Year,Aggr(Year,name))

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago
thiago_miranda
Contributor II
Contributor II
Author

I tried your suggestions and

FirstSortedvalue(year,Aggr(MIN(year),name))

but got the same result.

thiago_miranda
Contributor II
Contributor II
Author

After some testing i found it:

Min({<year={">=$(=MIN(year))"}>*<year={"<=$(=MAX(year))"}>}year)

It should be the intersection operator or else global minimums are shown.

Thank you for your attention.

Thiago_Justen_

Great man!

Thiago Justen Teixeira Gonçalves
Farol BI
WhatsApp: 24 98152-1675
Skype: justen.thiago