I have a data set
Cashback table
user | order_amount
-------+------------
raj | 200
rahul | 400
sameer | 244
amit | 654
arif | 563
raj | 245
rahul | 453
amit | 534
arif | 634
raj | 245
amit | 235
rahul | 345
arif | 632
I want to calculate the percentile of each user order amount
and If the percentile of any user's order amount is more than 80 percentile then return 'Yes' else 'No' in new column Big_spender means he is one of the top spenders
output will look like
user | percentile | Big_Spender
-------+------------+------------
raj | 50 | NO
rahul | 40 | NO
sameer | 84 | YES
amit | 85 | YES
arif | 96 | YES