I am trying to determine classes of a certain metric based on the metric number.

I came up with the following formula to put in the “Custom Measure” UI in Pivot UI.

$main.sum($my_metric).greaterThanOrEqual(5300).then(‘heavy’)

But, the above expression does not seem to be working, Druid is simply showing a dash ( - ) on the Pivot UI for the custom measure.

Appreciate any help or pointers.

Thanks,

~Pratik

Actually i think i need a dimension and not a metric, so i could get going by defining the following in as a custom dimension.

$my_metric.greaterThanOrEqual(5300).then(‘heavy’)

But, i could not get more than one value going. I would like three output values ‘light’, ‘medium’ and ‘heavy’ based on the metric value. Any ideas?

Thanks,

~Pratik

Even ($my_metric < 1000).then(‘light’) works…

but following does not:

($my_metric < 1000).then(‘light’).or($my_metric > 10000).then(‘heavy’)

The UI shows an error in syntax.