Add the number style `k`, `B`, `M` to the dimension + metric config
See original GitHub issueDescription: What is it?
in the metric or dimension configuration, you can add a style option to make the numeric field into units of thousands, millions, billions.
You can do this using compact
= k, m, b
or default
Problem: What problem does this solve?
Sometimes, I want my values to be formatted in different units to the raw data
What: Roughly, what does this look like in the product?
name: revenue
meta:
dimension:
compact: default
metrics:
total_revenue:
type: sum
compact: k
- If I had the
revenue
values (the first dimension in the example above withcompact
=default
) of1,000,000
and150,000
, then they would appear as1m
and150k
in Lightdash - If I had the
total revenue
values (the metric in the example above withcompact
=k
) of1,000,000
and150,000
, then they would appear as1,000k
and150k
in Lightdash. - Unit options are: ‘k’ or ‘thousands’ for thousands, ‘m’ or ‘millions’ for millions, ‘b’ or ‘billions’ for billions
- By default, there are 2 decimal places. (e.g.
1,550,000
withcompact
=m
would appear as:1.55m
). If there were only 0s after the number, then it would still appear with two decimal places (e.g.1,000,000
withcompact
=m
would appear as:1.00m
). - Users can override the number of decimal places shown using the
round
. So,round
gets applied after compact. For example, if I had the value1,550,000
withcompact
=m
andround = 1
, it would appear as1.6m
.
Issue Analytics
- State:
- Created a year ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
AutoCAD Custom Dimension Style Setup Imperial & Metric!
AutoCAD Fundamentals & Workflows Course: http://cadintentions.com/hurry** AutoCAD Productivity Training Webinar Available Now 20% off: ...
Read more >Formatting Metric Data
1. Click the Configure Metric Attributes icon to the right of the Metrics header. The Available Metrics dialog page displays. 2. In the...
Read more >Custom Metrics (CX) - Qualtrics
Click on the Settings icon. · Click on the Custom Metrics tab that is on the left side of the settings screen. ·...
Read more >Create and edit custom dimensions and metrics - Analytics Help
In the PROPERTY column, click Custom Definitions > Custom Dimensions. Click New Custom Dimension. Add a Name. This can be any string, but...
Read more >Format a number as 2.5K if a thousand or more, otherwise 900
(determines SI symbol) var tier = Math.log10(Math.abs(number)) / 3 | 0; ... scale the number var scaled = number / scale; // format...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I agree that Tableau has the best of both worlds. Also remember to include date formatting options:
3 Jun 03 Jun Jun 3 June 3rd 06/03 6/3 6.3 2022-06-03 etc
I think that there should be a default solution configurable in dbt (especially useful for dates, currency formats, etc), but also the ability to overwrite this in the UI depending on the analyst and the use case.
For example, it could be monthly reporting is in the thousands, but year-to-date reporting is in the millions. It could be that Finance would want full figures reported. UI-wise, I’ll add a vote to the Tableau-like solution.