General Discussions

Discuss any topics that are not product-specific here.

Filter specific day and time

deendrjophmc
5 - Atom

I've used this for filter tool but doesn't seem to work as intended  for the time part. The goal is to filter only the last update every Thursday at 8 am. But the run sometimes occur before 8 like 7:56 am.

 

DateTimeFormat([Last Update],"%A") = "Thursday"
AND
DateTimeFormat([Last Update],"%H") <= "8" 

 

Thank you!

2 REPLIES 2
atcodedog05
22 - Nova
22 - Nova

Hi @deendrjophmc 

 

Can you provide us with some data to work with and build a workflow?

atcodedog05
22 - Nova
22 - Nova

Hi @deendrjophmc 

 

The filter tool only works with row-level logic. I.e it only checks if it meets the given row cell value condition.

 

In this scenario, you also need to check other rows to see if this is the latest DateTime before 8 am. You can achieve this by using the below logic.

 

1. Filter all rows which are Thursday and Hour is less than 8 am

2. Use the formula tool to extract only the date. This is helpful to groupby date and check the latest time for each date

3. Use the sort tool to sort data by descending

4. Use Sample to pick 1st row groupby on the date. Refer to the below link to understand how to use the sample tool.

https://community.alteryx.com/t5/Interactive-Lessons/Sampling-Data/ta-p/85807

 

This way the latest DateTime before 8 am for each date is selected.

 

Give it a try you can refer to the below workflow if you get stuck

Spoiler
atcodedog05_0-1662006103391.png

 

Hope this helps : )

Labels
Top Solution Authors