I am performing “RANK” operation on a field which is mapped with another field.
Fields involved:
- “id” (Incremental record number for every entry/case)
- “case_check_id” (Unique value for every entry/case)
- “status” (Status of the entry/case)
To find the latest status of a case.
We need to perform rank operation on it like what is the max(id) per case_check_id.
Once we get the max(id) its related status is the current status for that case.
Till here we are good, its implemented.
Now there are 15 statuses all total, which are divided in to two slots:
1- With Scope
2- Without Scope
Things fall apart when we separate out status respective of its scope.
Requirement is - Rank should be calculated irrespective of scope.
But when we calculate rank, it is getting calculated twice once for With Scope and next for Without Scope.
Additionally RANK is calculated with in a date range which is provided as a onscreen filter.