Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Mastering Change Data Capture: Read Now
cancel
Showing results for 
Search instead for 
Did you mean: 
durgabhavani
Creator III
Creator III

Help me in below scenario?

Hi All,

Please find the attached qvw.

I need to calculate the total number of profiles in application.

One customer number is counted as one profile. But suppose the same customer having the same trigger id on same date then also we need to count that customer as one profile.

Please help me in counting the profiles.

Thanks,

Durga

1 Solution

Accepted Solutions
JonnyPoole
Former Employee
Former Employee

Not sure i understand what you are trying to count.

To count the number of records in the table with the Customer field use

count( Customer)

....If 'CustomerA' appears on two records it will count as 2

To count the number of unique values in the Customer field use: 

count( distinct Customer)

....If 'CustomerA' appears on two records it will count as 1

If you want to count a customer as being different if they have the same customer value but a different trigger id then

count( distinct Customer&[Trigger ID])


If you want to count a customer as being different if they have the same customer value but a different DATE then


count( distinct Customer&DATE)


if you want to count a customer as being different if they have the same customer value but a different trigger id  OR DATE then


count( distinct Customer&[Trigger ID]&DATE)


View solution in original post

5 Replies
JonnyPoole
Former Employee
Former Employee

Not sure i understand what you are trying to count.

To count the number of records in the table with the Customer field use

count( Customer)

....If 'CustomerA' appears on two records it will count as 2

To count the number of unique values in the Customer field use: 

count( distinct Customer)

....If 'CustomerA' appears on two records it will count as 1

If you want to count a customer as being different if they have the same customer value but a different trigger id then

count( distinct Customer&[Trigger ID])


If you want to count a customer as being different if they have the same customer value but a different DATE then


count( distinct Customer&DATE)


if you want to count a customer as being different if they have the same customer value but a different trigger id  OR DATE then


count( distinct Customer&[Trigger ID]&DATE)


Anonymous
Not applicable

have you tried count(total(Customer Number))?

durgabhavani
Creator III
Creator III
Author

Hi Jonathan,

Brilliant explanation. Everything is working fine but not last one. pls find screenshot.

Errrrr.JPG

JonnyPoole
Former Employee
Former Employee

i think your data model has Date defined as:  DATE

replace 'Date' with 'DATE' keeping everything else the same

durgabhavani
Creator III
Creator III
Author

Perfect Jonathan. Thanks a ton.