Filamentphp Export Data Integrity
I tried exporting my model with 37k~ records.. unfortunately their values are not the same compared to the database but if I will export them partially(export by type in the model) and try to combine the data the values are correct.. If you are going to ask me what is inside the exporter, well it is a basic exporter.. no fancy query.. so what is the reason for this?
20 Replies
Please check your version of Filamentphp
i am currently using
v3.2.40
Please upgrade
thanks for the advice.. ill take that
it didn't work..
here is my exporter
as you can see.. same count but the sum is different.. i already updated my filament to
v3.2.124
here is my table
hope you will investigate this matter.. thank you
How is amount stored?
if you count the records is there a difference?
Check the export queries too. you may be excluding trashed on export but not on the resource
And you checked that this isn't due to precision?
The count is the same.
For examount, if you are using decimal/string and not integers you'll end up with precision point issues PHP is known for. As per filamentphp docs store as cents in integers.
not sure because i checked manually the csv like.. example..
I exported two files(one partially exported based on type. ex: Subscription Bonus) and the other one is the whole record... inside the file with the whole record, i removed those data that isn't Subscription Bonus Type and compare to the exported.. counts are same but total amount isn't
csv's count differently to the export. how are you storing the amounts... so the export/import is correct your storing of data isn't.
i am using float for the amount
Edigleysson Silva
The Miners
Be cool. Don’t use float/double for storing monetary values A tour ...
In this article, we're going to dissect the classical floating point expression confusion
0.1 + 0.2 == 0.3
, walking through important concepts and details.yea but just like what ive said.. if i export them partially, it works...
Diff compare the import to the export and find the culprit
Can you find which records have different amount compared to DB?
Do you have records with a precision higher than 3. Like 12.314
i tried but the more i look it up the more it messes up.. maybe i will send a vid
i only store 2 decimals
the more it messes up.What is messed upß
i tried filtering it by type but it seems that the count isn't the same.. ill make a video of these issues in export