Announcements
cancel
Showing results for
Did you mean:
Contributor III

## Set Analysis with Count

Hello

I have a table that has part numbers and for each part number it has the total stock available, e.g.

PartNumber, Stock

100001,200

100002,150

100003,320

etc.

In Qlik Sense I want to create a number of text boxes that show various counts. They are all very similar and show the number of parts that have a stock count between one value and another. E.g. the number of parts that have a stock count between 100 and 200.

So far I have this,

=count({<PartNumber = {"=sum(Stock) >100"} >} distinct PartNumber)

which counts the number of parts with stock over 100.

But how do I change this to say >100 and < 200? Or is there another way to achieve the same thing?

Thanks.

1 Solution

Accepted Solutions
Master II

Hi,

Try like below

=count({\$<Stock = {">100<200"}>} distinct PartNumber)

to show in text with custom string value like below

='# of parts stock count between 100 & 200 is :'& chr(10)& count({\$<Stock = {">100<200"}>} distinct PartNumber)

4 Replies
Master II

Hi,

Try like below

=count({\$<Stock = {">100<200"}>} distinct PartNumber)

to show in text with custom string value like below

='# of parts stock count between 100 & 200 is :'& chr(10)& count({\$<Stock = {">100<200"}>} distinct PartNumber)

MVP

May be this

=Count({<PartNumber = {"=Sum(Stock) >100 and Sum(Stock) < 200"}>} distinct PartNumber)

Contributor III
Author

Thank you! That has worked fine.

Contributor III
Author

Thank you but unfortunately that has not worked. It returns zero.

Tags