Let’s talk Alteryx Copilot. Join the live AMA event to connect with the Alteryx team, ask questions, and hear how others are exploring what Copilot can do. Have Copilot questions? Ask here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Dynamic calculation of last x column

DTankova1
5 - Atom

Hello All,

 

I'm new in Alteryx. And I'm struggling to create this calculation.

 

So I have report for full year in which have 52 weeks, but I want to make calculation for last 4 weeks base on current week.

Example:

Today we are week 11,year 2020, i want to sum the value of 11 10 9 8. Next week will be 12 I want calc of 12 11 10 9 week. But if is week 2 I want calc to take weeks from previous year (2019), so 52 51 01 02 weeks.

If anyone can help, I'll be really thankful! 🙂

You can find attache xls for example.

6 REPLIES 6
Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @DTankova1,

 

Is this what you're trying to achieve? I've broken the 4 week running total by individual brand.

 

image.png

 

If this solves your issue please mark the answer as correct, if not let me know!

 

Regards,

Jonathan

RolandSchubert
16 - Nebula
16 - Nebula

Hi @DTankova1,

 

you can find the current week using DateTime-functions, filter out the last 4 weeks using a Filter tool and Summarize grouped by brand. Join the results to your original data and you're done. I've attached a sample workflow. Let me know, if it solves your problem.

 

Best,

 

Roland

DTankova1
5 - Atom

Thanks Jonathan,

 

Thank you! Yes it's work perfect, just one question how to cross tab the table with new column ?

 

 

BR/

Daniela

Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @DTankova1,

 

What do you want the output to look like? Could you mock up a quick example?

 

Regards

Jonathan

DTankova1
5 - Atom

Hi,

 

How it was of the begging, original format + "new column(Last 4 Weeks)".

Brand |1| 2| 3| 4| 5| 6|........... |Last 4 weeks|

 

Br/

Daniela 

 

DavidP
17 - Castor
17 - Castor

This is how I would do it

 

DavidP_0-1584701880426.png

 

Labels
Top Solution Authors