Alteryx Designer Desktop Discussions

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

IF Statement to get AVERAGE from another column

kianhozz
5 - Atom

Hi All,

 

I am looking to see how I could write an IF statement on one column, in order to get the average from another column. In my case, if day of week = Sunday, Monday, Tuesday, Wednesday or Thursday, then get the average price from another column.

 

Screenshot is as far as I got before getting stuck:

 

Thanks!

2 REPLIES 2
binuacs
20 - Arcturus

@kianhozz your formula seems to be fine for one value, if you have multiple price fields then you need to calculate the average you need to either mention those fields in the Average function Average([price1],[price2]) etc

binuacs_0-1684872377427.png

 

FrederikE
13 - Pulsar

Hey @kianhozz,

 

I think Average() is not the function you want to use (It takes the average of all the provided values per row, so in your case just the average of one single value). 

You should try to use a Filter tool to filter to these Weekdays and afterward use a Summarize tool, then you could rejoin it again. 

 

See my attached example flow. 

FrederikE_0-1684872432839.png

 

Labels