Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Ranking based on multiple criteria

Hi All, 

 

I have the following data: 

NameStatusDateTime
A12020/01/05 17:59:57
A12020/01/05 17:59:59
A22020/01/05 17:59:35
B12020/01/05 17:59:54
B12020/01/05 17:59:55

 

I need to rank my table based on status and date. 

I want to rank my table based on status = 1 with Desc datetime. 

So my O/P should look like as follows: 

 

NameStatusDateRank
A12020/01/05 17:59:591
A12020/01/05 17:59:572
B12020/01/05 17:59:553
B12020/01/05 17:59:544

 

I have tried the query which can rank based on the date (Desc) but as soon as I am clubbing it with filter all the records are getting ranked as "1". 

 

I can not add a column to the dataset no I need to restrict myself to the measure. 

 

Thanks

7 Replies