# Bounding the high end of a number

I’m trying to bound the ss value to 99 (99 or lower value). This works but the MIN function isn’t working like I assume it would. What should I use?

```x1=CHANGE(INT_TYPE=Year) ;
x2=CHANGE(INT_TYPE=Month, INT_COUNT=3);
s=(x2*0.25)+(x1*0.75);
ss=MIN(99,s);
ss
```

Thanks. Andy

Hi Andy,

There appears to be something decidedly screwy with the MIN function.

I tried a simple script:

MIN(500,100)

and applied that to a Chart Element which displayed the result as 7,843.88?????

So I change the numbers to

MIN(120, 75)

Amazing, the result was still 7,843.88.

Maybe this is a new “feature” in Optuma v1.5 Beta.

I’ve also posted this in the Support Forum for the guys at Optuma to take a look at.

Cheers

Trevor

Hi

It appears the MIN function does not accept single values at the moment.

We will look into allowing single values passed in with a datalist in a future update.

Please try using this alternative for now.

ss = if(s > 99, 99, s);

Regards

Peter

Hi Andy,

Mathew Humphreys, in his response to my Support Ticket advised “The MIN() function can’t handle raw values being added that way, it needs a script function or variable to reference.” The following script works with whatever values I insert and display using a CHART ELEMENT:

```v1= 99;
v2 =-10;
v3 = MIN(v1,v2);
v3```

This means your script changed as follows should work:

```x1=CHANGE(INT_TYPE=Year) ;
x2=CHANGE(INT_TYPE=Month, INT_COUNT=3);
s1=(x2*0.25)+(x1*0.75);
s2=99;
ss=MIN(s2,s1);
ss```

BUT, on every chart I put it on using a CHART ELEMENT to display the result, the result was always zero (0).

It looks like Peter’s approach is the way to go for the moment while the guys sort out what is going on. I’ll refer Matthew to this post for his information and follow up.

Cheers

Trevor