We are using Postgres and on our student
table, we have columns for letter grades [A, B, C, D, F]. We have two columns for previous grade and the current grade. I'm trying to find a way to run a report on how much the grades have changed for each record. So essentially, I want a field for current_grade-previous_grade
but since the values are text, I can't do that comparison easily. I was hoping that parseInt
in AWS QuickSight will parse a value for the grades but the documentation says it ignores non-numerical values. Since AWS QuickSight doesn't seem to solve this problem, how would I do this in my query in SQL when I don't have write access and can't create generated columns for this? I was hoping for something simple like:
SELECT id, report_card->'grade' as current_grade, report_card->'previous_grade' as old_grade, old_grade-current_grade FROM Students;