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

GetFieldSelections

Hi, people

i have this func:GetFieldSelections(filed)  and i have an Multiple select and i want to get the higest select.

like: 2010,2011,2012 and get only 2012. (i do it on variables)

Someone know how to do it?

1 Solution

Accepted Solutions
swuehl
MVP
MVP

I don't really get your point.

The suggested

=max(KeyYear)

e.g. in a variable defintion will return the max possible KeyYear (2012 if nothing is selected, or the maximum KeyYear within the selected list of KeyYears).

Just drop the GetFieldSelections() function.

If you only want to get a result when the user has selected at least one KeyYear, define your variable like

=if(GetSelectedCount(KeyYear), max(KeyYear) )

View solution in original post

10 Replies
Not applicable
Author

Hello.

Try with Max(field)

Create a variable with:

=Max(field)

Not applicable
Author

thankes for answering but it's still not working

this is what i do

=GetFieldSelections($(vMaxYear))

but isn't give any value in the text box (for cheaking)

MayilVahanan

Hi,

     Create a variable like vMaxYear = max(Year)

     and use the variable in text box like =vMaxYear

     and select the years in list box.. You will get the maximum year ,,

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

i try to be more clear

the user select years:

YEARS.png

and i want to take the max year from is select.

if i use GetFieldSelections(years) i get this in text box: 2009,2010,2011.

Now  i want to get the max result in this case :2011

what can i do?

MayilVahanan

Hi,

Can you say the result of max(years) in your case. That help to fix the issue.

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

2012

MayilVahanan

Hi,

     Did you check after select the years, and if so, please give in the text  object itself ,and check once = max(years) without variable .. I hope it works...check the filed name once..

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

it is working in the textbox, but when i put it in the func: =GetFieldSelections($(vMaxYear))

i get null.

what can i do?

Not applicable
Author

I have a 3 table of big,good(up) and bad(Down) brunchs and a chart to show the progres in time line.

now, when someone select for e.g. 2009,2010,2011 he get in the chart the up & down every month/Q/year

and in table he should get the change from 2009 till 2011 the problem is when he clik more than one year

he get null if it only to year i have soulition =GetFieldSelections(KeyYear)-1 and it work

but i want more dinamic for the user.