# Bug in parsing variable transformations

**URL:** <https://root-forum.cern.ch/t/bug-in-parsing-variable-transformations/31930>\
**Category:** TMVA\
**Created:** [December 8, 2018, 2:03pm UTC](https://root-forum.cern.ch/t/bug-in-parsing-variable-transformations/31930 "2018-12-08T14:03:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![a.bragagnolo](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/a/f14d63/32.png) [@a.bragagnolo](https://root-forum.cern.ch/u/a.bragagnolo)\
**Post date:** [December 8, 2018, 2:03pm UTC](https://root-forum.cern.ch/t/bug-in-parsing-variable-transformations/31930/1 "2018-12-08T14:03:57Z")

</div>

Hi,  
I found a bug in declaring variable transformations. In particular the string is parsed incorrectly if the variable has brackets in the name.

e.g.

```auto
dataloader.AddVariable("abs(x)","F")
dataloader.AddVariable("y","F")
dataloader.AddVariable("z","F")

```

The following string option:  
`:VarTransform=N,G(abs(x), y):`

will be parsed incorrectly because TMVA will not recognize the right bracket in abs(x) as part of the variable name, but as the closing bracket of G(). In this case the following error will be produced:  
`Dataset[dataset] : <ProcessOptions> Variable transform ', y)' unknown`

Regards,  
Alberto

---

<div class="post-metadata">

**Author:** ![kialbert](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/kialbert/32/16537_2.png) [@kialbert](https://root-forum.cern.ch/u/kialbert)\
**Post date:** [December 8, 2018, 4:24pm UTC](https://root-forum.cern.ch/t/bug-in-parsing-variable-transformations/31930/2 "2018-12-08T16:24:33Z")

</div>

Hi,

Thanks for the bug report. A bug will be filed to the issue tracker shortly. In the meanwhile, it should be possible to work around this issue by using `dataloader->AddVariable(”abs_x := abs(x)”)` and then transformining using `:VarTransform=N,G(abs_x, y):`.

Cheers,  
Kim
