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.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