Declaring variables/functions in calculated fields

I find when writing calculated fields I repeat snippets

Is there a way to declare a variable which is then used later within the calculated field?

I also tend to repeat patterns in different calculated fields. Is there a way to declare a custom function?

Hello @Ted,

This is not possible in QuickSight, normally you can use calculated fields inside other calculated fields but no variables or functions can be defined.

At AWS, our roadmap is primarily driven by our customers. Your feedback helps us build a better service. I have tagged this as a feature request.

Kind regards,
Andres.