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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
cm
Contributor II
Contributor II

Formula Returning Undesired Number

Probably an easy diagnosis for you experienced people out there, but I have a KPI that's returning a wild number when I'm using a filter pane.

Objective is to show number of Gang Members arrested. Data column has many different gang names, along with "none/null", which I exclude by counting the following:

KPI expression is: count({<[Gang Name]) /= {'NONE/NULL'}>} [Arrests]).

The above expression works correctly when there are no filters. 

When I filter by a Specific Gang Name in a filter pane, however, the same KPI shows a pretty crazy number: count([Arrests]) - count([Gang Name]) + count ([Specific Gang Name]).

Using the $ modifier helps to get the KPI correct when a Gang Name filter is on, but then removing the filter returns the full: count([Arrests]).

Any advice?

Thanks!

CM

1 Solution

Accepted Solutions
Lisa_P
Employee
Employee

Try this:

count({<[Gang Name]) -= {'NONE/NULL'}>} [Arrests]

Count arrests for selected gangs except NONE/NULL

View solution in original post

3 Replies
vishsaggi
Champion III
Champion III

To exclude values None/Null may be you should use like

=Count({< [Gang Name] -= {'NONE/NULL'} >} [Arrests])

and for your KPI try below?

count([Arrests]) - (count([Gang Name]) + count ([Specific Gang Name]))

Lisa_P
Employee
Employee

Try this:

count({<[Gang Name]) -= {'NONE/NULL'}>} [Arrests]

Count arrests for selected gangs except NONE/NULL

Channa
Specialist III
Specialist III

count({<[Gang Name]) -= {'NONE','NULL'}>} [Arrests])

 

Channa