Dublicate value strore one time

In my project the datas will come from API. If that datas contain any duplicate values that values should automatically added. In this image, the volume has 3 , 26 but there should be only one 26 and the other columns should be the sum of all the 26 fields.
1 answers

Hi Muthu,


I think there are several ways to solve this, depending on your use case.


Lets say you have an entity CarFinance with attributes “InstallmentCycle” and “Outstanding”.


You can maken sure that “InstallmentCycle” is a unique value and that on every new value of Outstanding for a given InstallmentCycle, you do not create a new object for that InstallmentCycle but retrieve the existing one and add the new value of “Outstanding” to the current value in the object.


Another way is to allow multiple CarFinance records for the same InstallmentCycle, but to create a report using OQL that sums the values. But i have to warn you: creating reports using OQL is tricky business. https://docs.mendix.com/refguide/report-widgets/ 


Personally i would go for the first option, if in any way possbile in your use case.

I hope this helps.