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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
egoziyan
Contributor II
Contributor II

count with expression

Hi

I uses this function to count all the invoices that have sales amount between 0 and 100

count (distinct{<sales={"<100 >=0"}>}INVOICE_NO)

now I want to increase the sales value by a variable.  I've added a variable named V_increase_sales and changed the formula to:

count (distinct(<sales*V_increase_sales={"<100 >=0"}>}INVOICE_NO)

and it's not working.

any help will be appreciated

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Qv might have problems evaluating the calculation in the advanced search.

Try

=count (distinct(<sales = {"<$(=100/ V_increase_sales) >=0"}>}INVOICE_NO)

See attached for a sample.

View solution in original post

6 Replies
jonasheisterkam
Partner - Creator III
Partner - Creator III

count (distinct{<sales={"<100*V_increase_sales >=0"}>}INVOICE_NO)

swuehl
MVP
MVP

Try

=count (distinct(<sales = {"<100/$(V_increase_sales) >=0"}>}INVOICE_NO)

You can only use pure field names left of the equal sign in a field modifier (hence the name).

Anonymous
Not applicable

You can use only fields on the left side of "=", that is it must be "sales=" in any case.  You have to change your right side to use variable.

Regards,

Michael

egoziyan
Contributor II
Contributor II
Author

Thanks for the help, however after I am adding the variable it is not recognized as one between the quotations and therefore doesn't do the calculation

swuehl
MVP
MVP

Qv might have problems evaluating the calculation in the advanced search.

Try

=count (distinct(<sales = {"<$(=100/ V_increase_sales) >=0"}>}INVOICE_NO)

See attached for a sample.

egoziyan
Contributor II
Contributor II
Author

Thanks a lot

working fine