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: 
Anonymous
Not applicable

Max function with conditon

Hi ,

Can anyone help me in finding

Max Item_Sold made by the salesman in each company?

Result is given below in the table.

  

CompanySales_ManIteam_Sold
Senthil SADANANDAMCLA15
Christophe BORDAISGOL35
Rameela SEEWOOSUNGKURLOI1
Dani REUTER-GUHLQUO7
George EYEROORSES

6

For Input please find the attachment.

1 Solution

Accepted Solutions
Anil_Babu_Samineni

And If you want to exact outcome use this

First Expression

FirstSortedValue(Sales_Man, -Aggr(Sum(Iteam_Sold),  Sales_Man))

Second expression same in above

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

6 Replies
Anonymous
Not applicable
Author

Sorry the result I want is

   

CompanySales_ManIteam_Sold
CLASenthil SADANANDAM15
GOLChristophe BORDAIS35
LOIRameela SEEWOOSUNGKUR1
QUODani REUTER-GUHL7
SESGeorge EYEROOR6
Anil_Babu_Samineni

May be this?

FirstSortedValue(Iteam_Sold, -Aggr(Sum(Iteam_Sold),  Sales_Man))

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anil_Babu_Samineni

And If you want to exact outcome use this

First Expression

FirstSortedValue(Sales_Man, -Aggr(Sum(Iteam_Sold),  Sales_Man))

Second expression same in above

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Thanks, Anil

It's working fine

Anil_Babu_Samineni

Excellent, Please close this thread by flag of Correct Answer

Qlik Community Tip: Marking Replies as Correct or Helpful

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
daveamz
Partner - Creator III
Partner - Creator III

Hi,

I prefer creating a flag in the script. You have more control over the output and also it is easier to debug.

Check the attach.

Regards,

David