Expensify.org/hunger SNAP campaign status
We’re no longer accepting new participants as our focus is on reimbursing existing claims. While we’re unable to provide a specific timeline on when your report will be reimbursed, we’re doing our best to drive donations and keep reimbursements moving forward. If you know anyone who can donate to this campaign please encourage them to enable Personal or Corporate Karma on their Expensify account.

We're currently experiencing issues with our American Express and Capital One connections. Please visit our status page for more details and to subscribe to updates.

Deep Dive: Understanding math and substring formula for custom exports

Stevie LaFortuneStevie LaFortune Expensify Team Posts: 153 Expensify Team
edited February 26 in Deep Dive Docs

The more you know - - - 

Information about the current user exporting the reports.  This is useful if you need to print the name of the exporter.  

To export the email of the currently logged in Expensify user -

  • {user:email} would output [email protected] assuming that is the currently logged in Expensify user's email.
  • {user:email|frontPart} would output bob assuming that is the currently logged in Expensify user's email.  

You are able add formulas that are a math type, allowing you to do arbitrary mathematical equations in your export.

  • * — Multiplication {math: 3 * 4} output 12
  • / — Division {math: 3 / 4 }output 0.75
  • + — Addition {math: 3 + 4 }output 
  • - — Subtraction {math: 3 - 4 }output -1
  • ^ — Exponent {math: 3 ^ 4 } output 81
  • sqrt — The square root of a number. {sqrt:64} output 8


  • Note - You can also combine the value of any two numerical fields. For example, you can use {math: {expense:tag:glcode} + {expense:category:glcode}} to add the value of the Tag GL code with the Category GL code.

Substring formulas will output a subset of the string in question. It is important to remember that the count starts at 0 not 1.

  • {expense:merchant|substr:0:4} would output Star for a merchant named Starbucks. This is because we are telling it to start at position 0 and be of 4 character length.
  • {expense:merchant|substr:4:5} would output bucks for a merchant named Starbucks. This is because we are telling it to start at position 4 and be of 5 character length.
Related articles
Have a question or want to know more? Start a discussion here!
Tagged:
Sign In or Register to comment.