I am in the middle of setup for my data import, just a bit confused about the part for own transfer , it would be something like transfer from acc A to acc B, and I have separate credit with debit table, both positive balance, so merge format not seems work
Originally created by @eitchtee on GitHub (Jan 31, 2025).
> Yes, I like it pretty much, just still figuring out the data for importing
>
> ```
> type:
> source: amount
> target: type
> detection_method: sign
>
> type:
> source: "Valor"
> target: "type"
> detection_method: sign
> ```
>
> what are these for ?
>
> <img width="503" alt="Image" src="https://github.com/user-attachments/assets/faaeb476-20fc-49b8-af76-fc8eabf42a32" />
>
> I am in the middle of setup for my data import, just a bit confused about the part for own transfer , it would be something like transfer from acc A to acc B, and I have separate credit with debit table, both positive balance, so merge format not seems work
>
> ```
> settings:
> file_type: csv
> delimiter: ","
> encoding: utf-8
> skip_lines: 0
> importing: transactions
> trigger_transaction_rules: true
> skip_errors: true
>
> mapping:
> account:
> target: account
> default: "MYR Wallet"
> type: name
>
> date:
> target: date
> source: Date
> format: "%d/%m/%Y"
>
> amount:
> target: amount
> source: Valor
>
> description:
> target: description
> source: Description
>
> type:
> source: "Valor"
> target: "type"
> detection_method: sign
>
> notes:
> target: notes
> source: Notes
>
> is_paid:
> target: is_paid
> detection_method: always_paid
>
> deduplicate:
> - type: compare
> fields:
> - internal_id
> match_type: strict
> ```
_Originally posted by @lucius100 in [#41](https://github.com/eitchtee/WYGIWYH/issues/41#issuecomment-2628057599)_
adam
added the bug label 2025-12-28 23:24:09 +01:00
@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 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.
We use two different type mappings, 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.
@eitchtee commented on GitHub (Jan 31, 2025):
@lucius100 please upgrade to v0.8.4
You might want to have two different accounts one for `Dompet` and another one for `TNG`, so the `Own Transfers` make sense
Then you can use the following template:
```yaml
settings:
file_type: csv
delimiter: ","
encoding: utf-8
skip_lines: 0
importing: transactions
trigger_transaction_rules: true
skip_errors: true
mapping:
account:
target: account
source: "Wallet"
type: name
date:
target: date
source: Date
format: "%d/%m/%Y"
amount:
target: amount
source: ["Credits", "Debits"]
transformations:
- type: "replace"
pattern: "MYR "
replacement: ""
- type: "replace"
pattern: ","
replacement: ""
description:
target: description
source: Description
category:
target: category
source: Category
type:
source: Credits
target: "type"
required: false
detection_method: always_income
type2:
source: Debits
target: "type"
required: false
detection_method: always_expense
is_paid:
target: is_paid
detection_method: always_paid
internal_id:
target: internal_id
transformations:
- type: hash
fields: ["Date", "Description", "Category", "Wallet"]
deduplication:
- type: compare
fields:
- internal_id
match_type: strict
```
If you don't want to have different accounts, you can use your original account definition, just make sure `MYR Wallet` is a created account on the app.
```yaml
account:
target: account
default: "MYR Wallet"
type: name
```
---
Explanation:
We use two different `type` mappings, 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.
[2025-01-31 20:27:02] WARNING: Error processing row 1: 'NoneType' object has no attribute 'replace'
This error is probably because you had some empty rows, in the first screenshot you had Initial balance without a Credit or Debits value. It's ok to error in this case.
[2025-01-31 20:28:18] WARNING: Error processing row 1: Required field amount is missing
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 "
@eitchtee commented on GitHub (Jan 31, 2025):
> [2025-01-31 20:27:02] WARNING: Error processing row 1: 'NoneType' object has no attribute 'replace'
This error is probably because you had some empty rows, in the first screenshot you had `Initial balance` without a Credit or Debits value. It's ok to error in this case.
> [2025-01-31 20:28:18] WARNING: Error processing row 1: Required field amount is missing
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:
```
amount:
target: amount
source: ["Credits", "Debits"]
default: "0"
```
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 "
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
@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
Oh man haha. It's always the last thing you expect.
Good it worked. Let me know if you have any other issue.
@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.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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.