Help / WLanguage / WLanguage functions / Controls, pages and windows / Pivot Table functions
  • Calculation mode
  • When to use <Pivot table>.CalculateUpdate?
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
Updates some of the data found in a Pivot Table control from a given date.
  • The content of the Pivot Table control was previously loaded into memory using <Pivot table>.Load.
  • The Pivot Table control includes a Date column, row or display filter.
// Builds the file name
sFile = SysDir(srAppData) + ["\"] + "StatsByCountry.tcd"
// The file exists?
IF fFileExist(sFile) THEN
// Yes, load it
// Update the Pivot Table control from the last calculation date
// (we assume that the records associated with an earlier date
// have not been modified)
// The file does not exist, calculate it
<Pivot Table control>.CalculateUpdate([<Start date>])
<Pivot Table control>: Control name
Name of the Pivot Table control to be used.
<Start date>: Optional character string or Date variable
Date from which the content of the Pivot Table control must be recalculated. This date must be in "YYYYMMDD" format. All the records associated with a Date item whose content corresponds to a date greater than <Start date> will be taken into account.
If this parameter is not specified, the date taken into account corresponds to the maximum date of the last result calculated or read by <Pivot table>.Load.

Calculation mode

The records taken into account for the re-calculation have the following characteristics:
  • The records include a Date item.
  • The content of the Date item is greater than or equal to the value of <Start date>.
The former values found in the Pivot Table control (if any) are deleted from the Pivot Table control from <Start date>.
The calculation can be quite long if an important volume of data must be read. In this case, a progress bar is displayed in the control.
At the end of the calculation, the new Pivot Table is displayed. Then, the result can be saved by <Pivot table>.Save.

When to use <Pivot table>.CalculateUpdate?

<Pivot table>.CalculateUpdate should be used when the data is fixed: invoices for example. You only have the ability to add new invoices. In this case, the recalculation date corresponds to the date on which the content of the Pivot Table control was saved.
If the data displayed in the Pivot Table control is modifiable (a quantity, a price, etc.), you must::
  • entirely recalculate the Pivot Table control.
  • recalculate the Pivot Table control from the date corresponding to the modified record.
Component: wd290obj.dll
Minimum version required
  • Version 23
This page is also available for…
Click [Add] to post a comment

Last update: 06/21/2023

Send a report | Local help