We are trying to migrate the SQL queries from Netezza to Snowflake. And got stuck in Percent_rank function of how differently they are used in both. below is the query getting fired in Netezza
Netezza code
Select
percent_rank(x.id,x.rate) within group(order by k.date)
from emp_sales x, emp_order k
where x.inv = k.inv;
Snowflake Converted Code
Select
percent_rank() over (partition by x.id,x.rate order by k.date)
from emp_sales x, emp_order k
where x.inv = k.inv;
However It is throwing error.
k.date is not a valid group by function.
I am stuck in this as not able to figure out how to replicate this. Please suggest.