Canvas - Expression Editor - 3 cases/ifs

Hi all, trying to use a case for the progress bar to set the 3 different colors based on what the value is.
I have tried using this:
valueColor={switch case={case if={gt 0.01} then="#1785b0"} case={case if={gt 1.25} then="#fd7643"} case={case if={gt 1.75} then="#e62e00"} default="#ffffff"}

It doesnt work even changing the values around it doesnt work.

@u3432 Can you share the rest of your expression? I'm assuming this is for coloring a progress element?

What is the range of values you're passing into your progress? Typically, the progress element expects the context (or output from the previous function) to be a value between 0 and 1 which would not meet your last 2 cases.

Below is the full expresion after the query. The range of values is 0.001 and 2.000. The value is currently 1.581 which should be setting my second colour but for some reason isnt. Thank you for your help.

| math "round(mean('CAST_cm.request.time AS FLOAT_'),3)"
| progress shape="semicircle" 
  font={font family="'Open Sans', Helvetica, Arial, sans-serif" size=16 align="center" color="#FFFFFF" weight="normal" underline=false italic=false} max=2 label=true barColor="#FFFFFF" 
  valueColor={switch case={case if={gt 0.01} then="#1785b0"} case={case if={gt 1.25} then="#fd7643"} case={case if={gt 1.75} then="#e62e00"} default="#ffffff"}
| render

ok so this wont work then because im using numbers other than 0 or 1?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.