Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

Count value when field equals. Need Assistance

Need assistance with the following query

We have a table with a single column, field name "Answered" with values True and False

Answered

True

True

False

False

True

We need to count the True values ?  I've tried the following but it returns zero.. Not sure what I'm missing?

Count({<Answered={"True"}>} Answered)

1 Solution

Accepted Solutions
nateuntiedt
New Contributor III

Re: Count value when field equals. Need Assistance

Give this a shot:

Count({$<Answered={'-1'}>} Answered)

It appears that Sense is evaluating the Answered field as a number instead of a string so in this case true=-1, false=0.

Hope this helps.

17 Replies

Re: Count value when field equals. Need Assistance

It should work ... try to cancel all selections in the document ...

Could you send me your document?

Not applicable

Re: Count value when field equals. Need Assistance

Will  send later tonight. Many thanks 

Sent from my Samsung Galaxy smartphone.

MVP
MVP

Re: Count value when field equals. Need Assistance

Hi,

This expression

=Count({<Answered={'True'}>} Answered)


Should work, check whether True has any blank space in it or try clearing the selections.


Regards,

Jagan.

Re: Count value when field equals. Need Assistance

try this

=Count(if(lower(trim(Answered))='trim',Answered))

Not applicable

Re: Count value when field equals. Need Assistance

Sample.JPG

Not applicable

Re: Count value when field equals. Need Assistance

We have some data from phone reporting, Date field, Call ID,  Answered (True or False)

I'm then using Qlik to count the total number of calls per day - which works fine count

Im using a table then adding my date field as my Dimension and using the measure  Count([Caller ID])

Which is fine, I then want to add a third column to the table to count the number of "True" answered calls

I attempted this by adding a third column to the table and selecting measure using the expression as below:

=Count({<Answered={'True'}>} Answered)

!

Not applicable

Re: Count value when field equals. Need Assistance

I've attached the QVF file for reference - thanks

Not applicable

Re: Count value when field equals. Need Assistance

I've attached my qvf file for reference see other response thanks for your assistance

Re: Count value when field equals. Need Assistance

Please see attached.

It is working

Community Browser