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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

issue with rangesum(above(Total sum(

Hi there,

I am trying to create a Kaplan Meier chart using two cyclical dimensions:

1) Time

2) Cycle 1 (containing SmokerHistory and differentation.

One of the expressions i need to calculate this is the cummulative number of deaths for each line on the graph. I can get it to work with one line (selecting a value for SmokerHistory for example) but it wont work for multiple lines as the cummulative deaths number does not seem to work.

My calculation for deaths looks like this:

rangesum(above(Total sum(Event),0,Time))

Event is 1 if there is a death.

I can get this to work in a pivot table but I need to display this on a line graph. How to I calculate the cummulative deaths for the line when there are multiple lines selected?

Please help!!

11 Replies
Not applicable
Author

right I think its almost there by doing this method:

if(GetCurrentField([Cycle 1])='SmokingHistory',
//$(=lineval)
//LineValue


rangesum(above(Total sum({$ < SmokingHistory={$(=lineval)} >} Event),0,rowno(total))),
)

The variable brings back the correct value and is essentially the same as just using LineValue function. For some reason the variable doesnt work in set analysis though, any ideas?

lineval variable contains:

FirstSortedValue($(=getcurrentfield([Cycle 1])), recID)

The idea is then I only need to do nested if for each dimension within [Cycle 1]

Lee_Matthews
Former Employee
Former Employee

Here is an example of how to create the Kaplan Meier Curve

http://community.qlik.com/message/401280#