Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

count if multiple dimension

Hi Everyone,

Please help.

I'm trying to count those ID Conversations that were answered within 30seconds.

count id conversations if [tAnswered]<=30 and [nAnswered] =1

    sample.JPG

I just do not know how to insert the [nAnswered] condition on the below.

Count({<[Aggr tAnswered]={'<=30'}>}Distinct [ID: Conversation])

1 Solution

Accepted Solutions
pradosh_thakur
Master II
Master II

Hi Isabel

try this


Count( Distinct {<[Aggr tAnswered] ={"=sum([Aggr tAnswered])/1000<=30"},[Aggr nAnswered] ={1}>} [ID: Conversation])



or


sum(If([Aggr tAnswered]<=30 and [Aggr nAnswered] =1,1,0))

Learning never stops.

View solution in original post

12 Replies
luismadriz
Specialist
Specialist

HI Isabel,

Please try this:

Count( Distinct {<tAnaswered={"<=30"},nAnswered={1} >} [ID: Conversation])


I hope this helps,


Luis

Anonymous
Not applicable
Author

I do not know the reason why it is counting 32.38 . It should be 0

wrong.JPG

luismadriz
Specialist
Specialist

But if you only want it in a table like you have in the post then you just need a calculated one:

If(tAnaswered<=30 and nAnswered=1,1,0)


If you need it as a KPI then this should do:

Count( Distinct {<tAnaswered={"<=30"},nAnswered={1} >} [ID: Conversation])


I hope this helps,


Luis

luismadriz
Specialist
Specialist

I think it's because 32.38 comes from a Sum, and you seem to be trying to use the direct value

Anonymous
Not applicable
Author

If(tAnaswered<=30 and nAnswered=1,1,0)

this returns everything to 0.


wrong.JPG2.JPG

Anonymous
Not applicable
Author

hmmm

Count( Distinct {<[Aggr tAnswered/1000] ={"<=30"},[Aggr nAnswered] ={1}>} [ID: Conversation])

how can I insert sum function here? I should sum the tAnswered

luismadriz
Specialist
Specialist

You're not comparing it correctly as you're displaying Sum(tAnaswered) but then using the field without aggregation in your IF

luismadriz
Specialist
Specialist

Please see if this example helps you:

Untitled.png

Please let me know,

Cheers,

Luis

Edited: changed data as two rows were clubbed together

pradosh_thakur
Master II
Master II

Hi Isabel

try this


Count( Distinct {<[Aggr tAnswered] ={"=sum([Aggr tAnswered])/1000<=30"},[Aggr nAnswered] ={1}>} [ID: Conversation])



or


sum(If([Aggr tAnswered]<=30 and [Aggr nAnswered] =1,1,0))

Learning never stops.