# Import csv if statement doesn't work on hledger field name

**URL:** <https://forum.plaintextaccounting.org/t/import-csv-if-statement-doesnt-work-on-hledger-field-name/554>\
**Category:** General\
**Tags:** hledger\
**Created:** [May 21, 2025, 8:31am UTC](https://forum.plaintextaccounting.org/t/import-csv-if-statement-doesnt-work-on-hledger-field-name/554 "2025-05-21T08:31:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johndoe](https://avatars.discourse-cdn.com/v4/letter/j/65b543/32.png) [@johndoe](https://forum.plaintextaccounting.org/u/johndoe)\
**Post date:** [May 21, 2025, 8:31am UTC](https://forum.plaintextaccounting.org/t/import-csv-if-statement-doesnt-work-on-hledger-field-name/554/1 "2025-05-21T08:31:52Z")

</div>

rules:

```auto
fields , date, desc1, desc2, amount
# set description to 2 fields
description %desc1 %desc2

```

referencing description does not work

```auto
if %description Bankgiro inbetalning
 account2 revenue

```

but the named fields work

```auto
if %desc2 Bankgiro inbetalning
 account2 revenue

```

Shouldn't using description for the if statement also work?  
Easy to work around, just thought I'd mention it and maybe worth creating an issue? Or maybe I am missing something?

---

<div class="post-metadata">

**Author:** ![simonmic](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/simonmic/32/1_2.png) [@simonmic](https://forum.plaintextaccounting.org/u/simonmic)\
**Post date:** [May 21, 2025, 3:42pm UTC](https://forum.plaintextaccounting.org/t/import-csv-if-statement-doesnt-work-on-hledger-field-name/554/2 "2025-05-21T15:42:09Z")

</div>

If rules can only test the csv fields - not the hledger field values, which may not be fully constructed yet.  
[https://hledger.org/1.42/hledger.html#matchers](https://hledger.org/1.42/hledger.html#matchers)

---

<div class="post-metadata">

**Author:** ![johndoe](https://avatars.discourse-cdn.com/v4/letter/j/65b543/32.png) [@johndoe](https://forum.plaintextaccounting.org/u/johndoe)\
**Post date:** [May 21, 2025, 3:54pm UTC](https://forum.plaintextaccounting.org/t/import-csv-if-statement-doesnt-work-on-hledger-field-name/554/3 "2025-05-21T15:54:17Z")

</div>

> (Don't use a hledger field name here, unless it is also a CSV field name.)

Got it
