cancel
Showing results for 
Search instead for 
Did you mean: 

Row Number Error in MV Spark SQL

nikhil_cr
Cosmonaut

Hi,

I’m trying to generate a Row Number using the query below, but it seems that Incorta is not returning the correct results. I checked the same query in another SQL editor, and the results were correct there. It seems either I'm missing something or there might be a bug in Incorta. 

I have attached the Sample file below, Appreciate if you can help me with this. 

SQL Query : Select *, row_number() over( partition by company, Supplier_code_JOIN, Item_code, Warehouse_code order by ( case when Outstanding_Quantity = ExcessPOSTPONE then 1 when Outstanding_Quantity < ExcessPOSTPONE then 2 else 3 end, Outstanding_Quantity desc, cast(order_date as date) desc ) ) as RowNum from Table

nikhil_cr_0-1733132385014.png

 

5 REPLIES 5

@amit_kothari  : Its via MV.