-
-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested if statements for better CSV import #1393
Comments
Hi @mgajda, since 1.19 you can combine matchers with |
Combining matchers into an AND operation is not the same thing as being able to nest them. I believe Michal's case could be coded pretty easily using a single flat level of matches (with or without and AND matcher) but the order of operations becomes critical and off the top of my head I'm not sure what it is and I don't see it skimming the docs. Are rules guaranteed to match in a certain order? |
@alerque yes rules are evaluated in the order you'd expect (related: https://hledger.org/csv.html#how-csv-rules-are-evaluated). And you're right, @mgajda doesn't need nesting or ANDing here, this would do:
Nesting if blocks is unlikely to get implemented I suspect. |
Yes, I upgraded to latest |
Could you give an example ? |
If "Nesting if blocks is unlikely to get implemented", could we close this issue? |
I did not find a way to make a conjunction of multiple conditions in CSV import documentation nor examples.
Small example:
Documentation:
In order to make a conjunction of conditions you may nest
if
statements with indentation.For example when director's fees are classified separately from wages, but director's reimbursements are treated the same as other emps...
This allows you to conveniently build nested matching rules.
The text was updated successfully, but these errors were encountered: