redash
redash copied to clipboard
Counter Visualization: can't format decimal numbers
Issue Summary
The number formatting options are disabled when I make a counter visualization from a decimal number.
Steps to Reproduce
- Create a new query against ~any SQL database~ BigQuery.
- Run the query
SELECT 0.15 as value
and execute - Make a counter visualization that points at the
value
column - Observe that the format options are gone
I expect to format this number as a percentage. Numeral.JS supports this with the scalePercentBy100
property option.
Further Details:
My query doesn't explicitly cast 0.15 as numeric so it comes into Redash as a text
type. You can produce the same issue in any SQL by running SELECT '0.15' as value
. I expect the Counter visualization should try to cast as a number, or at least give that option like a normal table does.
Technical details:
- Redash Version: Version 9 (and Version 8)
- Browser/OS: Firefox on MacOS
- How did you install Redash: Tested on SaaS and Docker
Did you select the column before trying to update the formatting?
Here's what you described and it seems to work: https://redash-preview.netlify.com/queries/231/source#418
One thing we should change is to either:
- When no column is picked, mark it as missing. and/or
- Pick the first column available as default.
Strange. I also can't reproduce it anymore using a fresh query. But my original query still doesn't work. I think this is probably a data type issue with the query runner. I've updated the issue above with more details.
I came across this after searching for the same problem. When I attempt to format the Counter type visualization, the UI controls are completely greyed out and cannot be interacted with. This makes it extremely unuseful with values that represent monetary value or other kinds of numerical data.
I've tried this numerous times on different queries, including creating new queries. The same result every time -- there's no way to control the format of the Counter visualization.