Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Count lines higher than other lines

Hello everyone,

I need your help about a set analysis expression.

I have to count the number of Lines higher than Invoice AND whose Invoice is not equal to 0.

To do that, I did this expression :

=Count({<Lines={"=Lines>Invoice"}*{"=Invoice<>0"}>}[Lines])

But the result does not seem very correct..

Do you have any idea to improve the expression ?

Thanks

1 Solution

Accepted Solutions
tresesco
MVP
MVP

This sort of set analysis gives right result only if the comparison field (here Lines) has unique values (i.e - a key field). Otherwise, try using if like: =Count( If(Lines>Invoice and Invoice<>0 ,[Lines]) )

View solution in original post

6 Replies
Not applicable
Author

=Count({<Lines={">=Invoice"}, Invoice={">=0"}>} Lines)

Not applicable
Author

try this

=count(If((lines>invoice and invoice<>0),lines))

Not applicable
Author

try:

Count({<Lines = p({<Lines = {'>=$(=Invoice)'}>}Lines)*p({<Invoice = {'>=$(=0)'}>}Lines) >}Lines

its_anandrjs
Champion III
Champion III

Some change



=Count({<Lines={ ' >Invoice ' }, Invoice = {">0"}>} Lines)

tresesco
MVP
MVP

This sort of set analysis gives right result only if the comparison field (here Lines) has unique values (i.e - a key field). Otherwise, try using if like: =Count( If(Lines>Invoice and Invoice<>0 ,[Lines]) )

Not applicable
Author

Thank you everyone for your response !