Alteryx Designer Desktop Discussions

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

Dynamic last 6 weeks sales calculation

Bryth
8 - Asteroid

Hello Team,  I am trying to create a calculation logic in Alteryx, that dynamically calculates the last 6 weeks sales. Can someone help me with this?  I don't have a date filed but a week filed that is in string data type. 

8 REPLIES 8
Felipe_Ribeir0
16 - Nebula

Hi @Bryth 

 

If you cold provide a sample input/expected output dataset, it would help a lot.

cjaneczko
13 - Pulsar

Is it only one year of data? If you have multiple years of data how do you differentiate a week in 2023 vs 2022 without a date field?

jbravman_
8 - Asteroid

what does your week field look like? 

Bryth
8 - Asteroid

I have this sales data and they are grouped by weeks. I want to dynamically get the last 6 weeks data for 2022 and 2023 data. My difficulty is that I don't have a date field format and the week filed is a string format

 

 

 

jbravman_
8 - Asteroid

If you have the week number you can convert it to a date, like the first day of the week and run off that. 

Bryth
8 - Asteroid

For instance I have this current year and Last year Sales Data with weeks field. I want to   calculate the  6 weeks trend data by dynamically calculating the the last 6 weeks sales data . I want to know the logic in Alteryx to write a formuale to look back at the last 6 weeks data. 

 
 

 

rzdodson
12 - Quasar

@Bryth I have attached a workflow containing a number of potential solutions for you based on your use case and workflow complexity.

 

N Week Workflows.png

 

Personally, I like the Analytical App approach because it enables you to customize your data retrieval without having to go in to the workflow and change numerous tools.

 

 

 

Analytical App Wand.png

 

Analytic App - N Week Selector.png

 

Hope that helps out!

jdminton
12 - Quasar

I think this way will work with your data. We don't see all of the columns, but if there is not a column for current and LY sales for each week, you will need to add a multirow formula to calculate first. Let me know if this works for you.

 

Snag_12620219.png

Labels