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: 
qv_testing
Specialist II
Specialist II

Count if Value only once

Hi Community,

facing issue on count value is one.

I have calculated but showing wrong result.

exp: Count({<sn = {"=Count({<Group={'FAIL'}>}sn) = 1"}>}sn)  - this expression value showing for one particular case 41, but when i click on 41 row, it changing the value to 67.  but my value should be 67

Please find the attachment.

Please correct me what was the wrong

Thanks in Advance!

Labels (1)
1 Solution

Accepted Solutions
tresesco
MVP
MVP

Change your expression to:

Count(if(Aggr(NODISTINCT Count(if(Group='FAIL',sn)), desc,sn)>1, sn))

View solution in original post

8 Replies
tresesco
MVP
MVP

For that, (since you are using the desc dimension in the chart) you have to modify your expression a bit, like:

Count({<sn = {"=Aggr(Count({<Group={'FAIL'}>}sn) = 1, desc,sn)"}>}sn)

qv_testing
Specialist II
Specialist II
Author

I got the solution, anyhow thank you so much 🙂

qv_testing
Specialist II
Specialist II
Author

Hi Tresesco,

This is not working for >1.

Count({<sn = {"=Aggr(Count({<Group={'FAIL'}>}sn) > 1, desc,sn)"}>}sn)

Could you please help me!

felcar2013
Partner - Creator III
Partner - Creator III

hi,

try this

Count({<sn = {"=if(Count({$<Group={'FAIL'}>}sn)>1,Count({$<Group={'FAIL'}>}sn))"}>}sn)

 

tresesco
MVP
MVP

Can you explain with an example - the expected output and the result you are getting?

 

qv_testing
Specialist II
Specialist II
Author

Thanks for reply!

I have tried this expressions, not giving correct result.

as er below scenario, total count is 71, one count is 67 remaining is greater than one count. that should be 4.

one count is working fine, but greater than one count showing wrong result.

 

when i click specific records - both values are showing correct.

while validating whole data not presenting all the records.

Please find the attachment for sample

 

tresesco
MVP
MVP

Change your expression to:

Count(if(Aggr(NODISTINCT Count(if(Group='FAIL',sn)), desc,sn)>1, sn))

qv_testing
Specialist II
Specialist II
Author

Perfect!  Very helpful Tresesco 🙂