Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
Not applicable

COUNT SYNTAX

I have to count all the '1' numbers in the column 'RequestStatusID'


The column contains the numbers 1,21,922,etc......

I tried to use count but I had problems with the syntax....

Thanks

5 Replies
SunilChauhan
Esteemed Contributor

Re: COUNT SYNTAX

count({<RequestStatusID={'1'}>} RequestStatusID)


or

count(if(RequestStatusID=1, RequestStatusID))

Re: COUNT SYNTAX

Sum(If(RequestStatusID=1,1,0)

if you use count with the same expression even 0 values will be counted ...

let me know

rajeshvaswani77
Valued Contributor III

Re: COUNT SYNTAX

Hi,

You can use Sum(If(RequestStatusID=1,1,0))

thanks,

Rajesh Vaswani

ashwanin
Valued Contributor

Re: COUNT SYNTAX

If you have 1 always in front

=Count({<RequestStatusID={'1*'}>} RequestStatusID)

If you have 1 anywhere in field (e.g 210)

use : =Count({<RequestStatusID={'*1*'}>} RequestStatusID)

Not applicable

Re: COUNT SYNTAX

Thanks,

Now Each RequestID belongs to MeterID

I would like to count the RequestID per unique MeterID

How do I add DISTINCT to the second count you wrote me in your last answer?