# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Contributor II

## Count Dimension only if Measure is positive

Trying to make simple calculation, tried both of below formulas, neither worked (still counts brands with Qty=0), please, help:

1. if(sum( [SalesQty]) > 0, count( distinct [Brand]),0)

2. count(

aggr(sum( {<SalesQty={">0"}>} Qty, Brand)

)

Tags (1)
1 Solution

Accepted Solutions
MVP

## Re: Count Dimension only if Measure is positive

Count(DISTINCT {<Brand = {"=Sum([SalesQty]) > 0"}>} [Brand])

16 Replies
Honored Contributor III

## Re: Count Dimension only if Measure is positive

may be like this

count(

aggr(sum( {<SalesQty={">0"}>} Qty), Brand)

)

Honored Contributor II

## Re: Count Dimension only if Measure is positive

let's try this expression below:

count( {< Brand = {"=Sum(SalesQty)>0"} >} distinct Brand )

Hope it helps.

Valued Contributor

## Re: Count Dimension only if Measure is positive

Maybe this

Count(if(Aggr(sum( [SalesQty]),Brand)>0,Brand))

Valued Contributor II

## Re: Count Dimension only if Measure is positive

Hi

or maybe this :

sum(if(aggr(sum(SalesQty),Brand) >0,1))

MVP

## Re: Count Dimension only if Measure is positive

Count(DISTINCT {<Brand = {"=Sum([SalesQty]) > 0"}>} [Brand])

Contributor III

## Re: Count Dimension only if Measure is positive

May be this -

count(if(sum( [SalesQty]) > 0, distinct [Brand]))

Contributor II

## Re: Count Dimension only if Measure is positive

the result includes 0 values

Contributor II

## Re: Count Dimension only if Measure is positive

the result returns "-"

MVP

## Re: Count Dimension only if Measure is positive

QlikView and Qlik Sense are case sensitive, have you checked if the field names are right?