Just had a question around my expression structure for a custom metric I am working on. I would like to compare the average CPU vs the average memory of a server. If either the memory or CPU average is 90% or greater, then I want it to return the integer '10000'. Otherwise, I would like it to simply multiply the two metrics and return the result as an integer. I can get it to multiply the two together with no problems, but when I try to put in the conditional, i get a generic 'Fatal error' returned.
Here is my expression:
...expression=CASE WHEN [avgProc] > 45 THEN 10000 WHEN [avgMem] > 89 THEN 10000 ELSE [avgProc] * [avgMem]
Any assistance with this query would be appreciated. I realize this could be a WHEN-OR-THEN-ELSE expression, but I have not been able to get that to work either.
Solved! Go to Solution.
Thanks for the suggestion, and apologies for taking so long to get a chance to test this. Have tried putting 'end' at the end of the line, but that has not seemed to fix the issue.
At the moment the error message looks like:
"SQL error: Incorrect syntax near the keyword 'THEN'"
I will attach my .properties file in case anyone else wants to give it a go on their system and have a play.
Luke is right. There shouldn't be any 'THEN' after 'ELSE'.
Please use the following formula
CVENT.Citrix.calculatedColumn.0.expression=CASE WHEN [avgProc] > 89 THEN 10000 WHEN [avgMem] > 89 THEN 10000 ELSE [avgProc] * [avgMem] end