Do widget expressions support if/then value substitution?
A user has a need to treat zero values on some jitter graphs as if they were NULL, and not roll up into some averages on a widget. I know that I can add a complex datapoint to the datasource, or clone the datasource and add a complex datapoint separately. Or I could declare the range of valid results to exclude zero in the datapoint on such a datasource. But I really dont want to maintain a datasource (new or changed).
Can widget expressions do thing like seeing a non-display variable to an expression that is if/then/else, instead of just math? Something logically equivalent to:
if (AvgSDJ <> 0) {return AvgSDJ;} else {return NULL;}.
NewAvgSDJ = NULLIF(AvgSDJ, 0)
Or perhaps there is some strictly mathematical way to do it? I really dont want to alter an official datasource or maintain a clone, but I need to get a solution.
Thanks!
If I understand you correctly, and you didn't mention the type of widget, but you can try making a Virtual Datapoint in a graph widget (and set the real datapoint to "do not display") that looks something like this (untested):
if(le(MyDatapoint,0),unkn(),MyDatapoint)
That should have the graph not show any values that are 0 or less. Virtual Datapoints use the same expressions as Complex DataSources.