Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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
matthias_wiciok
Contributor

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,

11 Replies
Not applicable

Re: Problem with Min() function in expression

Sorry expression incorrect I used.

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

matthias_wiciok
Contributor

Re: Problem with Min() function in expression

Hi Gerhardus,

how do you get the Unit IW Thickness?

Not applicable

Re: Problem with Min() function in expression

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

matthias_wiciok
Contributor

Re: Problem with Min() function in expression

Why don't you use

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

to get the minimum?

Not applicable

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)

matthias_wiciok
Contributor

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...

Not applicable

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

Thanks Matthias.

matthias_wiciok
Contributor

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?

Not applicable

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

If i filter for

Capture3.PNG.png

the textbox shows 0.05 and not 0.15