I am wondering if someone has any experience with executing functions in the titles of their Quicksight visuals. I am attempting to do so and am encountering a very vague error.
I have a StartDate and EndDate parameters. I want to have two visuals. I would like the first to show data between the start and end dates. For example, if the Start/End date parameters are August 1, 2022 - August 3, 2022, I would like my visual title to read “Showing Data from Aug 1, 2022 to Aug 3, 2022”.
I would like the second to show data from the same date range, but the previous year. For example if the Start/End date parameters are August 1, 2022 - August 3, 2022, I would like this visual to read “Showing Data from Aug 1, 2021 to Aug 3, 2021”.
In experimenting, I was able to prove that I am able to execute Quicksight functions in the title of a visual. For example, here I was able to run the following code using the now() and addDateTime() functions to produce a promising output
However, there seems to be some reason I cannot run similar code while also using parameters. If I run that same code using my start date parameter I get this very vague error message:
@TheCardlessMoose, Instead of using a title you can create a custom narrative visual using the same date format function to format date parameters and overlay custom narrative visual on top of your KPI visual, something like this
This looks like it would work. Though, I guess I’m mostly just curious as to why some functions can be run inside the title of a visual while others cannot. Wondering if anyone knows the specific reason
I see that when I type in the <<>> symbol, I am able to enter the code. However, the error I described occurs when I try to run some function on those parameters (such as formatDate()).
For example, in the title:
This is fine: Data between <<${StartDateParam}>> and <<${EndDateParam}>>
This throws an error: Data between <<formatDate(${StartDateParam}, 'dd MMM yyyy')>> and <<formatDate(${EndDateParam}, 'dd MMM yyyy')>>
And the main source of my confusion is that I can execute some functions but not others. For example, this is fine as well: Data between <<formatDate(now(), 'dd MMM yyyy')>> and <<formatDate(now(), 'dd MMM yyyy')>>