Question on grouping in custom functions

Dean Flinter shared this question 21 months ago
Answered

Hi,

I'm looking to add a custom function.

The function is technically an aggregation and should be grouped by other non aggregate fields in the query.

The function takes the form of

FUNCTION(field1, field2)

The plan is to allow the user to pick the fields. As you can see, field1 and field2 are not aggregated themselves so I was unsure whether I should add this to the definition?

<aggregate>$1</aggregate>
<aggregate>$2</aggregate>

If I do, will this group by the other non aggregate fields in the query as I need?


Thanks

Dean

Replies (4)

photo
1

Hi Dean,

Yes, if you want to aggregate the fields, you should add the relevant tags for that functionality in the definition. They won't appear in the GROUP BY clause, so it should do grouping by the other fields in your query.

Let me know how it goes.

Kind regards,

Chris

photo
1

Hi Dean,

Hope you're having a good week.

Just wanted to check-in and see how it's all going. Was there anything you were needing from me to help get this resolved?


Regards,

Chris

photo
1

Hi Chris,

Apologies, this one slipped my mind

Don't need anything else on this. We haven't added it yet but I'm happy enough with your answer


Thanks

Dean

photo
1

Hi Dean,

No worries. I'll close this off for now. Enjoy your week!

Kind regards,

Chris

Leave a Comment
 
Attach a file