Skip to main content

With this Expression I get the max-value of the 5 first List-values.

@max(@Value(FID{0}.FID),@Value(FID{1}.FID),@Value(FID{2}.FID),@Value(FID{3}.FID),@Value(FID{4}.FID))

 

But the features have different List-Numbers. Some of them 5, some of them more than 5. Is there a way to express not hard-coded? Where the Number of List-entries can be dynamic?

 

My solution to get the maximum value was the Listsorter. But I wonder, if there is a way with the ExpressionEvaluator. An expression which is not hard-coded seems to be very powerfull.

Thanks for help!

Did you only want statistics from list? use ListSummer.

or did you want to find the max 'elements' contained in list? use ListElementCounter

or did you want to find a value and return index of value? use ListSearcher and AttributeCreator -= _list{@Value(_list_index)}

 


Did you only want statistics from list? use ListSummer.

or did you want to find the max 'elements' contained in list? use ListElementCounter

or did you want to find a value and return index of value? use ListSearcher and AttributeCreator -= _list{@Value(_list_index)}

 

you can also combine listsorter and listelementcounter to grab feature's last known index feature.


FID_ModelNameIn this case I was looking for the maximum value in the list (not the maximum index, the maximum value). I know you can get that with the Listsorter. The same result you get with the ExressionEvaluator and the expression: 

@max(@Value(FID{0}.FID),@Value(FID{1}.FID),@Value(FID{2}.FID),@Value(FID{3}.FID),@Value(FID{4}.FID))

With this expression, you test only the values from five list-item(index 0 to 4).  

I wonder now, if there is a possibility to make an expression with a variable number of list-item.

 

In the picture you see the values from the attribut model_name, which I use for group by. With the FID I make a list. Out of this list I want to take the maximum FID.


why don't you explode list, and run it through StatisticsCalculator- enable group processing @Value(MODEL_NAME)?


The ListSorter transformer, with sorting order set to Descending, will put the highest value in item 0. Next you can extract the value of item 0 with the ListIndexer transformer.

If you don't want to sort your list, you can make a copy of it with the ListCopier transformer, and use the copy for sorting and extracting.

 

Edit: Ah, re-reading your question I now realise you already know how to use the ListSorter


Even more simple: the ListRangeExtractor transformer extracts the minimum and maximum values from a list.

But this is still a solution that does not use the ExpressionEvaluator from your initial question.

Unfortunately something like @max(@Value(_list{}.MyValues)) does not work.


ok, thank's for answering. anyway, it seems with list-elements it's not the idea to work with the expression evaluator.


Reply