You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "GODFATHRII (via GitHub)" <gi...@apache.org> on 2024/08/05 19:50:30 UTC

Re: [I] I want to specify custom time grain [superset]

GODFATHRII commented on issue #15037:
URL: https://github.com/apache/superset/issues/15037#issuecomment-2269797554

   I used this in superset_config.py file, it doesn't work and show me any options for some reason.
   TIME_GRAIN_ADDONS = {"WS_WED": "Week starting Wednesday", "WS_THURS": "Week starting Thurday"}
   
   TIME_GRAIN_ADDON_EXPRESSIONS = {
       "clickhouse": {
           "WS_WED": """
               toDateTime(
                   intDiv(
                       toUInt32(
                           toDateTime(
                               addDays({col}, 3 - toDayOfWeek(toDateTime({col})))
                           )
                       ),
                       2
                   ) * 2
               )
           """,
         "WS_THURS": """
               toDateTime(
                   intDiv(
                       toUInt32(
                           toDateTime(
                               addDays({col}, 4 - toDayOfWeek(toDateTime({col})))
                           )
                       ),
                       2
                   ) * 2
               )
           """,
       }
   }


-- 
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