Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Prior Year Column Sales

knlekash
7 - Meteor

Hello Community,

I am working with a live data set and am getting a bit muddy with dates. I want to add a column for each of my key measurements i.e. PY Sales, PY Units, etc aggregated at the product level.

So far I have been only able to produce a workflow that will give me last year / current year (attached) but all aggregated to the year. What I really want is a PY sales/PY units for at minimum a week. This seems like something there is a simple solution for that I have just missed thus far.

I have attached a workflow with Superstore date as an example.

8 REPLIES 8
fmvizcaino
17 - Castor
17 - Castor

Hi @knlekash ,

 

I've inserted the month and week column and I've done the calculations for both, but it didn't make much sense since your data is not distributed between all months/weeks.

 

Let me know if I'm in the right path here 🙂

Best,

Fernando Vizcaino

knlekash
7 - Meteor

Hey Fernando,


I went back to the data-source I am trying to solve for and what I see is a little different than my OP.

The depth of granularity is by a single date. Each date & product has both a column for Sales and for Sales YA. What is the most effecient way to give myself a column for Sales YA, this column should go back beyond current year (2020) and into 2019 as well

fmvizcaino
17 - Castor
17 - Castor

Hi @knlekash ,

 

Would you be able to share a sample output of what you are trying to achieve? I'm not sure what you are calling Sales YA

 

Best,

Fernando V.

knlekash
7 - Meteor

I attached an example of my desired output with the Sales and Units Year Ago Column. For example if we are looking at the sales on 1/25/20 for the Evl Twin Brew. The sales YA column is producing sales from 1/25/19.

fmvizcaino
17 - Castor
17 - Castor

Hi @knlekash ,

 

I'm attaching a workflow where I do an automatic way of using years as previous and also current depending on the year you are analyzing.

Each summarize was grouped by month and year respectively but you can try to look using the month-day as well.

 

Let me know if this makes sense to you or if I'm going in a totally different path.

 

Best,

Fernando Vizcaino

ramesh_neel
11 - Bolide
11 - Bolide

@knlekash -  Hope the attached workflow helps, (you need to replace the input file with your super store tableau extract file )  . It calculates the Sales YA and Order Date YA  , for any product with null as the date and sales YA , there was no sale corresponding to the exact date in the previous year. 

 

cheers,

Ramesh

Alteryx ACE | Sydney Alteryx User Group Lead | SparkED Contributor and Mentor
knlekash
7 - Meteor

Hi Fernando,

I just gave your workflow a try, it looks like it accomplishes aggregating up to a week / month in my particular case I was trying to find by day. 

@ramesh_neel  solution looks like what I was trying to deliver, thank you all!

ramesh_neel
11 - Bolide
11 - Bolide

@knlekash  - Glad it worked for you 🙂

Alteryx ACE | Sydney Alteryx User Group Lead | SparkED Contributor and Mentor
Labels