Rounding values in narrative editor

I’m looking for a way to round the percent values in the top/bottom movers’ insights narrative.
The value is presented with two decimal positions (56.98%). I want to round it to an integer (57%). I tried using the ‘round’ calculation and got the following error:

Any ideas?

Hello @Yuval.Shiboli, could you try changing the format of the value from the field well? Click the down arrow on the field you want to target, hover over format, and select more formatting options (or you can select the option that just shows a percent value without decimal places). This should allow QuickSight to handle the rounding functionality on the insight display.

Thanks @DylanM,
The value in the field well is a number with a “sum” aggregation.
when I play with the formatting of the value it affects the count but not the presents.

Hello @Yuval.Shiboli, I see on your original ifelse statment you put the round functionality outside of the whole ifelse statement. Could you try using it on the element that returns a percent value in the narrative instead?

Hi @DylanM ,
the ifelse statement is as follows:


I tried adding the ‘round’ functionality to the second and third parts and got the following error:

Cannot apply ‘round’ to arguments of type ‘round(<CHAR(7)>)’. Supported form(s): Numeric, Positive Integer)

maybe round is not the right function to use here?

Hello @Yuval.Shiboli, oh I think it is because you are using the formattedAbsoluteValue. Using that or formatted value is converting the returned value to a string so it is not able to run the rounding function. Maybe try percentDifference.value instead then the rounding should work.

I’ll link the documentation for that here, there is an explanation on that string conversion functionality.

Amazing- using the “value” computation along with the round() function and adding the % as text right after it- got me to where I wanted to be.
Thanks for all your support @DylanM - I will save that article on my favs for future narratives.

1 Like

That is great @Yuval.Shiboli, I am glad it worked out!