Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Ehab1996
Contributor
Contributor

Issue in calculating the sum of customers account

I have two data tables: the first is the customers table, which contains 5,000 records, and the second is the accounts table, which contains 9,600 records. I linked the two tables using the customer code When I try to find out the number of customers who have accounts, the result shows zero, even though I used this function count(distinct(if(Account_ID,Customer_ID))) Can you help me with that?

Labels (1)
3 Replies
Rohan
Specialist
Specialist

Hi @Ehab1996 ,

Instead create a flag field in the accounts table  & use this :

Count(distinct {<Flag={"Y"}>} Customer_Code)

 

The If() that you have written is not correct. that's why it's getting evaluated as null & the count is showing 0.

Regards,

Rohan.

Anil_Babu_Samineni

The condition not fulfilled, perhaps this?

count(distinct if(Account_ID=Customer_ID, 1))

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
Ehab1996
Contributor
Contributor
Author

I don't think so, because before I used to do this condition and get the correct result