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: 
andy8000
Contributor
Contributor

Bar Chart with counted expression and counted dimension

Hello everybody, 

i have two different tables:

  • Orders: CustomerID, Product
    • One CustomerID could order multiple identical products
  • Number of employees: CustomerID, Employees (1-10)

You'll find both tables at the bottom of this post (and in the attached files). 

Now I want to create a bar chart, displaying the Count of the ordered Product A on Y-Axis and the Count of companies with 5 employees on X-Axis.

The result should look like this:

Capture.PNG

 

I tried it with: 

Dimension: =count({<Product={'Product A'}>}Product)
Expressions: =count({<[Employees (1-10)]={'5'}>} CustomerID)

But it throws an error in calculated dimension. 

Could somebody please help me here :S
I would be very thankful 🙂

Orders:

CustomerIDProduct
9Product B
10Product A
10Product A
10Product A
10Product A
10Product A
11Product A
12Product A
12Product A
12Product A
13Product A
13Product A
14Product A
14Product A
14Product A
15Product A
15Product A
16Product A
16Product A
16Product A
17Product A
17Product A
17Product A
17Product A
17Product A
18Product A
18Product A
18Product A
18Product A

 

Number of employees:

CustomerIDEmployees (1-10)
92
1010
115
125
135
145
155
165
175
Labels (3)
1 Solution

Accepted Solutions
sunny_talwar

Try this

Dimension

=Aggr(Count({<Product = {'Product A'}>}Product), CustomerID)

Expression 

count(DISTINCT {<[Employees (1-10)]={'5'}, Product = {'Product A'}>} CustomerID)

 image.png

View solution in original post

2 Replies
sunny_talwar

Try this

Dimension

=Aggr(Count({<Product = {'Product A'}>}Product), CustomerID)

Expression 

count(DISTINCT {<[Employees (1-10)]={'5'}, Product = {'Product A'}>} CustomerID)

 image.png

andy8000
Contributor
Contributor
Author

Thank you for your answer 🙂
That's it! You made my day 😄