You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/11/21 09:13:20 UTC

[GitHub] [superset] NikolayZakharevich commented on issue #13261: Feature Request: Add last business day option to time range filter

NikolayZakharevich commented on issue #13261:
URL: https://github.com/apache/superset/issues/13261#issuecomment-1321736535

   > You can currently utilize the Advanced date functions to get this:
   > 
   > ```python
   > dateadd(datetrunc(datetime('today'), week), 5, day)
   > ```
   
   
   I don't understand how to use Advanced date functions to achieve the requested functionality as they don't support conditional expressions.
   
   Let's say we have a dataset that does not have weekend data. The desired behaviour of the "last business day" option should return:
   - on Monday: `Friday <= col <= Friday`
   - on Tuesday: `Monday <= col <= Monday`
   - on Wednesday: `Tuesday <= col <= Tuesday`
   - on Thursday: `Wednesday <= col <= Wednesday`
   - on Friday: `Thursday <= col <= Thursday`
   - on Saturday: `Friday <= col <= Friday`
   - on Sunday: `Friday <= col <= Friday`
   
   
   The suggested expression works for Monday but not for the rest days of the week. What could be the alternative?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org