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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

formula

Hello everyone

i want to show the percent of patients that their (send document date) -(discharge date) are greater than 21 to all patients

something  like this:

if((A-B) >21 , Vsum=Vsum+1)

c=Vsum/totalpatients


i would appreciate if anyone can help me to write this formula

Labels (1)
1 Solution

Accepted Solutions
Kushal_Chawda
MVP
MVP

Create the Flag in script like below

LOAD *,

          if([SendDocumentDate] - [DischargeDate] >21,1,0) as Flag_Days

.....

FROM Table;

Now use below expression

=count(DISTINCT {<Flag_Days={1}>} PatientID) / Count( distinct total PatientID)

View solution in original post

4 Replies
swuehl
Champion III
Champion III

Maybe something like

=Count(DISTINCT If( [SendDocumentDate] - [DischargeDate] >21, VisitID)) / Count(DISTINCT VisitID)

or in a chart context to ignore dimensions, use an additional TOTAL qualifier:

=Count(DISTINCT If( [SendDocumentDate] - [DischargeDate] >21, VisitID)) / Count(DISTINCT TOTAL VisitID)

Kushal_Chawda
MVP
MVP

Create the Flag in script like below

LOAD *,

          if([SendDocumentDate] - [DischargeDate] >21,1,0) as Flag_Days

.....

FROM Table;

Now use below expression

=count(DISTINCT {<Flag_Days={1}>} PatientID) / Count( distinct total PatientID)

Anonymous
Not applicable
Author

Thanks to reply

it should be correct but unfortunately didn't work.

Thanks anyway

Anonymous
Not applicable
Author

Many Thanks Kushal