Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Alarkis
New Contributor

Display User with most orders in specific step

Hello,

What to Display User with most orders in this step

Count({<DateType = {'Action_Date'}, Year ={$(vMaxYear)} ,STEPNAME={'Approval'},TASK_ID ={'ApprovalTask'}>}distinct Order_NO)

How i can use Aggr() or Rank() to display only the name of user with most orders in this step

(Assuming user field is USER_ID)

1 Solution

Accepted Solutions
Yoshidaqlik
Contributor

Re: Display User with most orders in specific step

hi

can do it that way

Aggr(
	if(
		Rank(Count({<DateType = {'Action_Date'}, Year ={$(vMaxYear)} ,STEPNAME={'Approval'},TASK_ID ={'ApprovalTask'}>}distinct Order_NO),4)=1
		,USER_ID
		
	)
,USER_ID)

Regards 

YoshidaQlik https://www.youtube.com/channel/UC1I9P8MqCZEhB6Nw3FdSqng
3 Replies
Yoshidaqlik
Contributor

Re: Display User with most orders in specific step

hi

can do it that way

Aggr(
	if(
		Rank(Count({<DateType = {'Action_Date'}, Year ={$(vMaxYear)} ,STEPNAME={'Approval'},TASK_ID ={'ApprovalTask'}>}distinct Order_NO),4)=1
		,USER_ID
		
	)
,USER_ID)

Regards 

YoshidaQlik https://www.youtube.com/channel/UC1I9P8MqCZEhB6Nw3FdSqng
Alarkis
New Contributor

Re: Display User with most orders in specific step

Hey Yoshidaqlik

thank you for your help 

can you explain to me about the 

4)=1

part 

Yoshidaqlik
Contributor

Re: Display User with most orders in specific step

Hi

4)=1

, 4) serves to inform the Rank function that does not repeat the placement, that a number is always incremented for subsequent positions

= 1

is to inform the if function to only bring the values when the rank function is 1

Regards 

YoshidaQlik https://www.youtube.com/channel/UC1I9P8MqCZEhB6Nw3FdSqng