11 Replies Latest reply: May 26, 2014 9:37 AM by Gerhardus de Villiers

# Problem with Min() function in expression

From the above table I sum data on the UG1 layer with total thickness, total Unit thickness and Min thickness where UNIT ends with IW.

results should be:

Thickness          Unit IW Thickness          Minimum IW thickness

1.27                             0.5                                0.15

Minimum IW thickness not correct as I get is 0.123

my expression is

=(total  aggr(avg({<LITH.UNIT={"*IW"}>} LITH.THICKNESS),LITH.PACKAGE))

Thanks.

• ###### Re: Problem with Min() function in expression

Sorry expression incorrect I used.

=min(total  aggr(avg({<LITH.UNIT={"*IW"}>} LITH.THICKNESS),LITH.PACKAGE))

• ###### Re: Problem with Min() function in expression

Hi Gerhardus,

how do you get the Unit IW Thickness?

• ###### Re: Problem with Min() function in expression

=sum({<LITH.UNIT={"*IW"}>} LITH.THICKNESS)

• ###### Re: Problem with Min() function in expression

Why don't you use

=min({\$ <UNIT={'*IW'}>} THICKNESS)

to get the minimum?

• ###### Re: Problem with Min() function in expression

Using it chnaged the result from  0.123 to 0.05 and the lowest thickness is 0.15

=min({\$ <LITH.UNIT={'*IW'}>} LITH.THICKNESS)

• ###### Re: Re: Problem with Min() function in expression

May be you could attach a QV file? I tried to rebuild your table and I got 0.15 as the Minimum...

• ###### Re: Re: Re: Problem with Min() function in expression

Thanks Matthias.

• ###### Re: Re: Re: Re: Problem with Min() function in expression

I just added listboxes so you can see the results:

The Expression =min({\$<UNIT={'*IW'}>} THICKNESS) calculates the minimum thickness of possible "THICKNESS"-values, where the unit ends on IW. Is this what you want? Or do you want to let the user define which minimum to calculate by selecting the different parameters in the other fields?

• ###### Re: Re: Re: Problem with Min() function in expression

If i filter for

the textbox shows 0.05 and not 0.15

• ###### Re: Re: Re: Re: Problem with Min() function in expression

Now I got your problem: Thickness is a calculated Expression. See attached file and the second TextBox for your answer.

UPDATE: I forgot to use Set Expression to hard filter on *IW. So you have to add this if you want,