Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
goro2010
Creator
Creator

If Expression - Distinct Count

Good Day,

I need help with the following.

11.PNG

I have got my expression correct of the total buying customers, my problem is that I am struggling to get the buying customers correct, what the expression must do is the following:

If "Customer Number" have 1 or more of a product bought, then only do the distinct count, else do not count the "Customer Number".

Thank you for the support!!

Kind Regards,

Jan

19 Replies
prieper
Master II
Master II

Then the 50 represents all customers, who bought shirts, pants etc.

SUM(TOTAL DISTINCT CustomerNumber)

should do then

Peter

edit: added DISTINCT to formula

goro2010
Creator
Creator
Author

Peter,

Thank you, I am getting there

Now, it is giving me the correct overall number of customers in the database, but when I expand it, it doesn't split it by total customers allocated to each warehouse but all together.

For example, if warehouse 2 has 100 customers allocated, then it shows also 150 customers as it combines warehouse 1 (50 customers) and warehouse 2 (100 customers) together.

How can I get it to give the total customers of each warehouse when expanding the chart?

Edit:

When expanding, if a warehouse has 50 customers allocated to it, it needs to show all 50 customers, one expression showing that this is a customer linked to the warehouse (TOTAL) does give it in a number but does not physically show the customer.

Thank You!

prieper
Master II
Master II

Then you need to add the distinguisher as well:

COUNT(TOTAL DISTINCT <Warehouse> CustomerNumber)

This should deliver the number of customers, regardless the dimension, except for Warehouse

goro2010
Creator
Creator
Author

Hi Peter,

It still combining the total customers for both warehouses, warehouse 1 (50 Customers) plus warehouse 2 (100 customers), giving me a total for both of 150 when expanding.

Also,

When I expand, I see the number 150, but it does not show all the customers, only the ones who bought.

My idea behind this is to build a penetration report, to see how many of the customers bought certain products, and we need to be able to identify the ones that haven't bought anything by customer level

Thank You

vishsaggi
Champion III
Champion III

Sometime you get quick resolutions if you can share your sample data. If it is confidential just scramble and send us a sample. How you do ?-> Preparing examples for Upload - Reduction and Data Scrambling

goro2010
Creator
Creator
Author

Thank You,

Please check screenshot below:

Products is showing the overall correct number, the total database is 3931 customers, but once you expand it, it is listing all the warehouses, each warehouse have about 50 - 80 customers allocated to each, but as per example below, it stills shows the overall amount, not the amount of customers allocated to each warehouse.

Thank You!

18.PNG

goro2010
Creator
Creator
Author

This is my current expression:

=Count(TOTAL DISTINCT{<OrderDate=>} [account with Prefix])

Thank You

goro2010
Creator
Creator
Author

Hello,

I have just checked, when I click on one of the wholesalers, the total is correct for that wholesaler.....

How can I get these numbers without clicking on them

Thank You

goro2010
Creator
Creator
Author

19.PNG

vishsaggi
Champion III
Champion III

What happens when you try this:

=Count(TOTAL DISTINCT{<OrderDate=, Warehouse=>} [account with Prefix])