below you can see my query it returns the date by month and I want to see a trend arrow in relation from last month to two months ago. Can someone tell me what is going wrong here?
select sum(users), date_trunc('month', date) as "Month" from analytics_googleanalyticsusers
where date between {{startdate}} and {{enddate}} and project_id={{project_id}}
and cast(schema as int) = -1
group by date_trunc('month', date)
Hi @snake-py
Please post “Diagnostic Info” from Admin > Troubleshooting, and which database type you are querying.
What do you mean with “trend not working” - what isn’t working, are you getting error, …?
I would guess that you are not returning data in format that Metabase can understand (since this is SQL instead of through the GUI).
Well I am querying the sum of user and accumulate by month
Mas Select return two cols one of type date and one of type int. When I select the trend I want to see the change from one month to another. Currently, within in trend, I am only getting time-based options.
I also dont see any output anymore.
@flamber
I looked ath the GitHub Post but I am not sure what they mean by - group by Quantity:unbinned and CreatedAt:Month?
My quantity would be the sum of users, but I cannot group after the sum?
select sum(users), date(date_trunc('month', date)) from analytics_googleanalyticsusers
where date between {{startdate}} and {{enddate}} and project_id={{project_id}}
and cast(schema as int) = -1
group by date(date_trunc('month', date))