Distance and MPG
Hello,
i have a dataset that has consists of Vehicle gas fill up data.
date of gas fill up
odometer reading (miles) at time of fill up
gallons pumped
cost per gallon
total spent
vehicle
I'd like to have a card represent by vehicle the calculated MPG, and the distance traveled.
This would be by month/quarter/year depending on the cards time selection.
Is this possible?
Thanks!
Comments
-
Hello,
Assuming you have all the necessary data pieces - which it looks like you do - this should be no problem.
The catch is if the data is in the correct structure to do this in a Beast Mode or if you have to transform the data a bit via dataflow first.
Could you provide a sample of the data?
0 -
-
Hi,
I would make a transformation in a redshift dataflow in order to get the odometer value in the last reffil.
Like this :
Select *,NVL(LAG("odometer mileage") RESPECT NULLS OVER (PARTITION BY vehicle ORDER BY date),0) PreviousOdometer from tst_dojo_gas
Then you can in a BeastMode get the Distance Traveled :
`odometer mileage`-`previousodometer`
And from here get the MPG also :
`gallons pumped`/(`odometer mileage`-`previousodometer`)
Sending as an attachement the export of the result table
Hope it helps.
Ricardo Granada
MajorDomo@Lusiaves
**If the post solves your problem, mark it by clicking on "Accept as Solution"
**You can say "Thank you" by clicking the thumbs up in the post that helped you.1 -
Ricardo,
Thank you for your reply! It certainly got the wheels turning and i appreciate the assist.
Would this be something possible to perform in Magic ETL?
Also, does this need to be done in dataflow or any possibilities within beastmode/card design?
Thanks!
0 -
Hi.
I don't know if window functions can be used in Magic ETL. And i can't see any way for a bestmode to get previous record values...
But we never know!
Ricardo Granada
MajorDomo@Lusiaves
**If the post solves your problem, mark it by clicking on "Accept as Solution"
**You can say "Thank you" by clicking the thumbs up in the post that helped you.1
Categories
- All Categories
- 1.8K Product Ideas
- 1.8K Ideas Exchange
- 1.6K Connect
- 1.2K Connectors
- 300 Workbench
- 6 Cloud Amplifier
- 9 Federated
- 2.9K Transform
- 102 SQL DataFlows
- 626 Datasets
- 2.2K Magic ETL
- 3.9K Visualize
- 2.5K Charting
- 753 Beast Mode
- 61 App Studio
- 41 Variables
- 692 Automate
- 177 Apps
- 456 APIs & Domo Developer
- 49 Workflows
- 10 DomoAI
- 38 Predict
- 16 Jupyter Workspaces
- 22 R & Python Tiles
- 398 Distribute
- 115 Domo Everywhere
- 276 Scheduled Reports
- 7 Software Integrations
- 130 Manage
- 127 Governance & Security
- 8 Domo Community Gallery
- 38 Product Releases
- 11 Domo University
- 5.4K Community Forums
- 40 Getting Started
- 30 Community Member Introductions
- 110 Community Announcements
- 4.8K Archive