Avg. Time between purchase orders
Hi,
Domo newbie here.
I am trying to find the average time between orders. The columns I have are
- Customer ID
- First Purchase date
- Last Purchase date
- Time between purchases
I tried to using the group by function to find the average time between orders, but it seems to be returning the same value as the 'time between purchases' column
Anyone have ideas of how to fix this in Magic ETL?
Thank you !
Comments
-
Sure @MichelleH ! Here is how I set up the group by function
0 -
@sarahi6 because you have start and end date in your group on columns, you are only finding the average time between purchases on the same start and end date. I am assuming you want to find the average time between purchase by customer, so you will want to just group on customer id (remove the start/end date columns).
2 -
@sarahi6 That would make sense that the "Avg Time Between Purchase" is the same, since the "First Purchase Date" and "Last Purchase Date" would be the same across all rows of the same Customer ID. If a customer has purchases on January 1, May 1, and August 1, then you would be comparing the difference between January 1 and August 1 for the customer overall.
1 -
@sarahi6 Are you wanting for each line to have the average time between purchases for all customers? If so, you'll want to use a Rank & Window tile to do that.
https://domohelp.domo.com/hc/en-us/articles/360042922814-Old-Magic-ETL-Tiles-Rank-and-Window
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**
1 -
@RobSomers Yes, I want each and average time between purchases for all customers. Will I keep the group by function that I listed above, and then add the rank & window?
0 -
You won't need your group by tile, just the Rank & Window tile.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**
2 -
@RobSomers , did I set this up right? I clicked the link you provided but I am having a hard time understanding what I should put as my preceding and following values.
thanks!
0 -
I actually think a better and easier way to do this would be using the FIXED function. You can do this either using a formula tile or using a beast mode in a card. The formula will be like this:
AVG(AVG('Time between purchase')FIXED())
I don't think the FIXED function will show up in the list of formulas in the ETL, but it should still work.
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**
0
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