Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
avishaiz
Contributor III
Contributor III

count if

i want to count the number of rows where there is a difference between the sum of counted items (the numbers that we have in our data system) and the actual number of items on the shelf

how can i do that?

1 Solution

Accepted Solutions
effinty2112
Master
Master

Hi Avishai,

                    I think I've got a solution but when I paste it here the order of parts of the expression become jumbled. Very odd!

This is the expression in a textbox properties sheet.

Expression.JPG

When  I copy and paste the expression here it comes out like:

=count(if([כמות בנמצא] <>[כמות בספירה],[מס' מק"ט]))

Cheers

Andrew

View solution in original post

11 Replies
sunny_talwar

Would you be able to provide a sample to have a look at your requirement with an expected output?

avishaiz
Contributor III
Contributor III
Author

here is a sample data

sunny_talwar

Would you also be able to share some information about the expected output?

avishaiz
Contributor III
Contributor III
Author

i am subtracting the number of Inventonhand from the counted to see if there are any missing items

now i want to show the number of rows where there was a difference

eg:

counted - inventonhand = -1, that means there is one item missing

the result shuld be

number of items counted - 25 rows

number of rows with missing items - 3

number of tows with extra items - 2

from here i think it will be easy to make a table/graph or a pie chart to show results

varshavig12
Specialist
Specialist

I'm not sure,

But, do you want something like:

count(Column_F) where, Column_F is not equal to 0 ?

ToniKautto
Employee
Employee

I would use a Count( If( ) ) construction in a chart, and embed it a Aggr() for total aggregation. Please see attached QVW for example.

Count(If(System<>Shelf,1)

Sum(Aggr(Count(If(System<>Shelf,1)) , Product ))

effinty2112
Master
Master

Hi Avishai,

                    I think I've got a solution but when I paste it here the order of parts of the expression become jumbled. Very odd!

This is the expression in a textbox properties sheet.

Expression.JPG

When  I copy and paste the expression here it comes out like:

=count(if([כמות בנמצא] <>[כמות בספירה],[מס' מק"ט]))

Cheers

Andrew

avishaiz
Contributor III
Contributor III
Author

hi actually it comes out good in the copy and in the script editor its just that qlik is not good with hebrew

avishaiz
Contributor III
Contributor III
Author

what does the aggr do?

i get the same result with

Count(If(System<>Shelf, Product ))