Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Any help please with an expression to count the Subject IDs for each Student ID
Student ID | Subject ID |
123 | 90A |
123 | 45B |
123 | 23C |
223 | 12B |
223 | 34H |
333 | 56J |
333 | 78U |
333 | 90A |
The output should be like
Student ID | Count of Subject ID |
123 | 3 |
223 | 2 |
333 | 3 |
Thanks,
MRM
TABLE:
LOAD * INLINE [
Student ID,Subject ID
123 ,90A
123 ,45B
123, 23C
223, 12B
223, 34H
333 ,56J
333 ,78U
333 ,90A ];
TABLA2:
LOAD [Student ID],
COUNT([Student ID]) AS [Count of Subject ID]
RESIDENT TABLE
GROUP BY [Student ID];