Alteryx Designer Desktop Discussions

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

Calculate previous 7 day average

AnanditaShankar
8 - Asteroid

Hi . I want to calculate 7 days average based on Material Number, Plant and Posting_Dt. I have used below logic but it's not working as expected.

 

AnanditaShankar_0-1681748844161.png

 

4 REPLIES 4
DataNath
17 - Castor

Hi @AnanditaShankar, Average() isn't a function in Alteryx that can be used like this. For a case like this, just add them all together and then divide by 7, such as:

 

([Row-7:Daily Closing Stocks New]+[Row-6:Daily Closing Stocks New]....)/7

AnanditaShankar
8 - Asteroid

Did that as well still not working

DataNath
17 - Castor

@AnanditaShankar can you post what you're expecting in the outcome then? From what you were attempting originally, that's how you would do it in Alteryx, so if it's not working as expected then we'll need more detail around what is actually needed.

 

DataNath_0-1681754281939.png

AnanditaShankar
8 - Asteroid

for eg : if on Day 1 closing stock is 200 and on Day 2 is 300 then average should be (200+300)/2 . And similarly it should do for consecutive days

Labels