Alteryx Designer Desktop Discussions

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

Add or subtract different columns based on date

justin_chow
5 - Atom

Hello,

 

I need to add different columns based on the date that's inside another column.

 

Date of dataPersonJan projected scoreFeb projected scoreMar projected scoreJan actual scoreFeb actual scoreMar actual scoreJan+Feb+Mar
Feb 1Fred102030405060??
Feb 1Bob123456??

 

So while we're in December, we add up Jan, Feb, and Mar's projected score. But after January passes, we add up Jan's actual score, and Feb+Mar's projected score. 

How do I set something up to automatically handle this?

1 REPLY 1
BrandonB
Alteryx
Alteryx

You could use an adaptation of this workflow. First the data is transposed so that the months become a column of data rather than headers. Then a formula tool is used to create actual date values from the month names. Then a filter tool is used to specify what the data is through so that actuals are pulled through for the dates prior and projected values are pulled through for months in the future. The summarize tool then adds these values together by Person. Finally, this data is joined back up to the original dataset. Workflow is attached. 

 

totals.png

 

In this example, we assume that January and February have actuals and March is projected. 

Labels