Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
paulwalker
Creator III
Creator III

get max data count of records

Hi Community,

I have 3 columns Name, Type and ID

Simple count I have to show which is working fine as below.

paulwalker_0-1699437872543.png

Created composite key like Name&'-'&Type and my expression aggregated based on Name.

below values are correct, but have to show Type value should be maximum count data.

Here first record is correct ABC-A, but second record should be BCA-D because the value of D is greater than C

paulwalker_1-1699438063241.png

Output should be

paulwalker_2-1699438330128.png

@tresesco@MayilVahanan,  @Kushal_Chawda@marcus_sommer@stevedark, @sunny_talwar  and experts can you please help

Thanks in Advance !

 

 

 

Labels (3)
11 Replies
paulwalker
Creator III
Creator III
Author

Could you please check the test app, unable to fetch the records.

PFA,

marcus_sommer

In general it should work like described above, per:

firstsortedvalue([Book of Business], -aggr(count(ICX_Patients&[Book of Business]), Payer, [Book of Business]))

Not here included is the distinct in the count because it's not clear if it's relevant respectively in which way and then where. Also the set analysis as it just complicates the comprehending - just select the test data-set(s) and if everything worked there you may transfer any of them in the inner- and/or outer-aggregations.

Also the other "complications" like restricting to top n and/or the sorting and/or any partial results and/or any NULL handling should be added step by step.