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

count when cell is 1

hi all,

i made IF expression that include two conditions:

if($(mFTDs$)<2000 and $(mNetDeposit)>=2000,1,0)

if the two conditions are TRUE it will show 1,

the problem is that the TOTAL cell in bottom of the chart, is not count when the cell is TRUE.

the TOTAL is 0.

how can i change it that the TOTAL will count how many times is 1.

thank you

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try something using advanced aggregation (or total mode sum-of-rows for a straight table, option in expression tab):

=sum( aggr(

if($(mFTDs$)<2000 and $(mNetDeposit)>=2000,1,0)

, YOURTABLEDIM1, YOURTABLEDIMENSIONDIM2

))

View solution in original post

4 Replies
swuehl
MVP
MVP

Try something using advanced aggregation (or total mode sum-of-rows for a straight table, option in expression tab):

=sum( aggr(

if($(mFTDs$)<2000 and $(mNetDeposit)>=2000,1,0)

, YOURTABLEDIM1, YOURTABLEDIMENSIONDIM2

))

Not applicable
Author

i think almost:

i have 3 dimensions so i write like this:

=sum( aggr(

if($(mFTDs$)<2000 and $(mNetDeposit)>=2000,1,0),dim1

, dim2, dim3

))

now is counting but he ignore the expressions:

if($(mFTDs$)<2000 and $(mNetDeposit)>=2000,1,0)

he put 1 in place that not according to this IF.

THANK YOU

swuehl
MVP
MVP

How have you defined your variables?

Could you maybe upload a small sample?

Not applicable
Author

its working good now,

thank you very much swuehl.

eran