How to using "min" function in order to select 1 out of 2 metrics?

For example:

min(sum(a),sum(b))

Hi @liari -

You can use the ifelse function

If sum(a) <= sum(b) then sum(a) is the min value out of the 2. Else, sum(b) is the min value.

ifelse(sum({a})<=sum({b}),sum({a}),sum({b}))
1 Like

Many thanks @robdhondt , I guess it will help in my calculations :slight_smile:

Is there a better way than nested ifelse() to achieve this, in case you need to compare 10 different metrics and return the minimum value between them??

Hi @darios -

I don’t believe so. The QuickSight min function only accepts 1 argument so you can’t nest them like min(min(arg1, arg2), arg3) etc.

You could create a new topic as a feature request. The best way to handle this would be if QuickSight had GREATEST and LEAST functions.