Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Counting the number of objects with a certain amount in it

Hello!

I am trying to count the number of KundID that have got Försäljning.CB0 that is higher then 500, I am using the expression below but I can not find out what is wrong. The program indicates that there is no data to display.



count

Thanks in advance

/Johan

(if(sum(Försäljning.CB0)>500,KundID))



5 Replies
Not applicable
Author

Hello you can filter the registers to count using set analysis within the count function.

It should look something like this:

count( {$<KundID = {"sum(Forsaljning.CB0) > 500"}>} KundID )

Regards

vgutkovsky
Master II
Master II

Small correction in Ivan's syntax: count( {<KundID = {"=sum([Forsaljning.CB0]) > 500"}>} KundID )

Regards,

Not applicable
Author

Hello!

I still can't get this to work, the table is showing nothing with this expression and I am having a bit of a trouble in understanding the logic behind it

/J

mruehl
Partner - Specialist
Partner - Specialist

Counting on a key field isn't optimal ...

Try to generate a "KundIDcount" field, which is exactly the KundID-field, while loading fhe tables ...

Not applicable
Author

Hello, it should work with the syntax correction that Vlad suggested. The only thing the expression is doing with set analysis, is artificially select all KundId which sum is greater than 500, one you selected them, you can count them. If the expression is not returning nothing, probably the fields are mispelled.

If this does not work, try posting a qlikview app with dummy data representing your problem.

Regards