Skip to content

Instantly share code, notes, and snippets.

@Zmey56
Created January 9, 2023 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zmey56/44ea3c4661310deb0466949af5d1ff0d to your computer and use it in GitHub Desktop.
Save Zmey56/44ea3c4661310deb0466949af5d1ff0d to your computer and use it in GitHub Desktop.
def get_group_by_expression(slice, group_by_slices_list, all_data=False):
if not all_data:
group_by_expression = ' date'
else:
group_by_expression = ' date, toStartOfFifteenMinutes(time) as time, time_'
if slice != 'total':
alias = group_by_slices_list[slice]['alias']
group_by_expression = group_by_expression + ',' + alias
return group_by_expression
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment