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: 
Anonymous
Not applicable

Count number

I have a table that has the center, count date, count.

Center

Count Date

Count

Completed

500

2/1/2016

0

0

2/2/2016

0

0

2/3/2016

0

0

2/4/2016

0

0

2/5/2016

0

0

2/8/2016

0

0

2/9/2016

0

0

2/10/2016

4385

1

2/11/2016

4180

1

2/12/2016

4192

1

2/15/2016

4217

1

2/16/2016

20

1

2/17/2016

20

1

2/18/2016

31

1

2/19/2016

51

1

2/22/2016

110

1

2/23/2016

81

1

2/24/2016

81

1

2/25/2016

86

1

2/26/2016

649

1

2/29/2016

690

1

Total

18793

14

I want to get to total times that a center had a count greater than 0. (So I am trying to create the Completed collum to get the totals.)

1 Solution

Accepted Solutions
sunny_talwar

You can also try:

Sum(Aggr(If(CountExpression > 0, 1, 0), Center, [Count Date]))

View solution in original post

7 Replies
swuehl
MVP
MVP

Try an expression like

=Count({<Count = {">0"}>} DISTINCT [Count Date])

sunny_talwar

You can also try:

Sum(Aggr(If(CountExpression > 0, 1, 0), Center, [Count Date]))

swuehl
MVP
MVP

Right, if Count in your table is an expression, not a field in a resident table, you can't use my set expression.

Then go with Sunny's solution where CountExpression needs to be replaced with the table chart expression you are using, of course (i.e. you can't use a column reference here).

clondono
Creator III
Creator III

Thank you Sunny, this helped me with an issue I am having on one of my apps!

Incorrect Null count in straight table

You rock!

Anonymous
Not applicable
Author

Sunny's solution is still giving me all 0s even if the Count is greater then 0.

swuehl
MVP
MVP

Could you post the expression you are using? Or maybe even a small sample QVW?

clondono
Creator III
Creator III

See attached QV sample I created using Sunny's expression.  It returns the correct count.