Hi,
I tried executing the Row_number() function for the above scenario and its working as expected.
I assume the following could have possibly happened in your case. The query you executed from VQL shell could have had the ROW_NUMBER() function and it dynamically generated the numbers starting from 1. On the other hand when a view was created using this ROW_NUMBER() function, the dynamic results are mapped as static value in the respective column of the view. So when you query the view with associated filter, this static value is returned instead of dynamically starting from 1.
For example, let's say I have a view “View1” that has 10 rows, if I have a condition that return 5 rows, a VQL shell execution would give values 1 to 5 for each row of the view.
* Select row_number() over (partition by 1 order by ‘1’) as row_derived from <view1> where <condition1>;
Now, if I create a view “View2” out of the View1 such that the row_number() is mapped to a column say “row_derived” in View2.
A query like below having the same condition would not yield the same values, this is because row_derived is a fixed column value assigned to each row of the View whereas row_number() is dynamic value generated for the resultset.
* Select row_derived from <View2> where <condition1>;
You can refer to the [ROW_NUMBER](https://community.denodo.com/docs/html/browse/7.0/vdp/vql/appendix/syntax_of_condition_functions/analytic_functions_window_functions#row-number) section of the Virtual DataPort Administration guide for more detailed information.
Hope this helps!