# Brackets with math() (BODMAS)

**URL:** <https://community.grafana.com/t/brackets-with-math-bodmas/15666>\
**Category:** General\
**Created:** [March 23, 2019, 5:10pm UTC](https://community.grafana.com/t/brackets-with-math-bodmas/15666 "2019-03-23T17:10:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![match79](https://avatars.discourse-cdn.com/v4/letter/m/7c8e57/32.png) [@match79](https://community.grafana.com/u/match79)\
**Post date:** [March 23, 2019, 5:10pm UTC](https://community.grafana.com/t/brackets-with-math-bodmas/15666/1 "2019-03-23T17:10:41Z")

</div>

I’m trying to do some calculations using math() - and while it honours BODMAS I can’t seem to find any way to use brackets - e.g. do something like: ( data - 1024 ) \* 1000 - if I add brackets I get an error, and if I leave them out I get: data -1024000 which is obviously not what I wnt!

Any ideas how to achieve this?

---

<div class="post-metadata">

**Author:** ![clanlaw](https://avatars.discourse-cdn.com/v4/letter/c/5f9b8f/32.png) [@clanlaw](https://community.grafana.com/u/clanlaw)\
**Post date:** [March 24, 2019, 8:40am UTC](https://community.grafana.com/t/brackets-with-math-bodmas/15666/2 "2019-03-24T08:40:33Z")

</div>

You have not said which database you are using, but this works for me on Influx  
`SELECT 1000*(-1024+"data")`
