We have updated Flexmonster Software License Agreement, effective as of September 30, 2024. Learn more about what’s changed.

Behaviour of null values

Answered
Pedro Fernandes asked on September 11, 2023

Hello,
We need the null vales to behave as an absorbing element in flexmonster, since null represents an unknown value in statistical terms.
The operations null + a , null * a and null / a must all result in null, but in flexmonster the null is handled as a zero by default. Is there anyway to make the null become absorbent?
Thank you for your support.
Regards,
Pedro Fernandes
 

4 answers

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster September 13, 2023

Hello Pedro,

Thank you for reaching out to us.

Kindly note that Flexmonster does not provide the feature of representing null as an absorbing element out of the box. However, you can customize the logic of aggregating the data by implementing the custom data source API. You can add any additional data processing in your server-side implementation using the custom data source API. For example, customize the logic of calculating totals and make the null become absorbent. The following guide will walk you through implementing your own server: Implementing the custom data source API server.

Please let us know if it works for you. Looking forward to your response.

Kind regards,
Nadia

Public
Pedro Fernandes October 13, 2023

Hello Nadia,
We have implemented the custom data source API through the flexmonster .NET server, as per your recommendation.
We are struggling to find a way to make null values absorbent within aggregations. At the moment we are focused on the method public IActionResult PostSelect([FromBody] SelectRequest request).
With this method, we can access the request and the response but we cannot see which data is being used to calculate the aggregation.
Is there another method we should be using to make the null values absorbent?
We couldn't find the documentation for the custom api, so we only know the 4 methods are are demonstrated within the example for .NET.
Can you tell us where the documentation with all the methods for the custom API is located?
Thank you in advance for any help you can provide us.
Best regards,
Pedro Fernandes

Public
Pedro Fernandes October 16, 2023

Hello Nadia,
Can you help up resolve the absorbent null value issue? 
Thank you,
Pedro Fernandes
Ambisig S.A.

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster October 16, 2023

Hello Pedro,

Thank you for the question.

Firstly, we would like to explain that absorbing null values is a feature that is not supported out of the box but can be achieved by implementing the custom data source API. The custom data source API is a protocol that facilitates communication between the client and server sides, and the behavior of handling null values within aggregations should be defined in your server-side implementation. While we won't be able to implement the server for you, we can offer guidance to assist you with implementing the absorbent null feature.

The mentioned public IActionResult PostSelect([FromBody] SelectRequest request) method is one of the entry points into your application and represents a part of your server-side implementation. The logic for making null values absorbent should be defined deeper in your server-side code. Therefore, you need to create a server-side solution that meets your specific requirements for null values. 

Besides, our team supposes you may use the Data Server as a DLL. If so, please note that the Data Server as a DLL does not provide the ability to customize the aggregation calculations. For your use case, the best option would be to use the custom data source API, please find the steps on how to implement the server here: https://www.flexmonster.com/doc/implement-custom-data-source-api/. You can check the .NET sample provided on our GitHub for inspiration. However, please note that the sample server is not production-ready and is only intended to demonstrate the implementation of the custom data source API protocol.

Please let us know if any questions arise.

Regards,
Nadia

Please login or Register to Submit Answer