Skip to content

Conversation

@jeremyborg
Copy link

If numeric data is stored as String, one will not be able to perform aggregations on it. This fix provides a solution to this problem.
Example:
aggregations={"total": expression("amount", "doubleSum")},
will perform doubleSum on the "amount" field and return the result as "total"

If numeric data is stored as String, one will not be able to perform aggregations on it. This fix provides a solution to this problem.
Example: 
aggregations={"total": expression("amount", "doubleSum")},
will perform doubleSum on the "amount" field and return the result as "total"
return {"type": "hyperUnique", "fieldName": raw_metric}

def expression(raw_metric, aggregation):
return {"expression": "\""+raw_metric+"\"", "type":aggregation}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return {"expression": '"{}"'.format(raw_metric), "type": aggregation}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants