Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
koscumbs
Contributor III
Contributor III

Advanced Set Analysis - Percent of rows with negative slope

Hello all,


I'm trying to show a percentage of patients where the slope of their line (using LINEST_M) is negative.

I'm really struggling with the syntax I need to use for the set analysis -- I believe what I have is somewhat close:

count(

{<PAT_ID = {"$(=LINEST_M(ALL_VL_VALUE,ALL_VL_DATE_DIFF) <0}">}PAT_ID)

          This is the numerator -- it should count the patients (PAT_ID) where the result of the LINEST_M equation is negative

/count(ALL_VL_VALUE)

          This is the denominator -- should be fine the way it is.

In essence, I'm sure my numerator syntax is off, but I have a hell of a time figuring out what I need to do in what order with the dollar sign expansion.  Any and all help would be appreciated.

Thanks!

1 Solution

Accepted Solutions
sunny_talwar

May be misplaced double quote? and an extra dollar sign expansion....

Count({<PAT_ID = {"=LINEST_M(ALL_VL_VALUE,ALL_VL_DATE_DIFF) < 0"}>} PAT_ID)

View solution in original post

5 Replies
sunny_talwar

May be misplaced double quote? and an extra dollar sign expansion....

Count({<PAT_ID = {"=LINEST_M(ALL_VL_VALUE,ALL_VL_DATE_DIFF) < 0"}>} PAT_ID)

koscumbs
Contributor III
Contributor III
Author

Unfortunately not, that throws me the same error: Error: Error in set modifier ad hoc element list: ',' or ')' expected

koscumbs
Contributor III
Contributor III
Author

That edit did it -- I think...stand by.

koscumbs
Contributor III
Contributor III
Author

I believe you got it -- thanks for the SUPER fast response!

sunny_talwar

Super