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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis-Greater than

Hello,

The formula I put together doesnt seem to pull in the right numbers.

Count({$<AMOUNT={">0"}>}DISTINCT PAT_ENC_CSN_ID)

This formula still includes charges(AMOUNT) of zero. I am not sure why as I have the set modifier as  greater than zero.

I need this formula to only count distinct csn ids when the charge amount is greater than zero.

Attached is a snapshop of how the HIS Visits are displayed with the formula used above.

Any help is greatly appreciated,

EK

3 Replies
swuehl
MVP
MVP

Could it happen that a single PAT_ENC_CSN_ID is linked to multiple AMOUNT values?

Are you maybe using an aggregation function in column Charges?

Not applicable
Author

The formula for charges is sum(AMOUNT).

A single PAT_ENC_CSN_ID could very well be linked to multiple charge(AMOUNT) values. I would want to count the PAT_ENC_CSN_ID everytime there is a charge related to a procedure code.

For example I could have a  PAT_ENC_CSN_ID linked to 5 different procedure codes. One of those procedure codes may have 5 different charges but would still be grouped under that single procedure code for one charge(AMOUNT).

Attached is another screenshot.

swuehl
MVP
MVP

Could it be that Charges are balanced (the sum(Amount) is zero, but single Amounts are like -10 and 10?)?

In your first attachement, the procedure codes and their Charges are collapsed for the lines in question.

If possible, could you upload a small sample file demonstrating your issue? You don't need to post real and possibly confidential data, just some mock up that comes close to your real setting.

I guess (since I don't really know your setting and complete requirement), that you just need to modify a field different from Amount, maybe filter on procedure codes:

Count({$<[Proc Code] = {"=sum(AMOUNT)>0"}>} DISTINCT PAT_ENC_CSN_ID)