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

Writing correct Formula

Shayna1
5 - Atom

I am struggling writing a formula to gather the correct information. 

I am needing to pull the greater value from the 3 columns. 

 

Same Day - Previous Day - Next Day

 

if same day is greater than previous or next day then display same. 

or if next day is greater than same and previous then display next and so on. 

 

Shayna1_0-1647263922287.png

 

 

 

7 REPLIES 7
MarqueeCrew
20 - Arcturus
20 - Arcturus

Have you played with Max() function?

 

https://help.alteryx.com/designer-cloud/minmax-functions

 

https://help.alteryx.com/20214/designer/minmax-functions

 

 Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
binuacs
21 - Polaris

@Shayna1 please provide some sample data and expected output

Shayna1
5 - Atom

I haven't just because I wasn't sure I could write something that could pull from all 3 columns at the same time for that max value. 

MarqueeCrew
20 - Arcturus
20 - Arcturus

Max([field 1],[field 2],[field 3]) returns the bigger or more recent date.  

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
TheOC
16 - Nebula
16 - Nebula

hey @Shayna1 

your formula using the Max function in a formula tool as suggested by @MarqueeCrew, would look like:
Max([Same Day], [Previous Day], [Next Day])

This would produce an output of the maximum value of all three columns.

 

Cheers,
TheOC

Cheers,
TheOC
Connect with me:
LinkedIn Bulien
Shayna1
5 - Atom
 

My expected output is just to have the greatest value from the 3 columns to be populated in the Greatest BOE Down

 

 

 

NextDay_BOEDown7Right_PreviousDay_BOEDown7SameDay_BOEDown7Greatest BOE DownDT_Info_SameDaySameDay_PROD_DATESameDay_WellName
8121 Maint DT TOW, No WR/WO in EAM2/11/2022ALICO #1
91001 Maint DT TOW, No WR/WO in EAM2/6/2022CLONA #1
9040 Maint DT TOW, No WR/WO in EAM2/7/2022CLONA #1
180100 Maint DT TOW, No WR/WO in EAM2/6/2022LINDSAY #1
001 Maint DT TOW, No WR/WO in EAM2/7/2022LINDSAY #1
100 Maint DT TOW, No WR/WO in EAM2/8/2022LINDSAY #1
010 Maint DT TOW, No WR/WO in EAM2/9/2022LINDSAY #1
TheOC
16 - Nebula
16 - Nebula

hey @Shayna1 

Please find attached,

Cheers,
TheOC

Cheers,
TheOC
Connect with me:
LinkedIn Bulien
Labels
Top Solution Authors