Search code examples
amazon-quicksight

Is it possible to have a constant value in a calculated field in QuickSight?


In QuickSight, when you want to define a constant value to reuse it in visualizations later, you can try to set it as:

  • Calculated field: goalFor2020
  • Formula: 20000

But right now it doesn't allow you to put just a number in the formula.

Is there any way to do achieve having just a number in the formula of a calculated field?

The reason we need it is just to have a number that doesn't depend on any data, just manually defined by us.


Solution

  • Interesting, QuickSight lets me insert a number into a calculated field, just fine.

    Insert number in calc working

    Since that isn't working for you, I'd recommend using a parameter with a default value. For example,

    Parameter

    Parameters essentially has the same "rights" as a calculated field (it can be used in visuals, other calculated fields, etc...). It can also be passed via query parameters which may or may not be a feature that you'd find useful.

    Another cool benefit of using parameters is that, if you're embedding QuickSight, you could retrieve this value dynamically and pass it to the dashboard. Then if you wanted to, say, generalize your for different yearly goals, the goal could be passed and dynamic (rather than hard-coded in a calculated field).