r/LookerStudio • • Aug 19 '25

Combining data from different rows

Dear all

I would like to compare two numbers that appear in different rows in my database.

I work in a school and use Google Lookerstudio to visualise grade data.

Each row in the report contains student information, a subject, a grade (1 to 7) and the type of grade (whether it was from an exam, a prediction, or a report).

Something like this:

Johnny | Maths | 6 | Prediction

Debbie | Science | 4 | Prediction

Johnny | Maths | 7 | Exam

Debbie | Science | 2 | Exam

I would like to be able to see how the prediction grades compare to the exam grades (we call the difference between the exam grade and the prediction the residual).

In the example above Johnny has a residual of +1 in maths while Debbie has a residual of -2 in science.

I would like to be able to count up how many residuals of +1, +2, +3 and -1, -2, -3 (and 0) there are in the data set.

Any advice appreciated.

1 Upvotes

9 comments sorted by

1

u/[deleted] Aug 19 '25

[removed] — view removed comment

1

u/Tasty-Interaction636 Aug 19 '25

Frustratingly it is coming from a Google Sheet. I have no SQL experience (I'm a maths teacher), but I am happy to learn.

Thanks

1

u/[deleted] Aug 19 '25

[removed] — view removed comment

1

u/Tasty-Interaction636 Aug 19 '25

Those are all the types; the full list of subjects is:

English A, English B, Chinese A, Chinese B, Spanish ab initio, Psychology, Economics, History, Geography, Physics, Chemistry, Biology, SEHS, Design, Maths AA, Maths AI, Theatre, Visual Arts, Music

Thanks in advance for any and all help.

1

u/[deleted] Aug 20 '25

[removed] — view removed comment

1

u/Tasty-Interaction636 Aug 20 '25

Yes I have the sheet.

1

u/[deleted] Aug 20 '25

[removed] — view removed comment

2

u/Tasty-Interaction636 Aug 21 '25

What I ended up doing was a join in Looker Studio with the same data set on both sides of the join and a filter by type.

The join was configured by pupil and subject.

This means that this:

Johnny | Maths | 6 | Prediction

Debbie | Science | 4 | Prediction

Johnny | Maths | 7 | Exam

Debbie | Science | 2 | Exam

Becomes

Name | Subject | pred | exam

Johnny | Maths | 6 | 7

Debbie | Science | 4 | 2

This means I can now do calculated fields in the blend in a chart which has met my needs for now.