Number and text in summary value
I need to show a value along with text in the summary number. I know this can be done by concatnating but for some reason I can't get the value to show as a summary number. This is what I need:
Show a count of distinct records (which is 10,232) and then add some text. The issue is when I concatnate the count(distinct records) and add the text, I loose the comma. So, I'd like to take the first two digits here (10) concatnate a ',' and then add the last three digits (232) and then add my text. Is this possible to do? Any suggestions?
Best Answer
-
This may get tricky if you just need to have the thousand seperator in your text. But since the 10232 is a string (post concat) you could maybe do something like
concat(
(case when length(10232field) > 3 then
substring(reverse(10232field),1,3),',',substring(reverse(10232),4,3)
else 10232field
end),
, 'blah blah blah'
)
I haven't tested this, but the reverse should allow you to insert the comma after the 3 digits...the case is there in case your count is below 1k. If you a count over a million.you may need to add some logic for that too.
Late at night so be cautious of my syntax or logic. ?
Matt
1
Answers
-
This may get tricky if you just need to have the thousand seperator in your text. But since the 10232 is a string (post concat) you could maybe do something like
concat(
(case when length(10232field) > 3 then
substring(reverse(10232field),1,3),',',substring(reverse(10232),4,3)
else 10232field
end),
, 'blah blah blah'
)
I haven't tested this, but the reverse should allow you to insert the comma after the 3 digits...the case is there in case your count is below 1k. If you a count over a million.you may need to add some logic for that too.
Late at night so be cautious of my syntax or logic. ?
Matt
1 -
This worked out great. Thank you for the suggestions here. I did change it a bit, did not use the 'reverse' but got it to work based on your input. This is what worked:
CONCAT(SUBSTRING(CONCAT(`10232field`,' '),1,2),',',SUBSTRING(CONCAT(`10232field`,' '),3,3))
Since my number is not really changing I was able to avoid the CASE WHEN logic to where the number grew, otherwise I would just have to add that.
1
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.5K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 8 Federated
- 2.9K Transform
- 100 SQL DataFlows
- 616 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 738 Beast Mode
- 57 App Studio
- 40 Variables
- 685 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 47 Workflows
- 10 DomoAI
- 36 Predict
- 15 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 124 Manage
- 121 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 10 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 108 Community Announcements
- 4.8K Archive