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

Target average in a set of values

JT0168
7 - Meteor

Given below sample data....

 

No.SKULeadtime (days)
166500850
266480020
366479910
46647058
56552967
66552587
76546836
86166826
96093405
106064545
116059455
12852453
13643322
14209811

 

Set Target Average Lead time = 5days; so from No. 4 to No 17 the average is 5, which formula to use in Alteryx to get those SKU that did not meet the target, which is from NO. 1 to No. 3. 

 

Thank you!      

3 REPLIES 3
IraWatt
17 - Castor
17 - Castor

@JT0168 Why are No. 4 to No 17 averaged, they are all different SKU's ?

JT0168
7 - Meteor

@IraWatt - sorry supposed to be No.14 only and not 17. I am looking for those SKU which affects the overall average lead time target of 5 for a specific category. So definitely after averaging No.4 to No 14 the average is 5, when you include No. 3 the new average is 5.4, if again you add No 2 the new average is 6.54.....and if No. 1 is included the new lead time for the data is 9.64..so definitely No. 1 to No. 3 affects the target lead time.

IraWatt
17 - Castor
17 - Castor

Hey @JT0168,

One way to do this is with an iterative macro. It loops through averaging from the lowest Lead time to highest and stops looping once the average is above 5. It then adds a column indicating which row tipped the balance over, in our case row 12 or no.3.

IraWatt_0-1661366973806.png

IraWatt_1-1661367188559.png

 

If you want to learn more about Macros the community has some really quick interactive videos on getting to grips with them here https://community.alteryx.com/t5/Interactive-Lessons/tkb-p/interactive-lessons/label-name/Macros

 

Any questions or issues please ask

Ira Watt
Technical Consultant
Watt@Bulien.com 

 

 

Labels
Top Solution Authors