# Qlik Sense App Development

Not applicable

## Total shows '0' for Conditional Counting in Qlik Sense Chart

Hello Guys,

I am trying to achieve conditional counting by comparing two measures A and B and count only when A>B. I was able to achieve this by a simple expression in chart measure

if(A>, count(A), 0).

The problem is with the Total in the Chart (Which I cannot remove in Qlik Sense) shows '0' for that measure. Please find the screen cap for the reference. Let me know if I am missing something. Thanks for your help.

1 Solution

Accepted Solutions
MVP

## Re: Total shows '0' for Conditional Counting in Qlik Sense Chart

Try this:

Sum(Aggr(If(A > B, Count(A), 0), Competition, A, B))

2 Replies
MVP

## Re: Total shows '0' for Conditional Counting in Qlik Sense Chart

Try this:

Sum(Aggr(If(A > B, Count(A), 0), Competition, A, B))

Not applicable

## Re: Total shows '0' for Conditional Counting in Qlik Sense Chart

Wow that was quick. I didn't know how it worked (I am new to Qlik) but will analyze the expression and make sure I remember this. Thanks Sunny.