Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Alarkis
Contributor III
Contributor III

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)

Labels (4)
1 Solution

Accepted Solutions
Yoshidaqlik
Creator II
Creator II

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

View solution in original post

3 Replies
Yoshidaqlik
Creator II
Creator II

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
Contributor III
Contributor III
Author

Hey Yoshidaqlik

thank you for your help 

can you explain to me about the 

4)=1

part 

Yoshidaqlik
Creator II
Creator II

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