Group Recipe - Custom aggregation (ranges)

clbfkp Registered Posts: 2

Is it possible to calculate ranges in the grouping recipe? Currently, I am using the provided max and min aggregation and taking the difference in a subsequent prepare step, but it would be easier to calculate it directly as part of the group recipe especially as the number of columns grow.

I'm getting an error when I try to create my own custom aggregation but my SQL is both limited and pretty rusty. Any help or links would be much appreciated.

MAX('colname') - MIN('colname') (Error: column "custom_aggr_1" is of type double precision but expression is of type text)

Best Answer

  • Turribeach
    Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 1,717 Neuron
    edited 4:21PM Answer ✓

    You should use the column names without any quotes otherwise you are asking the max() function to return the max of a text type which is why you get the error you get.

    MAX(colname) - MIN(colname)


Setup Info
      Help me…