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

Create a new dynamic column with the sum of last N column

Cagahan
6 - Meteoroid

Hello everyone, i have a workflow which refreshes everyday with the previous day's sales. 

 

I created a table where i can see the sales of last two weeks of the sites day by day. I would like to create a column to the end, where i sum up the sales of the last 3 days (or last n days) of sites. The data will be updated daily and the column names will be updated accordingly so it needs to be dynamic.

 

An example table: 

 19.09.202320.09.202321.09.202322.09.202323.09.2023Total of Last 3 Days
Site A109410923
Site B11121141227
Site C8381312
Site D3136110

 

Hope that was clear enough! 

 

Thank you in advance

3 REPLIES 3
binu_acs
21 - Polaris

@Cagahan One way of doing this

image.png

Cagahan
6 - Meteoroid

Thank you binuacs, i understood the logic.

 

However, i am having trouble to output "dates", which i believe it is a format issue. Dynamic Select tool only brings the Site, but not the dates.

 

Date column comes from the formula tool with following formula:

 

DateTimeFormat(DateTimeParse([KAYIT TARİHİ],"%Y-%m-%d %H:%M"), "%d-%m-%Y")

 

Really appreciated in advance!

 

 

 

Cagahan
6 - Meteoroid

It was date format issue and i figured it out. Your solution works perfectly! Thank you! 

Labels
Top Solution Authors