Closed kienli closed 2 years ago
And it does not iterate over 'breakout' section.
'dataset_query': {'database': 5,
'query': {'aggregation': [['distinct',
['field', 419, None]]],
'breakout': [['field',
414,
{'temporal-unit': 'day'}]],
'filter': ['not-null', ['field', 439, None]],
'source-table': 95},
'type': 'query'},
Hi @kienli, thanks for the feedback. I'll work on this on the weekend.
I found that aggregation can be quite tricky because of the custom aggregations:
Example 1
'dataset_query': {'database': 5,
'query': {'aggregation': [['aggregation-options',
['/',
['avg', ['field', 566, None]],
60],
{'display-name': 'tat1',
'name': 'tat1'}]],
'filter': ['and',
['=', ['field', 576, None], 'type'],
['not-null', ['field', 566, None]]],
'source-table': 103},
'type': 'query'},
Example 2
'dataset_query': {'database': 5,
'query': {'aggregation': [['aggregation-options',
['/',
['avg', ['field', 472, None]],
60],
{'display-name': 'tat1',
'name': 'tat1'}],
['aggregation-options',
['/',
['avg', ['field', 470, None]],
60],
{'display-name': 'tat2',
'name': 'tat2'}],
['aggregation-options',
['/',
['avg', ['field', 471, None]],
60],
{'display-name': 'tat3',
'name': 'tat3'}]],
'breakout': [['field',
473,
{'temporal-unit': 'day'}]],
'filter': ['and',
['=',
['field', 418, None],
'NY'],
['=', ['field', 560, None], 'type']],
'source-table': 95},
'type': 'query'},
Fixed in version 0.2.15
Hello,
I found that the function clone_card doesn't change the column_id to target_col_id for 'aggregation' part of the query here
My card_info has the following part
I assume that we have to iterate over aggregation part as well.
Metabase v0.43.0