How to calculate a ratio like 2:1
Hello, been looking at this one and cannot see how to make the calculation in a ETL or Beast Mode.
What I am trying to achieve is a ratio or products sold, for example we sell 2 used and 1 new i want to display a ratio of 2:1.
Is this possible?
In my data i have the following available:
1) N/U = Text value of New or Used per product sold
2) New = if new then 1, all other values 0
3) Used = if new then 1, all other values 0
So i can get the total products sold, total new and total used sold but cannot seem to work out how to display it how i need/want it to display.
Any help will be appreciated.
Thanks
Rob
Best Answers
-
You can use the formula tile and the concatenate function to build your ratio string like this:
CONCAT(`Usedfield`,':',`Newfield`)
This would build your string.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.2 -
@robdmitchell Also to build on what @MarkSnodgrass posted, if you have unusual ratios (216:81), then you could do the following:
CONCAT(SUM('UsedField')/SUM('NewField'),' : ','1')
This would always give you the number of used for one new.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**
3 -
@robdmitchell Yes, use the ROUND() function on your division in the beast mode:
ROUND(SUM('U')/(SUM('N'),2)
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**
2
Answers
-
You can use the formula tile and the concatenate function to build your ratio string like this:
CONCAT(`Usedfield`,':',`Newfield`)
This would build your string.
**Check out my Domo Tips & Tricks Videos
**Make sure to any users posts that helped you.
**Please mark as accepted the ones who solved your issue.2 -
@robdmitchell Also to build on what @MarkSnodgrass posted, if you have unusual ratios (216:81), then you could do the following:
CONCAT(SUM('UsedField')/SUM('NewField'),' : ','1')
This would always give you the number of used for one new.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**
3 -
Tip Top, this worked a treat. @RobSomers, have applied the formula in beast mode, is there a way i can reduce to just 2 decimal places, looks like 9.604651162790697:1
0 -
@robdmitchell Yes, use the ROUND() function on your division in the beast mode:
ROUND(SUM('U')/(SUM('N'),2)
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**
2 -
Legend, thanks for that, have a great rest of the week.
0
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.8K Visualize
- 2.5K Charting
- 738 Beast Mode
- 56 App Studio
- 40 Variables
- 684 Automate
- 176 Apps
- 452 APIs & Domo Developer
- 46 Workflows
- 10 DomoAI
- 35 Predict
- 14 Jupyter Workspaces
- 21 R & Python Tiles
- 394 Distribute
- 113 Domo Everywhere
- 275 Scheduled Reports
- 6 Software Integrations
- 123 Manage
- 120 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