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

Calculation based on number of empty cells

murthybhs
8 - Asteroid

Hello everyone,

I have a data set like this:

murthybhs_0-1611199063068.png

I want an average of the cells going back 5 cells from the most recent occurrence and multiply the average to the number of empty cells after the most recent occurrence.

For example, let's consider company A: Here the most recent occurrence is NOV_2020, so I want an average of JUL_2020 to NOV_2020. As shown in the image, it is 1500. So I want 1500 multiplied by 1 since there is only one empty cell after NOV_2020 i.e. 1000 (most recent occurance)

 

For example, in company B: The most recent occurrence is SEP_2020. Going back to 5 cells, the average from MAY_2020 to SEP_2020 is 10800. But there are 3 empty cells after SEP_2020. So, I want the average to be multiplied by 3.

 

Any help in this would be highly appreciated. Thank you for being amazing!! 

 

3 REPLIES 3
Qiu
21 - Polaris
21 - Polaris

@murthybhs 

Hope this is what you need.

0121-murthybhs.PNG

ArtApa
Alteryx
Alteryx

Hi @murthybhs - Here is a possible solution:

 

ArtApa_0-1611203923173.png

 

AbhilashR
15 - Aurora
15 - Aurora

Hi @murthybhs, I started making an attempt to build my logic but got sidetracked and now see that there are others who have already answered your post. Below is my solution just in case you cared for another way of achieving the same objective.

AbhilashR_0-1611206543815.png

Thank you for posting your question and we hope this helps!

 

Labels
Top Solution Authors