Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
omid5ive
Creator II
Creator II

max value

hi

i have a list box with some numeric value

i want to have a text object that show the maximum value of the list box

i know this is the very simple but my question is this:

Values
1
4
5
7
9

for example if user select number 7 from this list i want to see 5 in the text object
it means that i want to see the maximum of values from the new list with smaller than user selected value (in this example it meant the max from 1,4,5 and its 5)

if user select 5 i want to see 7

what should i do?

1 Solution

Accepted Solutions
omid5ive
Creator II
Creator II
Author

Hi Enrique

thanks for your answer

I changed your expression like below and i got my answer correctly:

=max({1-$} if(value<GetFieldSelections(value),value))

View solution in original post

7 Replies
ecolomer
Master II
Master II

Is necesary to have list of number in the same list?

Not applicable

I am not sure I understand your explantation - if the user picks 7 are you saying the highest is 5 because that is the highest number up to what they selected?

if that is true than I do not understant why if they pick 5, the user should be 7

petter
Partner - Champion III
Partner - Champion III

This expression works in a text box:

=Aggr( If(N = Only( {1} N), Above(Only( {1} N)) ) , N )

ecolomer
Master II
Master II

See file attached

petter
Partner - Champion III
Partner - Champion III

2015-09-25 #2.png

I also turned on the option (checkbox) of "Only One Selected Value" for the properties of the list box... not entirely necessary.

omid5ive
Creator II
Creator II
Author

Hi Enrique

thanks for your answer

I changed your expression like below and i got my answer correctly:

=max({1-$} if(value<GetFieldSelections(value),value))

omid5ive
Creator II
Creator II
Author

Hi Petter

your answer will be correct if in my data source like excel file i have my values in sort mode

but if have something like below:

Value

1
2
5
9
8

i cant get correct answer

i changed the expression that Enrique said and i got correct answer

the correct expression:

=max({1-$} if(value<GetFieldSelections(value),value))