Date autogrouping for pivot tables in Excel Scripts?
I'm recreating a few VBA scripts in Automate, since they broke with recent Office updates anyway.
Is there a way to mimic the way that either .AutoGroup from VBA (previously), or just manually adding a pivot table field based on a date automatically creates nested columns for Years (column name), Quarters (column Name), etc?
e.g. If I modify the example Farm script to have dates instead of the Farm column as so, and add "Date" as a column in a pivot table... ... Excel automatically creates the following columns.
If I record that process as a script and try to run it, it errors out at the first reference to
getHierarchy("Years (Date)")
If I only run the part where it creates the table, it turns out it only added the actual dates. Any ideas, short of creating new columns in the source table?