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: 
ziabobaz
Creator III
Creator III

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)

)


1 Solution

Accepted Solutions
sunny_talwar

How about this

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

View solution in original post

16 Replies
arulsettu
Master III
Master III

may be like this

count(

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

)

agigliotti
Partner - Champion
Partner - Champion

let's try this expression below:

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


Hope it helps.

prat1507
Specialist
Specialist

Maybe this

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

ogautier62
Specialist II
Specialist II

Hi

or maybe this :

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

sunny_talwar

How about this

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

isingh30
Specialist
Specialist

May be this -


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


ziabobaz
Creator III
Creator III
Author

the result includes 0 values

ziabobaz
Creator III
Creator III
Author

the result returns "-"

sunny_talwar

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