I'm trying to import some accounting data to a new software and need to add a debit column journalItemLine_debitAmount and a credit column journalItemLine_creditAmount that are filled if there is a debit or credit in the source data. When I run my script, I end with only the data marked Credit when positive and none of the Debit when positive data.
data = within(data, { journalItemLine_debitAmount = ifelse(If.Positive. == "Debit" & Amount>=0, Amount, "") journalItemLine_creditAmount = ifelse(If.Positive. == "Debit" & Amount<0, -Amount, "") journalItemLine_debitAmount = ifelse(If.Positive. == "Credit" & Amount<0, -Amount, "") journalItemLine_creditAmount = ifelse(If.Positive. == "Credit" & Amount>=0, Amount, "") })
Aucun commentaire:
Enregistrer un commentaire