Hi, I created a field StorageReportIndicator in a table to rank the records in the table.
This rank is a SQL window function RANK which combines table fields initially loaded from the data source (StorageUnit and ReferenceDateTime below) and lookup fields via table joins (DSA.Datum table, fields WeekKey and DayOfWeek).
Goal is to have a rank to determine the first record of each week for each storageUnit. The outcome afer execution is that all records have rank 1 which is incorrect. I verified this with the same SQL statement in Management Studio.
Could it be that this window function does not have the right result since the lookup is done after the rank is calculated? Note, the table is not historical and incremental.
Anyone with experience with this case and is there a proper solution?