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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

strange count results

I'm hoping someone may be able to help point me in the direction of figuring out this strange issue. I have one table loaded with the following fields:

accounting_date, customer_id, deposit_amount, withdrawal_amount, payment_method, count

I'm doing a distinct count for either those who made deposit or who made withdrawals in separate set analysis statements I have pasted below. The problem is that they are returning the same result, neither correct. It seems to be doing the count on the whole date range, while ignoring the -={0} in both statements.

any suggestions appreciated

Grant

=COUNT(
        {$
             <
ACCOUNTING_DATE={">=$(=Date((vRegDateStart)))<=$(=Date(30+(vRegDateEnd)))"},DEPOSIT_AMOUNT-={0}>
        }
distinct CUSTOMER_ID)


=COUNT(
        {$
             <
ACCOUNTING_DATE={">=$(=Date((vRegDateStart)))<=$(=Date(30+(vRegDateEnd)))"},WITHDRAWAL_AMOUNT-={0}>
        }
distinct CUSTOMER_ID)


1 Solution

Accepted Solutions
Not applicable
Author

try writing like DEPOSIT_AMOUNT = {'>0'}

View solution in original post

4 Replies
Not applicable
Author

try writing like DEPOSIT_AMOUNT = {'>0'}

Not applicable
Author

that works thanks! any idea why the not equal to wouldn't work just as well?

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Perhaps those fields don't contain any values that are exactly 0.


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks Gysbert! I assumed that 0.00 and 0 would be considered the same and now it makes sense. I tested both now and they do work.

Such a great community here