Can We Show the Number in Card Report in Alphabetical Series?

Hello Team Helical,

I am creating a Helical Insight report in the form of card. The card is showing numbers like 3546864. I would like to show the numbers like K, M, B etc so that is more easily understandable and readable. Basically humanize the numbers. How can that be achieved?Am using Helical Insight 3.0

Thank You.

1 Like

Hello Anu,

There could be different ways of doing that. One method is via Javascript which can be put in pre-fetch in JS editor tab of Adhoc report of Helical Insight.

Second is you could write a case statement in a custom column or in metadata you can create a view. There you will write something like below

CASE
WHEN COUNT(*) BETWEEN 1000 AND 999999
THEN CONCAT( cast ( CAST(ROUND(COUNT(*) / 1000.0, 1) AS DECIMAL(4, 1) ) as varchar ) , ' K') 
WHEN COUNT(*)BETWEEN 1000000 AND 999999999
THEN CONCAT( CAST( CAST(ROUND(COUNT(*) / 1000000.0, 2) AS DECIMAL(6, 2)) as varchar), ' M')
WHEN COUNT(*) >= 1000000000
THEN CONCAT( CAST( CAST(ROUND(COUNT(*) / 1000000000.0, 2) AS DECIMAL(6, 2)) as varchar), ' B') 
ELSE cast(COUNT(*) as varchar)
END as count

To read more about Custom Column and Views in Metadata please refer to the below.
Views in Metadata
Custom Column

Thank You
From
Team Helical