Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted
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
Highlighted
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)

Highlighted
Specialist II
Specialist II

I got the solution, anyhow thank you so much 🙂

Highlighted
Specialist II
Specialist II

Hi Tresesco,

This is not working for >1.

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

Could you please help me!

Highlighted
Partner
Partner

hi,

try this

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

 

Highlighted
MVP
MVP

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

 

Highlighted
Specialist II
Specialist II

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

 

Highlighted
MVP
MVP

Change your expression to:

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

View solution in original post

Highlighted
Specialist II
Specialist II

Perfect!  Very helpful Tresesco 🙂