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

Custom Aggregators #171

Open
farhanabdmusa opened this issue Feb 16, 2024 · 0 comments
Open

Custom Aggregators #171

farhanabdmusa opened this issue Feb 16, 2024 · 0 comments

Comments

@farhanabdmusa
Copy link

farhanabdmusa commented Feb 16, 2024

Hi, can i get little to create custom aggregators?

I have js code for aggregators and now i want to use it on NextJS

this is the example of my code

var tpl = $.pivotUtilities.aggregatorTemplates;
var fmtKg = $.pivotUtilities.numberFormat({suffix: ""});

$("#output").pivotUI(data, {
  renderers: renderers,
  cols: ["Country", "Month"],
  rows: ["Year", ],
  rowOrder: "key_a_to_z",
  colOrder: "key_a_to_z",
  aggregators: {
    "Net Weight (KG)": function () {
      return tpl.sum(fmtKg)(["netweight"]);
    },
  },
  rendererName: "Table",
});

Thank you

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