Alteryx Designer Desktop Discussions

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

Dynamic month: Sum Values

neromerob
10 - Fireball

Hello to everyone.

I´m working on a Workflow in order to get the total information of the last month.

For now, I was able to do it manually, but my goal is that the workflow can do it automatically without human intervention.

In the workflow you can see two browser, the first one is with the output that I need, the second one is when I tried to use a formula to get the last month from this database but the numbers don’t match and I can´t understand why (maybe the formula is wrong)

 

outputs_2.jpg

 

Thank you.

 

5 REPLIES 5
SPetrie
12 - Quasar

You did a calculation to figure out the previous month and year, but I done see where you ever filtered out the other months before doing your calculations so its inflating your numbers.

Add in the filter tool and I think you should be good.

SPetrie_0-1657572114571.png

datetimeformat([month],"%B") = [Previous_Month] and datetimeformat([month],"%Y") = [Previous_MonthYear]

 

DavidSkaife
13 - Pulsar

Hi @neromerob 

 

All 1,487 records are being tagged as June 2022 so it's totalling them up; try the attached instead:

 

I've made the assumption you're ONLY wanting the month prior to the current month? Edited the formula and added in a filter

 

DavidSkaife_0-1657572287618.png

 

 

Hi @neromerob 

 

I added a formula to the filter tool w/o changing the way the dates are coming thru. See below container CA.

christine_assaad_0-1657572697709.pngchristine_assaad_1-1657572720975.png

 

binuacs
20 - Arcturus

@neromerob one way of doing this dynamically. you need add the below custom condition in the filter tool

 

//Filtres all the dates based on the current month
DateTimePArse([month],'%Y-%m-%d') <= DateTimeFirstOfMonth()
AND

//taking the previous month records only
ToDate(DateTimeParse([month],'%Y-%m-%d')) = ToDate(DateTimeAdd(DateTimeAdd(DateTimeToday(),-1,'month'),-DateTimeDay(DateTimeToday())+1,'Day'))

binuacs_0-1657574505390.png

 

 

 

neromerob
10 - Fireball

Thank you @DavidSkaife @binuacs @christine_assaad  and @SPetrie for your time, I think is working. 

 

 

Labels