Alteryx Designer Desktop Discussions

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

Filter by highest fiscal year and highest fiscal month related to that fiscal year

eb7
6 - Meteoroid

Hi community,

 

I hope you can help me set up an automated filter for my workflow which is updated daily.

 

My data is processed daily which adds current FY 2021 and the current and prior FM (FM 2 and FM 3). My database looks as follows:

FYFMSales
2020115
2020216
2020717
2021117
2021218
2021322

 

If I run my Alteryx WF then FY 2021 and FM 2 and FM 3 will result in duplicated data. Thus, I want an automated filter in my WF to remove the highest FY (2021) and to this year related two highest FM (FM 2 and FM 3). It should not touch/filter any FM related to FY 2020 (FM 7 and FM 2 from FY2020 should not be filtered out).

 

Result wanted in Alteryx WF: Filter out FY2021 and FM2 and FM3 from dataset (last two rows in table above), then load FY2021 and FM2 and FM3. It should look like this after filtering:

FYFMSales
2020115
2020216
2020717
2021117

 

Thank you for your support!

11 REPLIES 11
eb7
6 - Meteoroid

Hi @DataNath

 

I have built in your solution in my WF but i noticed that I have hundred of rows for each fiscal months. Said that, the filter with:

 

[Month ID] != [Max_Month ID]
AND
[Month ID] != ([Max_Month ID]-1)

 

filters out the last two rows instead of all entries regarding the last two fiscal months. Any idea here?

 

2nd issue: When Fiscal year changes and there will be only one fiscal month available. Will the formula cause trouble?:

 

[Month ID] != [Max_Month ID]
AND
[Month ID] != ([Max_Month ID]-1)

 

Best Regards

DataNath
17 - Castor

@eb7 my original understanding was, if it's the most recent year in the data set, you want to filter out the most recent month & the one before it (max month & max month-1) - is this not the case? If so, what exactly do you need to be removed?

 

I don't understand what you mean by 'regarding the last two months' either, sorry.

 

If you could provide a bit of a larger sample size and the expected outcome then that would help to build out the amended solution too, cheers!

 

As to your second point - I had overlooked that but it's very easy to avoid. We can just add in another step which checks whether or not the amount of fiscal months is > 1.

Labels