I am struggling with this query I am trying to do. I want to count how many times we went to a specific stage grouped by weeks. There is something very strange though, I can select count(stagename) which works, and also CreatedDate, which works, but when I combine them they somehow give an error.
select week_in_year(createddate), Count(StageName) from OpportunityHistory where StageName = 'x'group by week_in_year(createddate)
I hope you guys can help me with this. Thanks a lot in advance.