mardi 23 juin 2020

Conditional column using threshold values

I have a table set up as follows:

Name    ScoreA    ScoreB    
Jimmy   0.95       0.95       
Claire  0.95       0.75      

What I would like to do is is have an output column that returns 1 if both scores are above 0.9, returns 0 if both scores are below 0.8 and returns 2 if both scores are within 0.8 < score < 0.9 OR if one score is above 0.9 and the other is below 0.9.

The output would look something like this:

Name    ScoreA    ScoreB   0/1/2  
Jimmy    0.95      0.95      1
Claire   0.65      0.75      0
Harry    0.85      0.82      2
Paige    0.91      0.82      2

Anyone have any ideas?

Thanks!

Aucun commentaire:

Enregistrer un commentaire