Min() and Max() are aggregation functions that operate on one or more rows in a table, usually classified into sets by way of a GROUP BY.
However, when loading & processing single rows at a time, Min() and Max() are invalid.
You may want to first find Min and Max values for all categories in a separate step, and then either JOIN the min/max results to your individual rows, or use ApplyMap to pick them out when LOADing individual rows.
Also not that Min() or Max() on their own as a logical expression will only evaluate to fales if an exact 0 is returned. Don't you want to compare the result of the Min() and Max() Calls to something else?