I don't think there is a way to dynamically set the formatting field.
What you could do instead is outputting the numbers in the desired format in the first place, even when this means you convert them first to a string.
I.E.:
For each entry in a use Button-Dropdown a different PQL is stored in a VARIABLE. Here it is called 'MY_KPI'.
This variable goes into the PQL editor field:
For a normal number (i.E. from a COUNT_TABLE() statement) the result can be displayed without any changes. Just write the PQL into the variable:
For a percentage representation you can multiply the result by 100, round it to x decimal places and concatinate a '%' character by using the '||' operator: If your KPI value was i.e. 0.0573 you would get:
Multiply by 100: 0.0573 * 100 -> 5.73
Round to 1 decimal: ROUND(0.0573 * 100, 1) = -> 5.7
Add '%' character: ROUND(0.0573 * 100, 1) || ' %' -> 5.7 %
This looks something like this:
I wanted to see decimal and thousand seperators so for the field "predefined formats" I chose "Custom Formula" with 0 decimal places. That gives me seperators for normal numbers and the percentage representation is just a custoim built string anyway.
BR Florian