jenkins-bot has submitted this change and it was merged. Change subject: Redo lost commit for overview fix ......................................................................
Redo lost commit for overview fix Redo Ic92978fbce45caa0ea58ad6d8ba56fb2bf8354c7 which got inadvertently reverted. Change-Id: I3e474f3c51cc7c2233c214b572fa0f4d98c34a8c Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/862 --- M uw-funnel/overview.sql 1 file changed, 22 insertions(+), 19 deletions(-) Approvals: Gilles: Looks good to me, approved jenkins-bot: Verified diff --git a/uw-funnel/overview.sql b/uw-funnel/overview.sql index a2287df..95b822c 100644 --- a/uw-funnel/overview.sql +++ b/uw-funnel/overview.sql @@ -2,26 +2,29 @@ @survivors = NULL -- holds number of users reaching the next step ; -SELECT - step, - @survivors / survivors AS relative, - @survivors := survivors AS absolute +SELECT -- the outer select is just for sorting - putting it into the middle select messes with the variable calculation somehow + * FROM ( SELECT - event_step AS step, - COUNT(*) AS survivors - FROM - UploadWizardStep_8851805 - WHERE - timestamp >= TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY)) - GROUP BY - event_step - ORDER BY - -- we need to calculate (users reaching next step / users reaching current step) - -- but there is no way to know abou the next row, so we reverse the ordering - -- here, then reverse it again in the outer select - survivors ASC -) uploadwizard_funnel_data + step, + @survivors / survivors AS relative, + @survivors := survivors AS absolute + FROM ( + SELECT + event_step AS step, + COUNT(*) AS survivors + FROM + UploadWizardStep_8851805 + WHERE timestamp >= TIMESTAMP(DATE_SUB(CURDATE(), INTERVAL 30 DAY)) + GROUP BY + event_step + ORDER BY + -- we need to calculate (users reaching next step / users reaching current step) + -- but there is no way to know abou the next row, so we reverse the ordering + -- here, then reverse it again in the outer select + FIELD(step, 'tutorial', 'file', 'deeds', 'details', 'thanks') DESC + ) uploadwizard_funnel_data +) steps_unsorted ORDER BY - absolute DESC + FIELD(step, 'tutorial', 'file', 'deeds', 'details', 'thanks') ASC ; -- To view, visit https://gerrit.wikimedia.org/r/161285 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3e474f3c51cc7c2233c214b572fa0f4d98c34a8c Gerrit-PatchSet: 1 Gerrit-Project: analytics/multimedia Gerrit-Branch: master Gerrit-Owner: Gergő Tisza <[email protected]> Gerrit-Reviewer: Gilles <[email protected]> Gerrit-Reviewer: Springle <[email protected]> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
