Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

mlandsittel
New Contributor II

Simple sum question

Or should be simple:

I have a tool being used to track census (both historical and current). To determine if a patient is active I am using:

if (len(DischargeDate)=0 and SOC <=today(),1) as ActiveCount,

during the load. This gives me a field with 1 in it if the patient is currently active. I am them just totaling this field (sum(ActiveCount)) to show the current census. The problem being, this total is off.

If I look and export the data associated, I can total up the ActiveCount column and get the correct number-however in Qlik, I am getting some duplicate entries showing up.

My question is - if a row does not show in a results table - where would this be coming from. Kind of hard to upload the tool w/the patient names but I can mask if that is needed.

Any thoughts as to why a count of a field would not match the data that is viewable in a table or exported to excel and then counted?

2 Replies
Not applicable

Re: Simple sum question

Can you pass a PatientID and perform a COUNT(DISTINCT instead? this would remove duplicates

e.g. IF(LEN(DischargeDate)=0 AND SOC <= TODAY(),[PatientID]) AS ActiveCount

COUNT( DISTINCT ActiveCount)

MVP
MVP

Re: Simple sum question

Any thoughts as to why a count of a field would not match the data that is viewable in a table or exported to excel and then counted?

Are you using a table box to view and export? A table box only shows distinct combinations of column values, no duplicate lines.

Community Browser