Hi community
I have a table and would like to calculate the NPS (Net Promoter Score) per quarter with the "table transformer" plugin. Data input is dynamic and data are grouped automatically from a CSV. Can someone help me to create a working sql statement?
Input: Table transformer table
Table transformer Formula from a working example
SELECT
/*Calc NPS
https://omf.ai/lexikon/nps/
*/
ROUND(
((COUNT(CASE WHEN 'Literal of How likely are you to recommend the TDE App Party to a colleague?' >= 9 THEN 1 END)
/COUNT(*))*100)-
((COUNT(CASE WHEN 'Literal of How likely are you to recommend the TDE App Party to a colleague?' <= 6 THEN 1 END)
/COUNT(*))*100),2)
AS NPS
FROM T1
Expected Output
Fertigstellungszeit : NPS
2023 Q1 : 0
2023 Q3 : -25
Data input from CSV
