Forum Discussion
Multiple IF Conditions in Custom Column
- 8 years ago
Hi,
Can you please try this custom column query:
(if ([Age of Incidents]>=0 and [Age of Incidents]<30) then "0-30" else if ([Age of Incidents]>=30 and [Age of Incidents]<60) then "30-60" else if ([Age of Incidents]>=60 and [Age of Incidents]<90) then "60-90" else if ([Age of Incidents]>=90 and [Age of Incidents]<180) then "90-180" else if ([Age of Incidents]>=180 and [Age of Incidents]<90) then "180+" else "")
Thanks,
Prasanth.C
+91 9043194307
Hi,
Can you please try this custom column query:
(if ([Age of Incidents]>=0 and [Age of Incidents]<30) then "0-30" else if ([Age of Incidents]>=30 and [Age of Incidents]<60) then "30-60" else if ([Age of Incidents]>=60 and [Age of Incidents]<90) then "60-90" else if ([Age of Incidents]>=90 and [Age of Incidents]<180) then "90-180" else if ([Age of Incidents]>=180 and [Age of Incidents]<90) then "180+" else "")
Thanks,
Prasanth.C
+91 9043194307
Hi All,
Thanks PrasanthKumar for this.
I've done something similar but now I need to build on it, replacing the values with parameters, so the client can edit the thresholds for each band. So based on the example below, my script looks like this:
CustomColumn =
(if ([Age of Incidents]>=#"Parameter1" and [Age of Incidents]<#"Parameter2") then "0-30" else if ([Age of Incidents]>=#"Parameter3" and [Age of Incidents]<#"Parameter4") then "30-60" else "")
... and so on. Error reads: The following syntax error occurred during parsing: Invalid token line 2, offset 26, #.
Any help would be gratefully received.
Thanks,
Kevin