Alteryx Designer Desktop Discussions

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

Filter Expression Writing Help

ShantanuDagar
8 - Asteroid

Filter to be applied on 2 columns - Quarter and Year

 

If we are running workflow today - Then the next quarter of the quarter in which today's date falls in should be taken.

 

Also, don't forget that there are only 4 quarters in a year possible. So, if the date of run falls in October-December, the year to be taken increases by 1 and the quarter changes back to 1.

 

Sample Data:

 

A 3 2023 Table - View Browse Tool Report Tab
B 3 2023 Table - View Browse Tool Report Tab
A 4 2023 Table - View Browse Tool Report Tab
B 4 2023 Table - View Browse Tool Report Tab
A 1 2024 Table - View Browse Tool Report Tab
A 2 2024 Table - View Browse Tool Report Tab
A 3 2024 Table - View Browse Tool Report Tab
B 4 2024 Table - View Browse Tool Report Tab
A 1 2025 Table - View Browse Tool Report Tab
B 1 2025 Table - View Browse Tool Report Tab
A 2 2025 Table - View Browse Tool Report Tab
B 2 2025 Table - View Browse Tool Report Tab
B 3 2025 Table - View Browse Tool Report Tab
B 4 2025 Table - View Browse Tool Report Tab
A 3 2032 Table - View Browse Tool Report Tab

 

If running today for example: Today's date falls in Quarter 3 so 3rd and 4th record should only get past the Filter (Out of T) (4th Quarter of 2023)

 

If running in october to december: As it falls in Quarter 4 of 2023, so records corresponding to Quarter 1 of 2024 must get out of T

 

Thanks

7 REPLIES 7
binuacs
21 - Polaris

@ShantanuDagar One way of doing this

image.png

ShantanuDagar
8 - Asteroid

@binuacs 

 

My way of writing data wasn't very clear.

 

The A/B is different column like a name column.

The number after that is the quarter in which data is lying.

The year after that is the year column.

And Table part is different column.

 

Like:

 

Name          Quarter        Year       Table

A                     3               2023        Table - View Browse Tool Report Tab
B                    3                2023        Table - View Browse Tool Report Tab
A                    4                2023        Table - View Browse Tool Report Tab

 

And so on..

So if we are running today (and today's date is falling in quarter 3 of 2023), so records of quarter 4 of year 2023 should be picked.

While if we run in quarter 4 of 2023 the quarter 1 of next year will be picked up.

binuacs
21 - Polaris

@ShantanuDagar Updated the workflow image.png

ShantanuDagar
8 - Asteroid

@binuacs 

It isn't working quite right.

 

Working only for the current quarter to filter quarter 4 records based on today's date/quarter.

 

When the quarter is 4 (or then DateTimeToday), it ain't filtering the records of 1st quarter of 2024, and gives 0 records out of T.

I think there is no part of adding year + 1 as well in case of changing quarter to 1, as even year should change from 2023 to 2024 and filter year=current date time year not giving anything.

binuacs
21 - Polaris

@ShantanuDagar It is not working for other quarters because it uses current quarter based on the current date (it is dynamic), once you are in the fourth quarter the filter will pick the 1st quarter of next year

ShantanuDagar
8 - Asteroid

Changing local pc time to some date in 4th quarter works until formula, updating quarters.

 

But filter not able to match any year or updating to 2024

binuacs
21 - Polaris

@ShantanuDagar comment on the and condition of the filter tool, which is also matching with the current year and the give year

image.png

Labels
Top Solution Authors