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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
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

1 Solution

Accepted Solutions
Kushal_Chawda

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
MVP
MVP

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

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