From 3ebadbcda9e3b733b702d585cefb11963ac16c01 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Wed, 11 Oct 2017 21:14:39 -0700 Subject: [PATCH] Fix #3612 - reverse sign in difference calculation (#3646) --- superset/assets/visualizations/time_table.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset/assets/visualizations/time_table.jsx b/superset/assets/visualizations/time_table.jsx index c8f10e9b7c322..f318b00f25ac0 100644 --- a/superset/assets/visualizations/time_table.jsx +++ b/superset/assets/visualizations/time_table.jsx @@ -109,7 +109,7 @@ function viz(slice, payload) { // Time lag ratio v = reversedData[parseInt(c.timeLag, 10)][metric]; if (c.comparisonType === 'diff') { - v -= recent; + v = recent - v; } else if (c.comparisonType === 'perc') { v = recent / v; } else if (c.comparisonType === 'perc_change') {