Alteryx Designer Desktop Discussions

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

Filter current month

gigi10
6 - Meteoroid

Hello,

 

Appreciate if you can help me because I am trying to filter the previous month data from 1 whole year data. 

 

For example, this November, I need to pull the data from October only from column C.

 

gigi10_0-1669106167782.png

 

And for the next month once I run the Alteryx in Dec, I need to get the Nov data only.

 

Please help. Thank you in advance

 

PS:

Here's the sample data set - how about when I run it again for Nov data, I need to manually change the filter to 11.

What I am trying to achieve is once I run the Alteryx from the production it will automatically pick up the month I needed. T

 

Thank you so much!

Company CodeYearMonthname 1name 2volumevolume2Year
PPPP2022011111111NAME1101Oct-22
PPPP2022022222222NAME223Oct-22
PPPP2022103333333NAME332Oct-22
PPPP2022034444444NAME46261Oct-22
PPPP2022055555555NAME53261Oct-22
PPPP2022106666666NAME662561Oct-22
PPPP2022107777777NAME751Oct-22
18 REPLIES 18
KrishnaChithrathil
11 - Bolide

@gigi10 

Please check the attached workflow.

KrishnaChithrathil_0-1669108019889.pngKrishnaChithrathil_1-1669108050590.png

 

ShankerV
17 - Castor

Hi @gigi10 

 

Please find another way to reach your solution.

 

ShankerV_0-1669108154141.png

 

Output:

ShankerV_1-1669108165981.png

 

Then filter your input to match this criteria and you can reach your desired output for every month dynamically.

 

Many thanks

Shanker V

 

 

 

ShankerV
17 - Castor

Hi @gigi10 

 

Step 1: 

ShankerV_0-1669108255346.png

 

 

Step 2:

 

ShankerV_1-1669108267542.png

 

Step 3: This step helps to convert the previous month and year into the format which you have in the input dataset so that you can use the filter tool to filter all the records matching this criteria.

 

ShankerV_3-1669108366127.png

 

ShankerV_2-1669108286017.png

 

 

Kindly accept this solution if it provided a solution to your question.

 

 

Many thanks

Shanker V

 

gigi10
6 - Meteoroid

Can you show me the formula please? Thank you so much!

ShankerV
17 - Castor

Hi @gigi10 

 

Complete workflow.

 

ShankerV_0-1669108961658.png

 

Step 1:

ShankerV_1-1669108974786.png

 

 

Step 2:

ShankerV_2-1669108989075.png

 

 

Step 3:

 

ShankerV_3-1669109002822.png

 

Run the workflow.

 

Output:

 

ShankerV_4-1669109026544.png

 

 

Many thanks

Shanker V

 

 

gigi10
6 - Meteoroid

Hello Denis - thank you so much. Can I ask for your formula please?

OllieClarke
15 - Aurora
15 - Aurora

Hey @gigi10 

 

Lot's of solutions offered so far, my approach would be to use a filter tool with the following formula:

ToString([Year])+'-'+ToString([Month])
=
Left(DateTimeAdd(DateTimeToday(),-1,'month'),7)

This checks that the year and month (concatenated with a hyphen) are the same as the year and month of this day last month (e.g. "2022-10") for today's date.

 

Hope that helps,

 

Ollie

KrishnaChithrathil
11 - Bolide

@gigi10 

What exactly is your blocker now?

 

KrishnaChithrathil
11 - Bolide

If I'm on the same page understanding your requirement, you can get the expected result using a filter tool. see the attached image.

KrishnaChithrathil_0-1669118491561.png

 

Labels