Sort 5 top

Hi,

I got some issue to extract the 5 top count companies with the status (Postpone).

I created the slice name Top Sort and  connected it to the main data name (Data), i used the expression  in the Row filter condition:IN([ID], TOP(ORDERBY(Previous Month [ID], [Status], FALSE), 5))

Previous Month: slice showing the previous month

Status: Enum column with the  two options : Postpone, Proceed

I tried many  expressions but the results were still wrong. 

Please advice

  

 

0 5 105
5 REPLIES 5


@Mouldi_Zeghouan wrote:

the 5 top count companies with the status (Postpone).


You may want to mention count of what parameter or what column has that count parameter?

 

 

Thank you for your reply.

Yes i have the virtual column name as Previous Month Count Postpone to count the monthly number of Postpone for each company the formula that  i used is: 

COUNT( FILTER(
Previous Month ,
AND(

[Company] = [_THISROW].[Company] ,
IN( [Status] , LIST( "Postpone" , "Service" ) )
)
) )

Okay thank you. You could try the below expression

condition:IN([ID], TOP(ORDERBY(Previous Month [ID], [Previous Month Count Postpone],  TRUE), 5))

But above approach could be probably improved. I will post back if it can be improved.

Thank you for your reply.

I tried you expression and  the result show more that 5 companies and the wrong  5 companies were postponed for the previous month,please see the attached : 

Slice filter 5 companies.png

 

Not sure what you are looking for the order seems to be correct in descending order. If you are looking for ascending order, please replace TRUE in expression with false.

Regarding more than 5 records, by values there are only 4  count values 6, 3, 1 and 0 , so all rows with those count values are appearing.

Top Labels in this Space