PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Calculation mode
  • When should PVTCalculateUpdate be used?
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Updates some of the data found in a pivot table from a given date.
Notes:
  • The pivot table was loaded in memory beforehand by PVTLoad.
  • The pivot table includes a Date column, row or display filter.
Example
// Builds the file name
sFile = SysDir(srAppData) + ["\"] + "StatsByCountry.tcd"

// The file exists?
IF fFileExist(sFile) THEN
// Yes, load it
PVTLoad(PVT_Statistics, sFile)
// Update the pivot table from the last calculation date
// (we assume that the records associated with an earlier date
// have not been modified)
PVTCalculateUpdate(PVT_Statistics, LoadParameter(DATE_LAST_CALCULATION))
ELSE
// The file does not exist, calculate it
PVTCalculateAll(PVT_Statistics)
END
Syntax
PVTCalculateUpdate(<Pivot Table Control> [, <Start Date>])
<Pivot Table Control>: Control name
Name of Pivot Table control to use.
<Start Date>: Optional character string or Date variable
Date from which the pivot table must be re-calculated. 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 PVTLoad.
Remarks

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 (if any) are deleted from the pivot table 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 calculation, the new pivot table is displayed. Then, the result can be saved by PVTSave.

When should PVTCalculateUpdate be used?

PVTCalculateUpdate must be used when the data is fixed: invoices for example. You only have the ability to add new invoices. In this case, the re-calculation date corresponds to the date of last backup of the pivot table.
If the data displayed in the pivot table can be modified (modifying a quantity, a price, ...), you must:
  • entirely recalculate the pivot table.
  • recalculate the pivot table from the date corresponding to the modified record.
Components
WINDEVReports and Queries wd230obj.dll
Minimum required version
  • Version 18
This page is also available for…
Comments
Click [Add] to post a comment