This commit is contained in:
Pavel 2024-06-18 21:19:49 +03:00
parent 2835b15071
commit 7b56647a86

@ -59,6 +59,24 @@ type Statistic struct {
type PipeLineStatsResp [][]Statistic
// todo нужно исключить множества из подмножеств, пока что получаются все уникальные векторы респондентов по опросу
// пример:
//"[0, 116783, 116810]"
//"[0, 116783, 116798]"
//"[0, 116783, 116798, 116831]"
//"[0, 116783, 116810, 116849]"
//[0]
//"[0, 116783]"
//"[0, 116783, 116810, 116843]"
//SELECT DISTINCT final FROM (
//SELECT groupArray(ctxquestionid) AS final FROM (SELECT DISTINCT f.ctxsession, a.ctxquestionid
//FROM (SELECT ctxsession, max(event_time) AS max_time
//FROM statistics WHERE ctxquizid = 26276 GROUP BY ctxsession ) f
//JOIN ( SELECT ctxsession, ctxquestionid, event_time
//FROM statistics WHERE ctxquizid = 26276 ) a ON f.ctxsession = a.ctxsession)
//GROUP BY ctxsession);
func (s *StatisticClick) getFunnel(ctx context.Context, quizID int64, from uint64, to uint64) (map[int64][]string, error) {
// берем из матвью все что принадлежит quizID в указанном интервале времени
// выбираем самыые поздние по роу набер - 1