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: 
ZoeM
Specialist
Specialist

Count values greater than specified

Hi Community.

I am hoping someone can help me formulate an expression that counts  how many dimensions meet a specific requirement.

In the attached dashboard, I need to populate 3 fields in the straight table: 1 Try, 2 Tries and > 2 Tries.

1 Try = # Components that were tried only once

2 tries = # Components that were tried a sum of two

> 2 Tries = # Components that were tried greater than sum of 2 times. 

I truly appreciate it.

1 Solution

Accepted Solutions
sunny_talwar

Is this what you are after?

image.png

View solution in original post

9 Replies
vvira1316
Specialist II
Specialist II

Can you please include your expected result? You can create that manually in an excel to illustrate it. It is not clear what is the expectation.

The table are behaving in certain way as some of the dimensions are not part of the table, so values are getting grouped based on the dimensions that are part of that table.

ZoeM
Specialist
Specialist
Author

If you look at the # Tries per Component Straight Table, the expected result should be:

1 Try = 1 component (1123)

2 Tries = 2 Components (1124, 1123)

> 2 Tries = 3 Components (1124, 1122 (for Jeep), 1122 (for Dodge))

vvira1316
Specialist II
Specialist II

Based on what groupings (dimensions) you will be getting these counts.

ZoeM
Specialist
Specialist
Author

IndustryMakeComponents1 Try2 Tries> 2 Tries
 Total Tests  123
CarDodge1122  4
CarJeep1122  7
CarDodge1123 2 
CarJeep11231  
CarDodge1124 2 
CarJeep1124  6

 

Let me know if the above helps, so each car line (Dodge, Jeep) will go through three types of testing and we want to find out how many tests it took to complete each component (1, 2, >2)

sunny_talwar

Is this what you are after?

image.png

ZoeM
Specialist
Specialist
Author

This is exactly what I am after Sunny!!

Thank you Community.

ZoeM
Specialist
Specialist
Author

hey Sunny, what if Make = Dodge and Component = 1122 had two instances of 1 on 1st Try? So then the 1 Try would have to be counted twice, is there any way of counting Distinct in the expression?

sunny_talwar

Would you be able to update the qvw to show the issue?

ZoeM
Specialist
Specialist
Author

Not a problem, please see attached.

I created Component 1121 associated with Jeep and it is showing 2 Tries for a value of 2, when it should be two 1122 line items each completed once.

Dodge Charger 1122 should show two 1 Tries, one 2 Tries, and one > 2 Tries