Hello Cedric - what Mario has stated is correct, but you could also put this as a reusable Dimension in the section marked library on the left, without having to use it in the script.
Check out the screens and this video: Creating Master Items (video)
Under Dimensions click - Create New
Name and add your expression
The you can use it in your chart object