mirror of https://github.com/apache/superset.git
[table] metric ordering is wrong in some cases (#2373)
This commit is contained in:
parent
e817382efd
commit
9a8c3a0447
|
@ -17,15 +17,10 @@ function tableVis(slice, payload) {
|
||||||
|
|
||||||
const data = payload.data;
|
const data = payload.data;
|
||||||
const fd = slice.formData;
|
const fd = slice.formData;
|
||||||
|
|
||||||
// Removing metrics (aggregates) that are strings
|
// Removing metrics (aggregates) that are strings
|
||||||
const realMetrics = [];
|
|
||||||
let metrics = fd.metrics || [];
|
let metrics = fd.metrics || [];
|
||||||
for (const k in data.records[0]) {
|
metrics = metrics.filter(m => !isNaN(data.records[0][m]));
|
||||||
if (metrics.indexOf(k) > -1 && !isNaN(data.records[0][k])) {
|
|
||||||
realMetrics.push(k);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
metrics = realMetrics;
|
|
||||||
|
|
||||||
function col(c) {
|
function col(c) {
|
||||||
const arr = [];
|
const arr = [];
|
||||||
|
|
Loading…
Reference in New Issue