Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] transform 丢失字段 #89

Open
liuxuan1-1 opened this issue May 21, 2020 · 0 comments
Open

[BUG] transform 丢失字段 #89

liuxuan1-1 opened this issue May 21, 2020 · 0 comments

Comments

@liuxuan1-1
Copy link

const dv = ds
    .createView()
    .source(rawData)
    .transform({
      type: 'map',
      callback(row) {
        sumRealityDaily += row['实际每日达成'];
        sumPredictionDaily += row['预计每日达成'];
        if (Number(row['日期']) < 4.6) {
          row['汇总实际每日达成'] = sumRealityDaily;
        } else {
          row['汇总预计每日达成'] = sumPredictionDaily;
        }
        return row;
      },
    })
    .transform({
      type: 'fold',
      fields: ['实际每日达成', '预计每日达成'], // 展开字段集
      key: 'type', // key字段
      value: 'value', // value字段
    });

最后一个transform转换完丢失 '汇总预计每日达成' 字段

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant