Skip to content
Advertisement

Getting sum of an alias

Trying to take the sum of the alias studentsnotreviewed, what is the best way to approach this I’ve been stuck trying different things. I want to get the total number for the alias of studentsnotreviewed.

[Sample data]

School examID examstart examend studentsnotreviewed duedate sum
343 458092 Mar 16, 2021, 3:52 PM Aug 28, 2017, 12:59 AM 2 Aug 30, 2017, 12:59 AM 2
125 360216 Jan 7, 2021, 11:55 AM Jul 26, 2018, 11:17 PM 27 Jul 28, 2018, 11:17 PM 27

[Desired result] The sum of the alias for studentsnotreviewed.

Total studentsnotreviewed
29

Advertisement

Answer

I believe metabase supports WITH, so you can alias your whole query as a temporary block of data, and then reuse it as if it were a table:

Your query has a slight syntax error it seems – you mention # and don’t mention students st in the outer query.. I’m sure you can fix this up

I assumed you wanted the 29 as a value repeating in the resultset. If you literally just want a single value of 29, I suppose it could be given by:

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement