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

Count the Sum greater than zero

I have an expression that works: count({$<TotalCharges={'>0'}>} DISTINCT Customer_ID)

The only problem is, there are possible occurrences where the TotalCharges for a Customer_ID is posted and then backed out of the system by posting a negative. Because of this, I'd like to count only the distinct Customer_IDs that have net positive TotalCharges.

I have attempted:

sum(aggr(count({$<TotalCharges={'>0'}>} DISTINCT Customer_ID),AcctPeriod))

where AcctPeriod is my only dimension in the chart, with no avail.

Any help is greatly appreciated, I'm obviously novice trying to pick up on things as quick as possible.

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

Hi John,

Did you try?

Count({< TotalCharges = {"=Sum(TotalCharges) > 0"} >} DISTINCT Customer_ID)

Miguel

View solution in original post

2 Replies
Miguel_Angel_Baeyens

Hi John,

Did you try?

Count({< TotalCharges = {"=Sum(TotalCharges) > 0"} >} DISTINCT Customer_ID)

Miguel

Not applicable
Author

Thank you so much Miguel! I am fairly certain this is correct, will vet it and reply if otherwise.

John