Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Problem with Min() function in expression

Capture.PNG.png

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.

1 Solution

Accepted Solutions
MWiciok
Creator
Creator

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,

View solution in original post

11 Replies
Not applicable
Author

Sorry expression incorrect I used.

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

MWiciok
Creator
Creator

Hi Gerhardus,

how do you get the Unit IW Thickness?

Not applicable
Author

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

MWiciok
Creator
Creator

Why don't you use

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

to get the minimum?

Not applicable
Author

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

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

MWiciok
Creator
Creator

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

Not applicable
Author

Thanks Matthias.

MWiciok
Creator
Creator

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?

Not applicable
Author

If i filter for

Capture3.PNG.png

the textbox shows 0.05 and not 0.15