mirror of
https://github.com/eitchtee/WYGIWYH.git
synced 2026-01-15 05:33:26 +01:00
Can't import csv with two positive rows #19
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @eitchtee on GitHub (Jan 31, 2025).
Originally posted by @lucius100 in #41
@eitchtee commented on GitHub (Jan 31, 2025):
@lucius100 I've opened this issue to track this as it's looking like you won't be able to import this with the available options. Let me have a look and get back to you.
@eitchtee commented on GitHub (Jan 31, 2025):
@lucius100 please upgrade to v0.8.4
You might want to have two different accounts one for
Dompetand another one forTNG, so theOwn Transfersmake senseThen you can use the following template:
If you don't want to have different accounts, you can use your original account definition, just make sure
MYR Walletis a created account on the app.Explanation:
We use two different
typemappings, one for each table column, the first to have a valid value is used. If Credits is empty, Debits is used and always validates to an expense; if Credits has a value, it is used and always validates to an Income.Also, since your file doesn't have some sort of unique identifier we create one by hashing Date, Description, Category and Wallet together, this should be enough to not duplicate entries if you re-import a file with the same values.
And finally, we use some replaces to remove "MYR " and commas from your values.
Let me know how this goes. If you have any more questions feel free to ask them.
@lucius100 commented on GitHub (Jan 31, 2025):
I make some changes to the data, so I have few errors while importing, have error on replace MYR and comma, so I removed them.
now have error on amount, can't figured out
here is the latest yaml code.
@eitchtee commented on GitHub (Jan 31, 2025):
This error is probably because you had some empty rows, in the first screenshot you had
Initial balancewithout a Credit or Debits value. It's ok to error in this case.This is probably due to the same thing, a row with empty values for Credits and Debits.
I tried importing the data you shared just now, with your configuration and got no errors.
If you really want to import everything, you can add
default: "0"to your amount mapping:Any transaction without a value will be imported with the 0 as the amount, just for reference sake. This way you won't even need to remove the commas and "MYR "
@lucius100 commented on GitHub (Feb 1, 2025):
Edit: Finally found the issue, I just copy the header and found out instead of "Credits" "Debits" , it was " Credits " , " Debits "
After fixing the space, now it can import smoothly, haha
@eitchtee commented on GitHub (Feb 1, 2025):
Oh man haha. It's always the last thing you expect.
Good it worked. Let me know if you have any other issue.