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

Help please - Difficulties to create a Table with the Right Info

Hello again,

  I have this data:

    

CompanyIdGroupIdOrderId
C01G011
C01G022
C01G053
C02G021
C02G042
C03G011
C03G022
C03G053
C03G064
C03G075

And I need to show a table that will show the number of distinct companies grouped by GroupId. The important thing is that a company has to be counted only once in the available group with the maximum OrderId.

So here you are some examples:

1) With no filters

GroupIdNumDistinctCompanies
G010
G020
G030
G041
G051
G060
G071
TOTAL3

2) Filtering groups G01, G02 and G06.

GroupIdNumDistinctCompanies
G010
G022
G061
TOTAL3


Do not hesiate to ask if you have any doubt and many many thanks in advance.

Javier

2 Replies
chiru_thota
Specialist
Specialist

Please have look at attached QVW . But I am not able to understand your question (2)

Max groupID by company.jpg

swuehl
MVP
MVP

Maybe using a dimension GroupId and an expression

=sum(aggr(if(OrderId= max(total<CompanyId> OrderId),1),CompanyId, GroupId))