I am using DB Browser for SQLite. Feel free to recommend another free GUI or software that uses SQL if SQLite is the problem.
I need to take the values from the percent_rank() function and use them for a later calculation. This could be done by exporting these values to a new table or appending them to the existing table (preferred). I don't think it is possible to reference these calculated columns. I cannot directly populate these columns because the UPDATE SET function will not work with the percent_rank() functions.
I have tried the following code based on this question. The code works to display the calculated values (Loan_def_rank) but the original data is unmodified.
SELECT a.entity_uuid,
a.name,
b.Loan_def_Rank
FROM data as a INNER JOIN
(SELECT entity_uuid,
percent_rank() OVER (PARTITION BY college_type ORDER BY loan_def_rate DESC)
AS Loan_def_Rank,
FROM data GROUP BY entity_uuid) as b
ON a.entity_uuid = b.entity_uuid;