Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
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)

17 Replies
Anonymous
Not applicable
Author

Hi,

Trim it and try.

HTH

Not applicable
Author

I've attached my QVF file but it hasn't been approved (moderated)

My data is as such

Call ID   |    Answered   |    Date   |

121                True            10/10/15

122                True             10/10/15

123                False           10/10/15

124                True              11/10/15

125                False             11/10/15

126                True              12/10/15

Need the following (I can get the total easily =count (Answered)  but  getting how many calls are answered for a particular day is beyond me.

Date               |      Total Calls (Count)        |     Answered  (Count)

10/10/15                     3                                             2

11/10/15                     2                                             1    

12/10/15                     1                                             1

Count({<Answered={"True"}>} Answered)    Returns 0 for each day   (Guess Im missing something to do with the date?)

Not applicable
Author

Not sure what you mean. Ive attached my qvf file above for reference. Appreciate your assistance.

I need to see the total count for each day total calls and total answered calls ie. "True"

Not applicable
Author

Maybe my issue is to do with the date . Please refer to my qvf which i posted above

Anonymous
Not applicable
Author

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.

jagan
Luminary Alumni
Luminary Alumni

HI,

Try like this

LOAD

CallID,

Answered,

Date(Floor(Date)) AS Date

FROM DataSource;

Now try below expression

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


Hope this helps you.


Regards,

Jagan.

raju_insights
Partner - Creator III
Partner - Creator III

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

This is what u need

Capture3.JPG

Not applicable
Author

Thanks this did it