Survival analysis chart

New Member

I want to display a survival probability chart for churn analysis.
Some background info:

I have index source with tenureday as field.
I can show a harzard chart (total customers per tenureday)

index=customers| chart count by tenureday

But I want to chart the survival probability.
Therefor I have to calculate a cumulative sum divided by total customers per tenureday.


Tags (2)
0 Karma

New Member

I found a way. I don't know if it's the best way:

index=customers | stats count as daycount by tenureday | sort tenureday | accum daycount as cumsum  | eventstats sum(daycount) as totalz | eval srv = 1 - (cumsum / totalz) | fields tenureday, srv
0 Karma

Esteemed Legend

I believe this will work:

index=customers | stats count sum(MyFieldName) AS sum BY tenureday | eval calculation=sum/count
0 Karma
State of Splunk Careers

Access the Splunk Careers Report to see real data that shows how Splunk mastery increases your value and job satisfaction.

Find out what your skills are worth!