ExcelScript.ShowAsCalculation enum
Fonction de calcul ShowAs pour dataPivotField.
Remarques
Exemples
/**
* The script changes the display for "Crates Sold at Farm".
* It shows the percentage of the grand total,
* instead of the default sum.
*/
function main(workbook: ExcelScript.Workbook) {
// Get the PivotTable named "Farm Pivot".
const farmPivot = workbook.getPivotTable("Farm Pivot");
// Get the data hierarchy "Sum of Crates Sold at Farm".
const farmSales = farmPivot.getDataHierarchy("Sum of Crates Sold at Farm");
// Show the data as a percentage of the grand total.
farmSales.setShowAs({
calculation: ExcelScript.ShowAsCalculation.percentOfGrandTotal
});
}
Champs
| differenceFrom | Différence par rapport au champ de base et à l’élément de base spécifiés. |
| index | Calcule les valeurs comme suit : ((valeur dans la cellule) x (Total général des totaux généraux)) / ((Total de la ligne générale) x (Total de la colonne générale)) |
| none | Aucun calcul n’est appliqué. |
| percentDifferenceFrom | Différence par rapport au champ de base et à l’élément de base spécifiés. |
| percentOf | Pourcentage du champ de base et de l’élément de base spécifiés. |
| percentOfColumnTotal | Pourcentage du total des colonnes. |
| percentOfGrandTotal | Pourcentage du total général. |
| percentOfParentColumnTotal | Pourcentage du total des colonnes pour le champ de base spécifié. |
| percentOfParentRowTotal | Pourcentage du total de lignes pour le champ de base spécifié. |
| percentOfParentTotal | Pourcentage du total général pour le champ de base spécifié. |
| percentOfRowTotal | Pourcentage du total de la ligne. |
| percentRunningTotal | Pourcentage total en cours d’exécution du champ de base spécifié. |
| rankAscending | Classement croissant du champ De base spécifié. |
| rankDecending | Rang décroissant du champ De base spécifié. |
| runningTotal | Total en cours d’exécution du champ de base spécifié. |
| unknown | Le calcul est inconnu ou non pris en charge. |