Skip to content

Commit

Permalink
fix: revert handle null values in time-series table (#18684)
Browse files Browse the repository at this point in the history
  • Loading branch information
Grace Guo committed Feb 11, 2022
1 parent a7d505d commit 35684c5
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions superset-frontend/src/visualizations/TimeTable/TimeTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,17 +192,14 @@ const TimeTable = ({
} else {
v = reversedEntries[timeLag][valueField];
}
if (typeof v === 'number' || typeof recent === 'number') {
if (column.comparisonType === 'diff') {
v = recent - v;
} else if (column.comparisonType === 'perc') {
v = recent / v;
} else if (column.comparisonType === 'perc_change') {
v = recent / v - 1;
}
} else {
v = 'N/A';
if (column.comparisonType === 'diff') {
v = recent - v;
} else if (column.comparisonType === 'perc') {
v = recent / v;
} else if (column.comparisonType === 'perc_change') {
v = recent / v - 1;
}
v = v || 0;
} else if (column.colType === 'contrib') {
// contribution to column total
v =
Expand Down

0 comments on commit 35684c5

Please sign in to comment.