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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Upew
Contributor III
Contributor III

Kpi calculation issues

Hello, would love to hear your ideas for my problem

This is my table:

Customer

Product

Bought it or not

A

1

1

A

2

0

A

3

0

B

1

1

B

2

0

B

3

1

C

1

1

C

2

0

C

3

1

 

In my dashboard I put the product column into a filter panel and I want to create a KPI that count the number of customer that bought the product.

For example: When I choose product 1 and 3, I want the kpi to show 2 because there are only 2 customers that bought product 1 AND product 3 (costumer B and costumer C)

Any idea how can I do this?

Thanks a lot!

Labels (3)
3 Solutions

Accepted Solutions
vinieme12
Champion III
Champion III

as below

 

=Count({<Customer={"=sum(BoughtIt)=Getselectedcount(Product)"}>} Distinct Customer)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

vinieme12
Champion III
Champion III

"can i count also only the customer the bought this 2 product only? (and didn't buy any of the other products)"

that would as below

=Count({<Customer={"=count({<Product=>}distinct Product)=Getselectedcount(Product)"}>} Distinct Customer)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

vinieme12
Champion III
Champion III

you can use the same expression, replace Customer with ID

 

=Count({<ID={"=count(distinct Product)=Getselectedcount(Product)"}>} Distinct ID)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

6 Replies
vinieme12
Champion III
Champion III

as below

 

=Count({<Customer={"=sum(BoughtIt)=Getselectedcount(Product)"}>} Distinct Customer)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Upew
Contributor III
Contributor III
Author

Hey! Thanks a lot omg!

it looks like its working great. still need to do some validity test but its looks great!

At the moment, its counting all the customer that bought this 2 product and other products as well.

can i count also only the customer the bought this 2 product only? (and didn't buy any of the other products)

*i didnt upload the full table but in my original table i have more the 3 products and it will be nice to know which customer buying only a specific products

Tahnks alot!!

 

vinieme12
Champion III
Champion III

"can i count also only the customer the bought this 2 product only? (and didn't buy any of the other products)"

that would as below

=Count({<Customer={"=count({<Product=>}distinct Product)=Getselectedcount(Product)"}>} Distinct Customer)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Upew
Contributor III
Contributor III
Author

Hello,

would like to ask last question about this issuse please 

I Changed my table so now its looks like this:

ID           Product

1              1

1              2

1             3

2            2

2             3

3            1

4            1

4            2

4           3

5           2

 

I want to create the same KPI that will count only the ids that have all the product that i choose.

For example: when i choose product 1 and 2, and i want the kpi to count 2 (because there are 2 ids that have both product 1 and 2)

any suggestion how can i make it?

 

Thanks alot!!!!

vinieme12
Champion III
Champion III

you can use the same expression, replace Customer with ID

 

=Count({<ID={"=count(distinct Product)=Getselectedcount(Product)"}>} Distinct ID)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Upew
Contributor III
Contributor III
Author

Working Great!

Thanks alot.