def METHOD_NAME(self):
    # to_char('2016-01-01'::date, 'day');
    # select extract(hour from timestamp '2001-02-16 20:38:40');
    day_of_week_and_hour_added = f"""SELECT *, 
    trim(to_char(datetime, 'day')) as dow, extract(hour from datetime) as hour 
    FROM ({self.sds.get_query()}) _"""
    hour_case = f"""(CASE 
    {" ".join(f"WHEN hour={hour} THEN {score}" for hour, score in enumerate(self.score_hour))}
    END)"""
    day_case = f"""(CASE 
            {" ".join(f"WHEN dow='{dow}' THEN {score}" for dow, score in self.score_dow.items())}
            END)"""
    location_cols = self.spatial_unit.location_id_columns
    query = f"""
    SELECT subscriber, {", ".join(location_cols)}, datetime,
           {hour_case} AS score_hour,
           {day_case} AS score_dow
    FROM ({day_of_week_and_hour_added}) AS subset_dates
    """
    location_cols = ", ".join([f"scores.{c}" for c in location_cols])
    sql = f"""
        SELECT scores.subscriber AS subscriber,
            {location_cols},
            SUM(score_hour)::float / COUNT(*) AS score_hour,
            SUM(score_dow)::float / COUNT(*) AS score_dow
        FROM ({query}) AS scores
        GROUP BY scores.subscriber,
                {location_cols}
    """
    return sql