Splunk
스플렁크에서 nps 계산하는 쿼리
앗사비
2024. 1. 25. 17:59
728x90
https://channel.io/ko/blog/nps_basic
수많은 기업에서 선택한 NPS 알아보기 - 기본편
고객 만족도 지표 고민 중이신가요? 최근 많은 글로벌 기업에서 선택한 NPS의 개념 및 계산 방법부터 장,단점까지 알아보도록 해요.
channel.io
index="log_test_com" uri_path IN (/test/nps)
| stats count by _time, uuid, point
| sort - _time `comment("최신 응답이 최상단")`
| streamstats count as response_number by uuid `comment("동일 유저의 여러 개 응답에 넘버링")`
| where response_number=1 `comment("최신 응답만 필터링")`
| eval nps_category=case(point>=9 AND point<=10, "promoter", point>=7 AND point<=8, "passive", point>=0 AND point<=6, "detractor") `comment("점수 범위에 따라 라벨링")`
| stats count as category_count by nps_category `comment("각 라벨 개수 구하기")`
| eventstats sum(category_count) as total_responses `comment("total_responses 컬럼 만들어서 category_count의 총합으로 채우기")`
| eval percentage = round((category_count/total_responses)*100, 2)
| where nps_category="promoter" OR nps_category="detractor"
| stats sum(percentage) as nps by nps_category
| eval nps = case(nps_category="promoter", nps, nps_category="detractor", -nps)
| stats sum(nps) as Net_Promoter_Score
728x90