Hello! Quick and possibly simple MAQL question. ...
# gooddata-platform
Hello! Quick and possibly simple MAQL question. If I have a table of events, each with a user_id and course_id, as in the screenshot, is there an easy way to generate the COUNT of
user_id, course_id
combinations? e.g. in this set of data the all time count should be 4, as the user_id 1, course_id 1 combination is repeated. Struggling to find a way to aggregate based on two attributes without adding a new attribute to the data set and feel like we're missing something obvious
Hi Drew! The way how to do it is to first count the number of users for each course, and then sum the result:
SELECT SUM(SELECT COUNT(user_id) BY course_id)
. Check out this course for the full explanation and other examples
Ah that is great - need to dig into the University resources more, clearly. Thanks!
👍🏻 1