Trigonometry functions in aggregate on local Entity.

Trigonometry functions in aggregate on local Entity.

  

Hi,

We have an entity with coordinates and to calculate distance between points we use trigonometric functions. All works fine using Advanced SQL for server entities, but if we sync entity with coordinates to local entity - there is no Advanced SQL in client actions and aggregate doesn't understand trigonometric functions. So is it possible to have client side trigonometry functions to use in aggregate or only way is to loop through aggregate results?


Thank you.

Hi Mykola

Can you consider the option of using Advance queries in server action and then call that action in client action?

Thanks and Regards,

Suraj Borade

Hi Suraj,

Idea is to have all this calculations client side without any server calls after initial data sync.

Hi Mykola,

I need to think about this or let's see someone from community can answer this.

Hi Mykola Tkachenko,

Might be below component helps you to perform the calculation in aggregate. 

https://www.outsystems.com/forge/component/516/trigfunctions/ 

Regards,

Manish Jawla

Hi Manish,

These are server side functions and it is not possible to use them inside aggregate filter expressions.

Hello Mykola,

If you want to perform the calculations client side, I don't see many options here. 

Probably, the time you will spend doing the calculations server side (or in the query) is the same as iterating the list and performing the calculations client side, for example, in the On After Fetch action. Or at least will not be a concern. 

Cheers,
Eduardo Jauch

Mykola Tkachenko wrote:

Hi Manish,

These are server side functions and it is not possible to use them inside aggregate filter expressions.

Hi Mykola Tkachenko,

Please find the attachment for your reference we can use them inside the aggregate as well and we also add 1 more attribute inside our aggregate and perform all the calculation inside it for calculating the distance as well.

Regards,

Manish Jawla

Hi Manish,

It seems not to be the solution for local entities aggregate:

Hi Mykola Tkachenko,

I will try to find some other solution :)

Regards,

Manish Jawla

As mentioned by Eduardo Jauch it is not a big problem to iterate through the list and move logic from aggregate to actions in loop. it is just that as there is no Advanced query for local entities we need to create own trigonometrical functions implementations instead of using built-in. 


Hi Mykola,

Have you been able to find a solution to this question?