Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

193
Views
Pivot Table Filtering Office Scripts

I have an excel Pivot Table titled PivotTable1. Utilizing Office Scripts I am trying to automate the filtering. There are two columns prescriber and spent amount. I am trying to add a filter to the sum of the spent amount when it’s greater than $325. Essentially trying to automate the filter value function in excel. enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I think the below Office Script should be similar to what you are trying to do. The Office Script Pivot Table interface is in documentation but there aren't a lot of great samples matching your goals, at least they aren't readily available. I poked around in the forum and swear I saw a previous post with similar question but lost that tab.

function main(workbook: ExcelScript.Workbook)
{
  // declare the target pivot table
  let moviesPivot = workbook.getPivotTable("PivotTable4");

  // declare the field you are filtering
  let filterField = moviesPivot.getHierarchy("Title");

  // declare the filter to only include rows with budget over...
  let filter: ExcelScript.PivotValueFilter = {
    condition: ExcelScript.ValueFilterCondition.greaterThan,
    comparator: 2000000,
    value: "Sum of budget"
  };

  // apply the value filter to the field
  filterField.getPivotField("Title").applyFilter({ valueFilter: filter });

}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!