Group Recipe - Custom aggregation (ranges)

Solved!
clbfkp
Level 1
Group Recipe - Custom aggregation (ranges)

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)

 

0 Kudos
1 Solution
Turribeach

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)

 

View solution in original post

0 Kudos
2 Replies
Turribeach

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)

 

0 Kudos
clbfkp
Level 1
Author

Thanks!

0 Kudos

Setup info

?
Tags (1)
A banner prompting to get Dataiku