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: 
sguerra2
Contributor II
Contributor II

Count of IDs- Use of set analysis

Hi team,

Hope you are doing great!  I need your help! I am trying to perform a count with a set analysis... let me explain the situation:

I have two bases. The count i have to do is the amount of product code (from BASE 1) but considering the characteristics of BASE 2- (for example Juan is in ARG and the sector is GREEN) the amount that should result is : 9 because shouldnt consider CHILE and other SECTORS. However what I noticed is that if the Nurse number that Juan has in the BASE 2 is present in BASE 1 related to another sector (nurse 456), the product code is summarized (painted in red in the screen).... I need to exclude that one, so the numbers in the count are just for juan's sector in BASE 2.

 
 
  BASE 1     
        
 COUNTRYPROD CODEPRODUCTDOCTORSECTOR 1NURSE NUMBER
 ARG1APPLEJUANGREEN123 
 ARG2APPLEJUANGREEN456 
 ARG3APPLELUISGREEN789 
 ARG4APPLELUISGREEN1122 
 ARG5APPLECARLOSGREEN1455 
 ARG6APPLECARLOSGREEN1788 
 ARG7APPLEMARCOGREEN2121 
 ARG8APPLEMARCOGREEN2454 
 ARG9APPLEMARTAGREEN2787 
 ARG10APPLEMARTAORANGE3120 
 ARG11APPLEOSCARORANGE3453 
 CHI12LEMONJUANGREEN456 
 ARG12ORANGEJUANRED456 
 ARG13BANANA YELLOW  

 

BASE 2   
    
COUNTRYDOCTORSECTOR 2nurse number
ARGJUANGREEN123
ARGJUANGREEN456
ARGLUISGREEN789
ARGLUISGREEN1122
ARGCARLOSGREEN1455
ARGCARLOSGREEN1788
ARGMARCOGREEN2121
ARGMARCOGREEN2454
ARGMARTAGREEN2787
ARGMARTAGREEN3120
ARGOSCARGREEN3453

 

I used the expresion: COUNT({<sector 1=p(sector 1),PRODUCT=p(PRODUCT),COUNTRY=p(COUNTRY)>}prod code)

Really appreciate your help!

Regards.

Sofía

Labels (2)
0 Replies