Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Count based on other information

Hi All.

I am trying to count the number of customers if the condition is met, but I don't get the correct answer.

Ex.

Pol_noinfo_nocustomers
1122312515A
123311223B
105053105053C

I used:

if(Pol_no = info_no),count(distinct customers))

What else can I try to give me the answer of 2?

1 Solution

Accepted Solutions
stigchel
Partner - Master
Partner - Master

Try with

=Count({<Pol_no=P(info_no)>} customers)

View solution in original post

16 Replies
sunny_talwar

May be this:

=Count({<customers = {"=Pol_no = info_no"}>}DISTINCT customers)

sunny_talwar

In your above example, the answer should be 1, right? Only for the last row Pol_no = Info_no?

krishna_2644
Specialist III
Specialist III

if( Pol_no = info_no ,customers)  


if 'Customers' column contains the 'number of customers' then y do u want count again?

sunny_talwar

Or =Count(DISTINCT If(Pol_no = info_no,  customers))

krishna_2644
Specialist III
Specialist III

if you want to count on front end then use Set expression as sunindia‌ 's

Anonymous
Not applicable
Author

Hi,

maybe you want to have 1 for total result.

Regards.

stigchel
Partner - Master
Partner - Master

Try with

=Count({<Pol_no=P(info_no)>} customers)

Anonymous
Not applicable
Author

Hi. No the answer should be 2. it shouldn't look at the order of the values, if the number is in col 1 and in col 2 it should be counted. thus the answer should be 2

11223 = 11223

105053= 105053

sunny_talwar

You have a typo in your sample

Capture.PNG