Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Calculate Average Cost over Distance in 1K Buckets

spnclr
6 - Meteoroid

Hello,

 

I am currently facing a challenge and hope someone can assist me. I have a table that logs the activity of wells, including their phase, the footage drilled each day, and the daily costs. We aim to evaluate how costs change over the distance drilled per well, categorized into buckets of 1,000 miles (e.g., 0-1,000, 1,000-2,000, etc.). The total footage drilled per well varies, with some wells having drilled 10,000 miles or more, while others have less. We are certain that average costs differ across these footage buckets, but we need to determine the extent of these differences.

 

Attached is a sample of fictional data and the workflow I have started.

 

Any help would be greatly appreciated!

5 REPLIES 5
Yoshiro_Fujimori
15 - Aurora
15 - Aurora

Hi @spnclr ,

 

I am not exactly sure how you want the "Avg Cost Per Foot" calculated, but

I trid to categorize each row into bucktes of footage by each 1000 as below:

 

Here I assigned each row to one bucket for simplicity.

But if you need to split the cost proportionally to multiple buckets, it would take further consideration.

 

I hope this helps.

 

Workflow

workflow.png

Running Total

Group = {"wellname", "PHase Name"}

Create Running Total = {"Footage Made"}

 

Formula #1

[Footage] = 

ToString((CEIL([RunTot_Footage Made] / 1000) - 1) * 1000) +

" - " +

ToString((CEIL([RunTot_Footage Made] / 1000)) * 1000)

 

Formula #2

[Avg Cost Per Foot] = Round([Sum_Daily Cost] / [Sum_Footage Made],1)

[Total Cost] = [Avg Cost Per Foot] * 1000

 

Output

wellnamePHase NameFootageSum_Daily CostSum_Footage MadeAvg Cost Per FootTotal Cost
Well 1Phase 10 - 100050080.02999261192192000
Well 1Phase 11000 - 2000146852.88741034142142000
Well 1Phase 12000 - 3000235235.61551420166166000
Well 1Phase 13000 - 4000552956.7248983563563000
Well 1Phase 14000 - 500044392.305598445353000
Qiu
21 - Polaris
21 - Polaris

@spnclr 
Though I am not quite able to understand your intention here, but somehow I feel you want to arrange the daily drill footage to a bucket of 5280 feed (1 mile) more or less.
If so, then it will be a Bin Packing problem, which is discussed briefly here.

https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/HELP-How-to-use-ITERATIVE-MACR...

I made some modification to the flow there and it is given the results as below.

0120-spnclr-A.png

0120-spnclr-B.png

spnclr
6 - Meteoroid

There are some techniques in this solution that I'm sure I'll be able to use in the future.

 

Thank you very much for taking a look!

 

 

spnclr
6 - Meteoroid

I think this solution will work for what we need.

 

Thank you so much for your help!

 

 

Qiu
21 - Polaris
21 - Polaris

Glad to be any help.

Labels
Top Solution Authors