AnsweredAssumed Answered

Calculate value from collected values not working

Question asked by sfraccascia on Jan 15, 2019
Latest reply on Feb 7, 2019 by xander_bakker

I am building up a nested model that iterates through N feature classes (point shapefiles) in order to calculate statistics for field X and get the minimum value for each feature class. So far so good.

The iteration includes the model tool Get Field Value to extract the minimum value from the summary statistics and the Collect Values Tool to collect the values (Zmin, see figure below). It works properly.

nested model

Next step would be to extract the minimum out of the N collected values (Zmin) and use it as a parameter in the main model:

main model

The output of the nested model (Zmin) is returned as multiple values:

Zmin, model outputput

I have tried to use the Calculate Value Tool applying the following function:

Expression:

    lowest("%Zmin%")

Code Block:

    def lowest(Zmin):
        Zmin.replace(";",",")
        Zmin.split(',')
        LowestLine = min(Zmin)
        return LowestLine

Data Type: Double

It only returns '-', thus something is obviously wrong in the code but I cannot figure out what, due to my limited Python skills. Any help would be very much appreciated! Thanks in advance.

Outcomes